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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6ac1663178756aabbc4160b702df41a90ef59b2b | 401 | asm | Assembly | programs/oeis/160/A160675.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/160/A160675.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/160/A160675.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A160675: Duplication root: the maximal number of distinct squarefree words that a word of length n can be reduced to by iterated application of string-rewriting rules uu->u.
; 1,1,1,1,1,1,1,1,2,2,2,2,2,4,4,4,4,4,4,4,4,4,4,4,5
lpb $0
mov $2,$0
sub $2,1
add $3,6
lpb $3
mov $0,6
mov $3,0
lpe
lpb $2
add $0,1
add $1,1
sub $2,5
trn $2,6
lpe
lpe
add $1,1
mov $0,$1
| 19.095238 | 175 | 0.603491 |
cda4ec1b6e9e190d23154a40dfe28d1939408cf2 | 1,109 | asm | Assembly | _build/dispatcher/jmp_ippsAES_XTSGetSize_714357dc.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsAES_XTSGetSize_714357dc.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsAES_XTSGetSize_714357dc.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsAES_XTSGetSize:function
extern n8_ippsAES_XTSGetSize:function
extern y8_ippsAES_XTSGetSize:function
extern e9_ippsAES_XTSGetSize:function
extern l9_ippsAES_XTSGetSize:function
extern n0_ippsAES_XTSGetSize:function
extern k0_ippsAES_XTSGetSize:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsAES_XTSGetSize
.Larraddr_ippsAES_XTSGetSize:
dq m7_ippsAES_XTSGetSize
dq n8_ippsAES_XTSGetSize
dq y8_ippsAES_XTSGetSize
dq e9_ippsAES_XTSGetSize
dq l9_ippsAES_XTSGetSize
dq n0_ippsAES_XTSGetSize
dq k0_ippsAES_XTSGetSize
segment .text
global ippsAES_XTSGetSize:function (ippsAES_XTSGetSize.LEndippsAES_XTSGetSize - ippsAES_XTSGetSize)
.Lin_ippsAES_XTSGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsAES_XTSGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsAES_XTSGetSize]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsAES_XTSGetSize:
| 28.435897 | 99 | 0.801623 |
4ef12849e3f73a70232c78615da4cef316c6d0bb | 12,273 | asm | Assembly | Project_Metronome/Code/T14_MetroKnome_FINAL_v1.0.asm | Brian1273/ECE_411 | 788233d1740659cce4746cd2b96feb9af299b34e | [
"MIT"
] | 1 | 2016-11-23T23:54:00.000Z | 2016-11-23T23:54:00.000Z | Project_Metronome/Code/T14_MetroKnome_FINAL_v1.0.asm | Brian1273/ECE_411 | 788233d1740659cce4746cd2b96feb9af299b34e | [
"MIT"
] | null | null | null | Project_Metronome/Code/T14_MetroKnome_FINAL_v1.0.asm | Brian1273/ECE_411 | 788233d1740659cce4746cd2b96feb9af299b34e | [
"MIT"
] | null | null | null | ;********************************************************************************
; DOES IT WORK? YES!!!
; FILENAME: T14_MetroKnome_Final_V1.0
; VERSION: 1.0
; DATE: 30 NOV 2016
; FILE SAVED AS: T14_MetroKnome_Final_V1.0.asm
; MICROCONTROLLER: PIC16F648A
; CLOCK FREQUENCY: 32kHz using the on-board(ext) oscillator for battery life
;********************************************************************************
; FILES REQUIRED: p16f648a.inc
;********************************************************************************
; PROGRAM FUNCTION: METROKNOME
; THIS CODE IS FOR FINAL OPERATION
;********************************************************************************
; HOUSEKEEPING
list p=16f648a ; list directive to define processor
include C:\Program Files (x86)\Microchip\MPLABX\v3.45\mpasmx\p16f648a.inc
; '__CONFIG' directive is used to embed configuration word within .asm file
__CONFIG _FOSC_LP & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _BOREN_OFF & _LVP_OFF & _CPD_OFF & _CP_OFF
;================================================================================
; DECLARATIONS cpu equates (memory map)
TMR0 EQU 0x01 ; Timer0 Module Register
porta EQU 0x05 ; assigns the memory location of register PORTA to porta for use in code
PORTA EQU 0x05 ; literals assigned with EQU cannot be changed elswhere in code
PORTB EQU 0x06 ; creates an un-changable pointer and allows use of lower case porta
portb EQU 0x06 ; allows use of lower case PORTB
state EQU 0x21 ; stores current lighting state
tic_rt EQU 0xFC ; variable for tic rate. ~10ms
work EQU 0x23 ; interrupt service temporarilly stores working register here
stat EQU 0x24 ; interrupt service temporarilly stores status register here
oldstate EQU 0x25 ; register to store encoder prior state
newstate EQU 0x26 ; register to store register current state
rate EQU 0x27 ; register to store encoder rate to pass to timer
w_temp EQU 0x71 ; variable used for context saving
status_temp EQU 0x72 ; variable used for context saving
pclath_temp EQU 0x73 ; variable used for context saving
; DECLARATIONS bit equates
w EQU 0 ; allows for use of "w" =working register instead of zero for the destination
f EQU 1 ; allows for use of "f" =file instead of one for the destination
;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
; START
ORG 0x00
GOTO start
ORG 0x04
GOTO intserv
start
CALL initializer
GOTO main
main
NOP
GOTO main
;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
;*********************************************************************************
; Subroutines and Functions
;*********************************************************************************
intserv
;---------------------------------------------------------
;Push registers to store current state before interrupt
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,w ; move pclath register into W register
movwf pclath_temp ; save off contents of PCLATH register
;Check Timer
BTFSC INTCON, 2 ; Timer0 interrupt flag
GOTO timer_svc
;Check Button(PORTB:0)
BTFSC INTCON, 1 ; RB0 Interrupt flag
GOTO button_svc
;Check Encoder(PORTB:(4:5))
BTFSC INTCON, 0 ; PORTB Interrupt flag
GOTO encoder_svc
GOTO intexit ; Must be a glitch get out and hope nobody noticed
;---------------------------------------------------------
timer_svc
BTFSS state, 0 ; Test current state
CALL toc ; If 0 goto 'toc'
BTFSC state, 0 ; If 0, return from call from previous line will skip this
CALL tic ; If 1 goto 'tic'
COMF state, f ; Toggle state bit
BCF INTCON, 2 ; Clear interrupt flag
GOTO intexit ; END TIMER_SVC
button_svc
BCF INTCON, 5 ; Disable interrupt for Timer0
BCF INTCON, 1 ; Clear interrupt flag
loopb BTFSS INTCON, 1 ; Wait for button press
GOTO loopb ; If button not pressed keep waiting
BCF INTCON, 1
BSF INTCON, 5 ; ReEnable interupt for Timer0
GOTO intexit ; END BUTTON_SVC
encoder_svc
MOVF PORTB, f ; Clears interrupt condition
CALL chk_encoder ; Read encoder
BCF INTCON, 0 ; Clear interrupt flag
GOTO intexit ; END ENCODER_SVC
intexit
;Pop to registers to state before interrupts
BSF INTCON, 5
MOVF rate, w ; Load UPDATED timer rate for Timer0
MOVWF TMR0 ; Load timer rate INTO Timer0
movf pclath_temp,w ; retrieve copy of PCLATH register
movwf PCLATH ; restore pre-isr PCLATH register contents
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
RETFIE
;**************************************************************************************************************************************************
;**************************************************************************************************************************************************
initializer
; Set PORTA Tri-State. Outputs are bits PORTA:0,1,2. Bits PORTA:3,4,5 are input by default
;
CLRF PORTA ; Set outputs to 0 FOR SAFETY
BSF STATUS, 5 ; GO to bank 1
BCF TRISA, 0 ; PORTA:0 IS AN OUTPUT
BCF TRISA, 1 ; PORTA:1 IS AN OUTPUT
BCF TRISA, 2 ; PORTA:2 IS AN OUTPUT
BCF STATUS, 5 ; Back to Bank0
; Set PORTB Tri-State. Output is PORTB:3 ; Bits PORTB:0,1,2,4,5,6,7 are inputs by defaults
;
CLRF PORTB ; GO to bank 1
BSF STATUS, 5
BCF TRISB, 3 ; PORTB:3 IS AN OUTPUT
BCF STATUS, 5 ; Bank0
;
; Set-up Timer TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
;TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
CLRWDT
;OPTION REGISTER(81h)
BSF STATUS, 5 ; BANK1
BCF OPTION_REG, 7 ; PORTB PULL-UPS ENABLED
BSF OPTION_REG, 6 ; INTERRUPT ON RISING EDGE
BCF OPTION_REG, 5 ; TIMER0 CLOCK SOURCE IS INTERNAL
BCF OPTION_REG, 4 ; UNUSED WHEN INTERNAL CLOCK SOURCE BUT SET 0 FOR LOW-HIGH TRANSITION
BCF OPTION_REG, 3 ; PRESCALER IS ASSIGNED TO TIMER0 NOT WDT
BSF OPTION_REG, 2 ; PS:2 PRESCALER RATE BITS<2:0>. USING 128<1,1,0> FOR PRESCALER
BSF OPTION_REG, 1 ; PS:1
BCF OPTION_REG, 0 ; PS:0
BCF STATUS, 5 ;RETURN TO BANK 0
; INTERRUPT CONTROL REGISTER
BCF INTCON, 2 ;(T0IF) TIMER0 INTERRUPT FLAG CLEARED
BSF INTCON, 5 ;(T0IE) ENABLE INTTERUPT FOR TIMER0
; SET TEMPO AND STORE
MOVLW 0x80 ; 80 IS MIDRANGE FOR STARTING TEMPO
MOVWF rate ; STORE TEMPO IN 'RATE' REGISTER
CLRF state ; 'state' stores current lighting condition at bit 0. 0 is 'toc' 1 is 'tic'
;TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
;TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
;PWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWM
;PWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWM
; Set-up PWM for Audio____________________________________________
;_________________________________________________________________
; * PWM registers configuration
; * Fosc = 32768 Hz
; * Fpwm = 1024.00 Hz (Requested : 1000 Hz)
; * Duty Cycle = 25 %
; * Resolution is 5 bits
; * Prescaler is 1
; * Uses TIMER2 and CCP to create PWM
; PR2 = 0b00000001 ; ; Timer2 preset
; T2CON = 0b00000100 ; ; Sets timer2 prescale and enables timer2
; CCPR1L = 0b00000001 ; ; Sets Duty Cycle
; CCP1CON = 0b00111100 ;
;_________________________________________________________________
; PR2 ; TIMER2 PERIOD REGISTER IN BANK1
BSF STATUS, 5
;MOVLW 0b0000111
MOVLW 0x07
MOVWF PR2
BCF STATUS, 5
; T2CON
BSF T2CON, 2
; CCPR1L
BSF CCPR1L, 1
; CCP1CON
;MOVLW 0b00111100
MOVLW 0x0C
MOVWF CCP1CON
;___________________________________________________________________
;PWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWM
;PWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWMPWM
; Enable Interrupts for IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
;IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
; TIMER
BCF INTCON, 2 ; Clear timer0 interrupt flag
BSF INTCON, 5 ; Timer0 interrupt enable
; BUTTON
BCF INTCON, 1 ; Clear RB0 interrupt flag
BSF INTCON, 4 ; RB0 interrupt enable
; ENCODER
BCF INTCON, 0 ; Clear register B interrupt on change flag
BSF INTCON, 3 ; PORTB interrupt on change enable
; Global interrupt enable
BSF INTCON, 7 ; Global Interrupt Enable
;IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
RETURN ;END OF INITIALIZER
;********************************************************************
;********************************************************************
chk_encoder
CLRF TMR0
goto enc_st_4
; Encoder uses grey code to cycle through its states. <1:1> is the start/end state
; Code reads each bit and determines the next state from these inputs
; If the sequence is completed, the 'rate' is inc/dec accordingly and the code exits
; If the sequence is not completed, then the code exits
; If a change in encoder state is missed then the next turn of the encoder will catch the missed state and continue
; PORTB bits <a:b>
enc_st_1 ; 1:0
btfss PORTB, 4
goto enc_st_2
btfsc PORTB, 5
goto decrement_rate
goto enc_st_1
enc_st_2 ; 0:0
btfsc PORTB, 4
goto enc_st_1
btfsc PORTB, 5
goto enc_st_3
goto enc_st_2
enc_st_3 ; 0:1
btfsc PORTB, 4
goto enc_st_4
btfss PORTB, 5
goto enc_st_2
goto enc_st_3
enc_st_4 ; 1:1
btfss PORTB, 4
goto enc_st_3
btfss PORTB, 5
goto enc_st_5
RETURN
enc_st_5 ; 1:0
btfss PORTB, 4
goto enc_st_6
btfsc PORTB, 5
goto enc_st_4
goto enc_st_5
enc_st_6 ; 0:0
btfsc PORTB, 4
goto enc_st_5
btfsc PORTB, 5
goto enc_st_7
goto enc_st_6
enc_st_7 ; 0:1
btfsc PORTB,4
goto increment_rate
btfss PORTB, 5
goto enc_st_6
goto enc_st_7
;=======================================
decrement_rate
CALL toc
MOVLW 0x01 ;To determine scaling factor, the 3 MSB's are checked
BTFSS rate, 7 ; Amount to increment or decrement is weighted by these bits
ADDLW 0x08 ; Range of change is from 1 to 16
BTFSS rate, 6 ; bits<7:5> are used from 'rate'
ADDLW 0x04 ; bit:7 set adds 8
BTFSS rate, 5 ; bit:6 set adds 4
ADDLW 0x02 ; bit:5 set adds 2
SUBWF rate, f ; Subtract scaled amount from rate
return
increment_rate
CALL tic ; Same as decrement except with add
MOVLW 0x01 ; Amount to increment or decrement is weighted by these bits
BTFSS rate, 7 ; Range of change is from 1 to 16
ADDLW 0x08 ; bits<7:5> are used from 'rate'
BTFSS rate, 6 ; bit:7 set adds 8
ADDLW 0x04 ; bit:6 set adds 4
BTFSS rate, 5 ; bit:5 set adds 2
ADDLW 0x02
ADDWF rate, f ; Add scaled amount to rate
return
;++++++++++++++++++++++++++++++++++++++++
tic
BSF PORTA, 0 ; turn on green led
BSF PORTA, 2 ; turn on sound
BCF INTCON, 2 ; Clear timer0 interrupt flag
MOVF tic_rt, w ; load time for sound on(~10ms)
MOVWF TMR0 ; load time into TMR0
loopa BTFSS INTCON, 2 ; wait for TMR0
GOTO loopa
BCF PORTA, 0 ; turn off green led
BCF PORTA, 2 ; turn off sound
RETURN
toc
BSF PORTA, 1 ; turn on green led
BSF PORTA, 2 ; turn on sound
BCF INTCON, 2 ; Clear timer0 interrupt flag
MOVF tic_rt, w ; load time for sound on(~10ms)
MOVWF TMR0 ; load time into TMR0
loopc BTFSS INTCON, 2 ; wait for TMR0
GOTO loopc
BCF PORTA, 1 ; turn off green led
BCF PORTA, 2 ; turn off sound; turn on red led
RETURN
;**********************************************************
;**********************************************************
;================================================================================
END
;================================================================================
| 37.53211 | 147 | 0.613705 |
f6e9de5cd28c83373b4b23cf5daba4614f427dea | 694 | asm | Assembly | programs/oeis/078/A078489.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/078/A078489.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/078/A078489.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A078489: a(n)=j such that binomial(n,j)<binomial(n-1,j-2).
; 2,2,3,4,4,5,6,6,7,7,8,9,9,10,10,11,12,12,13,14,14,15,15,16,17,17,18,19,19,20,20,21,22,22,23,23,24,25,25,26,27,27,28,28,29,30,30,31,32,32,33,33,34,35,35,36,36,37,38,38,39,40,40,41,41,42,43,43,44,44,45,46,46,47
mov $2,$0
add $2,1
mov $7,$0
lpb $2,1
mov $0,$7
sub $2,1
sub $0,$2
mov $3,$0
mov $5,2
lpb $5,1
mov $0,$3
sub $5,1
add $0,$5
mov $8,$0
pow $0,2
lpb $0,1
sub $0,$8
trn $0,2
add $8,2
lpe
mov $6,$5
mul $8,16
lpb $6,1
mov $4,$8
sub $6,1
lpe
lpe
lpb $3,1
mov $3,0
sub $4,$8
lpe
mov $8,$4
div $8,32
add $1,$8
lpe
add $1,1
| 17.35 | 210 | 0.5 |
6b34059dbdc53fa700ca1145b5a373c05f0e9018 | 718 | asm | Assembly | oeis/035/A035107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/035/A035107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/035/A035107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A035107: First differences give (essentially) A028242.
; 3,9,17,29,44,64,88,118,153,195,243,299,362,434,514,604,703,813,933,1065,1208,1364,1532,1714,1909,2119,2343,2583,2838,3110,3398,3704,4027,4369,4729,5109,5508,5928,6368,6830,7313,7819,8347,8899,9474,10074,10698,11348,12023,12725,13453,14209,14992,15804,16644,17514,18413,19343,20303,21295,22318,23374,24462,25584,26739,27929,29153,30413,31708,33040,34408,35814,37257,38739,40259,41819,43418,45058,46738,48460,50223,52029,53877,55769,57704,59684,61708,63778,65893,68055,70263,72519,74822,77174,79574
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
add $0,3
mov $4,0
lpb $0
add $4,$0
sub $0,2
lpe
add $1,$4
lpe
mov $0,$1
| 35.9 | 498 | 0.725627 |
0ff3ec0b5acf74cc4ee6bf4340be8dbcab5771cf | 5,068 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_21829_908.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_21829_908.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_21829_908.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 %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x296, %r15
nop
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%r15), %r9d
nop
nop
nop
nop
nop
sub $3313, %rbx
lea addresses_D_ht+0x1ac16, %rsi
lea addresses_WC_ht+0x151d6, %rdi
nop
inc %r11
mov $83, %rcx
rep movsw
nop
sub %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rax
push %rbp
push %rdx
// Store
lea addresses_WC+0x1a696, %rax
nop
nop
nop
nop
nop
cmp $18959, %rbp
movw $0x5152, (%rax)
nop
nop
sub %r10, %r10
// Load
lea addresses_D+0x13296, %rax
cmp %r13, %r13
mov (%rax), %r10d
nop
and %r10, %r10
// Store
lea addresses_D+0x1ee56, %rbp
nop
xor $53151, %r10
mov $0x5152535455565758, %rdx
movq %rdx, (%rbp)
nop
nop
nop
nop
and $63994, %r13
// Faulty Load
lea addresses_PSE+0x13296, %r13
nop
nop
mfence
mov (%r13), %rax
lea oracles, %r10
and $0xff, %rax
shlq $12, %rax
mov (%r10,%rax,1), %rax
pop %rdx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': True}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 43.316239 | 2,999 | 0.657261 |
9bbc85828776b2509fb455fe676d2505661a0de5 | 3,702 | asm | Assembly | Page Table/start.asm | SomeHash/Operating-Systems | 3e275fc81a68b4badf6cc05c77c45e3ccab9e88b | [
"MIT"
] | null | null | null | Page Table/start.asm | SomeHash/Operating-Systems | 3e275fc81a68b4badf6cc05c77c45e3ccab9e88b | [
"MIT"
] | null | null | null | Page Table/start.asm | SomeHash/Operating-Systems | 3e275fc81a68b4badf6cc05c77c45e3ccab9e88b | [
"MIT"
] | null | null | null | ; bkerndev - Bran's Kernel Development Tutorial
; By: Brandon F. (friesenb@gmail.com)
; Desc: Kernel entry point, stack, and Interrupt Service Routines.
;
; Notes: No warranty expressed or implied. Use at own risk.
;
; This is the kernel's entry point. We could either call main here,
; or we can use this to setup the stack or other nice stuff, like
; perhaps setting up the GDT and segments. Please note that interrupts
; are disabled at this point: More on interrupts later!
[BITS 32]
global start
start:
mov esp, _sys_stack ; This points the stack to our new stack area
jmp stublet
; This part MUST be 4byte aligned, so we solve that issue using 'ALIGN 4'
ALIGN 4
mboot:
; Multiboot macros to make a few lines later more readable
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_AOUT_KLUDGE equ 1<<16
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
EXTERN code, bss, end
; This is the GRUB Multiboot header. A boot signature
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM
; AOUT kludge - must be physical addresses. Make a note of these:
; The linker script fills in the data for these ones!
dd mboot ; header_addr:
; address corresponding to the multiboot header
dd code ; load_addr:
; physical address of the beginning of the text segment
dd bss ; load_end_addr:
; physical address of the end of the data segment
; (load_end_addr - load_addr) specifies how much data to load.
dd end ; bss_end_addr:
; pysical address of end of bss segment.
; boot loader initializes this area to zero,
; and reserves the memory
dd start ; entry_addr:
; physical address to which the boot loader should jump
; to start running the OS
stublet:
; Initilization of static global objects. This goes through each object
; in the ctors section of the object file, where the global constructors
; created by C++ are put, and calls it. Normally C++ compilers add some code
; to do this, but that code is in the standard library - which we do not
; include
; See linker.ld to see where we tell the linker to put them.
extern start_ctors, end_ctors, start_dtors, end_dtors
static_ctors_loop:
mov ebx, start_ctors
jmp .test
.body:
call [ebx]
add ebx,4
.test:
cmp ebx, end_ctors
jb .body
; Entering the kernel proper.
extern _main
call _main
; Deinitialization of static global objects. This goes through each object
; in the dtors section of the object file, where the global destructors
; created by C++ are put, and calls it. Normally C++ compilers add some code
; to do this, but that code is in the standard library - which we do not include.
; See linker.ld to see where we tell the linker to put them.
static_dtors_loop:
mov ebx, start_dtors
jmp .test
.body:
call [ebx]
add ebx,4
.test:
cmp ebx, end_dtors
jb .body
; Enter an endless loop here in order to stop.
jmp $
; Set up Global Descriptor Table
%include "gdt_low.asm"
; Set up Low-level Exception Handling
%include "idt_low.asm"
; Set up Low-level Interrupt Handling
%include "irq_low.asm"
; Here is the definition of our BSS section. Right now, we'll use
; it just to store the stack. Remember that a stack actually grows
; downwards, so we declare the size of the data before declaring
; the identifier '_sys_stack'
SECTION .bss
resb 8192 ; This reserves 8KBytes of memory here
_sys_stack:
| 33.351351 | 99 | 0.722312 |
8341b5ebdb1171e08e1c7deb645dc050dcd958f2 | 405 | asm | Assembly | oeis/103/A103583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/103/A103583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/103/A103583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A103583: Same as A103582, but read antidiagonals in upward direction.
; Submitted by Jon Maiga
; 1,1,0,1,1,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,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,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
mov $1,2
pow $1,$2
div $0,$1
add $0,1
mod $0,2
| 25.3125 | 201 | 0.562963 |
fddab4049e937a1fb8d3c312fe6bd4164a3f3544 | 798 | asm | Assembly | programs/oeis/010/A010370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/010/A010370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/010/A010370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A010370: a(n) = binomial(2*n, n)^2 / (1-2*n).
; 1,-4,-12,-80,-700,-7056,-77616,-906048,-11042460,-139053200,-1796567344,-23696871744,-317933029232,-4326899214400,-59605244280000,-829705000377600,-11654762427179100,-165021757273414800,-2353088020380174000,-33764531705178120000,-487222192505720271600,-7066379009674800129600,-102958894165757625028800,-1506430701026397008928000,-22125700921325206068630000,-326115131019596477286751296,-4822258653360778678932494016,-71520247681943400653797154048,-1063681234657474555641932163520,-15860359907972331662009309548800,-237059512757826450574832480056064,-3551205770719739419849415590933504,-53309702253421713244067594202958812,-801848414059731554580190259912273040
mov $1,1
sub $1,$0
sub $1,$0
mov $2,1
sub $2,$1
bin $2,$0
pow $2,2
div $2,$1
mov $0,$2
| 61.384615 | 661 | 0.829574 |
ea113a16c761f19c1db640c4440319dc908d582e | 595 | asm | Assembly | data/mapObjects/IndigoPlateauLobby.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | data/mapObjects/IndigoPlateauLobby.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | data/mapObjects/IndigoPlateauLobby.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | IndigoPlateauLobby_Object:
db $0 ; border block
db 3 ; warps
warp 7, 11, 0, -1
warp 8, 11, 1, -1
warp 8, 0, 0, LORELEIS_ROOM
db 0 ; signs
db 5 ; objects
object SPRITE_NURSE, 7, 5, STAY, DOWN, 1 ; person
object SPRITE_GYM_HELPER, 4, 9, STAY, RIGHT, 2 ; person
object SPRITE_LASS, 5, 1, STAY, DOWN, 3 ; person
object SPRITE_MART_GUY, 0, 5, STAY, RIGHT, 4 ; person
object SPRITE_CABLE_CLUB_WOMAN, 13, 6, STAY, DOWN, 5 ; person
; warp-to
warp_to 7, 11, INDIGO_PLATEAU_LOBBY_WIDTH
warp_to 8, 11, INDIGO_PLATEAU_LOBBY_WIDTH
warp_to 8, 0, INDIGO_PLATEAU_LOBBY_WIDTH ; LORELEIS_ROOM
| 27.045455 | 62 | 0.714286 |
8820146a6cc5272340ed164187d47af73cc4b975 | 2,962 | asm | Assembly | lib.asm | CrociDB/wordlos | 68e6eb6fadf96239cc31dbc87453319435d1cd91 | [
"MIT"
] | 6 | 2022-03-09T19:33:53.000Z | 2022-03-12T20:12:57.000Z | lib.asm | CrociDB/wordlos | 68e6eb6fadf96239cc31dbc87453319435d1cd91 | [
"MIT"
] | null | null | null | lib.asm | CrociDB/wordlos | 68e6eb6fadf96239cc31dbc87453319435d1cd91 | [
"MIT"
] | null | null | null | ;
; Print string function
; Params: AH - background/foreground color
; BP - string addr
; CX - position/offset
;
print_string:
mov di, cx ; Adds offset to DI
mov al, byte [bp] ; Copies the char to AL (AH already contains color data)
cmp al, 0 ; If the char is zero, string finished
jz _0 ; ... return
stosw
add cx, 2 ; Adds more 2 bytes the offset
inc bp ; Increments the string pointer
jmp print_string ; Repeats the rest of the string
_0:
ret
;
; Print string function with fixed length and HIGH case
; Params: AH - background/foreground color
; BP - string addr
; BX - length
; CX - position/offset
;
print_string_fixed:
mov di, cx ; Adds offset to DI
mov cx, bx
_psf0:
mov al, byte [bp]
sub al, 32
stosw
inc bp ; Increments the string pointer
loop _psf0
ret
;
; Print number function
; Params: AX - num value
; DI - position/offset
; general_value - background/foreground color
;
print_number:
cmp ax, 0
jne _init
mov cx, 1
push 0
jmp _print
_init:
xor cx, cx
_get_unit:
cmp ax, 0
je _print
xor dx, dx
mov bx, 10
div bx
xor bx, bx
mov bl, dl
push bx
inc cx
jmp _get_unit
_print:
pop ax
add al, '0' ; Add char `0` to value
mov ah, byte [general_value] ; Copy color info
stosw
loop _print
_p_exit:
ret
;
; Draw box function
; Params: [bp+2] - row offset
; [bp+4] - column offset
; [bp+6] - box dimensions
; [bp+8] - char/Color
;
draw_box:
mov bp, sp ; Store the base of the stack, to get arguments
xor di, di ; Sets DI to screen origin
add di, [bp+2] ; Adds the row offset to DI
mov dx, [bp+6] ; Copy dimensions of the box
mov ax, [bp+8] ; Copy the char/color to print
mov bl, dh ; Get the height of the box
xor ch, ch ; Resets CX
mov cl, dl ; Copy the width of the box
add di, [bp+4] ; Adds the line offset to DI
rep stosw
add word [bp+2], 160 ; Add a line (180 bytes) to offset
sub byte [bp+7], 0x01 ; Remove one line of height - it's 0x0100 because height is stored in the msb
mov cx, [bp+6] ; Copy the size of the box to test
cmp ch, 0 ; Test the height of the box
jnz draw_box ; If not zero, draw the rest of the box
ret | 29.62 | 113 | 0.483457 |
9f2dfd19e801156343042d376966b2f9372c7412 | 623 | asm | Assembly | oeis/023/A023826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/023/A023826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/023/A023826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A023826: Sum of exponents in prime-power factorization of C(4n,n).
; Submitted by Jon Maiga
; 2,3,4,5,7,6,9,9,10,10,9,9,13,14,14,14,15,15,15,16,19,16,19,18,21,20,18,19,21,21,22,22,23,25,24,24,27,26,28,26,30,28,28,29,28,28,30,30,31,31,31,31,35,30,31,31,32,34,33,33,38,39,39,37,39,38,39,40,43,40,41,41,44,44,43,44,46,45,47,45,45,45,46,45,46,45,44,47,48,47,47,46,50,51,54,49,52,53,51,50
add $0,1
mov $1,$0
mul $0,4
bin $0,$1
mov $1,1
mov $2,2
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
lpb $0
dif $0,$2
add $1,2
lpe
lpe
mov $0,$1
div $0,2
| 22.25 | 291 | 0.589085 |
a1af485e430a86c4d0677163f18940055740f833 | 2,240 | asm | Assembly | programs/oeis/288/A288827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/288/A288827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/288/A288827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A288827: Decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 515", based on the 5-celled von Neumann neighborhood.
; 1,3,5,13,27,59,119,247,495,1007,2015,4063,8127,16319,32639,65407,130815,261887,523775,1048063,2096127,4193279,8386559,16775167,33550335,67104767,134209535,268427263,536854527,1073725439,2147450879,4294934527,8589869055,17179803647,34359607295,68719345663,137438691327,274877644799,549755289599,1099511103487,2199022206975,4398045462527,8796090925055,17592183947263,35184367894527,70368739983359,140737479966719,281474968322047,562949936644095,1125899890065407,2251799780130815,4503599593816063,9007199187632127,18014398442373119,36028796884746239,72057593903710207,144115187807420415,288230375883276287,576460751766552575,1152921504069976063,2305843008139952127,4611686017353646079,9223372034707292159,18446744071562067967,36893488143124135935,73786976290543239167,147573952581086478335,295147905170762891263,590295810341525782527,1180591620700231434239,2361183241400462868479,4722366482835285475327,9444732965670570950655,18889465931409861378047,37778931862819722756095,75557863725776884465663,151115727451553768931327,302231454903382415769599,604462909806764831539199,1208925819614079418892287,2417851639228158837784575,4835703278457417187196927,9671406556914834374393855,19342813113831867772043263,38685626227663735544086527,77371252455331869134684159,154742504910663738269368319,309485009821336272631758847,618970019642672545263517695,1237940039285362682713079807,2475880078570725365426159615,4951760157141485915224408063,9903520314282971830448816127,19807040628566014029641809919,39614081257132028059283619839,79228162514264196856055595007,158456325028528393712111190015,316912650057057068899199090687,633825300114114137798398181375,1267650600228228838546749784063
add $0,1
seq $0,288828 ; 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 515", based on the 5-celled von Neumann neighborhood.
div $0,2
add $0,8
mov $1,$0
add $0,5
mul $1,3
mov $2,$1
sub $2,4
add $0,$2
div $0,8
sub $0,4
mul $0,2
add $0,1
| 124.444444 | 1,671 | 0.889286 |
3c155d5a34d85dfacb97cb3b6c8be0450d47d884 | 180 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_saddrpup_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_saddrpup_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_saddrpup_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void *zx_saddrpup_fastcall(void *saddr)
SECTION code_clib
SECTION code_arch
PUBLIC _zx_saddrpup_fastcall
EXTERN asm_zx_saddrpup
defc _zx_saddrpup_fastcall = asm_zx_saddrpup
| 15 | 44 | 0.85 |
81781fafa864362680a9afbe1afceb2c021460db | 2,597 | asm | Assembly | data/tilesets/lighthouse_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/tilesets/lighthouse_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/tilesets/lighthouse_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | tilecoll WALL, WALL, WALL, WALL ; 00
tilecoll WALL, WALL, WALL, WALL ; 01
tilecoll WALL, WALL, WALL, WALL ; 02
tilecoll WALL, WALL, WALL, WALL ; 03
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 04
tilecoll WALL, WALL, WALL, WALL ; 05
tilecoll FLOOR, FLOOR, WALL, WALL ; 06
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 07
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 08
tilecoll STAIRCASE, WALL, FLOOR, FLOOR ; 09
tilecoll WALL, WALL, FLOOR, FLOOR ; 0a
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0b
tilecoll WALL, WALL, WALL, WALL ; 0c
tilecoll WALL, WALL, WALL, WALL ; 0d
tilecoll WALL, WALL, WALL, WALL ; 0e
tilecoll WALL, WALL, WALL, WALL ; 0f
tilecoll 9C, FLOOR, COUNTER, FLOOR ; 10
tilecoll WALL, WALL, WALL, WALL ; 11
tilecoll WALL, WALL, WALL, WALL ; 12
tilecoll WALL, WALL, WALL, WALL ; 13
tilecoll WALL, WARP_CARPET_DOWN, WALL, WALL ; 14
tilecoll WALL, WALL, WALL, WALL ; 15
tilecoll 9C, FLOOR, COUNTER, FLOOR ; 16
tilecoll WALL, WALL, WALL, WALL ; 17
tilecoll FLOOR, WALL, FLOOR, WALL ; 18
tilecoll WALL, WALL, WALL, STAIRCASE ; 19
tilecoll LADDER, FLOOR, FLOOR, FLOOR ; 1a
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 1b
tilecoll WALL, WALL, WALL, WALL ; 1c
tilecoll WALL, WALL, FLOOR, FLOOR ; 1d
tilecoll WALL, WALL, WALL, WALL ; 1e
tilecoll WALL, WALL, WALL, WALL ; 1f
tilecoll WALL, FLOOR, WALL, FLOOR ; 20
tilecoll FLOOR, WALL, FLOOR, WALL ; 21
tilecoll WALL, FLOOR, WALL, WALL ; 22
tilecoll FLOOR, WALL, WALL, WALL ; 23
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 24
tilecoll FLOOR, FLOOR, WALL, WALL ; 25
tilecoll WALL, WALL, WALL, WALL ; 26
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 27
tilecoll FLOOR, FLOOR, PIT, PIT ; 28
tilecoll WALL, WALL, WINDOW, WINDOW ; 29
tilecoll WALL, WALL, WALL, WALL ; 2a
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2b
tilecoll WALL, WALL, FLOOR, FLOOR ; 2c
tilecoll WALL, WALL, WALL, WALL ; 2d
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 2e
tilecoll WALL, WALL, WALL, BOOKSHELF ; 2f
tilecoll WALL, WALL, FLOOR, WALL ; 30
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 31
tilecoll WALL, WALL, WALL, WALL ; 32
tilecoll WALL, FLOOR, WALL, FLOOR ; 33
tilecoll WALL, WALL, PC, FLOOR ; 34
tilecoll FLOOR, FLOOR, FLOOR, WALL ; 35
tilecoll FLOOR, WALL, FLOOR, WALL ; 36
tilecoll WALL, WALL, WALL, WALL ; 37
tilecoll WALL, WALL, FLOOR, WALL ; 38
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 39
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 3a
tilecoll WALL, WALL, WALL, WALL ; 3b
tilecoll WALL, WALL, WALL, WALL ; 3c
tilecoll WALL, WALL, WINDOW, WALL ; 3d
tilecoll WALL, WALL, WALL, WALL ; 3e
tilecoll WALL, WALL, WALL, WALL ; 3f
| 39.953846 | 63 | 0.704274 |
4c82ae1d638a1fbdff881b4c35521744152a5af9 | 26,136 | asm | Assembly | Tests/mathsunminsky.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 9 | 2021-09-29T22:08:15.000Z | 2022-03-23T05:35:43.000Z | Tests/mathsunminsky.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-21T12:35:42.000Z | 2022-01-21T17:47:24.000Z | Tests/mathsunminsky.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-15T10:13:49.000Z | 2022-01-15T10:13:49.000Z | DEVICE ZXSPECTRUMNEXT
DEFINE DOUBLEBUFFER 1
CSPECTMAP mathsunminsky.map
OPT --zxnext=cspect --syntax=a --reversepop
testStartup: ORG $8000
ld ix, TestCase1
.TestLoop: ld a,(testCounter)
ld hl, testTotal
cp (hl)
jp z,.Done
.CopyXYZ: ld bc,9
push ix
pop hl
ld de,SBnKxlo
ldir
ld a,(hl)
ld (ALPHA),a
inc hl
ld a,(hl)
ld (BETA),a
call SunApplyMyRollAndPitch
.SaveResults: push ix
pop hl
ld a,32
add hl,a
ex hl,de
ld hl,SBnKxlo
ld bc,9
ldir
ex de,hl
.TestX: ld iyl,'X'
push ix
pop hl
ld a,16
add hl,a
ld de,SBnKxlo
dec de
ld bc,3
.NextXByte: inc de
ld a,(de)
cpi
jp po,.TestY
jp z,.NextXByte
jp .failed
.TestY: ld iyl,'Y'
push ix
pop hl
ld a,16 + 3
add hl,a
ld de,SBnKylo
dec de
ld bc,3
.NextYByte: inc de
ld a,(de)
cpi
jp po,.TestZ
jp z,.NextYByte
jp .failed
.TestZ: ld iyl,'Z'
push ix
pop hl
ld a,16 + 6
add hl,a
ld de,SBnKzlo
dec de
ld bc,3
.NextZByte: inc de
ld a,(de)
cpi
jp po,.TestDone
jp z,.NextZByte
jp .failed
.TestDone: ld iyl,'P'
.failed: ld hl,ix
ld a,15
add hl,a
ld a,iyl
ld (hl),a
ld a,16
add hl,a
ld a,iyl
ld (hl),a
ld a,16
add hl,a
ld a,iyl
ld (hl),a
ld (FailPoint),a
ld hl,ix
ld a,48
add hl,a
ld ix,hl
ld hl,testCounter
inc (hl)
jp .TestLoop
.Done break
jp .Done ; complete tight loop
INCLUDE "../Variables/constant_equates.asm"
INCLUDE "../Hardware/L2ColourDefines.asm"
INCLUDE "../Macros/carryFlagMacros.asm"
INCLUDE "../Macros/signBitMacros.asm"
INCLUDE "../Macros/jumpMacros.asm"
INCLUDE "../Macros/ReturnMacros.asm"
INCLUDE "../Macros/ldCopyMacros.asm"
INCLUDE "../Macros/ShiftMacros.asm"
INCLUDE "../Macros/NegateMacros.asm"
INCLUDE "../Variables/general_variables_macros.asm"
INCLUDE "../Maths/multiply.asm"
INCLUDE "../Maths/asm_add.asm"
INCLUDE "../Variables/general_variables.asm"
STRUCT testCase
XLo BYTE 1 ; ROW 1
XHi BYTE 2 ; ROW 1
XSgn BYTE 3 ; ROW 1
YLo BYTE 4 ; ROW 1
YHi BYTE 5 ; ROW 1
YSgn BYTE 6 ; ROW 1
ZLo BYTE 7 ; ROW 1
ZHi BYTE 8 ; ROW 1
ZSgn BYTE 9 ; ROW 1
Pitch BYTE 10 ; ROW 1
Roll BYTE 11 ; ROW 1
Padding1 BYTE 12 ; ROW 1
Padding2 BYTE 13 ; ROW 1
Padding3 BYTE 14 ; ROW 1
Padding4 BYTE 15 ; ROW 1
Padding5 BYTE 16 ; ROW 1
XLoRes BYTE 17 ; ROW 2
XHRes BYTE 18 ; ROW 2
XSgnRes BYTE 19 ; ROW 2
YLoRes BYTE 20 ; ROW 2
YHRes BYTE 21 ; ROW 2
YSgnRes BYTE 22 ; ROW 2
ZLoRes BYTE 23 ; ROW 2
ZHiRes BYTE 24 ; ROW 2
ZSgnRes BYTE 25 ; ROW 2
Padding6 BYTE 26 ; ROW 2
Padding7 BYTE 27 ; ROW 2
Padding8 BYTE 28 ; ROW 2
Padding9 BYTE 29 ; ROW 2
Padding10 BYTE 30 ; ROW 2
Padding11 BYTE 31 ; ROW 2
PassFail BYTE 32 ; ROW 3
XLoAct BYTE 33 ; ROW 3
XHAct BYTE 34 ; ROW 3
XSgnAct BYTE 35 ; ROW 3
YLoAct BYTE 36 ; ROW 3
YHAct BYTE 37 ; ROW 3
YSgnAct BYTE 38 ; ROW 3
ZLoAct BYTE 39 ; ROW 3
ZHiAct BYTE 40 ; ROW 3
ZSgnAct BYTE 41 ; ROW 3
Padding12 BYTE 42 ; ROW 3
Padding13 BYTE 43 ; ROW 3
Padding14 BYTE 44 ; ROW 3
Padding15 BYTE 45 ; ROW 3
Padding16 BYTE 46 ; ROW 3
Padding17 BYTE 47 ; ROW 3
Padding18 BYTE 48 ; ROW 3
ENDS
; X Y Z pit rll X Y Z
; 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
TestCase1 DB $00, $00, $00, $00, $00, $00, $32, $00, $00, $0B, $00, $00, "T", "0", "1", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "R", "0", "1", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "1", $00 ;TestCase1
TestCase2 DB $64, $00, $00, $00, $00, $00, $32, $00, $00, $0B, $0B, $00, "T", "0", "2", $00, $64, $00, $00, $06, $00, $80, $32, $00, $00, $00, $00, $00, "R", "0", "2", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "2", $00 ;TestCase2
TestCase3 DB $64, $00, $00, $00, $00, $00, $32, $00, $00, $0B, $00, $00, "T", "0", "3", $00, $64, $00, $00, $04, $00, $80, $32, $00, $00, $00, $00, $00, "R", "0", "3", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "3", $00 ;TestCase3
TestCase4 DB $64, $00, $00, $00, $00, $00, $32, $00, $00, $0B, $0B, $00, "T", "0", "4", $00, $64, $00, $00, $06, $00, $80, $32, $00, $00, $00, $00, $00, "R", "0", "4", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "4", $00 ;TestCase4
TestCase5 DB $00, $00, $00, $64, $00, $00, $32, $00, $00, $0B, $00, $00, "T", "0", "5", $00, $04, $00, $00, $64, $00, $00, $32, $00, $00, $00, $00, $00, "R", "0", "5", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "5", $00 ;TestCase5
TestCase6 DB $00, $00, $00, $64, $00, $00, $32, $00, $00, $0B, $00, $00, "T", "0", "6", $00, $04, $00, $00, $64, $00, $00, $32, $00, $00, $00, $00, $00, "R", "0", "6", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "6", $00 ;TestCase6
TestCase7 DB $00, $00, $00, $64, $00, $00, $32, $00, $00, $00, $0B, $00, "T", "0", "7", $00, $00, $00, $00, $62, $00, $00, $36, $00, $00, $00, $00, $00, "R", "0", "7", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "7", $00 ;TestCase7
TestCase8 DB $00, $00, $00, $64, $00, $00, $32, $00, $00, $00, $0B, $00, "T", "0", "8", $00, $00, $00, $00, $62, $00, $00, $36, $00, $00, $00, $00, $00, "R", "0", "8", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "8", $00 ;TestCase8
TestCase9 DB $E2, $04, $00, $64, $00, $00, $C8, $00, $00, $0B, $00, $00, "T", "0", "9", $00, $E4, $04, $00, $2f, $00, $00, $C8, $00, $00, $00, $00, $00, "R", "0", "9", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "0", "9", $00 ;TestCase9
TestCase10 DB $E3, $04, $00, $64, $00, $00, $C8, $00, $00, $00, $0B, $00, "T", "1", "0", $00, $E3, $04, $00, $5C, $00, $00, $CC, $00, $00, $00, $00, $00, "R", "1", "0", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "0", $00 ;TestCase10
TestCase11 DB $E4, $04, $00, $64, $00, $00, $C8, $00, $00, $0B, $0B, $00, "T", "1", "1", $00, $E5, $04, $00, $27, $00, $00, $CA, $00, $00, $00, $00, $00, "R", "1", "1", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "1", $00 ;TestCase11
TestCase12 DB $64, $00, $00, $E2, $04, $00, $C8, $00, $00, $0B, $00, $00, "T", "1", "2", $00, $99, $00, $00, $DE, $04, $00, $C8, $00, $00, $00, $00, $00, "R", "1", "2", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "2", $00 ;TestCase12
TestCase13 DB $64, $00, $00, $E2, $04, $00, $C8, $00, $00, $00, $0B, $00, "T", "1", "3", $00, $64, $00, $00, $D8, $04, $00, $FD, $00, $00, $00, $00, $00, "R", "1", "3", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "3", $00 ;TestCase13
TestCase14 DB $64, $00, $00, $E2, $04, $00, $C8, $00, $00, $0B, $0B, $00, "T", "1", "4", $00, $99, $00, $00, $D4, $04, $00, $FD, $00, $00, $00, $00, $00, "R", "1", "4", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "4", $00 ;TestCase14
TestCase15 DB $E2, $04, $00, $64, $00, $00, $C8, $00, $00, $0B, $00, $00, "T", "1", "5", $00, $E4, $04, $00, $2F, $00, $00, $C8, $00, $00, $00, $00, $00, "R", "1", "5", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "5", $00 ;TestCase15
TestCase16 DB $64, $00, $00, $E2, $04, $00, $D0, $07, $00, $0B, $00, $00, "T", "1", "6", $00, $99, $00, $00, $DE, $04, $00, $D0, $07, $00, $00, $00, $00, "R", "1", "6", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "6", $00 ;TestCase16
TestCase17 DB $64, $00, $00, $E2, $04, $00, $D0, $07, $00, $00, $0B, $00, "T", "1", "7", $00, $64, $00, $00, $8A, $04, $00, $05, $08, $00, $00, $00, $00, "R", "1", "7", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "7", $00 ;TestCase17
TestCase18 DB $64, $00, $00, $E2, $04, $00, $D0, $07, $00, $0B, $0B, $00, "T", "1", "8", $00, $95, $00, $00, $86, $04, $00, $05, $08, $00, $00, $00, $00, "R", "1", "8", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "8", $00 ;TestCase18
TestCase19 DB $E2, $04, $00, $64, $00, $00, $D0, $07, $00, $0B, $00, $00, "T", "1", "9", $00, $E4, $04, $00, $2F, $00, $00, $D0, $07, $00, $00, $00, $00, "R", "1", "9", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "1", "9", $00 ;TestCase19
TestCase20 DB $E2, $04, $00, $64, $00, $00, $D0, $07, $00, $00, $0B, $00, "T", "2", "0", $00, $E2, $04, $00, $0E, $00, $00, $D4, $07, $00, $00, $00, $00, "R", "2", "0", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "0", $00 ;TestCase20
TestCase21 DB $E2, $04, $00, $64, $00, $00, $D0, $07, $00, $0B, $0B, $00, "T", "2", "1", $00, $E1, $04, $00, $27, $00, $80, $D2, $07, $00, $00, $00, $00, "R", "2", "1", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "1", $00 ;TestCase21
TestCase22 DB $64, $00, $00, $64, $00, $00, $D0, $07, $00, $0B, $00, $00, "T", "2", "2", $00, $68, $00, $00, $60, $00, $00, $D0, $07, $00, $00, $00, $00, "R", "2", "2", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "2", $00 ;TestCase22
TestCase23 DB $64, $00, $00, $64, $00, $00, $D0, $07, $00, $00, $0B, $00, "T", "2", "3", $00, $64, $00, $00, $0E, $00, $00, $D4, $07, $00, $00, $00, $00, "R", "2", "3", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "3", $00 ;TestCase23
TestCase24 DB $64, $00, $00, $64, $00, $00, $D0, $07, $00, $0B, $0B, $00, "T", "2", "4", $00, $64, $00, $00, $0A, $00, $00, $D4, $07, $00, $00, $00, $00, "R", "2", "4", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "4", $00 ;TestCase24
TestCase25 DB $88, $01, $03, $64, $00, $00, $C8, $00, $00, $0B, $00, $00, "T", "2", "5", $00, $21, $00, $03, $AC, $20, $80, $C8, $00, $00, $00, $00, $00, "R", "2", "5", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "5", $00 ;TestCase25
TestCase26 DB $88, $01, $03, $64, $00, $00, $C8, $00, $00, $00, $0B, $00, "T", "2", "6", $00, $88, $01, $03, $5C, $00, $00, $CC, $00, $00, $00, $00, $00, "R", "2", "6", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "6", $00 ;TestCase26
TestCase27 DB $88, $01, $03, $64, $00, $00, $C8, $00, $00, $0B, $0B, $00, "T", "2", "7", $00, $21, $00, $03, $A6, $20, $80, $9F, $00, $00, $00, $00, $00, "R", "2", "7", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "7", $00 ;TestCase27
TestCase28 DB $E2, $04, $00, $64, $00, $00, $88, $01, $03, $0B, $00, $00, "T", "2", "8", $00, $E4, $04, $00, $2F, $00, $00, $88, $01, $03, $00, $00, $00, "R", "2", "8", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "8", $00 ;TestCase28
TestCase29 DB $E2, $04, $00, $64, $00, $00, $88, $01, $03, $00, $0B, $00, "T", "2", "9", $00, $E2, $04, $00, $AD, $20, $80, $8C, $01, $03, $00, $00, $00, "R", "2", "9", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "2", "9", $00 ;TestCase29
TestCase30 DB $E2, $04, $00, $64, $00, $00, $88, $01, $03, $0B, $0B, $00, "T", "3", "0", $00, $79, $03, $00, $E1, $20, $80, $8A, $01, $03, $00, $00, $00, "R", "3", "0", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "0", $00 ;TestCase30
TestCase31 DB $E2, $04, $00, $88, $01, $03, $88, $01, $03, $0B, $00, $00, "T", "3", "1", $00, $F0, $25, $00, $53, $01, $03, $88, $01, $03, $00, $00, $00, "R", "3", "1", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "1", $00 ;TestCase31
TestCase32 DB $E2, $04, $00, $88, $01, $03, $88, $01, $03, $00, $0B, $00, "T", "3", "2", $00, $E2, $04, $00, $0C, $DF, $02, $98, $22, $03, $00, $00, $00, "R", "3", "2", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "2", $00 ;TestCase32
TestCase33 DB $E2, $04, $00, $88, $01, $03, $88, $01, $03, $0B, $0B, $00, "T", "3", "3", $00, $75, $24, $00, $D7, $DE, $02, $96, $22, $03, $00, $00, $00, "R", "3", "3", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "3", $00 ;TestCase33
TestCase34 DB $88, $01, $03, $64, $00, $00, $D0, $07, $00, $0B, $00, $00, "T", "3", "4", $00, $21, $00, $03, $AC, $20, $80, $D0, $07, $00, $00, $00, $00, "R", "3", "4", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "4", $00 ;TestCase25
TestCase35 DB $E2, $04, $00, $64, $00, $00, $C8, $00, $00, $0B, $00, $00, "T", "3", "5", $00, $E4, $04, $00, $2F, $00, $00, $C8, $00, $00, $00, $00, $00, "R", "3", "5", $00, $00, $00, $00, $00, $00, $00, $32, $00, $00, $00, $00, $00, "A", "3", "5", $00 ;TestCase28
PaddingString DB "----------------"
PaddingString2 DB ">"
testTotal DB ($-TestCase1)/48
PaddingString3 DB "~"
testCounter DB 0
PaddingString4 DB "~"
FailPoint DB 0
PaddingString5 DB "<---------"
SBnKxlo DB 0
SBnKxhi DB 0
SBnKxsgn DB 0
SBnKylo DB 0
SBnKyhi DB 0
SBnKysgn DB 0
SBnKzlo DB 0
SBnKzhi DB 0
SBnKzsgn DB 0
SunAlphaMulX DS 4
SunAlphaMulY DS 4
SunBetaMulZ DS 4
SunK2 DS 3
UBnKxlo DS 4
SunApplyMyRollAndPitch: ld a,(ALPHA) ; no roll or pitch, no calc needed
ld hl,BETA
or (hl)
and SignMask8Bit
jp z,.NoRotation
.CalcAlphaMulX: ld a,(ALPHA) ; get roll magnitude
xor SignOnly8Bit ; d = -alpha (Q value)
ld d,a ; .
ld a,(SBnKxlo) ; HLE = x sgn, hi, lo
ld e,a ; .
ld hl,(SBnKxhi) ; .
call mulHLEbyDSigned ; DELC = x * -alpha, so DEL = X * -alpha / 256 where d = sign byte
.SaveAlphaMulX: ;ld a,c ; a = upper byte of results which will have the sign ONLY NEEDED FOR DEBUGGING TEST
;ld (SunAlphaMulX),a ; save sign from result, ELC holds actual result ONLY NEEDED FOR DEBUGGING TEST
ld a,l ; also save all of alpha *X as we will need it later
ld (SunAlphaMulX+1),a
ld a,e
ld (SunAlphaMulX+2),a
ld a,d
ld (SunAlphaMulX+3),a ; we actually only want X1 X2 X3 later as its /256
.CalcK2: ld de,(SBnKyhi) ; DEL = Y
ld a,(SBnKylo) ; .
ld l,a ; .
ld bc,(SunAlphaMulX+2) ; BCH = Y sgn, hi, lo, we loose the C from result
ld a,(SunAlphaMulX+1) ; Deal with sign in byte 4
ld h,a ; .
call AddBCHtoDELsigned ; DEL = y - (alpha * x)
ld a,l ; K2 = DEA = DEL = y - (alpha * x)
ld (SunK2),a ; we also need to save l for teh beta k2 calc
ld (SunK2+1),de ;
.CalcBetaMulK2: ex de,hl ; HLE == DEA
ld e,a ; .
ld a,(BETA) ; D = BETA
ld d,a ; .
call mulHLEbyDSigned ; DELC = Beta * K2, DEL = Beta/256 * K2
.CalcZ: ld bc,(SBnKzhi) ; BCH = z
ld a,(SBnKzlo) ;
ld h,a ;
call AddBCHtoDELsigned ; DEL still = Beta * K2 so its z + Beta * K2
ld (SBnKzhi),de ; z = resuklt
ld a,l ; .
ld (SBnKzlo),a ; .
.CalcBetaZ: ld a,(BETA)
xor SignOnly8Bit ; d = -beta (Q value)
ld d,a ; .
ld a,(SBnKzlo) ; HLE = z
ld e,a ; .
ld hl,(SBnKzhi) ; .
call mulHLEbyDSigned ; DELC = z * -beta, so DEL = Z * -beta / 256 where d = sign byte
.SaveAlphaMulZ: ;ld a,c ; a = upper byte of results which will have the sign ONLY NEEDED FOR DEBUGGING TEST
;ld (SunBetaMulZ),a ; save sign from result, ELC holds actual result ONLY NEEDED FOR DEBUGGING TEST
;ld a,l ; also save all of alpha *X as we will need it later ONLY NEEDED FOR DEBUGGING TEST
;ld (SunBetaMulZ+1),a ; . ONLY NEEDED FOR DEBUGGING TEST
;ld a,e ; . ONLY NEEDED FOR DEBUGGING TEST
;ld (SunBetaMulZ+2),a ; . ONLY NEEDED FOR DEBUGGING TEST
;ld a,d ; . ONLY NEEDED FOR DEBUGGING TEST
;ld (SunBetaMulZ+3),a ; we actually only want X1 X2 X3 later as its /256 ONLY NEEDED FOR DEBUGGING TEST
.CalcY: ld bc,de ; bch = - Beta * z
ld h,l
ld de,(SunK2+1) ; DEL = k2
ld a,(SunK2)
ld l,a
call AddBCHtoDELsigned ; DEL = K2 - Beta * Z
ld (SBnKyhi),de ; y = DEL = K2 - Beta * Z
ld a,l ; .
ld (SBnKylo),a ; .
.CalcAlphaMulY: ld a,(ALPHA)
ld d,a ; d = alpha (Q value)
ld a,(SBnKylo) ; HLE = x sgn, hi, lo
ld e,a ; .
ld hl,(SBnKyhi) ; .
call mulHLEbyDSigned ; DELC = y * alpha, so DEL = Y * alpha / 256 where d = sign byte
.SaveAlphaMulY: ld a,c ; a = upper byte of results which will have the sign
ld (SunAlphaMulY),a ; save sign from result, ELC holds actual result
ld a,l ; also save all of alpha *X as we will need it later
ld (SunAlphaMulY+1),a
ld a,e
ld (SunAlphaMulY+2),a
ld a,d
ld (SunAlphaMulY+3),a
.CalcxPLusAlphaY: ld bc,de ; BCH = Y sgn, hi, lo, we loose the C from result Deal with sign in byte 4
ld h,l ; .
ld de,(SBnKxhi) ; DEL = Y
ld a,(SBnKxlo) ; .
ld l,a ; .
call AddBCHtoDELsigned ; DEL = x + alpha * Y
.SaveResult1: ld a,d ; Result 1 (X) = AHL + DEL
ld h,e ;
.CopyResultTo2: ld (SBnKxlo+2),a ; .
ld (SBnKxlo) ,hl ; .
ret
.NoRotation: ld a,(DELTA) ; BCH = - Delta
ReturnIfAIsZero
ld c,0 ;
ld h,a ;
ld b,$80 ;
ld de,(SBnKzhi) ; DEL = z position
ld a,(SBnKzlo) ; .
ld l,a ; .
call AddBCHtoDELsigned ; update speed
ld (SBnKzhi),DE ; write back to zpos
ld a,l
ld (SBnKzlo),a ;
ret
SAVENEX OPEN "mathsunminsky.nex", $8000 , $7F00
SAVENEX CFG 0,0,0,1
SAVENEX AUTO
SAVENEX CLOSE
| 76.198251 | 285 | 0.331688 |
2a42241d7d1cc8aa5f0c266bfae4f84a7e740f01 | 798 | asm | Assembly | oeis/134/A134437.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/134/A134437.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/134/A134437.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A134437: Number of cells in the 2nd rows of all deco polyominoes of height n. A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column.
; 0,1,7,45,312,2400,20520,194040,2016000,22861440,281232000,3732220800,53169177600,809512704000,13120332825600,225573828480000,4100866818048000,78606921609216000,1584587492167680000,33513225162633216000,742035112493875200000,17166556569694371840000,414194268186048430080000,10405436737401203097600000,271756399959158874439680000,7367824770582218342400000000,207090165288511993872384000000,6026989240806557920985088000000,181408565043969746998394880000000,5641044152005929846998827008000000
mov $1,$0
mov $2,4
lpb $1
mul $0,$1
sub $1,1
add $2,12
lpe
mul $0,$2
div $0,16
| 61.384615 | 489 | 0.849624 |
2478c859da9d64d32eb03e831eefd62b5b5123ae | 112 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/nextafter.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/nextafter.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/nextafter.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC nextafter
EXTERN cm48_sccz80_nextafter
defc nextafter = cm48_sccz80_nextafter
| 12.444444 | 38 | 0.866071 |
5f3f52f544db89c222c4455da0bb4081bb608274 | 1,243 | asm | Assembly | a/assembler_6809vectrex.asm | venusing1998/hello-world | 4b5ff1ef90ceb442f5633fc9e5d28297ac0f69ff | [
"MIT"
] | 94 | 2021-05-06T18:23:35.000Z | 2021-06-11T15:45:48.000Z | a/assembler_6809vectrex.asm | venusing1998/hello-world | 4b5ff1ef90ceb442f5633fc9e5d28297ac0f69ff | [
"MIT"
] | 91 | 2019-11-11T15:41:26.000Z | 2022-03-21T04:17:18.000Z | a/assembler_6809vectrex.asm | venusing1998/hello-world | 4b5ff1ef90ceb442f5633fc9e5d28297ac0f69ff | [
"MIT"
] | 10 | 2020-10-12T10:59:03.000Z | 2021-10-17T10:50:05.000Z |
; Hello World for Vectrex computer with 6809 CPU
; by Frog ( http://frog.enlight.ru )
; 24 March 2016
;***************************************************************************
org 0
; this header required to identify ROM by Vectrex hardware (only year allowed to change)
db "g GCE 2016", $80 ; 'g' is copyright sign
dw $F600 ; music from the rom (no music)
db $FC, $30, 33, -$2a ; height, width, rel y, rel x for app title
db "HELLO WORLD", $80 ; app title, ending with $80
db 0 ; end of header
; main loop (required to redraw vectors on CRT screen)
loop:
; recalibrate CRT, reset beam to 0,0 (center of the screen)
jsr $f192 ; Wait_Recal subroutine in ROM
ldu #helloworld ; string address
lda #10 ; Y
ldb #-45 ; X
jsr $f37a ; Print_Str_d subroutine in ROM
bra loop
; Text data ($80 - end of line)
helloworld: db 'HELLO WORLD!',$80
| 36.558824 | 91 | 0.43041 |
aeaff3f29e5bdf007129d4bd1ee0c7a479857577 | 7,733 | asm | Assembly | x64/PreventElevation/inline_hook.asm | EgeBalci/SelfDefense | 685d987d10ca38e8f7cf3a96bed63cf68a762f40 | [
"MIT"
] | 20 | 2019-07-05T10:45:28.000Z | 2022-02-17T01:24:11.000Z | x64/PreventElevation/inline_hook.asm | listinvest/SelfDefense | 685d987d10ca38e8f7cf3a96bed63cf68a762f40 | [
"MIT"
] | null | null | null | x64/PreventElevation/inline_hook.asm | listinvest/SelfDefense | 685d987d10ca38e8f7cf3a96bed63cf68a762f40 | [
"MIT"
] | 10 | 2019-07-17T19:18:55.000Z | 2021-09-20T15:00:16.000Z | ;-----------------------------------------------------------------------------;
; Author: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com)
; Compatible: Windows 7, 2003
; Architecture: x64
; Size: 200 bytes
;-----------------------------------------------------------------------------;
[BITS 64]
; Windows x64 calling convention:
; http://msdn.microsoft.com/en-us/library/9b372w95.aspx
; Input: The hash of the API to call in r10d and all its parameters (rcx/rdx/r8/r9/any stack params)
; Output: The return value from the API call will be in RAX.
; Clobbers: RAX, RCX, RDX, R8, R9, R10, R11
; Un-Clobbered: RBX, RSI, RDI, RBP, R12, R13, R14, R15.
; RSP will be off by -40 hence the 'add rsp, 40' after each call to this function
; Note: This function assumes the direction flag has allready been cleared via a CLD instruction.
; Note: This function is unable to call forwarded exports.
inline_hook:
pop rbx ; Save the return address
call api_call ; Get the address of API that will be hooked
add rsp,0x20 ; Clear stack
mov rsi,rax ; Save API address to RSI
mov r10d,0xC38AE110 ; hash("KERNEL32.dll", "VirtualProtect")
call api_call ; Get the VirtualProtect API address
add rsp,0x20 ; Clear stack
push qword 0x00 ; OldProtect
mov r9,rsp ; lpflOldProtect
mov r8,0x40 ; flNewProtect (PAGE_EXECUTE_READWRITE)
mov rdx,patch_size ; dwSize
mov rcx,rsi ; lpAddress
call rax ; VirtualProtect(lpAddress,12,PAGE_EXECUTE_READWRITE,&OldProtect)
pop rax ; Clean stack
call patch_end
patch_start:
;incbin "patch" ; Patch code for the hooked API
db 0x48,0x31,0xc0,0xc3
patch_end:
patch_size: equ $-patch_start:
pop rdx ; Pop out the address of patch code
mov rcx,patch_size ; Move the size of the patch to RCX
write:
mov al,byte [rdx] ; Get one byte from patch code
mov byte [rsi],al ; Move one byte to hooked function
inc rsi
inc rdx
loop write
push rbx ; Push back the return address
ret ; Return to caller
api_call:
push r9 ; Save the 4th parameter
push r8 ; Save the 3rd parameter
push rdx ; Save the 2nd parameter
push rcx ; Save the 1st parameter
push rsi ; Save RSI
xor rdx, rdx ; Zero rdx
mov rdx, [gs:rdx+96] ; Get a pointer to the PEB
mov rdx, [rdx+24] ; Get PEB->Ldr
mov rdx, [rdx+32] ; Get the first module from the InMemoryOrder module list
next_mod: ;
mov rsi, [rdx+80] ; Get pointer to modules name (unicode string)
movzx rcx, word [rdx+74] ; Set rcx to the length we want to check
xor r9, r9 ; Clear r9 which will store the hash of the module name
loop_modname: ;
xor rax, rax ; Clear rax
lodsb ; Read in the next byte of the name
cmp al, 'a' ; Some versions of Windows use lower case module names
jl not_lowercase ;
sub al, 0x20 ; If so normalise to uppercase
not_lowercase: ;
ror r9d, 13 ; Rotate right our hash value
add r9d, eax ; Add the next byte of the name
loop loop_modname ; Loop untill we have read enough
; We now have the module hash computed
push rdx ; Save the current position in the module list for later
push r9 ; Save the current module hash for later
; Proceed to itterate the export address table,
mov rdx, [rdx+32] ; Get this modules base address
mov eax, dword [rdx+60] ; Get PE header
add rax, rdx ; Add the modules base address
cmp word [rax+24], 0x020B ; is this module actually a PE64 executable?
; this test case covers when running on wow64 but in a native x64 context via nativex64.asm and
; their may be a PE32 module present in the PEB's module list, (typicaly the main module).
; as we are using the win64 PEB ([gs:96]) we wont see the wow64 modules present in the win32 PEB ([fs:48])
jne get_next_mod1 ; if not, proceed to the next module
mov eax, dword [rax+136] ; Get export tables RVA
test rax, rax ; Test if no export address table is present
jz get_next_mod1 ; If no EAT present, process the next module
add rax, rdx ; Add the modules base address
push rax ; Save the current modules EAT
mov ecx, dword [rax+24] ; Get the number of function names
mov r8d, dword [rax+32] ; Get the rva of the function names
add r8, rdx ; Add the modules base address
; Computing the module hash + function hash
get_next_func: ;
jrcxz get_next_mod ; When we reach the start of the EAT (we search backwards), process the next module
dec rcx ; Decrement the function name counter
mov esi, dword [r8+rcx*4]; Get rva of next module name
add rsi, rdx ; Add the modules base address
xor r9, r9 ; Clear r9 which will store the hash of the function name
; And compare it to the one we want
loop_funcname: ;
xor rax, rax ; Clear rax
lodsb ; Read in the next byte of the ASCII function name
ror r9d, 13 ; Rotate right our hash value
add r9d, eax ; Add the next byte of the name
cmp al, ah ; Compare AL (the next byte from the name) to AH (null)
jne loop_funcname ; If we have not reached the null terminator, continue
add r9, [rsp+8] ; Add the current module hash to the function hash
cmp r9d, r10d ; Compare the hash to the one we are searchnig for
jnz get_next_func ; Go compute the next function hash if we have not found it
; If found, fix up stack, call the function and then value else compute the next one...
pop rax ; Restore the current modules EAT
mov r8d, dword [rax+36] ; Get the ordinal table rva
add r8, rdx ; Add the modules base address
mov cx, [r8+2*rcx] ; Get the desired functions ordinal
mov r8d, dword [rax+28] ; Get the function addresses table rva
add r8, rdx ; Add the modules base address
mov eax, dword [r8+4*rcx]; Get the desired functions RVA
add rax, rdx ; Add the modules base address to get the functions actual VA
; We now fix up the stack and perform the call to the drsired function...
finish:
pop r8 ; Clear off the current modules hash
pop r8 ; Clear off the current position in the module list
pop rsi ; Restore RSI
pop rcx ; Restore the 1st parameter
pop rdx ; Restore the 2nd parameter
pop r8 ; Restore the 3rd parameter
pop r9 ; Restore the 4th parameter
pop r10 ; pop off the return address
sub rsp, 32 ; reserve space for the four register params (4 * sizeof(QWORD) = 32)
; It is the callers responsibility to restore RSP if need be (or alloc more space or align RSP).
push r10 ; push back the return address
ret ; Return to caller
; We now automagically return to the correct caller...
get_next_mod: ;
pop rax ; Pop off the current (now the previous) modules EAT
get_next_mod1: ;
pop r9 ; Pop off the current (now the previous) modules hash
pop rdx ; Restore our position in the module list
mov rdx, [rdx] ; Get the next module
jmp next_mod ; Process this module
| 53.331034 | 123 | 0.609337 |
276b0993c19b6ae97230e970ff75cb400544f45c | 25,104 | asm | Assembly | T3P1/AssemblyT3P1.asm | cggewehr/Projeto-De-Processadores | a7e0735342b83b3524152060162330423b3672c5 | [
"CC0-1.0"
] | null | null | null | T3P1/AssemblyT3P1.asm | cggewehr/Projeto-De-Processadores | a7e0735342b83b3524152060162330423b3672c5 | [
"CC0-1.0"
] | null | null | null | T3P1/AssemblyT3P1.asm | cggewehr/Projeto-De-Processadores | a7e0735342b83b3524152060162330423b3672c5 | [
"CC0-1.0"
] | null | null | null | .org #000h
; Carlos Gewehr e Emilio Ferreira
; Tabela de Registradores:
; ------------------------ r00 = 0
; ------------------------ r01 = Valor de retorno de subrotina
; ------------------------ r02 = &PortData
; ------------------------ r03 = &PortConfig
; ------------------------ r04 = &PortEnable
; ------------------------ r05 = Dado a ser lido/escrito
; ------------------------ r06 = Contador de 2ms
; ------------------------ r07 = Valor do contador continuo de 1 seg
; ------------------------ r08 = Valor do contador manual
; ------------------------ r09 = Decimal do contador do display continuo
; ------------------------ r10 = Unidade do contador do display continuo
; ------------------------ r11 = Decimal do contador do display manual
; ------------------------ r12 = Unidade do contador do display manual
; ------------------------ r13 = 500
; ------------------------ r14 = Temporario
; ------------------------ r15 = PUSH SP, após isso, Temporario
; PortConfig : 0 = Read, 1 = Write
; /////////////////////////// BASIC ///////////////////////////
;net "rst" loc = T10; // SW0 (Right-most)
;net "clk" loc = V10; // 100MHz board clock
;/////////////////////////// INPUT ///////////////////////////
;net "port_io[14]" loc = A8; // BUTTON UP
;net "port_io[15]" loc = C9; // BUTTON DOWN
;/////////////////////////// OUTPUT ///////////////////////////
;net "port_io[7]" loc = T17; // Segment A
;net "port_io[6]" loc = T18; // Segment B
;net "port_io[5]" loc = U17; // Segment C
;net "port_io[4]" loc = U18; // Segment D
;net "port_io[3]" loc = M14; // Segment E
;net "port_io[2]" loc = N14; // Segment F
;net "port_io[1]" loc = L14; // Segment G
;net "port_io[0]" loc = M13; // Segment P
;net "port_io[12]" loc = P17; // Display 3 (Left-most)
;net "port_io[11]" loc = P18; // Display 2
;net "port_io[10]" loc = N15; // Display 1
;net "port_io[9]" loc = N16; // Display 0 (Right-most)
;////////////////////////////////////////////////////////////////////
; ID da porta = 0
.code
;---------------------------------------Ponto de Entrada-----------------------------------------------------
;Seta o SP;
;Seta r0 em ZERO
;Seta o endereço de Port DATA
;Seta o endereço de Port CONFIG
;Seta o endereço de Port Enable
;Retorna NADA
main:
; Seta SP para ultimo endereço no espaço de endereçamento da memória
ldh r15, #7fh
ldl r15, #FFh
ldsp r15
; r0 <= 0
xor r0, r0, r0
; r1 <= 0
xor r1, r1, r1
; r2 <= &PortData
ldh r2, #80h
ldl r2, #00h
; r3 <= &PortConfig
ldh r3, #80h
ldl r3, #01h
; r4 <= &PortEnable
ldh r4, #80h
ldl r4, #02h
; r6 <= 0 (inicializa contador de 2ms)
xor r6, r6, r6
; r7 <= 0 (inicializa contador do display continuo)
xor r7, r7, r7
; r8 <= 0 (inicializa contador do display manual)
xor r8, r8, r8
; r9 <= 0 (inicializa Decimal do contador do display continuo)
xor r9, r9, r9
; r10 <= 0 (inicializa Unidade do contador do display continuo)
xor r10, r10, r10
; r11 <= 0 (inicializa Decimal do contador do display manual)
xor r11, r11, r11
; r12 <= 0 (inicializa Unidade do contador do display manual)
xor r12, r12, r12
; r13 <= 500
addi r13, r0, #500d
; PortConfig <= "00111111_11111111", bit 15 e 14 = entrada, outros = saida
ldh r5, #3Fh
ldl r5, #FFh
st r5, r0, r2
; PortEnable <= "11011110_11111111", habilita acesso a todos os bits da porta de I/O, menos bit 13 e bit 8
ldh r5, #CEh
ldl r5, #FFh
st r5, r0, r3
;-----------------------------------------Loop do Programa Principal-----------------------------------------
; Verifica o estado dos botoes e displays de 2 em 2 ms
pollingLoop:
; Gasta 2ms de processador
jsr #delay
; Incrementa contador de 2ms
addi r6, r0, #01h
; Le porta ( Verificar estado dos botoes )
jsr #lerPorta
; Define valor a ser exibido no contador manual
jsr #incrementaManual
; Incrementa contador de 2 ms
addi r6, r6, #01h
; Se contador de 2 ms = 500, incrementa contador continuo (1 seg)
sub r5, r13, r6
jsr #incrementaContinuo
; Atualiza valores de r9, r10, r11, r12 conforme os valores de r7 e r8
jsr #traduzSSD
; Determina em qual display deve ser feita a escrita
jsr #controleSSD
; Escreve na porta os valores determinados
jsr #escrevePorta
; Retorna para loop de polling
jmpd #pollingLoop
;----------------------------------- Fim do Programa Principal-----------------------------------------------
; Abaixo estão as subrotinas:
; compensaTempo, incrementaContinuo, incrementaManual devem ter o mesmo tempo de execução
; --- delay : TODO
; --- lePorta : DONE
; --- compensaTempo : DONE
; --- incrementaManual : DONE
; --- incrementaContinuo : DONE
; --- HEXtoDEC : DONE
; --- traduzSSD : TODO
; --- controleSSD : TODO
; --- escrevePorta : TODO
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;HEXtoDEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Recebe um valore (HEX) se separas ele em decimal(DEC) e Unidade(DEC) ;
; ;
; REGISTRADORES - (r14) NumeroOriginal - ENTRADA ;
; (r9) DECIMAL - SAIDA ;
; (r10) UNIDADE - SAIDA ;
; ;
; RETORNO - Ao final da subrotina os valores de r9, r10, irao representar a dezena e unidade do numero ;
; respectivamente ;
; ;
; FUNCIONAMENTO - Primeiramente carrega os valores a serem traduzidos de HEX para DEC nos registradores ;
; de dezena, apois isso é iniciado um loop de subtrações sucessivas onde a cada iteração ;
; é diminuido 10(decimal)/A(HEX) do valor total, quando o valor se apresentar zero, ;
; finalizao loop e quando se apresentar negativo (ex -3, soma-se 10, -3+10 = 7) e ;
; finaliza o loop ;
; ;
; EXEMPLO - r7 = 1A(hex) = 26(dec) ;
; Inicio -> r10(Unidade) = 1A | r9(Dezena) = 0 ;
; 1 iteração -> r10(Unidade) = 10 | r9(Dezena) = 1 ;
; 2 iteração -> r10(Unidade) = 6 | r9(Dezena) = 2 ;
; 3 iteração -> r10(Unidade) = 6 | r9(Dezena) = 2 ;
;------------------------------------------------------------------------------------------------------------;
HEXtoDEC: ;
add r10, r0, r14 ; Carrega o r14(Numero original) no r10(parte da dezena do contador) ;
xor r9, r9, r9 ; Zera r9(dezena) ;
;
dezena: ; Loop que por subtrações sucessivas calcula a dezena ;
subi r10, #0Ah; ;
jmpzd #fimHEXtoDECzero ; Caso o a Unidade for igual a zero, não é necessario realizar mais uma soma ;
jmpnd #fimHEXtoDEC ; Acabou de calcular a dezena e unidade do numero ;
addi r9, #01h ; Incrementa a dezena do numero; ;
jmpd #dezenaAUTO ; Retorna para o loop de calculo de dezena ;
;
fimHEXtoDEC: ;
addi r10, #0Ah; ;
;
fimHEXtoDECzero; ;
st r9, r0, r9; ; Salva o valor da dezena em r9 ;
st r10, r0, r10 ; Salva o valor da unidade em r10 ;
rts ; Retorno da Subrotina ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;escreveSSD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Escreve Nos Displays e alterna entre eles ;
; ;
; REGISTRADORES - (r5) Dado a ser escrito na porta - SAIDA ;
; (r7) Index(dispARRAY)/ContContinuo - -/ENTRADA ;
; (r9) Valor da dezena Automatica - SAIDA da HEXtoDEC ;
; (r10) Valor da unidade Automatica - SAIDA da HEXtoDEC ;
; (r11) Valor da dezena Manual - SAIDA da HEXtoDEC ;
; (r12) Valor da unidade manual - SAIDA da HEXtoDEC ;
; (r14) Valor do contador Continuo - ENTRADA ;
; (r15) Endereço inicial do DispARRAY - ENTRADA ;
; ;
; RETORNO - Ao final da subrotina deverá ter sido escrito na porta de saida e nos 4 displays de 7 segmentos;
; os valores de Contador Automatico ( Unidade, Dezena) e Contador Manual( Unidade, Dezena) da ;
; Direita para a Esquerda, respectivamente. ;
; ;
; FUNCIONAMENTO - É utiliza a subrotina de HEXtoDEC para adquirir os valores de dezena e unidade de cada ;
; contador e após isso é setada os resgistradores da porta: ;
; REG_PORT_CONFIG ( 12 bits de saida) ;
; REG_PORT ENABLE ( Habilita para a escrita esss 12 bits) ;
; Então é carregado o valor do endereço inicial do array dos valores do disp que é ;
; indexado pelo proprio numero ;
; Finalmente é mostrado nos disp os valores seguidos do delay para vizualização, é feito ;
; para os 4 displays e entao retorna ;
;------------------------------------------------------------------------------------------------------------;
escreveSSD: ;
push r5 ;
push r7 ;
push r9 ;
push r10 ;
push r11 ;
push r12 ;
push r14 ;
push r15 ; Salva o contexto nos registradores que irá alterar ;
;
add r14, r0, r7 ; Carrega em r14 o valor do contador contiuno ;
jsr #HEXtoDEC ; Pula na subrotina de transformação de valores hexa pra decimal ;
add r9, r0, r9 ; Guarda em r9 o valor da dezena do numero r7(continuo) ;
add r10, r0, r10 ; Guarda em r10 o valor da unidade do numero r7(continuo) ;
;
add r14, r0, r8 ; carrega em r14 o valor do contador manual ;
jsr #HEXtoDEC ; Chama a subrotina de transformação de valores hexa pra decimal ;
add r11, r0, r9 ; Guarda em r11 o valor da dezena do numero r7(continuo) ;
add r12, r0, r10 ; Guarda em r12 o valor da unidade do numero r7(continuo) ;
;
ldh r5, #F0h ; ;
ldl r5, #00h ; ;
st r5, r0, r3 ; PortConfig <= "1111 0000 0000 0000" | (12 downto 0)LSBs = SAIDA ;
;
ldh r5, #0Fh ; ;
ldl r5, #FFh ; ;
st r5, r0, r4 ; PortEnable <= "0000 1111 1111 1111" | Habilita acesso somente aos bits do SSD ;
; ;
ldh r15, #array ;
ldl r15, #array ; R15 <- endereço inicial do array ;
;
st r7, r15, r10 ; r7 <= array[Unidade Automatico] ;
ldh r5, #01h ; Primeiro display ;
ldl r5, r7 ; Valor de 8 bits a ser colocado no SSD ;
st r5, r0, r2 ; PortData <= "0000 0001 & (Valor Unidade Atomatico)" | PRIMEIRO SSD ;
;
jsr #delay ; Pula na subrotina de espera para vizualização nos disps ;
;
st r7, r15, r9 ; r7 <= array[Dezena Automatico] ;
ldh r5, #02h ; Segundo display ;
ldl r5, r7 ; Valor de 8 bits a ser colocado no SSD ;
st r5, r0, r2 ; PortData <= "0000 0010 & (Valor Dezena Atomatico)" | SEGUNDO SSD ;
;
jsr #delay ; Pula na subrotina de espera para vizualização nos disps ;
;
st r7, r15, r12 ; r7 <= array[Unidade Manual] ;
ldh r5, #04h ; Terceiro display ;
ldl r5, r7 ; Valor de 8 bits a ser colocado no SSD ;
st r5, r0, r2 ; PortData <= "0000 0100 & (Valor Unidade Manual)" | TERCEIRO SSD ;
;
jsr #delay ; Pula na subrotina de espera para vizualização nos disps ;
;
st r7, r15, r11 ; r7 <= array[Dezena Manual] ;
ldh r5, #08h ; Quarto display ;
ldl r5, r7 ; Valor de 8 bits a ser colocado no SSD ;
st r5, r0, r2 ;PortData <= "0000 1000 & (Valor Dezena Manual)" | QUARTO SSD ;
;
jsr #delay ;
;
pop r15 ;
pop r14 ;
pop r12 ;
pop r11 ;
pop r10 ;
pop r9 ;
pop r7 ;
pop r5 ; Retoma o contexto ;
rts ; REtorna ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lePorta:
; Retorna Estado do botao
; r1 <= Dado da porta
ld r1, r0, r2
; Gera flag zero para condição de pulo
add r1, r0, r1
rts
compensaTempo:
; Executa 72 ciclos
nop ;3 ciclos
nop ;6 ciclos
nop ;9 ciclos
nop ;12 ciclos
nop ;15 ciclos
nop ;18 ciclos
nop ;21 ciclos
nop ;24 ciclos
nop ;27 ciclos
nop ;30 ciclos
nop ;33 ciclos
nop ;36 ciclos
nop ;39 ciclos
nop ;42 ciclos
nop ;45 ciclos
nop ;48 ciclos
nop ;51 ciclos
nop ;54 ciclos
nop ;57 ciclos
nop ;60 ciclos
ld r15, r0, r0 ;64 ciclos
ld r15, r0, r0 ;68 ciclos
rts ;72 ciclos
incrementaManual:
;net "port_io[14]" loc = A8; // BUTTON UP
;net "port_io[15]" loc = C9; // BUTTON DOWN
; 4PUSH/POP + 10ARITIMETICAS + 2 JUMPS + RTS
; 4x4 + 10x3 + 2x11 + 4 (Assume jumps sempre not taken)
; 16 + 30 + 22 + 4
; 72 ciclos de execução
; Pilha <= Valor lido da porta
push r1
; r14 <= 1
xor r14, r14, r14
addi r14, r0, #01h
; r15 <= Mascara de comparação para BTN DOWN (10000000_00000000)
ldh r15, #80h
ldl r15, #00h
; Se BTN DOWN foi pressionado, r1 <= 0, decrenenta contador
and r1, r1, r15
sub r1, r1, r15
jmpzd #manual--
; Carrega lixo em r15 para manter tempo de execução constante, independente da tomada de branch (11 ciclos)
ld r15, r0, r0
ld r15, r0, r0
returnManual--:
; Restaura valor lido da porta, salva novamente
pop r1
push r1
; r15 <= Mascara de comparação para BTN UP (01000000_00000000)
ldh r15, #04h
ldl r15, #00h
; Se BTN UP foi pressionado, r1 <= 0, incrementa contador
and r1, r1, r15
sub r1, r1, r15
jmpzd #manual++
; Carrega lixo em r15 para manter tempo de execução constante, independente da tomada de branch (11 ciclos)
ld r15, r0, r0
ld r15, r0, r0
returnManual++:
; Restaura valor lido da porta
pop r1
rts
;------------------------------------ AUXILIARES incrementaManual -------------------------------------------
manual--:
; Contador display manual --
subi r8, #01h
jmp #returnManual--
manual++:
; Contador display manual ++
addi r8, #01h
jmp #returnManual++
;------------------------------------ AUXILIARES incrementaManual -------------------------------------------
incrementaContinuo:
; Incrementa contador continuo se passou 1 seg, demorando 72 ciclos
; Se 1 segundo se passou, nao incrementa contador
jmpzd #returnContinuo ;3 ciclos
addi r7, #01h ;6 ciclos
ld r15, r0, r0 ;11 ciclos
ld r15, r0, r0 ;14 ciclos
nop ;17 ciclos
nop ;20 ciclos
nop ;23 ciclos
nop ;26 ciclos
nop ;29 ciclos
nop ;32 ciclos
nop ;35 ciclos
nop ;38 ciclos
nop ;41 ciclos
nop ;44 ciclos
nop ;47 ciclos
nop ;50 ciclos
nop ;53 ciclos
nop ;56 ciclos
nop ;59 ciclos
nop ;62 ciclos
nop ;65 ciclos
nop ;68 ciclos
rts ;72 ciclos
returnContinuo:
nop ;7 ciclos
nop ;10 ciclos
nop ;13 ciclos
nop ;16 ciclos
nop ;19 ciclos
nop ;22 ciclos
nop ;25 ciclos
nop ;28 ciclos
nop ;31 ciclos
nop ;34 ciclos
nop ;37 ciclos
nop ;40 ciclos
nop ;43 ciclos
nop ;46 ciclos
nop ;49 ciclos
nop ;52 ciclos
nop ;55 ciclos
nop ;58 ciclos
nop ;61 ciclos
nop ;64 ciclos
ld r15, r0, r0 ;68 ciclos
rts ;72 ciclos
;;-----------------------------------Copiado do trabalho anterior--------------------------------------------
;pollingLoop: ; Repete esse loop infinitamente
nop
; r5 <= PortData
ld r5, r0, r2
; 8 Shifts para a esquerda (Desloca dados dos Switches para seus respectivos LEDs)
sl0 r4, r4 ;1
sl0 r4, r4 ;2
sl0 r4, r4 ;3
sl0 r4, r4 ;4
sl0 r4, r4 ;5
sl0 r4, r4 ;6
sl0 r4, r4 ;7
sl0 r4, r4 ;8
; PortData <= r5
st r5, r0, r2
jsrd #pollingLoop
;;-----------------------------------Copiado do trabalho anterior-------------------------------------------
return: ; Esse trecho de código nunca executa
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop r7
pop r6
pop r5
pop r4
pop r3
pop r2
pop r1
pop r0
rts
.endcode
.data
; array SSD representa o array de valores a serem postos nos displays de sete seg
; 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9
arraySSD: db #03h, #9fh, #25h, #0dh, #99h, #49h, #21h, #1fh, #01h, #09h
; Array que escolhe qual disp sera utilizado
; Mais da direita -> Mais da esquerda
arrayDisp: db #01h, #02h, #04h, #08h
.enddata | 47.908397 | 216 | 0.350263 |
7dbe179ecfa47e7aab12c3e7b8361e636bb50f8d | 326 | asm | Assembly | src/io/data.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | 2 | 2019-08-03T17:09:30.000Z | 2021-04-01T22:17:09.000Z | src/io/data.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | null | null | null | src/io/data.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | 1 | 2019-08-04T21:26:32.000Z | 2019-08-04T21:26:32.000Z | ; Input
_gr_input_buffer rb 256 ; Max input = 255
_gr_input_char_count db 0 ; Current character count
; Output
_gr_output_buffer rb 65535 ; Max output = 65535
_gr_output_char_count dw 0 ; Current character count
| 36.222222 | 78 | 0.521472 |
66c8dabe759e19b44e676222c0849e2c6d888ca8 | 1,049 | asm | Assembly | Wizardry/ExternalHacks/UnlockChest/TryAddToUnlockTargetList.asm | sme23/WhatHeck | 746a2be83358aaa4e855182176b47c4808f2587a | [
"CC0-1.0"
] | 1 | 2021-09-27T02:59:12.000Z | 2021-09-27T02:59:12.000Z | Wizardry/ExternalHacks/UnlockChest/TryAddToUnlockTargetList.asm | sme23/WhatHeck | 746a2be83358aaa4e855182176b47c4808f2587a | [
"CC0-1.0"
] | null | null | null | Wizardry/ExternalHacks/UnlockChest/TryAddToUnlockTargetList.asm | sme23/WhatHeck | 746a2be83358aaa4e855182176b47c4808f2587a | [
"CC0-1.0"
] | null | null | null | .thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.equ IsThereClosedChestAt, 0x080831AC
.equ IsThereClosedDoorAt, 0x080831f0
.equ AddTarget, 0x0804F8BC
.equ gMapTerrain, 0x0202E4DC
.equ ChestTerrainType, 0x21
.equ DoorTerrainType, 0x1E
.equ BridgeTerrainType, 0x14
push {r4-r6, lr}
mov r4, r0
mov r5, r1
ldr r0, =gMapTerrain
ldr r1, [r0]
lsl r0, r5, #0x2
add r0, r0, r1
ldr r0, [r0]
add r0, r0, r4
ldrb r6, [r0] @terrain type
lsl r0, r4, #0x18
asr r0, r0, #0x18
lsl r1, r5, #0x18
asr r1, r1, #0x18
cmp r6, #ChestTerrainType
beq CheckForChest
cmp r6, #BridgeTerrainType
beq CheckForDoor
cmp r6, #DoorTerrainType
beq CheckForDoor
b EndFunc
CheckForDoor:
blh IsThereClosedDoorAt
lsl r0, r0, #0x18
cmp r0, #0x0
beq EndFunc
b AddToTargetList
CheckForChest:
blh IsThereClosedChestAt
lsl r0, r0, #0x18
cmp r0, #0x0
beq EndFunc
b AddToTargetList
AddToTargetList:
mov r0, r4
mov r1, r5
mov r2, r6
mov r3, #0x0
blh AddTarget, r6
EndFunc:
pop {r4-r6}
pop {r0}
bx r0
.align
.ltorg
| 15.426471 | 38 | 0.709247 |
eab03e02d4f7e3a8d270c8c2503c58e9f2781c69 | 670 | asm | Assembly | 8_kyu/Bin_to_Decimal.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | 8_kyu/Bin_to_Decimal.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | 8_kyu/Bin_to_Decimal.asm | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | global bin_to_dec
section .text
; <--- unsigned bin_to_dec(const char *bin) --->
bin_to_dec:
xor rcx, rcx ; ecx = accumulated value
mov bx, '10' ; cache constants bl='1', bh = '0'
mov rsi, rdi ; rsi = running pointer in string
test rsi, rsi
jz .exit ; error: null string pointer
.loop:
lodsb
cmp al, bl ; cmp to '1'
jne .not1
shl ecx, 1 ; digit is '1'
inc ecx
jmp .loop
.not1:
cmp al, bh ; cmp to '0'
jne .exit
shl ecx, 1 ; digit is '0'
jmp .loop
.exit: ; not '0' stop parsing
mov rax, rcx ; return value
ret
; ---------> endof bin2dec <---------
| 23.928571 | 54 | 0.523881 |
cdc3e48a23b159a9505cd6c443be79dff95ff8dd | 702 | asm | Assembly | oeis/098/A098297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/098/A098297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/098/A098297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A098297: Member r=12 of the family of Chebyshev sequences S_r(n) defined in A092184.
; Submitted by Jon Maiga
; 0,1,12,121,1200,11881,117612,1164241,11524800,114083761,1129312812,11179044361,110661130800,1095432263641,10843661505612,107341182792481,1062568166419200,10518340481399521,104120836647576012,1030690025994360601,10202779423296030000,100997104206965939401,999768262646363364012,9896685522256667700721,97967086959920313643200,969774184076946468731281,9599774753809544373669612,95027973354018497267964841,940679958786375428305978800,9311771614509735785791823161,92177036186310982429612252812
mov $3,1
lpb $0
sub $0,1
mul $1,8
add $3,$1
add $2,$3
mov $1,$2
add $3,2
lpe
mov $0,$1
| 46.8 | 489 | 0.840456 |
6cabf9d7590b5c78e9e9133ea6258ddd9e23b7f5 | 600 | asm | Assembly | oeis/128/A128963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/128/A128963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/128/A128963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A128963: a(n) = (n^3 - n)*5^n.
; 0,150,3000,37500,375000,3281250,26250000,196875000,1406250000,9667968750,64453125000,418945312500,2666015625000,16662597656250,102539062500000,622558593750000,3735351562500000,22178649902343750,130462646484375000,761032104492187500,4405975341796875000,25334358215332031250,144767761230468750000,822544097900390625000,4649162292480468750000,26151537895202636718750,146448612213134765625000,816732645034790039062500,4537403583526611328125000,25117769837379455566406250,138580799102783203125000000
add $0,2
mov $2,5
pow $2,$0
bin $0,3
mul $0,$2
div $0,125
mul $0,150
| 54.545455 | 496 | 0.861667 |
450fe9d009f1b7dfe3a670861b5dbf1b31d53d39 | 202 | asm | Assembly | Lab Assessment Submission/labassisment1.asm | DAs240/CSE331L-Section-10-Fall20-NSU | 4a8aec29a7d8fa22a070a852a43dd31c9fe4508d | [
"MIT"
] | null | null | null | Lab Assessment Submission/labassisment1.asm | DAs240/CSE331L-Section-10-Fall20-NSU | 4a8aec29a7d8fa22a070a852a43dd31c9fe4508d | [
"MIT"
] | null | null | null | Lab Assessment Submission/labassisment1.asm | DAs240/CSE331L-Section-10-Fall20-NSU | 4a8aec29a7d8fa22a070a852a43dd31c9fe4508d | [
"MIT"
] | null | null | null |
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
MOV AX, 01
MOV BX, 05
MOV CX, 05
ADD AX, BX
ADD AX, CX
ret
| 10.631579 | 68 | 0.707921 |
d4b6f78211070a5991b6f8140d12dc729176f67a | 352 | asm | Assembly | programs/oeis/040/A040546.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040546.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040546.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A040546: Continued fraction for sqrt(570).
; 23,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1,46,1,6,1
cal $0,40548 ; Continued fraction for sqrt(572).
mov $1,$0
add $0,1
gcd $1,5
sub $1,5
sub $0,$1
mov $1,$0
sub $1,5
| 29.333333 | 190 | 0.596591 |
32ddab1e121ae4dcd4f0a6a812863015e5bce3af | 429 | asm | Assembly | programs/oeis/004/A004455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/004/A004455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/004/A004455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A004455: Nimsum n + 14.
; 14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1,30,31,28,29,26,27,24,25,22,23,20,21,18,19,16,17,46,47,44,45,42,43,40,41,38,39,36,37,34,35,32,33,62,63,60,61,58,59,56,57,54,55,52,53,50,51,48,49,78,79,76,77,74,75,72,73,70,71,68,69,66,67,64,65,94,95,92,93,90,91,88,89,86,87,84,85,82,83,80,81,110,111,108,109
mov $3,$0
div $0,2
mod $0,8
mov $1,1
mov $2,$0
add $2,$0
mul $2,2
sub $1,$2
add $1,13
add $1,$3
mov $0,$1
| 28.6 | 295 | 0.620047 |
24d128257f556363c7f648a97f6b0a5880bd8d1b | 4,342 | asm | Assembly | const.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | const.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | const.asm | jorgicor/altair | a83f4a5b177c366000f69cb261befb499602aa69 | [
"MIT"
] | null | null | null | ; ----------------------------------------------------------------------------
; Altair, CIDLESA's 1981 arcade game remade for the ZX Spectrum and
; Amstrad CPC.
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
; Constants.
; ----------------------------------------------------------------------------
; ------------
; Sprite Table
; ------------
MINE_SP_SLOT .equ 0
MINE_SP_SLOTS .equ 12
EXPLOSION_SP_SLOT .equ MINE_SP_SLOT+MINE_SP_SLOTS
EXPLOSION_SP_SLOTS .equ 6
SHIP_SHOT_SP_SLOT .equ EXPLOSION_SP_SLOT+EXPLOSION_SP_SLOTS
SHIP_SHOT_SP_SLOTS .equ 2
SHIP_SP_SLOT .equ SHIP_SHOT_SP_SLOT+SHIP_SHOT_SP_SLOTS
SHIP_SP_SLOTS .equ 5
ALIEN_SHOT_SP_SLOT .equ SHIP_SP_SLOT+SHIP_SP_SLOTS
ALIEN_SHOT_SP_SLOTS .equ 6
ALIEN_SP_SLOT .equ ALIEN_SHOT_SP_SLOT+ALIEN_SHOT_SP_SLOTS
ALIEN_SP_SLOTS .equ 6
BIRD_LSHIELD_SP_SLOT .equ ALIEN_SP_SLOT+ALIEN_SP_SLOTS
BIRD_LSHIELD_SP_SLOTS .equ 1
BIRD_RSHIELD_SP_SLOT .equ BIRD_LSHIELD_SP_SLOT+BIRD_LSHIELD_SP_SLOTS
BIRD_RSHIELD_SP_SLOTS .equ 1
HOUSE_SP_SLOT .equ BIRD_RSHIELD_SP_SLOT+BIRD_RSHIELD_SP_SLOTS
HOUSE_SP_SLOTS .equ 2
NSPRS .equ HOUSE_SP_SLOT+HOUSE_SP_SLOTS
; Careful, for the bird we are reusing the sprites form ALIEN_SHOT_SP_SLOTS
BIRD_NSPS .equ 14
BIRD_SP_SLOT .equ ALIEN_SHOT_SP_SLOT
BIRD_SP_SLOTS .equ BIRD_NSPS
BIRD_EXPLOSION_SP_SLOT .equ HOUSE_SP_SLOT
; Maximum number of rects that the Rect List can contain.
MAXRECS .equ NSPRS*2
; Object slots.
; Function.
OB_FUL .equ 0
OB_FUH .equ 1
; Sprite pointer.
OB_SPL .equ 2
OB_SPH .equ 3
; Dimensions.
OB_DX .equ 4
OB_DY .equ 5
; Other sprite
OB_SP2L .equ 4
OB_SP2H .equ 5
; Counters.
OB_CNT0 .equ 4
OB_CNT1 .equ 5
OB_CNT3 .equ 2
OBJSZ .equ 6
; -------------
; Sprite Struct
; -------------
#ifdef ZX
; Address of Image Table.
SP_ITL .equ 0
SP_ITH .equ 1
; Position in pixels.
SP_PX .equ 2
SP_PY .equ 3
; Color if SP_COH is 0, otherwise address of Color Pattern.
SP_COL .equ 4
SP_COH .equ 5
; Animation address, 0 no animation.
SP_ANL .equ 6
SP_ANH .equ 7
; Speed and speed counter for animation.
SP_SPE .equ 8
SP_SPC .equ 9
; Frame of animation.
SP_FRA .equ 10
; If looped or not.
SP_LOP .equ 11
SPRSZ .equ 12
#endif
#ifdef CPC
; Address of Image Table.
SP_ITL .equ 0
SP_ITH .equ 1
; Position in pixels.
SP_PX .equ 2
SP_PY .equ 3
; Animation address, 0 no animation.
SP_ANL .equ 4
SP_ANH .equ 5
; Speed and speed counter for animation.
SP_SPE .equ 6
SP_SPC .equ 7
; Frame of animation.
SP_FRA .equ 8
; If looped or not.
SP_LOP .equ 9
SPRSZ .equ 10
#endif
; Image Slots.
; Dimensions.
IM_WID .equ 0
IM_HEI .equ 1
; Image constants.
SHIP_IM_WC .equ 3
SHIP_IM_W .equ SHIP_IM_WC*8
SHIP_IM_H .equ 16
SHIP_IM_HC .equ SHIP_IM_H/8
HOUSE_IM_WC .equ 3
ALIEN_IM_H .equ 6
ALIEN_IM_WC .equ 2
ALIEN_IM_W .equ ALIEN_IM_WC*8
EXPLOSION_IM_H .equ 12
EXPLOSION_OFFS .equ (EXPLOSION_IM_H - ALIEN_IM_H) / 2
BIRD_WC .equ 6
BIRD_HC .equ 7
; Starting positions.
HOUSE_LPOS .equ 8
HOUSE_MPOS .equ 8 * ((BBUFWC - HOUSE_IM_WC) / 2)
HOUSE_RPOS .equ 8 * (BBUFWC - HOUSE_IM_WC - 1)
SHIP_LPOS .equ 8
SHIP_MPOS .equ 8 * ((BBUFWC - SHIP_IM_WC) / 2)
SHIP_RPOS .equ 8 * (BBUFWC - SHIP_IM_WC - 1)
BIRD_LEVEL .equ 7
;
SHIP_SHOT_SPEED .equ 4
ALIEN_SHOT_SPEED .equ 4
HOUSE_YPOS .equ 8
; Main program states.
STATE_NONE .equ -1
STATE_MENU .equ 0
STATE_GAMEPLAY .equ 1
STATE_ATTRACT .equ 2
STATE_OPTIONS .equ 3
STATE_KILLED .equ 4
STATE_ROUND .equ 5
STATE_NAME .equ 6
STATE_DISCLAIMER .equ 7
STATE_DEDICATE .equ 8
STATE_GAMEOVER .equ 9
; End of line.
EOF .equ 2
#ifdef ZX
BLACK_BLACK .equ BLACK|PBLACK
WHITE_BLACK .equ WHITE|PBLACK
BLUE_BLUE .equ BLUE|BLUE
GREEN_BLUE .equ PBLUE|GREEN
CYAN_BLUE .equ CYAN|PBLUE
ABUFCLR .equ BLUE|PBLACK
BBUF_BLACK .equ ABUFCLR
BBUF_GREEN .equ BLACK|PGREEN
BBUF_RED .equ BLACK|PRED
SHIELD_FULL .equ $ff
SHIELD_PARTIAL .equ $55
SHIELD_EMPTY .equ 0
#endif
#ifdef CPC
BLACK_BLACK .equ BLACK|PBLACK
WHITE_BLACK .equ WHITE|PBLACK
BLUE_BLUE .equ BLUE|PBLUE
GREEN_BLUE .equ PBLUE|GREEN
CYAN_BLUE .equ CYAN|PBLUE
ABUFCLR .equ BLACK|PBLACK
BBUF_BLACK .equ BBLACK
BBUF_GREEN .equ BGREEN
BBUF_RED .equ BRED
SHIELD_FULL .equ WHITE|PWHITE
SHIELD_PARTIAL .equ WHITE|PBLACK
SHIELD_EMPTY .equ BLACK|PBLACK
#endif
; Some border colors.
BORDER_MENU .equ BBLUE
BORDER_GAME .equ BBLACK
BORDER_NAME .equ BRED
| 22.266667 | 78 | 0.707278 |
74ed7a4e1208bcfbd19b6aecc48ff798a013abbd | 6,150 | asm | Assembly | base/ntos/rtl/i386/stringsp.asm | yang235/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 209 | 2018-10-30T15:59:10.000Z | 2022-03-31T06:02:48.000Z | base/ntos/rtl/i386/stringsp.asm | WindowsExploitation/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 2 | 2019-01-17T04:52:33.000Z | 2019-06-11T06:37:43.000Z | base/ntos/rtl/i386/stringsp.asm | WindowsExploitation/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 66 | 2018-08-03T11:15:44.000Z | 2022-03-31T01:03:03.000Z | TITLE "String support routines"
;++
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt).
; If you do not agree to the terms, do not use the code.
;
;
; Module Name:
;
; stringsup.asm
;
; Abstract:
;
; This module implements supplementary routines for performing string
; operations.
;
;--
.386p
include ks386.inc
include callconv.inc ; calling convention macros
if DBG
_DATA SEGMENT DWORD PUBLIC 'DATA'
_MsgStringTooLong db 'RTL: RtlInit*String called with string length: (%x)\n',0
_DATA ENDS
extrn _KdDebuggerEnabled:BYTE
EXTRNP _DbgBreakPoint,0
extrn _DbgPrint:near
endif
_TEXT SEGMENT DWORD PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
page ,132
subttl "RtlInitAnsiString"
;++
;
; VOID
; RtlInitAnsiString(
; OUT PANSI_STRING DestinationString,
; IN PSZ SourceString OPTIONAL
; )
;
;
; Routine Description:
;
; The RtlInitAnsiString function initializes an NT counted string.
; The DestinationString is initialized to point to the SourceString
; and the Length and MaximumLength fields of DestinationString are
; initialized to the length of the SourceString, which is zero if
; SourceString is not specified.
;
; Arguments:
;
; (TOS+4) = DestinationString - Pointer to the counted string to initialize
;
; (TOS+8) = SourceString - Optional pointer to a null terminated string that
; the counted string is to point to.
;
;
; Return Value:
;
; None.
;
; NOTE:
; This routine assumes that the string is less than 64K in size.
;
;--
cPublicProc _RtlInitString ,2
cPublicFpo 2,2
push edi
mov edi,[esp]+8+4 ; (edi)= SourceString
mov edx,[esp]+4+4 ; (esi)= DestinationString
mov DWORD PTR [edx], 0 ; (Destination).Length = (Destination).MaximumLength = 0
mov DWORD PTR [edx]+4, edi ; (Destination).Buffer = 0
or edi, edi
jz @f
or ecx, -1
xor eax, eax
repne scasb
not ecx
cmp ecx,0ffffh
jbe rtis
;
; spew length and bp if debugger attached.
;
if DBG
push edx
push ecx
push offset FLAT:_MsgStringTooLong
call _DbgPrint
add esp, 2 * 4
cmp _KdDebuggerEnabled,0
je nobp1
call _DbgBreakPoint@0
nobp1: pop edx
endif
mov ecx,0ffffh ; overflow, truncate at MAXUSHORT
rtis: mov [edx]+2, cx ; Save maximum length
dec ecx
mov [edx], cx ; Save length
@@: pop edi
stdRET _RtlInitString
stdENDP _RtlInitString
cPublicProc _RtlInitAnsiString ,2
cPublicFpo 2,2
push edi
mov edi,[esp]+8+4 ; (edi)= SourceString
mov edx,[esp]+4+4 ; (esi)= DestinationString
mov DWORD PTR [edx], 0 ; (Destination).Length = (Destination).MaximumLength = 0
mov DWORD PTR [edx]+4, edi ; (Destination).Buffer = 0
or edi, edi
jz @f
or ecx, -1
xor eax, eax
repne scasb
not ecx
cmp ecx,0ffffh
jbe rtias
;
; spew length and bp if debugger attached.
;
if DBG
push edx
push ecx
push offset FLAT:_MsgStringTooLong
call _DbgPrint
add esp, 2 * 4
cmp _KdDebuggerEnabled,0
je nobp2
call _DbgBreakPoint@0
nobp2: pop edx
endif
mov ecx,0ffffh ; overflow, truncate at MAXUSHORT
rtias: mov [edx]+2, cx ; Save maximum length
dec ecx
mov [edx], cx ; Save length
@@: pop edi
stdRET _RtlInitAnsiString
stdENDP _RtlInitAnsiString
page
subttl "RtlInitUnicodeString"
;++
;
; VOID
; RtlInitUnicodeString(
; OUT PUNICODE_STRING DestinationString,
; IN PWSTR SourceString OPTIONAL
; )
;
;
; Routine Description:
;
; The RtlInitUnicodeString function initializes an NT counted string.
; The DestinationString is initialized to point to the SourceString
; and the Length and MaximumLength fields of DestinationString are
; initialized to the length of the SourceString, which is zero if
; SourceString is not specified.
;
; Arguments:
;
; (TOS+4) = DestinationString - Pointer to the counted string to initialize
;
; (TOS+8) = SourceString - Optional pointer to a null terminated string that
; the counted string is to point to.
;
;
; Return Value:
;
; None.
;
; NOTE:
; This routine assumes that the string is less than 64K in size.
;
;--
cPublicProc _RtlInitUnicodeString ,2
cPublicFpo 2,2
push edi
mov edi,[esp]+8+4 ; (edi)= SourceString
mov edx,[esp]+4+4 ; (esi)= DestinationString
mov DWORD PTR [edx], 0 ; (Destination).Length = (Destination).MaximumLength = 0
mov DWORD PTR [edx]+4, edi ; (Destination).Buffer = 0
or edi, edi
jz @f
or ecx, -1
xor eax, eax
repne scasw
not ecx
shl ecx,1
cmp ecx,0fffeh
jbe rtius
;
; spew length and bp if debugger attached.
;
if DBG
push edx
push ecx
push offset FLAT:_MsgStringTooLong
call _DbgPrint
add esp, 2 * 4
cmp _KdDebuggerEnabled,0
je nobp3
call _DbgBreakPoint@0
nobp3: pop edx
endif
mov ecx,0fffeh ; overflow, truncate at MAX_USTRING
rtius: mov [edx]+2, cx ; Save maximum length
dec ecx
dec ecx
mov [edx], cx ; Save length
@@: pop edi
stdRET _RtlInitUnicodeString
stdENDP _RtlInitUnicodeString
_TEXT ends
end
| 25.625 | 134 | 0.581789 |
092945b9d975f06667734f90fc1242dc2ee288c4 | 4,280 | asm | Assembly | asm/subtitles/originais/0200760c_eu.asm | Iemnur/megaman-zx-traducao-ptbr | f2710a06052384cf93d423681e9875c6cd424f06 | [
"MIT"
] | 10 | 2015-10-14T11:43:58.000Z | 2021-08-30T14:41:07.000Z | asm/subtitles/originais/0200760c_eu.asm | Iemnur/megaman-zx-traducao-ptbr | f2710a06052384cf93d423681e9875c6cd424f06 | [
"MIT"
] | 17 | 2015-10-16T01:53:21.000Z | 2020-05-25T00:54:40.000Z | asm/subtitles/originais/0200760c_eu.asm | Iemnur/megaman-zx-traducao-ptbr | f2710a06052384cf93d423681e9875c6cd424f06 | [
"MIT"
] | 5 | 2015-10-14T12:55:54.000Z | 2021-06-07T19:37:33.000Z | 0200760C B570 push r4-r6,r14
0200760E B084 add sp,-10h
02007610 1C04 mov r4,r0
02007612 482C ldr r0,=27E00FCh
02007614 6800 ldr r0,[r0]
02007616 2800 cmp r0,0h
02007618 D001 beq 200761Eh
0200761A F7FFFE71 bl 2007300h ; na jp, apontar para 2007198h
0200761E 2000 mov r0,0h
02007620 43C0 mvn r0,r0
02007622 F0A8E870 blx 20AF704h ; na jp, apontar para 20AE848h
02007626 1C20 mov r0,r4
02007628 F7FFFEB2 bl 2007390h ; na jp, apontar para 2007228h
0200762C 2800 cmp r0,0h
0200762E DB42 blt 20076B6h
02007630 2101 mov r1,1h
02007632 4824 ldr r0,=27E00FCh
02007634 6001 str r1,[r0]
02007636 4924 ldr r1,=27E01FCh
02007638 68CD ldr r5,[r1,0Ch]
0200763A 4C24 ldr r4,=20F751Ch ; na jp, apontar para 20F735Ch
0200763C 2380 mov r3,80h
0200763E 5563 strb r3,[r4,r5]
02007640 5D62 ldrb r2,[r4,r5]
02007642 4823 ldr r0,=4000240h
02007644 542A strb r2,[r5,r0]
02007646 690A ldr r2,[r1,10h]
02007648 54A3 strb r3,[r4,r2]
0200764A 5CA1 ldrb r1,[r4,r2]
0200764C 5411 strb r1,[r2,r0]
0200764E 2000 mov r0,0h
; a partir daqui, foi acrescentado
02007650 4920 ldr r1,=4000Eh
02007652 F7FBFB91 bl 2002D78h ; na jp, apontar para 2002BE4h
02007656 4820 ldr r0,=20F89B0h ; na jp, apontar para 20F87F0h
02007658 6804 ldr r4,[r0]
0200765A 2200 mov r2,0h
0200765C 6002 str r2,[r0]
0200765E 4D1F ldr r5,=20F8930h ; na jp, apontar para 20F8770h
02007660 0193 lsl r3,r2,6h
02007662 18E9 add r1,r5,r3
02007664 6041 str r1,[r0,4h]
02007666 58E9 ldr r1,[r5,r3]
02007668 2607 mov r6,7h
0200766A 43B1 bic r1,r6
0200766C 2605 mov r6,5h
0200766E 4331 orr r1,r6
02007670 50E9 str r1,[r5,r3]
02007672 6845 ldr r5,[r0,4h]
02007674 682B ldr r3,[r5]
02007676 491A ldr r1,=0FFFFF0FFh
02007678 400B and r3,r1
0200767A 491A ldr r1,=400h
0200767C 430B orr r3,r1
0200767E 602B str r3,[r5]
02007680 4919 ldr r1,=4002h
02007682 6840 ldr r0,[r0,4h]
02007684 8181 strh r1,[r0,0Ch]
02007686 2024 mov r0,24h
02007688 2184 mov r1,84h
0200768A F7FDFAFF bl 2004C8Ch ; na jp, apontar para 2004AF8h
0200768E 2100 mov r1,0h
02007690 9100 str r1,[sp]
02007692 9101 str r1,[sp,4h]
02007694 9102 str r1,[sp,8h]
02007696 2024 mov r0,24h
02007698 4A14 ldr r2,=100h
0200769A 1C0B mov r3,r1
0200769C F7FDFD2A bl 20050F4h ; na jp, apontar para 2004F60h
020076A0 480D ldr r0,=20F89B0h ; na jp, apontar para 20F87F0h
020076A2 6004 str r4,[r0]
020076A4 4A0D ldr r2,=20F8930h ; na jp, apontar para 20F8770h
020076A6 01A1 lsl r1,r4,6h
020076A8 1851 add r1,r2,r1
020076AA 6041 str r1,[r0,4h]
; daqui para baixo é equivalente na rom jp
020076AC F7F1FC0E bl 1FF8ECCh
020076B0 2001 mov r0,1h
020076B2 B004 add sp,10h
020076B4 BD70 pop r4-r6,r15
020076B6 2000 mov r0,0h
020076B8 43C0 mvn r0,r0
020076BA F0A8E824 blx 20AF704h ; na jp, apontar para 20AE848h
020076BE 2000 mov r0,0h
020076C0 B004 add sp,10h
020076C2 BD70 pop r4-r6,r15
.pool
020076C4 00FC lsl r4,r7,3h
020076C6 027E lsl r6,r7,9h
020076C8 01FC lsl r4,r7,7h
020076CA 027E lsl r6,r7,9h
020076CC 751C strb r4,[r3,14h]
020076CE 020F lsl r7,r1,8h
020076D0 0240 lsl r0,r0,9h
020076D2 0400 lsl r0,r0,10h
020076D4 000E lsl r6,r1,0h
020076D6 0004 lsl r4,r0,0h
020076D8 89B0 ldrh r0,[r6,0Ch]
020076DA 020F lsl r7,r1,8h
020076DC 8930 ldrh r0,[r6,8h]
020076DE 020F lsl r7,r1,8h
020076E0 F0FFFFFF bl 21076E2h
020076E4 0400 lsl r0,r0,10h
020076E6 0000 lsl r0,r0,0h
020076E8 4002 and r2,r0
020076EA 0000 lsl r0,r0,0h
020076EC 0100 lsl r0,r0,4h
020076EE 0000 lsl r0,r0,0h | 39.62963 | 78 | 0.606308 |
50eae8ccdd6ebc7db081c7d50b90f53416a229bd | 684 | asm | Assembly | oeis/066/A066916.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/066/A066916.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/066/A066916.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A066916: a(n) = n^phi(n) - 1.
; Submitted by Jon Maiga
; 0,1,8,15,624,35,117648,4095,531440,9999,25937424600,20735,23298085122480,7529535,2562890624,4294967295,48661191875666868480,34012223,104127350297911241532840,25599999999,7355827511386640,26559922791423,907846434775996175406740561328,110075314175,9094947017729282379150390624,95428956661682175,58149737003040059690390168,232218265089212415,88540901833145211536614766025207452637360,656099999999,550618520345910837374536871905139185678862400,1208925819614629174706175,2345734188103679287078463273600
mov $1,$0
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
add $1,1
pow $1,$0
mov $0,$1
sub $0,1
| 62.181818 | 499 | 0.845029 |
00b40e77b99c6037327ca972ecaa76cebc648d62 | 378 | asm | Assembly | oeis/104/A104680.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/104/A104680.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/104/A104680.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A104680: a(n) = binomial(n+7,7)*binomial(n+12,7).
; Submitted by Christian Krause
; 792,13728,123552,772200,3775200,15402816,54609984,172931616,498841200,1330243200,3316739712,7801876368,17439488352,37263864000,76488984000,151448188320,290275694280,540192201120,978609060000,1729734435000,2988981103680,5058275713920
mov $2,$0
add $2,7
bin $2,$0
add $0,12
bin $0,7
mul $0,$2
| 34.363636 | 234 | 0.793651 |
d40f672332f99092f04a0891aa905341dd5a5af7 | 980 | asm | Assembly | u7-common/patch-suppressBarks.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | u7-common/patch-suppressBarks.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | u7-common/patch-suppressBarks.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | ; Adds the ability to suppress printing of bark-texts by setting a global flag.
; Used to suppress the printing of (redundant and sometimes inaccurate) spell-
; rune incantations by the Avatar that are triggered by spell Usecode.
[bits 16]
startPatch EXE_LENGTH, suppressBarks
%macro maybeSuppressBarkWhileGettingItemZ 2
%define %%ibo %1
%define %%off_dontBark %2
cmp byte [dseg_areBarksSuppressed], 0
jnz calcJump(%%off_dontBark)
push word %%ibo
callVarArgsEopFromOverlay getItemZ, 1
pop cx
; leave item Z in ax
%endmacro
startBlockAt addr_barkWithoutDialogs_getItemZ
maybeSuppressBarkWhileGettingItemZ \
barkWithoutDialogs_ibo, off_barkWithoutDialogs_dontBark
times 15 nop
endBlockAt off_barkWithoutDialogs_getItemZ_end
startBlockAt addr_barkWithDialogs_getItemZ
maybeSuppressBarkWhileGettingItemZ \
barkWithDialogs_ibo, off_barkWithDialogs_dontBark
times 6 nop
endBlockAt off_barkWithDialogs_getItemZ_end
endPatch
| 27.222222 | 79 | 0.8 |
073cfb613aae3a3f2c44a8cd1f19fb71541a222c | 583 | asm | Assembly | pros/print.asm | ichdream/labs-Insight | 9c077b899aff93c9e8ddd0a2372850a9f434b9d0 | [
"BSD-3-Clause"
] | null | null | null | pros/print.asm | ichdream/labs-Insight | 9c077b899aff93c9e8ddd0a2372850a9f434b9d0 | [
"BSD-3-Clause"
] | null | null | null | pros/print.asm | ichdream/labs-Insight | 9c077b899aff93c9e8ddd0a2372850a9f434b9d0 | [
"BSD-3-Clause"
] | null | null | null | global _start ; _start是一个符号(.symboil),链接器会把其作为entry point
; 数据段
section .data
buffer db 'Hello, system call.', 10, 0 ; buffer,10是换行符,0是字符串结束
length db 40 ; buffer的长度
; 代码段
section .text
_start:
mov eax, 4 ; 4,write系统调用
mov ebx, 1 ; fd(文件描述符),1为标准输出
mov ecx, buffer ; buffer的地址
mov edx, [length] ; 根据地址从数据段获取buffer的长度
int 0x80 ; system call
mov eax, 1 ; 1,exit系统调用
mov ebx, 0 ; exit code
int 0x80 ; system call
| 29.15 | 68 | 0.51458 |
06d8319c5fccf703b41e7f89b5b4786309ffc62d | 518 | asm | Assembly | oeis/319/A319950.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/319/A319950.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/319/A319950.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A319950: a(n) = Product_{i=1..n} floor(5*i/3).
; Submitted by Jon Maiga
; 1,3,15,90,720,7200,79200,1029600,15444000,247104000,4447872000,88957440000,1868106240000,42966443520000,1074161088000000,27928188288000000,781989272064000000,23459678161920000000,727250023019520000000,23999250759644160000000
add $0,1
mov $1,2
mov $2,1
lpb $0
mov $3,$2
lpb $3
mod $0,30
add $2,1
mod $3,5
div $3,2
add $2,$3
add $4,1
lpe
sub $0,1
mul $1,$4
add $2,1
lpe
mov $0,$1
sub $0,2
div $0,2
add $0,1
| 19.923077 | 226 | 0.679537 |
828bd96ce49596b71b84c6feff764ce6eed70af7 | 409 | asm | Assembly | programs/oeis/033/A033162.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/033/A033162.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/033/A033162.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A033162: Begins with (3, 4); avoids 3-term arithmetic progressions.
; 3,4,6,7,12,13,15,16,30,31,33,34,39,40,42,43,84,85,87,88,93,94,96,97,111,112,114,115,120,121,123,124,246,247,249,250,255,256,258,259,273,274,276,277,282,283,285,286,327,328,330,331,336,337,339,340,354,355,357,358,363
mov $2,$0
div $0,2
seq $0,240400 ; Numbers n having a partition into distinct parts of form 3^k-2^k.
add $0,$2
add $0,3
| 45.444444 | 217 | 0.704156 |
70e9e15a8ebf0f6ca4ce11a2339599c35178cde2 | 152 | asm | Assembly | src/print_string.asm | saitama951/OSDev | 13a6f556f508bae3252b590af3facbcd88bd3348 | [
"MIT"
] | null | null | null | src/print_string.asm | saitama951/OSDev | 13a6f556f508bae3252b590af3facbcd88bd3348 | [
"MIT"
] | null | null | null | src/print_string.asm | saitama951/OSDev | 13a6f556f508bae3252b590af3facbcd88bd3348 | [
"MIT"
] | null | null | null | printstring:
pusha
mov ah,0x0e
print_char:
mov al, [bx]
cmp al,0
je end_print
int 0x10
add bx,1
jmp print_char
end_print:
popa
ret
| 10.133333 | 16 | 0.664474 |
9e95e95d6b84d23ad4e66bec5fbc0a2dc8a614fa | 1,551 | asm | Assembly | data/phone/text/wilton_caller.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/phone/text/wilton_caller.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/phone/text/wilton_caller.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | WiltonGrownText:
text "My @"
text_ram wStringBuffer4
text "'s"
line "grown impressive!"
para "My fishing skills"
line "have improved too!"
done
UnknownText_0x66b3e:
text "We beat a wild"
line "@"
text_ram wStringBuffer4
text "…"
para "You know, I have"
line "more fun fishing"
para "than beating wild"
line "#MON."
done
UnknownText_0x66b8f:
text "But a while back,"
line "we came this close"
para "to landing a wild"
line "@"
text_ram wStringBuffer4
text "."
para "I tell you, it was"
line "huge. Believe me."
done
UnknownText_0x66bf3:
text "I'm fishing on"
line "@"
text_ram wStringBuffer5
text ","
para "but nothing's"
line "biting today."
para "Help me while my"
line "time away, come"
cont "over for a battle."
done
UnknownText_0x66c58:
text "All right, later."
done
UnknownText_0x66c6b:
text "I snagged an item"
line "while fishing."
para "Come pick it up on"
line "@"
text_ram wStringBuffer5
text "."
done
WiltonHaventFoundAnythingText:
text "Nah, I haven't"
line "found anything"
para "that's worth your"
line "time."
para "You have to have"
line "patience."
done
WiltonNotBitingText:
text "Sigh…"
line "They're not biting"
para "like before on"
line "@"
text_ram wStringBuffer5
text "…"
para "You have to come"
line "for a battle!"
done
WiltonWantThisText:
text "Don't you want"
line "this item?"
para "Hah? You don't"
line "know where?"
para "@"
text_ram wStringBuffer5
text "…"
line "Just head from"
para "MAHOGANY toward"
line "BLACKTHORN!"
done
| 14.913462 | 30 | 0.691167 |
54aae55a0aeefa32a583f1d51c2a94d1bca0a879 | 7,557 | asm | Assembly | cmd/setver/device.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/setver/device.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/setver/device.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | ;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
;========================================================
COMMENT #
DEVICE.ASM
=================================================
Device driver to activate the version table in
MS-DOS 6.0. Upon initialization the driver will
set the DWORD PTR in the DOS data area at offset
05dh to point to the version table in the device
driver and also calculates the minimum install
size needed to include only the valid entries
in the default version table.
================================================
johnhe - 12/30/90
END COMMENT #
; =======================================================
INCLUDE VERSIONA.INC
CMD EQU 2 ; Command field offset in packet
STATUS EQU 3 ; Return status field offset
DEV_LEN EQU 14 ; Device length field offset
DOS_TABLE EQU 5dh ; Lie table ptr offset in dos data
TABLE_LEN EQU 2048 ; Max size of lie table
; ====================================================================
A_DEVICE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:A_DEVICE, DS:NOTHING, ES:NOTHING
PUBLIC ENTRY
PUBLIC DeviceInit
; ====================================================================
DeviceHeader:
dw -1,-1
dw 1000000000000000b; Device attributes (character device)
dw Strategy ; Device strategy entry offset
dw Entry ; Device entry offset
db 'SETVERXX'
ExtendedHeader: ; Extended header is used by the
; SETVER.EXE program to determine
; where the version table is located
; within the .EXE file
VerMinor db 0 ; Version 1.0 of Setver
VerMajor db 1 ;
TableOffset dd OFFSET VerList ; Offset of table from device start
TableLength dw TABLE_LEN ; Max table size
PtrSave dd (?) ; Address of device packet
; ====================================================================
; ====================================================================
StratProc PROC FAR
Strategy:
mov WORD PTR CS:[PtrSave],BX ; Save device packet for
mov WORD PTR CS:[PtrSave][2],ES ; use on call to dev entry
ret
StratProc ENDP
; ====================================================================
; ====================================================================
Entry PROC FAR ; Device driver entry location
push BX
push DS
lds BX,[PtrSave] ; DS:BX --> Cmd structure
mov AL,DS:[BX].CMD ; AL == command from sysinit
cbw
or AX,AX ; Check for init function zero
jnz CmdError ; If not init then error
jmp DeviceInit ; Jmp to initialize device
CmdError:
mov AL,3 ; Return invalid function code
mov AH,10000001b ; Signal error in AH
SetStatus:
mov [BX].Status,AX ; Copy status to packet
pop DS
pop BX
ret
Entry ENDP
; ====================================================================
; ====================================================================
SIG db 'PCMN'
TblLen dw TABLE_LEN
; ====================================================================
; ====================================================================
public VerList
; B# refer to MSDOS 6 bug database
VerList db 10,"KERNEL.EXE" ,5,00 ; GeoWorks Pro 1.2 B#1344
db 8, "NETX.COM" ,5,00 ; NOVELL netx.com 3.26 B#707
db 8, "NETX.EXE" ,5,00 ; Novell Redir 3.31 B#4243
db 8, "NET5.COM" ,5,00 ; Microsoft Device Library
db 9, "BNETX.COM" ,5,00 ; Novell Burst Mode Redir B#3843
db 9, "BNETX.EXE" ,5,00 ; Novell Burst Mode Redir B#4377
db 11,"EMSNETX.EXE" ,5,00 ; Novell EMS Redir B#4775
db 11,"EMSNET5.EXE" ,5,00 ; Novell EMS Redir B#4775
db 11,"XMSNETX.EXE" ,5,00 ; Novell XMS Redir B#4775
db 11,"XMSNET5.EXE" ,5,00 ; Novell XMS Redir B#4775
db 10,"DOSOAD.SYS" ,5,00 ; Iomega bernoulli B#2223
db 11,"REDIR50.EXE" ,5,00 ; IBM PLCP 1.34 B#1459
db 10,"REDIR5.EXE" ,5,00 ; PATHWORKS 4.1 B#1646
db 12,"REDIRALL.EXE" ,5,00 ; Banyan Vines 4.115 B#1347
db 12,"REDIRNP4.EXE" ,5,00 ; Banyan redirector B#3283
db 9, "EDLIN.EXE" ,5,00 ; Microsoft Device Library
IFNDEF OEMBASE
db 10,"BACKUP.EXE" ,5,00 ; Microsoft Device Library
ENDIF
db 10,"ASSIGN.COM" ,5,00 ; Microsoft Device Library
db 11,"EXE2BIN.EXE" ,5,00 ; Microsoft Device Library
db 8, "JOIN.EXE" ,5,00 ; Microsoft Device Library
db 11,"RECOVER.EXE" ,5,00 ; Microsoft Device Library
db 12,"GRAFTABL.COM" ,5,00 ; Microsoft Device Library
db 11,"LMSETUP.EXE" ,5,00 ; LanMan 2.1 Setup B#969
db 11,"STACKER.COM" ,5,00 ; Stacker B#2338
db 10,"NCACHE.EXE" ,5,00 ; Norton Utilities B#1329
db 11,"NCACHE2.EXE" ,5,00 ; Norton Utilities B#3819
db 12,"IBMCACHE.SYS" ,5,00 ; B#2228
db 11,"XTRADRV.SYS" ,5,00 ; XtraDrive compression B#2371
db 8, "2XON.COM" ,5,00 ; Superstor floppy reader B#5272
db 11,"WINWORD.EXE" ,4,10 ; winword 1.0
db 9, "EXCEL.EXE" ,4,10 ; excel 2.x
db 7, "LL3.EXE" ,4,01 ; LapLink 3
db 10,"REDIR4.EXE" ,4,00 ; IBM PCLP
db 11,"REDIR40.EXE" ,4,00 ; IBM DLR
db 11,"MSREDIR.EXE" ,4,00 ; 3Com 3+Share
db 10,"WIN200.BIN" ,3,40 ; windows 2.x
db 9, "METRO.EXE" ,3,31 ; Lotus Metro
db (TABLE_LEN - ($ - VerList)) dup (0)
db 0
; ====================================================================
; Device initialization function first determines minimum size the
; driver needs to be and then sets the DWORD PTR in the DOS data area
; to the location of the version table.
; ====================================================================
DeviceInit:
push BX
push CX
mov AH,30h ; Get version
int 21h
pop CX
pop BX
cmp AX,expected_version
je SetupScan
xor AX,AX ; Set end of device to 0
jmp SHORT SetDevEnd
SetupScan:
push SI
push DS
mov AX,CS
mov DS,AX
mov SI, OFFSET VerList ; DS:SI --> Version table
xor AX,AX ; Clear high byte of AX
ScanLoop:
lodsb ; Grab the name length
or AX,AX ; Test for end of the table
jz FoundEnd
inc AX ; Add 2 bytes for the version number
inc AX
add SI,AX ; Make SI so it points to next entry
jmp SHORT ScanLoop
FoundEnd:
mov AX,SI ; AX == Offset of end of table
inc AX ; Need 1 zero byte at end of table
pop DS
pop SI
SetTablePtr:
push BX
push ES
push AX ; Save end of device offset
mov AH,52h ; Get the DOS data segment
int 21h
pop AX ; Restore end of device offset to AX
cli ; Safety measure when altering DOSdata
mov WORD PTR ES:[DOS_TABLE], OFFSET VerList ; Offset of lie table
mov WORD PTR ES:[DOS_TABLE][2],CS ; Segment of lie table
sti
pop ES
pop BX
SetDevEnd:
mov WORD PTR DS:[BX].DEV_LEN,AX ; Set end of driver @ end of list
mov DS:[BX].DEV_LEN[2],CS ; Set device segment
mov AH,00000001b ; Normal status return
jmp SetStatus ; End of init code
; ====================================================================
A_DEVICE ENDS
; ====================================================================
END
| 32.021186 | 82 | 0.510255 |
6cc3356958217a5d600707a82dd4b91db7bf2940 | 312 | asm | Assembly | test/br3026808.asm | bitwiseworks/nasm-os2 | ef78e4ee1ca3220ac3b60a61b084a693b8032ab6 | [
"BSD-2-Clause"
] | 3 | 2015-03-21T07:35:15.000Z | 2018-01-12T01:24:02.000Z | 3rdParties/src/nasm/nasm-2.15.02/test/br3026808.asm | blue3k/StormForge | 1557e699a673ae9adcc8f987868139f601ec0887 | [
"Apache-2.0"
] | 1 | 2020-03-26T19:58:54.000Z | 2020-04-24T08:58:04.000Z | test/br3026808.asm | bitwiseworks/nasm-os2 | ef78e4ee1ca3220ac3b60a61b084a693b8032ab6 | [
"BSD-2-Clause"
] | 5 | 2015-03-21T07:35:21.000Z | 2021-01-14T10:54:46.000Z | ;Testname=br3026808; Arguments=-Ox -fbin -obr3026808.o; Files=stdout stderr br3026808.o
%imacro proc 1
%push proc
%assign %$arg 1
%endmacro
%imacro arg 0-1 1
%assign %$arg %1+%$arg
%endmacro
%imacro endproc 0
%pop
%endmacro
;----------------------------
proc Test
%$ARG arg
endproc
| 14.857143 | 88 | 0.596154 |
7cc1c800f22cedfa086140d9bdbb92a10d4cb09e | 1,909 | asm | Assembly | src/firmware/Door/OpenStates.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | 1 | 2019-12-12T09:07:08.000Z | 2019-12-12T09:07:08.000Z | src/firmware/Door/OpenStates.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | src/firmware/Door/OpenStates.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | #include "Platform.inc"
#include "FarCalls.inc"
#include "Timer0.inc"
#include "Motor.inc"
#include "Door.inc"
#include "States.inc"
radix decimal
NUMBER_OF_TICKS_0_5S equ 2
NUMBER_OF_TICKS_3S equ 12
defineDoorState DOOR_STATE_OPEN
bcf doorFlags, DOOR_FLAG_PREVIOUSJAM
setDoorState DOOR_STATE_MOTORVDD_ENABLE
setDoorNextState DOOR_STATE_OPEN_MOTORVDDENABLED
returnFromDoorState
defineDoorStateInSameSection DOOR_STATE_OPEN_MOTORVDDENABLED
storeSlowTimer0 doorOperationStartedTimestamp
startRaising:
.unknownBank
setDoorState DOOR_STATE_MOTOR_STARTRAISING
setDoorNextState DOOR_STATE_OPEN_RAISING
returnFromDoorState
defineDoorStateInSameSection DOOR_STATE_OPEN_RAISING
; TODO: NO LOAD - FAULT
; TODO: TIMEOUT - FAULT
.setBankFor motorFlags
btfss motorFlags, MOTOR_FLAG_OVERLOAD
returnFromDoorState
motorJammed:
.setBankFor doorFlags
btfss doorFlags, DOOR_FLAG_PREVIOUSJAM
goto lowerAndThenTryRaisingAgain
motorJammedAgain:
elapsedSinceSlowTimer0 doorTurnFullSpeedTimestamp
sublw NUMBER_OF_TICKS_3S
btfss STATUS, C
goto lowerAndThenTryRaisingAgain
motorJammedTwicedWithinShortTimeOfStarting:
setDoorState DOOR_STATE_MOTOR_DONE
setDoorNextState DOOR_STATE_OPENED
returnFromDoorState
lowerAndThenTryRaisingAgain:
.safelySetBankFor doorFlags
bsf doorFlags, DOOR_FLAG_PREVIOUSJAM
setDoorState DOOR_STATE_MOTOR_STARTLOWERING
setDoorNextState DOOR_STATE_OPEN_LOWERING
returnFromDoorState
defineDoorStateInSameSection DOOR_STATE_OPEN_LOWERING
; TODO: TIMEOUT - FAULT
elapsedSinceSlowTimer0 doorTurnFullSpeedTimestamp
sublw NUMBER_OF_TICKS_0_5S
btfsc STATUS, C
returnFromDoorState
goto startRaising
defineDoorStateInSameSection DOOR_STATE_OPENED
bsf doorFlags, DOOR_FLAG_OPENED
bcf doorFlags, DOOR_FLAG_CLOSED
bcf doorFlags, DOOR_FLAG_PREVIOUSJAM
setDoorState DOOR_STATE_WAIT_SUNSET
returnFromDoorState
end
| 24.164557 | 61 | 0.848612 |
fd030a9c9dd05f608f87a85af0bd852919582741 | 665 | asm | Assembly | oeis/057/A057449.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/057/A057449.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/057/A057449.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A057449: Product of differences between consecutive positive divisors of n.
; Submitted by Christian Krause
; 1,1,2,2,4,3,6,8,12,15,10,12,12,35,40,64,16,81,18,100,112,99,22,192,80,143,216,588,28,600,30,1024,352,255,224,1944,36,323,520,2400,40,3087,42,3388,2880,483,46,12288,252,5625,952,6084,52,19683,1056,14112,1216,783,58,36000,60,899,8064,32768,1664,59895,66,15028,1840,52920,70,186624,72,1295,20000,21660,1584,138411,78,230400,11664,1599,82,576240,3264,1763,3016,255552,88,729000,2808,40204,3472,2115,4256,3145728,96,60025,34848,625000
seq $0,34729 ; a(n) = Sum_{ k, k|n } 2^(k-1).
seq $0,124758 ; Product of the parts of the compositions in standard order.
| 95 | 431 | 0.75188 |
d19c7c5ddb053b4de55141abf4ee85a01666c228 | 473 | asm | Assembly | oeis/175/A175249.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/175/A175249.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/175/A175249.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A175249: Noncomposites (A008578) with nonprime (A018252) subscripts.
; Submitted by Jon Maiga
; 1,5,11,17,19,23,31,41,43,47,59,67,71,73,83,89,97,101,103,109,127,131,137,139,149,157,163,167,179,191,193,197,211,223,227,229,233,241,251,257,263,269,277,283,293,307,311,313,331,337,347,353,367,373,379,383,389,401,409,419
add $0,1
seq $0,65090 ; Natural numbers which are not odd primes: composites plus 1 and 2.
sub $0,2
seq $0,6005 ; The odd prime numbers together with 1.
| 52.555556 | 222 | 0.733615 |
6e0099ddc885859ef8412ab85ce621eb36b6b636 | 3,561 | asm | Assembly | videocodec/libvpx_internal/libvpx/vp8/encoder/ppc/encodemb_altivec.asm | Omegaphora/hardware_intel_common_omx-components | 2dc257bd12d2604f5bac67d039e2b7e53c255ac9 | [
"Apache-2.0"
] | 49 | 2015-01-07T04:37:04.000Z | 2022-03-25T08:37:14.000Z | videocodec/libvpx_internal/libvpx/vp8/encoder/ppc/encodemb_altivec.asm | Omegaphora/hardware_intel_common_omx-components | 2dc257bd12d2604f5bac67d039e2b7e53c255ac9 | [
"Apache-2.0"
] | 15 | 2015-02-17T09:28:19.000Z | 2017-09-23T16:51:25.000Z | videocodec/libvpx_internal/libvpx/vp8/encoder/ppc/encodemb_altivec.asm | Omegaphora/hardware_intel_common_omx-components | 2dc257bd12d2604f5bac67d039e2b7e53c255ac9 | [
"Apache-2.0"
] | 16 | 2015-01-08T01:47:24.000Z | 2022-02-25T06:06:06.000Z | ;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
.globl vp8_subtract_mbuv_ppc
.globl vp8_subtract_mby_ppc
;# r3 short *diff
;# r4 unsigned char *usrc
;# r5 unsigned char *vsrc
;# r6 unsigned char *pred
;# r7 int stride
vp8_subtract_mbuv_ppc:
mfspr r11, 256 ;# get old VRSAVE
oris r12, r11, 0xf000
mtspr 256, r12 ;# set VRSAVE
li r9, 256
add r3, r3, r9
add r3, r3, r9
add r6, r6, r9
li r10, 16
li r9, 4
mtctr r9
vspltisw v0, 0
mbu_loop:
lvsl v5, 0, r4 ;# permutate value for alignment
lvx v1, 0, r4 ;# src
lvx v2, 0, r6 ;# pred
add r4, r4, r7
addi r6, r6, 16
vperm v1, v1, v0, v5
vmrghb v3, v0, v1 ;# unpack high src to short
vmrghb v4, v0, v2 ;# unpack high pred to short
lvsl v5, 0, r4 ;# permutate value for alignment
lvx v1, 0, r4 ;# src
add r4, r4, r7
vsubshs v3, v3, v4
stvx v3, 0, r3 ;# store out diff
vperm v1, v1, v0, v5
vmrghb v3, v0, v1 ;# unpack high src to short
vmrglb v4, v0, v2 ;# unpack high pred to short
vsubshs v3, v3, v4
stvx v3, r10, r3 ;# store out diff
addi r3, r3, 32
bdnz mbu_loop
mtctr r9
mbv_loop:
lvsl v5, 0, r5 ;# permutate value for alignment
lvx v1, 0, r5 ;# src
lvx v2, 0, r6 ;# pred
add r5, r5, r7
addi r6, r6, 16
vperm v1, v1, v0, v5
vmrghb v3, v0, v1 ;# unpack high src to short
vmrghb v4, v0, v2 ;# unpack high pred to short
lvsl v5, 0, r5 ;# permutate value for alignment
lvx v1, 0, r5 ;# src
add r5, r5, r7
vsubshs v3, v3, v4
stvx v3, 0, r3 ;# store out diff
vperm v1, v1, v0, v5
vmrghb v3, v0, v1 ;# unpack high src to short
vmrglb v4, v0, v2 ;# unpack high pred to short
vsubshs v3, v3, v4
stvx v3, r10, r3 ;# store out diff
addi r3, r3, 32
bdnz mbv_loop
mtspr 256, r11 ;# reset old VRSAVE
blr
;# r3 short *diff
;# r4 unsigned char *src
;# r5 unsigned char *pred
;# r6 int stride
vp8_subtract_mby_ppc:
mfspr r11, 256 ;# get old VRSAVE
oris r12, r11, 0xf800
mtspr 256, r12 ;# set VRSAVE
li r10, 16
mtctr r10
vspltisw v0, 0
mby_loop:
lvx v1, 0, r4 ;# src
lvx v2, 0, r5 ;# pred
add r4, r4, r6
addi r5, r5, 16
vmrghb v3, v0, v1 ;# unpack high src to short
vmrghb v4, v0, v2 ;# unpack high pred to short
vsubshs v3, v3, v4
stvx v3, 0, r3 ;# store out diff
vmrglb v3, v0, v1 ;# unpack low src to short
vmrglb v4, v0, v2 ;# unpack low pred to short
vsubshs v3, v3, v4
stvx v3, r10, r3 ;# store out diff
addi r3, r3, 32
bdnz mby_loop
mtspr 256, r11 ;# reset old VRSAVE
blr
| 23.123377 | 70 | 0.517551 |
17a8a8505715743dc1fb7fbd8b7b39d9a51094b2 | 6,792 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_sm_/i3-7100_9_0xca_notsx.log_21829_1871.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_sm_/i3-7100_9_0xca_notsx.log_21829_1871.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_sm_/i3-7100_9_0xca_notsx.log_21829_1871.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xeade, %r9
nop
nop
nop
nop
inc %rcx
mov (%r9), %di
nop
cmp %rdx, %rdx
lea addresses_A_ht+0x4841, %r14
clflush (%r14)
nop
nop
nop
inc %r10
movb $0x61, (%r14)
nop
nop
nop
xor %r10, %r10
lea addresses_A_ht+0x19d7e, %rsi
lea addresses_D_ht+0x11303, %rdi
clflush (%rdi)
sub $5795, %rax
mov $96, %rcx
rep movsb
nop
nop
nop
nop
add $5920, %rax
lea addresses_WC_ht+0x236e, %rsi
lea addresses_WC_ht+0xb1ee, %rdi
nop
nop
nop
sub %r9, %r9
mov $79, %rcx
rep movsl
nop
nop
nop
nop
and $55827, %r10
lea addresses_WT_ht+0x10d5e, %rsi
lea addresses_WC_ht+0x8b0e, %rdi
nop
cmp $52902, %r10
mov $52, %rcx
rep movsb
nop
inc %rsi
lea addresses_normal_ht+0x160ee, %rdi
nop
nop
xor %r10, %r10
mov (%rdi), %r9d
nop
nop
nop
and %r9, %r9
lea addresses_UC_ht+0x14cde, %rcx
nop
xor %r14, %r14
mov (%rcx), %rsi
nop
nop
nop
nop
and $3970, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %r9
push %rbp
push %rdx
// Store
lea addresses_PSE+0x12cde, %rdx
nop
nop
nop
nop
cmp $46431, %r9
mov $0x5152535455565758, %r10
movq %r10, (%rdx)
nop
nop
nop
xor $19850, %r15
// Store
mov $0x8a6, %r9
nop
and %r12, %r12
mov $0x5152535455565758, %rbp
movq %rbp, %xmm7
vmovups %ymm7, (%r9)
nop
nop
nop
nop
nop
xor %rbp, %rbp
// Store
lea addresses_WT+0x64de, %r14
clflush (%r14)
cmp $43741, %r12
mov $0x5152535455565758, %r10
movq %r10, (%r14)
nop
nop
inc %rdx
// Store
lea addresses_WC+0xacde, %r14
nop
nop
add $58273, %rdx
mov $0x5152535455565758, %r15
movq %r15, %xmm5
vmovups %ymm5, (%r14)
nop
nop
nop
nop
nop
and %r12, %r12
// Faulty Load
lea addresses_WC+0xacde, %r15
nop
nop
nop
nop
add %rbp, %rbp
movntdqa (%r15), %xmm0
vpextrq $0, %xmm0, %rdx
lea oracles, %r12
and $0xff, %rdx
shlq $12, %rdx
mov (%r12,%rdx,1), %rdx
pop %rdx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'src': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'58': 21512, '00': 304, '79': 13}
58 58 58 58 58 58 58 58 58 79 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 34.477157 | 2,999 | 0.654741 |
94875c70e4f02f07d87e521759a9d4cb0faa4ff5 | 60,757 | asm | Assembly | Library/Text/TextRegion/trLargeInfo.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Text/TextRegion/trLargeInfo.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Text/TextRegion/trLargeInfo.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: trLargeInfo.asm
AUTHOR: John Wedgwood, Feb 12, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 2/12/92 Initial revision
DESCRIPTION:
Misc information about regions in large objects.
$Id: trLargeInfo.asm,v 1.1 97/04/07 11:21:38 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TextRegion segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisLargeTextPurgeRegionCache
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Purge the cache used with regions stored in huge arrays
CALLED BY: via MSG_VIS_LARGE_TEXT_PURGE_REGION_CACHE
PASS: *ds:si = Instance ptr
ds:di = Instance ptr
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
tony 9/3/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisLargeTextPurgeRegionCache method dynamic VisLargeTextClass,
MSG_VIS_LARGE_TEXT_PURGE_REGION_CACHE
mov cx, -1
call PointAtRegionElement
ret
VisLargeTextPurgeRegionCache endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisLargeTextPurgeCachedInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Purge the cache used to record previously calculated
region walking calculations.
CALLED BY: via MSG_VIS_LARGE_TEXT_PURGE_CACHED_INFO
PASS: *ds:si = Instance ptr
ds:di = Instance ptr
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
lshields 4/19/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisLargeTextPurgeCachedInfo method dynamic VisLargeTextClass,
MSG_VIS_LARGE_TEXT_PURGE_CACHED_INFO
mov cx, 0
call ResetCachedLineIfLower
ret
VisLargeTextPurgeCachedInfo endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionLinesInClipRect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the range of lines in a region that fall inside a
given rectangle.
CALLED BY: TR_LinesInClipRect via CallRegionHandlers
PASS: *ds:si = Instance
ss:bp = TextRegionEnumParameters
ss:bx = VisTextRange to fill in
RETURN: VisTextRange holds the range of lines
carry set if no lines appear in the region
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionLinesInClipRect proc near
uses ax, dx
.enter
mov ax, ss:[bp].TREP_regionWidth ; ax <- width
movdw dsdi, ss:[bp].TREP_regionPtr ; ds:di <- region
ceilwbf ds:[di].VLTRAE_calcHeight, dx ; dx <- height
call LinesInClipCommon
.leave
ret
LargeRegionLinesInClipRect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionNextSegmentTop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the next segment of a region.
CALLED BY: TR_NextSegmentTop via CallRegionHandler
PASS: *ds:si = Instance
bx = non-zero to get the next segment top for blt purposes
cx = Region number
dx = Y position within that region
RETURN: dx = Y position of the top of the next segment
= Region bottom if there are no more segments
carry set if there are no more segments
DESTROYED: bx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionNextSegmentTop proc near
class VisLargeTextClass
uses ax
.enter
EC < call T_AssertIsVisLargeText >
call GetFillRegion ;axdi = region
jc regionExists
tst bx ;if not for blt then return
jz useTrueHeight ; true height
; we're getting the height for blt-ing -- return calcHeight unless
; we are in galley mode, in which case we want to return something
; very large
mov dx, di ;dx = calc height
call TextRegion_DerefVis_DI
cmp ds:[di].VLTI_displayMode, VLTDM_CONDENSED
jbe checkReturnNull
mov dx, LARGEST_BLT_VALUE
returnNull:
stc
done:
.leave
ret
checkReturnNull:
;
; We want to return the *minimum* of the calculated height and the
; true height.
;
mov bx, dx ; bx <- calculated height
call LargeRegionGetTrueHeight
ceilwbf dxal, dx ; dx <- true height
;
; Return the minimum in dx.
;
cmp dx, bx
jbe returnNull
mov dx, bx
jmp returnNull
unlockPopDSSIuseTrueHeight:
call DBUnlockDS
pop si, ds ; Restore instance
useTrueHeight:
call LargeRegionGetTrueHeight
ceilwbf dxal, dx ; dx <- height
jmp returnNull
; region exists -- scan it
regionExists:
push si, ds
call DBLockToDSSI ;ds:si = region
yloop:
; search for correct swath -- ds:si points at y pos
lodsw ;ax <- y position of swath
;
; It is possible that the position passed may be below the bottom
; of the object. If that is the case, then the first word of the
; line will be EOREGREC. If we find that, we return the computed
; height (for lack of anything better to do).
;
cmp ax, EOREGREC
je unlockPopDSSIuseTrueHeight
; skip to the next swath
push ax ;save position of 1st swath
skiploop:
lodsw ;skip on/off points
cmp ax, EOREGREC
jnz skiploop
pop ax ;ax <- Y pos of current swath
cmp ax, dx ;check for reached requested pos
jle yloop ;branch if we haven't
; found the swath after the position passed in dx, return the y position
mov_tr dx, ax ;dx <- top of next swath
lodsw ;ax <- left edge of swath
cmp ax, EOREGREC ;check for end of region
jz unlockPopDSSIuseTrueHeight ;branch if it is
call DBUnlockDS
pop si, ds
clc
jmp done
LargeRegionNextSegmentTop endp
TextRegion ends
TextFixed segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetRegionTopLeft
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the top/left edge of a region.
CALLED BY: TR_GetRegionTopLeft via CallRegionHandler
PASS: *ds:si = Instance
cx = Region number
ss:bp = PointDWord to fill in
RETURN: PointDWord contains the top-left corner of the region
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetRegionTopLeft proc near
class VisLargeTextClass
uses ax, bx
.enter
EC < call T_AssertIsVisLargeText >
call TextFixed_DerefVis_DI
mov ax, ds:[di].VLTI_displayMode
cmp ax, VLTDM_PAGE
jz pageMode
push cx, dx, si
;
; load callback based on mode
;
mov bx, offset addCondensed
cmp ax, VLTDM_CONDENSED
jz gotCallback
mov bx, offset addGalleyOrDraft
gotCallback:
clr ax
clrdw ss:[bp].PD_x, ax
clrdw ss:[bp].PD_y, ax
jcxz done ;if region 0 then done
if 0 ; no need for this one yet OPTIMIZE_REGIONS_IN_HUGE_ARRAY
mov di, ds:[di].VLTI_regionSpacing ;di = region spacing
push di, ds, es
push bx ;save callback
mov_tr ax, cx ;ax = region number
call NewSetupForRegionScan
regionLoop:
pop ax
push ax ;get callback from stack
call ax ;ax = region height
add ax, di ;add spacing
add ss:[bp].PD_y.low, ax
adc ss:[bp].PD_y.high, 0
add si, dx
loop regionLoop
sub si, dx
call NewScanToNextRegion
jnz regionLoop
call NewFinishRegionScan
pop bx ;discard callback
pop di, ds, es
else
mov_tr ax, cx ;ax = region number
call SetupForRegionScan
mov_tr cx, ax ;cx = count
regionLoop:
call bx ;ax = region height
add ax, ds:[di].VLTI_regionSpacing
add ss:[bp].PD_y.low, ax
adc ss:[bp].PD_y.high, 0
dec cx
jz done
call ScanToNextRegion ; ds:si <- ptr to next region
jmp regionLoop
endif
done:
pop cx, dx, si
jmp quit
pageMode:
call PointAtRegionElement ;ds:di = data
movdw ss:[bp].PD_x, ds:[di].VLTRAE_spatialPosition.PD_x, ax
movdw ss:[bp].PD_y, ds:[di].VLTRAE_spatialPosition.PD_y, ax
;
; Adjust for the region.
;
call GetFillRegion ; axdi = region
jnc quit ; Branch if no region
;
; A region exists. Adjust the position for the region rectangle.
;
push ds, si ; Save nuked registers
call DBLockToDSSI ; ds:si <- ptr to region
sub si, size Rectangle ; ds:si <- ptr to rectangle
mov ax, ds:[si].R_top ; ax <- top of rectangle
call DBUnlockDS ; Release the region
pop ds, si ; Restore nuked registers
;
; Account for the region rectangle.
;
add ss:[bp].PD_y.low, ax
adc ss:[bp].PD_y.high, 0
quit:
.leave
ProfilePoint 18
ret
;---
addCondensed:
;
; Adjust for the region.
;
push di ; Save nuked registers...
mov di, si ; ds:di <- ptr to region
call NotDraftModeGetRegionInfo ; axdi <- region
jnc noCondensedRegion ; Branch if no region
;
; A region exists. Adjust the position for the region rectangle.
;
push ds, si ; Save nuked registers
call DBLockToDSSI ; ds:si <- ptr to region
sub si, size Rectangle ; ds:si <- ptr to rectangle
mov ax, ds:[si].R_bottom ; ax <- height of rectangle
sub ax, ds:[si].R_top
call DBUnlockDS ; Release the region
pop ds, si ; Restore nuked registers
pop di
retn
noCondensedRegion:
mov ax, ds:[si].VLTRAE_size.XYS_height
pop di
retn
;---
addGalleyOrDraft:
ceilwbf ds:[si].VLTRAE_calcHeight, ax
retn
LargeRegionGetRegionTopLeft endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GetFillRegion
DESCRIPTION: Get a region's fill region
CALLED BY: INTERNAL
PASS:
*ds:si - instance
cx - region number
RETURN:
carry - set if region
axdi - region DB item
clear if not region
ax - region width
di - region calc height
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 8/27/92 Initial version
------------------------------------------------------------------------------@
GetFillRegion proc far
class VisLargeTextClass
EC < call T_AssertIsVisLargeText >
call TextFixed_DerefVis_DI
cmp ds:[di].VLTI_displayMode, VLTDM_DRAFT_WITH_STYLES
jb notDraftMode
mov ax, ds:[di].VLTI_draftRegionSize.XYS_width
mov di, ds:[di].VLTI_draftRegionSize.XYS_height
jmp doneNoRegion
notDraftMode:
call PointAtRegionElement
NotDraftModeGetRegionInfo label far
;
; Make sure there aren't any pushes or pops above this...
;
mov ax, ds:[di].VLTRAE_region.high
tst ax
jnz regionExists
ceilwbf ds:[di].VLTRAE_calcHeight, ax
mov di, ds:[di].VLTRAE_size.XYS_width
xchg ax, di
doneNoRegion:
clc
ret
regionExists:
mov di, ds:[di].VLTRAE_region.low
stc
ret
GetFillRegion endp
COMMENT @----------------------------------------------------------------------
FUNCTION: DBLockToDSSI
DESCRIPTION: Lock a DB item containing a region's path
CALLED BY: INTERNAL
PASS:
*ds:si - instance
axdi - region DB item
RETURN:
ds:si - pointer to region path (after Rectangle bounds)
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
------------------------------------------------------------------------------@
DBLockToDSSI proc far
push bx, es
; Assume that DB item with path is in the same file as
; the rest of the data. If VTI_vmFile is zero, we assume
; that it is in our own file (in accordance with the
; way T_GetVMFile determines the file for other operations).
; [mg, 02/26/00]
call T_GetVMFile ; bx <- handle of our file
call DBLock
segmov ds, es
mov si, ds:[di] ;ds:si = region
add si, size Rectangle ;point past bounds
pop bx, es
ret
DBLockToDSSI endp
DBUnlockDS proc far
push es
segmov es, ds
call DBUnlock
pop es
ret
DBUnlockDS endp
TextFixed ends
TextRegion segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetLineCount
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the number of lines in a region.
CALLED BY: TR_RegionGetLineCount via CallRegionHandler
PASS: *ds:si = Instance
cx = Region
RETURN: cx = Number of lines
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/18/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetLineCount proc near
uses ax, dx
class VisTextClass
.enter
EC < call T_AssertIsVisLargeText >
call PointAtRegionElement ;ds:di = data, z set if last
mov cx, ds:[di].VLTRAE_lineCount.low
.leave
ret
LargeRegionGetLineCount endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetCharCount
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the number of characters in a region.
CALLED BY: TR_RegionGetCharCount via CallRegionHandler
PASS: *ds:si = Instance
cx = Region
RETURN: dx.ax = Number of lines
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/18/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetCharCount proc near
class VisTextClass
.enter
EC < call T_AssertIsVisLargeText >
call PointAtRegionElement ;ds:di = data, z set if last
movdw dxax, ds:[di].VLTRAE_charCount
.leave
ret
LargeRegionGetCharCount endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionLeftRight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the bounds of the region at a given y position.
CALLED BY: TR_RegionLeftRight via CallRegionHandler
PASS: *ds:si = Instance
cx = Region number
dx = Y position within that region
bx = Integer height of the line at that position
RETURN: ax = Left edge of the region at that point.
bx = Right edge of the region at that point.
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionLeftRight proc near
.enter
call GetFillRegion
jc regionExists
; no region -- just return width (in ax)
mov_tr bx, ax
clr ax
done:
.leave
ret
; region exists -- scan it
regionExists:
push cx, dx, si, ds
call DBLockToDSSI ;ds:si = region
add bx, dx ;bx = bottom
yloop:
; search for correct swath -- ds:si points at y pos
lodsw
cmp ax, dx
jg foundY
cmp ax, EOREGREC
jz returnNull
; skip to the next swath
skiploop:
lodsw
cmp ax, EOREGREC
jnz skiploop
jmp yloop
; found the swath, return the width
foundY:
mov_tr cx, ax ;cx <- swath bottom
lodsw ;ax <- left
cmp ax, EOREGREC ;Check for no swath at all
jz returnNull
push cx ;Save swath bottom
mov_tr cx, ax ;cx <- left
lodsw
mov_tr dx, ax ;dx <- right
finalloop:
;
; See if the region is any smaller further down
;
; bx = Bottom of area we're interested in
; cx = left edge so far, including current swath
; dx = right edge so far, including current swath
; ds:si = Pointer into current swath
; On stack:
; Bottom of current swath
;
pop ax ;ax <- bottom of swath
cmp ax, bx ;Check for swath contains area
jg regionDone ;Branch if it does
;
; The swath does not completely contain the area we're interested in.
; We need to check the actual data.
;
; Since the information we have includes this swath, we need to skip
; to the end of this swath.
;
skiploop2:
lodsw
cmp ax, EOREGREC
jnz skiploop2 ;Loop until done with swath
lodsw ;ax <- Bottom of next swath
;
; Check for no more region, which we figure is sort of the same
; thing as no more restrictions.
;
cmp ax, EOREGREC
je regionDone
;
; So here we are... We have a real swath and we need to factor
; in the left/right edges of this swath into our left/right edges
; for the entire swath.
;
; We're only interested in the left edge moving in or the right
; edge moving in.
;
; There is the chance that the left edge of this swath will be
; larger than our current right edge, or that the right edge of
; this swath will be less than the left edge of our current swath.
;
; Neither of these cases is really acceptable. It indicates a type
; of region which we don't handle well. For the purposes of calculation
; or drawing, it is sort of a discontinuity. In all cases we need
; to leave the line in the original segment, so it is unreasonable
; to create a situation where left > right...
;
; Anyway, we do two quick checks here. If either of the following
; is true, we figure "good enough" and quit out of here.
; newLeft > curRight
; newRight < curLeft
;
; cx = curLeft
; dx = curRight
; ds:si = Left edge of current swath, followed by right edge
;
cmp {word} ds:[si], dx ;Compare newLeft, curRight
jge regionDone
cmp {word} ds:[si+2], cx ;Compare newRight, curLeft
jle regionDone
;
; We're safe... go on as usual.
;
push ax ;Save bottom of next swath
lodsw ;ax <- Left edge of next swath
cmp ax, cx
jle noLeftRestriction
mov_tr cx, ax
noLeftRestriction:
lodsw ;load new right
cmp ax, dx
jge noRightRestriction
mov_tr dx, ax
noRightRestriction:
jmp finalloop
regionDone:
mov_tr ax, cx ;ax = left
mov bx, dx ;dx = right
call DBUnlockDS
pop cx, dx, si, ds
jmp done
returnNull:
clr ax
clr bx
jmp regionDone
LargeRegionLeftRight endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionFromOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the region associated with a given offset.
CALLED BY: TR_RegionFromOffset via CallRegionHandler
PASS: *ds:si = Instance
dx.ax = Offset
RETURN: cx = Region
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionFromOffset proc near uses si
.enter
call FindRegionByOffset
.leave
ret
LargeRegionFromOffset endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionFromOffsetGetStartLineAndOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get info about the region associated with a given offset.
CALLED BY: TR_RegionFromOffsetGetStartLineAndOffset via CallRegionHandler
PASS: *ds:si = Instance
dx.ax = Offset
RETURN: dx.ax = Region start offset
bx.di = Region start line
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionFromOffsetGetStartLineAndOffset proc near
uses cx, si, bp
offsetToFind local dword push dx, ax
regStartLine local dword
region local word
ProfilePoint 39
.enter
; If zero, then return 0s (this avoids messing up our cache)
tstdw dxax
jne notZero
clrdw dxax
clrdw bxdi
jmp exit
notZero:
push si
; dx.ax = offset to find
; ds.si = object
call FetchCachedRegionFromOffset
; ax.di = start char of region
; bx.cx = start line of region
; dx = region index
movdw regStartLine, bxcx
mov region, dx
call VisLargeTextGetRegionCount
sub cx, dx
; cx = number of regions to follow
; Point at the first region
push ax, cx, di
mov cx, dx
call PointAtRegionElement
; ds:di = region data
; ax = element size
mov si, di
mov dx, ax
pop ax, cx, di
;-----------------------------------------------------------------------------
findLoop:
;
; ds:si = Current region
; dx = Amount to add to get to next region
; cx = Number of regions after ds:si
; ax.di = Starting offset of current region
; ss:bp = Stack frame
;
adddw axdi, ds:[si].VLTRAE_charCount
cmpdw offsetToFind, axdi
jb gotRegion
ja checkNext
;
; Screw it... We always return the first region in which the offset
; falls. This makes some stuff work, but slows down some other
; operations. Thankfully those other operations are things like
; typing the first character in a new region.
;
jmp gotRegion
checkNext:
adddw regStartLine, ds:[si].VLTRAE_lineCount, bx
dec cx
jz gotRegion
inc region
call ScanToNextRegion ; ds:si <- ptr to next region
jmp findLoop
gotRegion:
;
; ds:si = Pointer to current region
; regStartLine = First line in this region
; ax.di = Starting offset of next region
;
subdw axdi, ds:[si].VLTRAE_charCount ; ax.di <- offset to current reg
gotOffsetAndLine::
;
; regStartLine = First line of this region
; ax.di = Offset to start of region
;
mov dx, ax ; dx.ax <- Start offset
mov ax, di
movdw bxdi, regStartLine ; bx.di <- Start line
mov cx, region
pop si
call StoreCachedRegionFromOffset
exit:
.leave
ProfilePoint 36
ret
LargeRegionFromOffsetGetStartLineAndOffset endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FindNextSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a pointer to the first region in the next section.
CALLED BY: HasNextSection
PASS: ds:si = Current region
dx = Size of region data
cx = Number of regions after ds:si
RETURN: carry set if there is a next section
ds:si = First region in next section
ax = Number of regions after current one to next section
DESTROYED: ax, si, if no next section
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FindNextSection proc near
uses bp
.enter
clr bp ; bp <- number after current
mov ax, ds:[si].VLTRAE_section ; ax <- current section
regionLoop:
dec cx ; One less to process
jcxz noNextSection ; Branch if no next section
call ScanToNextRegion
inc bp ; bp <- one more processed
cmp ax, ds:[si].VLTRAE_section ; Check for in same section
jne hasNextSection ; Branch if it has one
jmp regionLoop ; Loop to do the next one
hasNextSection:
;
; Not so fast... If the section doesn't contain any lines (ie: if the
; line-count for this region is zero) then the section is a new one
; and really shouldn't be counted.
;
tstdw ds:[si].VLTRAE_lineCount
jz noNextSection
stc ; Signal: has next section
quit:
mov ax, bp ; ax <- # processed
.leave
ret
noNextSection:
clc ; Signal: no next section
jmp quit
FindNextSection endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionFromLineGetStartLineAndOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get info about the region associated with a given line.
CALLED BY: TR_RegionFromLineGetStartLineAndOffset via CallRegionHandler
PASS: *ds:si = Instance
bx.dx = Line
RETURN: dx.ax = Region start offset
bx.di = Region start line
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
It is important to return the *first* region that could contain
a given line.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionFromLineGetStartLineAndOffset proc near
uses cx, bp
offsetToFind local dword push bx, dx
region local word
.enter
; If zero, then return 0s (this avoids messing up our cache)
tstdw bxdx
jne notZero
clrdw dxax
clrdw bxdi
jmp exit
notZero:
push si
; Get previously located stack element and point to its region
; (or initialize it all)
call FetchCachedRegionFromLine
mov region, dx
push ax, cx, di
mov cx, dx
call PointAtRegionElement
mov si, di
mov dx, ax
pop ax, cx, di
;-----------------------------------------------------------------------------
findLoop:
;
; ds:si = Current region
; dx = Amount to add to get to next region
; bx.cx = Starting offset of current region
; ax.di = Starting line of current region
; ss:bp = Stack frame
;
adddw axdi, ds:[si].VLTRAE_lineCount ; ax.di <- offset to next region
cmpdw offsetToFind, axdi
jb gotRegion
ja checkNext
checkNext:
adddw bxcx, ds:[si].VLTRAE_charCount
inc region
call ScanToNextRegion ; ds:si <- ptr to next region
jmp findLoop
;-----------------------------------------------------------------------------
gotRegion:
;
; ds:si = Pointer to current region
; bx.cx = Offset to start of next region
; ax.di = First line in this region
;
subdw axdi, ds:[si].VLTRAE_lineCount ; ax.di <- offset to current reg
gotRegionAndLine::
xchg ax, bx ; ax.cx <- offset to current reg
; bx.di <- first line in reg
mov dx, ax ; dx.ax <- start offset
mov ax, cx
pop si
push cx
mov cx, region
call StoreCachedRegionFromLine
pop cx
exit:
.leave
ProfilePoint 37
ret
LargeRegionFromLineGetStartLineAndOffset endp
COMMENT @----------------------------------------------------------------------
FUNCTION: FindRegionByOffset
DESCRIPTION: Find a region given its offset
CALLED BY: INTERNAL
PASS:
*ds:si - text object
dxax - position
RETURN:
ds:si - region data
cx - region number
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/19/92 Initial version
------------------------------------------------------------------------------@
FindRegionByOffset proc near
uses ax, bx, dx, bp, di
.enter
mov bx, dx ;bx.ax = position
call SetupForRegionScan
EC < ERROR_C VIS_TEXT_LARGE_OBJECT_MUST_HAVE_REGION_ARRAY >
; ds:si = first region
; cx = region count
; dx = element size
clr bp
lloop:
subdw bxax, ds:[si].VLTRAE_charCount
tst bx ; Check for edge conditions
js gotRegion ; Branch if negative
jnz checkNext ; Branch if more to do
tst ax
jnz checkNext ; Branch if there's more to do
;
; The offset falls at the end of this region. Check to see if this
; is the last region.
;
call IsLastRegionInSection
jc checkLastRegion ; Branch if is last region
checkNext:
inc bp
dec cx
jz loopEnd
call ScanToNextRegion ; ds:si <- ptr to next region
jmp lloop
loopEnd:
dec bp
gotRegion:
mov cx, bp
.leave
ProfilePoint 19
ret
checkLastRegion:
;
; If this is the last region in this section then we want to return
; the first region in the next section, unless of course there is no
; next section... In that case we return this region.
;
call SaveCachedRegion ; bx = token for current region
call FindNextSection ; carry set if there's another
; ds:si <- region in next section
; ax <- # processed
jnc returnCached ; Branch if no next section
add bp, ax ; bp <- region to return
jmp gotRegion
returnCached:
call RestoreCachedRegion
jmp gotRegion
FindRegionByOffset endp
TextRegion ends
TextFixed segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionFromLine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the region associated with a given line.
CALLED BY: TR_RegionFromOffset via CallRegionHandler
PASS: *ds:si = Instance
bx.dx = Line
RETURN: cx = Region
DESTROYED: di
PSEUDO CODE/STRATEGY:
It is important to return the *first* region that could contain
a given line. Since a region can legally contain no lines this is
not quite as simple as it seems...
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionFromLine proc near uses bx, dx, bp, ax
lineLimit local dword
region local word
total local dword
numRegions local word
current local word
ProfilePoint 32
.enter
push si
call VisLargeTextGetRegionCount
mov numRegions, cx
mov di, dx
movdw lineLimit, bxdi
; bx.di = line
; ds.si = object
call FetchCachedLineToRegionIfLower
; cx = last region (or zero)
; bx.di = matching line for region (or zero)
push di
call PointAtRegionElement
mov si, di
mov dx, ax
pop di
; bx.di = lines remaining
; dx = element size
; ds:si = first region
mov current, cx
; cx = number of current region
sub cx, numRegions
neg cx
; cx = region count (of remaining)
; ds:si = first region
; cx = region count
; dx = element size
lloop:
; Remember what we got up to
movdw total, bxdi
push ax
mov ax, current
mov region, ax
pop ax
;
; bx.di = Number of lines ahead of current region we need to go.
;
adddw bxdi, ds:[si].VLTRAE_lineCount
cmpdw bxdi, lineLimit
ja gotRegion ; Branch if gone negative
jz scanToRealRegion
;nextRegion:
inc current
dec cx
jz usePrevRegion
call ScanToNextRegion ; ds:si <- ptr to next region
jmp lloop
usePrevRegion:
dec current
gotRegion:
movdw bxdi, total
mov cx, region
pop si
call StoreCachedLineToRegion
mov cx, current
.leave
ProfilePoint 20
ret
scanToRealRegion:
;
; If the current region ends with a column break, then we
; want to return the next region.
;
; ds:si = Region
; cx = Number of regions after ds:si
; current = Current region number
; dx = Size of region elements
;
inc current
test ds:[si].VLTRAE_flags, mask VLTRF_ENDED_BY_COLUMN_BREAK
jnz gotRegion
;
; Check for the last region in the list
;
cmp cx, 1
je usePrevRegion
;
; One more special check: If the current region has a line-count
; of zero, then we return this region. This is the case of either
; a new region that has just been inserted or else an empty region.
;
; Fortunately the current region *can't* be empty. If it is, then
; we would have branched here when we saw the previous region.
;
tstdw ds:[si].VLTRAE_lineCount
jz usePrevRegion
;
; If the current region ends with a section break, then we want
; to return the first region in the next section.
;
call IsLastRegionInSection
jc scanToNextSection
;
; We are just right on the boundary... If the next region is not
; empty then return it.
;
call ScanToNextRegion ; ds:si <- next region
test ds:[si].VLTRAE_flags, mask VLTRF_EMPTY
jz gotRegion
jmp usePrevRegion
scanToNextSection:
;
; Scan until we reach the first region of the next section.
; We do this by skipping empty regions.
;
; current = Region number for next region
; ds:si = Current region
;
call ScanToNextRegion ; ds:si <- next region
test ds:[si].VLTRAE_flags, mask VLTRF_EMPTY
jz gotRegion ; Branch if not empty
inc current ; bp <- next region
jmp scanToNextSection ; Loop to check it out
LargeRegionFromLine endp
TextFixed ends
TextRegion segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionPrevSkipEmpty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move to the either the immediately previous region or else
the first in a sequence of empty regions falling before the
passed on.
CALLED BY: TR_RegionPrevSkipEmpty
PASS: *ds:si = Instance
cx = Region
RETURN: carry set if there is no previous region
carry clear otherwise
cx = Previous region
DESTROYED: if carry is set, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/ 1/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionPrevSkipEmpty proc far
uses ax, bx, dx, di
.enter
jcxz quitNoPrevious
;
; Point at the current element
;
call PointAtRegionElement ; ds:di <- current element
; ax <- element size
mov bx, ds:[di].VLTRAE_section ; bx <- Current section
call prevRegionDIAX ; ds:di <- previous element
dec cx ; Region number of ds:di
mov dx, -1 ; dx <- current prev region
checkLoop:
;
; ds:di = Current element to check
; cx = Region number of ds:di
; bx = Section for starting element
; dx = Current "previous" region (or -1, if none)
; ax = Size of region data
;
;
; Check for previous being in same section as current
;
cmp bx, ds:[di].VLTRAE_section
jne useCurrentPrevRegion
mov dx, cx ; Prev region is valid
;
; The current one is a valid previous region. Check for not having
; any lines. If this is the case, we try to move to the previous
; region.
;
tstdw ds:[di].VLTRAE_lineCount ; Check for empty
jnz useCurrentPrevRegion ; Branch if not
;
; The previous region is empty move backward
;
jcxz useCurrentPrevRegion ; Branch if no previous
dec cx ; Move to previous region
call prevRegionDIAX ; ds:di <- previous element
jmp checkLoop
useCurrentPrevRegion:
;
; dx = Current previous region (or -1, if none)
;
cmp dx, -1
je quitNoPrevious
mov cx, dx ; cx <- previous region
clc ; Signal: has previous
quit:
.leave
ret
quitNoPrevious:
stc
jmp quit
prevRegionDIAX:
xchg si, di
xchg ax, dx
call ScanToPrevRegion
xchg si, di
xchg ax, dx ; ds:di <- previous element
retn
LargeRegionPrevSkipEmpty endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionFromPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the region associated with a given point.
CALLED BY: TR_RegionFromOffset via CallRegionHandler
PASS: *ds:si = Instance
ss:bp = PointDWFixed
RETURN: cx = Region
ax = Relative X position
dx = Relative Y position
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 2/25/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionFromPoint proc near uses bx, si, es
visdata local nptr
vischunk local nptr
point local PointDWFixed
spatialPos local PointDWord
regionSize local XYSize
class VisLargeTextClass
.enter
EC < call T_AssertIsVisLargeText >
call TextRegion_DerefVis_DI
mov visdata, di
mov vischunk, si
push si, ds
segmov ds, ss
mov si, ss:[bp] ;ds:si = source
segmov es, ds
lea di, point ;es:di = dest
mov cx, (size PointDWFixed) / 2
rep movsw
pop si, ds
clr ax
clrdw spatialPos.PD_x, ax
clrdw spatialPos.PD_y, ax
call SetupForRegionScan
EC < ERROR_C VIS_TEXT_LARGE_OBJECT_MUST_HAVE_REGION_ARRAY >
clr bx
; ds:si = first region
; cx = region count
; dx = element size
; for special display modes we need to keep around the spatial
; position and update it as we go
lloop:
push bx ;save region number
; get the spatial position and size
mov ax, ds:[si].VLTRAE_size.XYS_width
mov regionSize.XYS_width, ax
mov ax, ds:[si].VLTRAE_size.XYS_height
mov regionSize.XYS_height, ax
mov di, visdata
mov ax, ds:[di].VLTI_displayMode
cmp ax, VLTDM_PAGE
jnz notPage
;
; For page-mode we need to set the spatial position explicitly.
;
movdw bxax, ds:[si].VLTRAE_spatialPosition.PD_x
movdw spatialPos.PD_x, bxax
movdw bxax, ds:[si].VLTRAE_spatialPosition.PD_y
movdw spatialPos.PD_y, bxax
jmp gotPos
notPage:
cmp ax, VLTDM_CONDENSED
je gotPos
; must be galley or draft
cmp ax, VLTDM_DRAFT_WITH_STYLES
jb notDraft
mov ax, ds:[di].VLTI_draftRegionSize.XYS_width
mov regionSize.XYS_width, ax
mov ax, ds:[di].VLTI_draftRegionSize.XYS_height
mov regionSize.XYS_height, ax
notDraft:
call LargeRegionIsLastRegionInLastSection ;if last region then
jc gotPos ;use size
ceilwbf ds:[si].VLTRAE_calcHeight, ax
mov regionSize.XYS_height, ax
gotPos:
; check for point inside rectangular bounds
.warn -jmp
movdw bxdi, spatialPos.PD_x
jgdw bxdi, point.PDF_x.DWF_int, next ; Branch if left > X
.warn @jmp
add di, regionSize.XYS_width
adc bx, 0 ; bx.di <- right
jldw bxdi, point.PDF_x.DWF_int, next ; Branch if right < X
movdw bxdi, spatialPos.PD_y
jgdw bxdi, point.PDF_y.DWF_int, next ; Branch if top > Y
add di, regionSize.XYS_height
adc bx, 0 ; bx.di <- bottom
push si
mov si, visdata ; ds:di <- ptr to instance
add di, ds:[si].VLTI_regionSpacing ; Account for spacing
adc bx, 0
pop si
jledw bxdi, point.PDF_y.DWF_int, next ; Branch if bottom < Y
; inside rectangular bounds -- do region check if needed
mov di, visdata
mov bx, ds:[di].VLTI_displayMode
cmp bx, VLTDM_DRAFT_WITH_STYLES
jae found
movdw axdi, ds:[si].VLTRAE_region
tst ax
jz found
regionExists::
push cx, dx, si, ds
mov cx, point.PDF_x.DWF_int.low
sub cx, spatialPos.PD_x.low ;cx = x
mov dx, point.PDF_y.DWF_int.low
sub dx, spatialPos.PD_y.low ;dx = y
mov si, vischunk ;needs instance [mg, 02/26/00]
call DBLockToDSSI
inc cx ;adjust coordinates for a
inc dx ;routine that deals with
;device coordinates
;
; For condensed mode we don't actually need to compensate for the top
; edge of the region since the data always gets pushed up toward the
; top of the visible area.
;
cmp bx, VLTDM_CONDENSED
je skipTopAdjust
;
; The coordinates are now relative to the top of the
; bounding rectangle and not relative to the top of the actual
; region-rectangle. We need to make one more adjustment.
;
sub dx, ds:[si - size Rectangle].R_top ;dx <- relative Y
skipTopAdjust:
;
; Finally... we now check to see if the point is in the region.
;
; ds:si = Pointer to the region
; cx = X position relative to the left edge of the region
; dx = Y position relative to the top edge of the region-rectangle
;
call GrTestPointInReg ;carry - set if in
call DBUnlockDS
pop cx, dx, si, ds
jc found
next:
;
; Advance to the next region if in draft or condensed mode.
;
pop bx ; bx <- current region
call advanceSpatialPosition
inc bx
dec cx
jz notFound
call ScanToNextRegion ; ds:si <- ptr to next region
jmp lloop
notFound:
mov cx, CA_NULL_ELEMENT ;return not found
done:
.leave
ProfilePoint 21
ret
found:
pop cx ;return region number
;
; Check for region empty and if it is, use some other region
;
test ds:[si].VLTRAE_flags, mask VLTRF_EMPTY
;;;
;;; Removed, 10/21/92 -jw
;;; This causes problems in places where we really expect the point
;;; to truly be over the region in question.
;;;
;;; jnz usePrevNonEmptyRegion ; Branch if empty
jnz notFound
gotRegion::
;
; Compute the relative X position
;
movdw bxax, point.PDF_x.DWF_int
subdw bxax, spatialPos.PD_x
;
; Force position into a reasonable 16 bit value
;
tst bx
jz gotResultX
mov ax, -1 ; Assume really large
jns gotResultX
clr ax ; Else use really small
gotResultX:
;
; Compute the relative Y position
;
movdw bxdx, point.PDF_y.DWF_int
subdw bxdx, spatialPos.PD_y
;
; Force position into a reasonable 16 bit value
;
tst bx
jz gotResultY
mov dx, -1 ; Assume really large
jns gotResultY
clr dx ; Else use really small
gotResultY:
jmp done
advanceSpatialPosition:
;
; Advance the Y part of the spatial position by adding in
; the appropriate height.
;
; We add different amounts for different display modes.
; PAGE - nothing, we'll set it later anyway
; CONDENSED - true height of region
; GALLEY - calc height of region
; DRAFT w/ STYLES - calc height of region
; DRAFT w/o STYLES- calc height of region
;
; ds:si = Pointer to region
;
push di
mov di, visdata ; ds:di <- ptr to instance
;
; For page-mode, we do nothing
;
cmp ds:[di].VLTI_displayMode, VLTDM_PAGE
je quitAdvance
;
; For everything else except condensed, we use the calc-height
;
ceilwbf ds:[si].VLTRAE_calcHeight, ax ; ax <- calcHeight
cmp ds:[di].VLTI_displayMode, VLTDM_CONDENSED
jne advanceY
;
; For condensed, we use the true height.
;
mov ax, regionSize.XYS_height ; ax <- height of region
advanceY:
;
; ax = Amount to add
;
add ax, ds:[di].VLTI_regionSpacing ; Account for spacing
add spatialPos.PD_y.low, ax ; Adjust the position
adc spatialPos.PD_y.high, 0
quitAdvance:
pop di
retn
LargeRegionFromPoint endp
TextRegion ends
TextFixed segment
COMMENT @----------------------------------------------------------------------
FUNCTION: PointAtRegionElement
DESCRIPTION: Given a large text object, point at the region
CALLED BY: INTERNAL
PASS:
*ds:si - text object
cx - region number (or -1 to clear cache)
RETURN:
ds:di - region data
ax - element size
z flag - set if last region
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/16/92 Initial version
------------------------------------------------------------------------------@
PointAtRegionElement proc far
class VisLargeTextClass
push si
EC < call T_AssertIsVisLargeText >
call TextFixed_DerefVis_DI
test ds:[di].VLTI_attrs, mask VLTA_REGIONS_IN_HUGE_ARRAY
jnz huge
cmp cx, -1
jne notNegOne
clr cx
notNegOne:
mov si, ds:[di].VLTI_regionArray ;*ds:si = array
EC < call ECLMemValidateHandle >
mov ax, cx
call ChunkArrayElementToPtr ;ds:di = VisTextRegionArrayEl
; test for last region
inc ax
mov si, ds:[si]
cmp ax, ds:[si].CAH_count
mov ax, ds:[si].CAH_elementSize
pop si
ret
huge:
;
; Regions in huge array
;
push bx
push dx
mov di, ds:[di].VLTI_regionArray
call T_GetVMFile
call HugeArrayGetCount ;dx.ax = count
; if there are no regions we don't want to die, since the small
; version doesn't die in this case -- just set the region
; number (cx) to -1 so that the cache gets purged and nothing
; else
tst ax
jnz atLeastOneRegionExists
mov cx, -1
atLeastOneRegionExists:
dec ax ;ax = last region
cmp cx, ax
pop dx
pushf
mov ax, ATTR_VIS_LARGE_TEXT_LOCAL_REGION
call ObjVarFindData ;ds:bx = data
EC < ERROR_NC -1 >
cmp cx, ds:[bx].VLTCR_num
jz hugeDone
push bx, dx, bp
push ds, es
segmov es, ds ;es:bx = local data
mov bp, bx ;ds:bp = local data
call T_GetVMFile ;bx = file
; write back old region (if not -1)
cmp ds:[bp].VLTCR_num, -1
jz noCopyBack
push cx, di, ds
mov ax, ds:[bp].VLTCR_num ;ax = old
writeax::
clr dx
call HugeArrayLock ;ds:si = data
EC < tst ax >
EC < ERROR_Z -1 >
segxchg ds, es
mov di, si ;es:di = array data
mov si, bp ;ds:si = local data
mov cx, size VisLargeTextRegionArrayElement
rep movsb
segxchg ds, es ;ds = huge array, es = local
call HugeArrayDirty
call HugeArrayUnlock
pop cx, di, ds ;cx = new region
noCopyBack:
mov ds:[bp].VLTCR_num, cx
cmp cx, -1
jz afterRead
push cx
mov_tr ax, cx
clr dx ;dx.ax = element
call HugeArrayLock ;ds:si = data
EC < tst ax >
EC < ERROR_Z -1 >
mov di, bp ;es:di = local data
mov cx, size VisLargeTextRegionArrayElement
rep movsb
call HugeArrayUnlock
pop cx
afterRead:
pop ds, es
readcx::
pop bx, dx, bp
hugeDone:
lea di, ds:[bx].VLTCR_region ;ds:di = region data
popf
pop bx
pop si
mov ax, si ;return ax = -object
pushf
neg ax
popf
ret
PointAtRegionElement endp
COMMENT @----------------------------------------------------------------------
FUNCTION: SetupForRegionScan
DESCRIPTION: Setup registers to scan the region array
CALLED BY: INTERNAL
PASS:
*ds:si - text object
RETURN:
carry - set if regions do not exist
ds:si - first region
cx - region count
dx - element size
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/17/92 Initial version
------------------------------------------------------------------------------@
SetupForRegionScan proc far uses di
class VisLargeTextClass
.enter
EC < call T_AssertIsVisLargeText >
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VLTI_attrs, mask VLTA_REGIONS_IN_HUGE_ARRAY
jnz huge
mov si, ds:[di].VLTI_regionArray ;*ds:si = array
tst si
stc
jz done
EC < call ECLMemValidateHandle >
mov si, ds:[si]
mov cx, ds:[si].CAH_count
mov dx, ds:[si].CAH_elementSize
add si, ds:[si].CAH_offset
clc
jmp done
huge:
call VisLargeTextGetRegionCount ;cx = count
push ax, cx
clr cx
call PointAtRegionElement ;ds:di = element, ax = "size"
mov_tr dx, ax
mov si, di ;ds:si = data
pop ax, cx
clc
done:
.leave
; ProfilePoint 3
ret
SetupForRegionScan endp
;---
ScanToNextRegion proc far
tst dx
js huge
add si, dx ; ds:si <- ptr to next region
ret
huge:
push ax, bx, cx, di
mov si, dx
neg si
mov ax, ATTR_VIS_LARGE_TEXT_LOCAL_REGION
call ObjVarFindData
mov cx, ds:[bx].VLTCR_num
inc cx
call PointAtRegionElement
mov si, di
pop ax, bx, cx, di
ret
ScanToNextRegion endp
;---
ScanToPrevRegion proc far
tst dx
js huge
sub si, dx ; ds:si <- ptr to next region
ret
huge:
push ax, bx, cx, di
mov si, dx
neg si
mov ax, ATTR_VIS_LARGE_TEXT_LOCAL_REGION
call ObjVarFindData
mov cx, ds:[bx].VLTCR_num
dec cx
EC < ERROR_S -1 >
call PointAtRegionElement
mov si, di
pop ax, bx, cx, di
ret
ScanToPrevRegion endp
;---
; ds:si = region, return bx = cache token
SaveCachedRegion proc far
tst dx
js huge
mov bx, si ;just save offset
ret
huge:
push ax, si
mov si, dx
neg si
mov ax, ATTR_VIS_LARGE_TEXT_LOCAL_REGION
call ObjVarFindData
mov bx, ds:[bx].VLTCR_num
pop ax, si
ret
SaveCachedRegion endp
;---
RestoreCachedRegion proc far
pushf
tst dx
js huge
mov si, bx ;just recover
popf
ret
huge:
push ax, cx, di
mov si, dx
neg si
mov cx, bx
call PointAtRegionElement ; ds:di = data, ax = size
mov si, di
pop ax, cx, di
popf
ret
RestoreCachedRegion endp
COMMENT @----------------------------------------------------------------------
FUNCTION: NewSetupForRegionScan
DESCRIPTION: Setup registers to scan the region array in an efficient
manner, even if there are large regions
CALLED BY: INTERNAL
PASS:
*ds:si - text object
cx - first region index
RETURN:
carry - set if regions do not exist (same)
ds:si - first region (same, except ds could be a different segment)
cx - region count (IN THIS BLOCK -- not total) (similar but different)
dx - element size (same)
bx - token value to return to NewFinishRegionScan (NEW)
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/17/92 Initial version
------------------------------------------------------------------------------@
NewSetupForRegionScan proc far uses di
class VisLargeTextClass
.enter
EC < call T_AssertIsVisLargeText >
; ProfilePoint 2
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VLTI_attrs, mask VLTA_REGIONS_IN_HUGE_ARRAY
jnz huge
mov si, ds:[di].VLTI_regionArray ;*ds:si = array
tst si
stc
jz done
EC < call ECLMemValidateHandle >
mov si, ds:[si]
push ax
mov ax, cx ;ax = cx = first region index
mov dx, ds:[si].CAH_elementSize
imul dx
mov dx, ds:[si].CAH_elementSize
mov cx, ds:[si].CAH_count
add si, ds:[si].CAH_offset
add si, ax ;skip to the first index
pop ax
clr bx
clc
jmp done
huge:
push ds ;save this block
push ax
push ds:[di].VLTI_regionArray ;save VM block
push cx ;save first region to lock
call T_GetVMFile ;bx = file
mov cx, -1 ;write out cached region
call PointAtRegionElement ;destroys ax and di
pop ax
clr dx ;dxax = element to lock
pop di ;di = block
call HugeArrayLock ;ds:si = data
;dx = size
mov_tr cx, ax ;cx = consecutive elements
pop ax
pop bx ;return bx = segment
clc
done:
; ProfilePoint 1
.leave
ret
NewSetupForRegionScan endp
;---
; return ds:si = next
; return cx = regions in this block (0 if done)
; return Z = set if done
NewScanToNextRegion proc far
tst bx
jnz huge
clr cx
ret
huge:
push ax, dx
call HugeArrayNext
mov cx, ax
pop ax, dx
tst cx
ret
NewScanToNextRegion endp
;---
NewFinishRegionScan proc far
pushf
tst bx
jz done
call HugeArrayUnlock
mov ds, bx
done:
popf
ret
NewFinishRegionScan endp
TextFixed ends
TextRegion segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: PointAtRegionElementAsScanDoes
DESCRIPTION: Point at a region array element with the same values that
SetupForRegionScan would have
CALLED BY: INTERNAL
PASS:
*ds:si - text object
cx - region
RETURN:
ds:si - region
cx - region count - region #
dx - element size
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/ 2/92 Initial version
------------------------------------------------------------------------------@
PointAtRegionElementAsScanDoes proc near uses ax, di
class VisLargeTextClass
.enter
EC < call T_AssertIsVisLargeText >
mov ax, cx
call TextRegion_DerefVis_DI
test ds:[di].VLTI_attrs, mask VLTA_REGIONS_IN_HUGE_ARRAY
jnz huge
mov si, ds:[di].VLTI_regionArray ;*ds:si = array
EC < call ECLMemValidateHandle >
mov di, ds:[si]
mov cx, ds:[di].CAH_count
mov dx, ds:[di].CAH_elementSize
sub cx, ax
call ChunkArrayElementToPtr ;ds:di = VisTextRegionArrayEl
mov si, di
jmp done
; region is in huge array, ax = region number
huge:
call VisLargeTextGetRegionCount ;cx = count
sub cx, ax ;cx = # regions after this one
push cx
mov_tr cx, ax ;cx = region to point to
call PointAtRegionElement ;ds:di = element, ax = "size"
mov_tr dx, ax ;dx = "size"
mov si, di ;ds:si = data
pop cx
done:
.leave
; ProfilePoint 33
ret
PointAtRegionElementAsScanDoes endp
;---
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetTrueWidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the width of the rectangle bounding a region.
CALLED BY: TR_RegionGetTrueWidth
PASS: *ds:si = Instance ptr
cx = Region number
bx = non-zero to get value for blt-ing
RETURN: ax = Width of bounding rectangle
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/31/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetTrueWidth proc near uses di
class VisLargeTextClass
.enter
EC < call T_AssertIsVisLargeText >
call TextRegion_DerefVis_DI
cmp ds:[di].VLTI_displayMode, VLTDM_DRAFT_WITH_STYLES
jae useDisplayModeWidth
tst bx
jz useRegionWidth
cmp ds:[di].VLTI_displayMode, VLTDM_GALLEY
jae useDisplayModeWidth
useRegionWidth:
call PointAtRegionElement ; ds:di = data, z set if last
mov ax, ds:[di].VLTRAE_size.XYS_width
done:
.leave
ret
useDisplayModeWidth:
mov ax, ds:[di].VLTI_displayModeWidth
jmp done
LargeRegionGetTrueWidth endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetHeight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the computed height of a region.
CALLED BY: TR_RegionGetHeight
PASS: *ds:si = Instance ptr
cx = Region number
RETURN: dx.al = Computed height of bounding rectangle
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/31/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetHeight proc near
call PointAtRegionElement ; ds:di = data, z set if last
movwbf dxal, ds:[di].VLTRAE_calcHeight
ret
LargeRegionGetHeight endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetTrueHeight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the height of the rectangle bounding a region.
CALLED BY: TR_RegionGetTrueHeight
PASS: *ds:si = Instance ptr
cx = Region number
RETURN: dx.al = Height of bounding rectangle
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/31/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetTrueHeight proc near
class VisLargeTextClass
EC < call T_AssertIsVisLargeText >
call TextRegion_DerefVis_DI
mov dx, ds:[di].VLTI_draftRegionSize.XYS_height
cmp ds:[di].VLTI_displayMode, VLTDM_DRAFT_WITH_STYLES
jae done
;
; The height of the region is one of two things:
; Has a Region -
; Height is the height of the region-rectangle
; Has no Region -
; Height is the height of the bounding rectangle
;
call GetFillRegion ; axdi = region or...
; ax = width, di = height
jc regionExists
call PointAtRegionElement ; ds:di = data, z set if last
mov dx, ds:[di].VLTRAE_size.XYS_height
done:
clr ax
ret
regionExists:
push ds, si ; Save nuked registers
call DBLockToDSSI ; ds:si <- ptr to region
sub si, size Rectangle ; ds:si <- ptr to rectangle
mov dx, ds:[si].R_bottom ; dx <- height of area
sub dx, ds:[si].R_top
call DBUnlockDS ; Release the region
pop ds, si ; Restore nuked registers
jmp done
LargeRegionGetTrueHeight endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeCheckCrossSectionChange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check to see if a range crosses a section break.
CALLED BY: TR_CheckCrossSectionChange
PASS: *ds:si = Instance
ss:bp = VisTextRange
RETURN: carry set if the range crosses sections
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
We take advantage of the fact that if an offset falls at the end
of the last region in a section, FindRegionByOffset will return
the first region of the next section.
This means that if the user selects just the section break and
tries to delete it, even though it appears (visually) as though
the selected range is in a single section, FindRegionByOffset will
treat the range as though it crosses sections.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeCheckCrossSectionChange proc far
uses ax, cx, dx, di, si
class VisLargeTextClass
.enter
; If the object has no regions then skip this check
call TextRegion_DerefVis_DI
tst ds:[di].VLTI_regionArray
jz quit
;
; Figure the start region.
;
mov di, si ; Save instance ptr
movdw dxax, ss:[bp].VTR_start
call FindRegionByOffset ; ds:si <- region data
xchg di, si ; *ds:si <- instance
; ds:di <- start region
;
; Figure the end region.
;
movdw dxax, ss:[bp].VTR_end
call FindRegionByOffset ; ds:si <- region data
;
; ds:di = Start region
; ds:si = End region
;
cmp di, si ; Check for same region
je quit ; Carry clear if we branch
;
; The start/end regions aren't the same. Check that the sections
; are the same.
;
mov ax, ds:[di].VLTRAE_section
cmp ax, ds:[si].VLTRAE_section
jne badReplace
quit:
.leave
ret
badReplace:
stc ; Signal: cross section replace
jmp quit
LargeCheckCrossSectionChange endp
TextRegion ends
TextLargeRegion segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionAlterFlags
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Alter the flags for a large region.
CALLED BY: Global
PASS: *ds:si = Instance
cx = Region
ax = Bits to set
dx = Bits to clear
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionAlterFlags proc near
uses dx, di
.enter
push ax
call PointAtRegionElement ; ds:di = data, z set if last
pop ax
push ds:[di].VLTRAE_flags ; Save old flags
not dx
and ds:[di].VLTRAE_flags, dx ; Clear flags
or ds:[di].VLTRAE_flags, ax ; Set flags
pop dx ; dx <- old flags
;
; Check for region-break state change.
; ax = New flags
; dx = Old flags
;
and ax, mask VLTRF_ENDED_BY_COLUMN_BREAK
and dx, mask VLTRF_ENDED_BY_COLUMN_BREAK
xor ax, dx
;
; ax will be non-zero if there has been a change.
;
tst ax
jz quit ; Branch if no change
call TR_RegionTransformGState ; Setup the gstate
call LargeRegionClearToBottom ; Draw the break
quit:
.leave
ret
LargeRegionAlterFlags endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LargeRegionGetFlags
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the flags for a large region.
CALLED BY: Global
PASS: *ds:si = Instance
cx = Region
RETURN: ax = VisTextRegionFlags
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LargeRegionGetFlags proc near
uses di
.enter
call PointAtRegionElement ; ds:di = data, z set if last
mov ax, ds:[di].VLTRAE_flags
.leave
ret
LargeRegionGetFlags endp
TextLargeRegion ends
| 22.755431 | 80 | 0.613361 |
ceb633e9dc0e189b4cabaa7a11b97c11eddf8bdd | 282 | asm | Assembly | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_clear_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_clear_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_clear_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; void bv_priority_queue_clear_fastcall(bv_priority_queue_t *q)
SECTION code_adt_bv_priority_queue
PUBLIC _bv_priority_queue_clear_fastcall
defc _bv_priority_queue_clear_fastcall = asm_bv_priority_queue_clear
INCLUDE "adt/bv_priority_queue/z80/asm_bv_priority_queue_clear.asm"
| 25.636364 | 68 | 0.893617 |
57b96ed2aa6f069785bedac68fd20fec1500c840 | 12,545 | asm | Assembly | P6/data_P6_2/ALUTest88.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P6/data_P6_2/ALUTest88.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6_2/ALUTest88.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | lhu $0,10($0)
and $1,$5,$3
addiu $5,$3,22198
lh $4,10($0)
lhu $1,16($0)
slt $5,$4,$3
sb $4,14($0)
sltu $3,$4,$3
sllv $4,$0,$3
lhu $4,0($0)
lh $4,12($0)
xor $3,$0,$3
addu $3,$3,$3
slt $4,$4,$3
sw $5,12($0)
sll $4,$5,19
addu $3,$6,$3
addiu $4,$3,-18705
andi $5,$5,1984
slti $1,$5,19052
subu $4,$5,$3
ori $3,$0,7149
sra $3,$3,24
xori $4,$4,36507
sllv $0,$1,$3
andi $3,$1,32945
or $3,$1,$3
subu $3,$3,$3
addu $5,$5,$3
srav $3,$4,$3
sh $3,4($0)
ori $1,$5,48551
srav $1,$6,$3
sb $5,3($0)
srav $4,$0,$3
srl $5,$5,5
lw $5,12($0)
xori $3,$3,14253
sltiu $4,$1,-24828
addiu $4,$6,-7573
addiu $3,$4,-25818
srav $4,$5,$3
lh $4,8($0)
andi $4,$4,35048
sltiu $3,$3,195
addu $4,$4,$3
sltiu $0,$3,-8084
sh $0,6($0)
lbu $4,5($0)
addiu $4,$4,-14279
srlv $4,$3,$3
sll $4,$1,16
addiu $4,$5,21328
srav $4,$4,$3
srav $1,$4,$3
srl $3,$4,11
srl $3,$3,6
sll $3,$3,29
addiu $4,$4,8493
subu $3,$3,$3
sw $3,8($0)
addu $3,$3,$3
subu $3,$4,$3
sll $3,$0,8
srl $3,$3,4
lhu $1,8($0)
lw $1,0($0)
sltu $3,$0,$3
sra $5,$3,11
or $4,$5,$3
lh $5,14($0)
lhu $3,0($0)
addiu $4,$3,23423
lbu $5,6($0)
lhu $5,2($0)
slt $1,$1,$3
addiu $3,$3,-8461
lh $0,12($0)
sltu $3,$3,$3
lhu $1,8($0)
subu $3,$3,$3
lhu $1,10($0)
subu $3,$3,$3
andi $3,$3,21936
sra $5,$3,0
lhu $4,6($0)
sltu $3,$5,$3
srl $0,$1,25
addiu $1,$4,18016
sra $4,$4,31
srl $0,$3,10
slt $3,$6,$3
addiu $1,$4,24201
xori $3,$3,21738
subu $0,$5,$3
slt $0,$3,$3
addu $3,$4,$3
addu $1,$5,$3
or $5,$5,$3
lw $1,12($0)
ori $4,$3,63392
sltiu $3,$3,20105
srl $6,$1,18
subu $6,$6,$3
or $3,$3,$3
sltiu $3,$4,23937
ori $4,$3,15846
addiu $0,$0,12206
lhu $3,4($0)
andi $4,$4,43191
ori $3,$5,37104
sllv $1,$1,$3
srav $1,$0,$3
lw $6,12($0)
sw $0,4($0)
subu $3,$3,$3
subu $3,$5,$3
sll $0,$1,20
addiu $3,$1,8947
slti $4,$3,-4089
sllv $3,$1,$3
sltu $5,$3,$3
addu $4,$5,$3
sltiu $4,$3,21083
xor $4,$1,$3
lhu $3,2($0)
sb $4,13($0)
xori $0,$2,27385
or $4,$3,$3
sll $3,$3,12
subu $3,$3,$3
sltiu $3,$3,31364
nor $4,$3,$3
sh $3,4($0)
ori $3,$1,37284
srl $1,$1,3
slti $0,$0,-26127
sw $0,12($0)
sh $5,10($0)
andi $6,$4,2898
srav $4,$4,$3
xori $3,$3,36259
ori $5,$3,15808
xori $4,$4,37588
sllv $3,$4,$3
nor $5,$1,$3
addiu $6,$6,4177
sh $0,10($0)
or $1,$4,$3
sltu $5,$5,$3
sb $4,6($0)
nor $0,$0,$3
xori $5,$4,9554
addu $4,$0,$3
lhu $3,10($0)
sll $4,$1,29
addu $5,$3,$3
sra $5,$4,9
addu $3,$3,$3
addu $4,$5,$3
sw $3,12($0)
sllv $3,$0,$3
addiu $5,$5,22062
lbu $5,12($0)
srav $1,$4,$3
xori $4,$1,60024
srlv $3,$3,$3
addu $5,$3,$3
sltiu $3,$5,-18592
addiu $3,$3,9004
sltu $0,$3,$3
srlv $0,$3,$3
lh $3,14($0)
xor $3,$3,$3
andi $4,$3,36338
slti $3,$3,-29229
srav $0,$4,$3
addu $3,$3,$3
sltiu $3,$3,31913
or $3,$1,$3
or $5,$5,$3
sw $3,8($0)
addu $3,$5,$3
andi $5,$0,3875
slti $5,$1,-20426
sltu $4,$5,$3
lbu $4,3($0)
addu $4,$0,$3
sltu $3,$5,$3
sltu $5,$6,$3
srav $3,$3,$3
xori $4,$1,32222
subu $4,$5,$3
slti $5,$1,19908
sllv $6,$6,$3
slt $5,$4,$3
lh $3,14($0)
addu $0,$0,$3
lh $3,0($0)
lh $1,2($0)
addu $3,$6,$3
subu $5,$0,$3
and $5,$3,$3
srav $0,$5,$3
addu $4,$4,$3
lbu $3,16($0)
sw $5,4($0)
ori $6,$0,30471
addiu $3,$3,59
addu $1,$3,$3
sll $5,$4,1
nor $3,$4,$3
srav $0,$2,$3
sllv $5,$1,$3
sw $1,8($0)
srlv $0,$3,$3
xori $3,$0,62122
andi $6,$1,24252
xori $1,$1,23472
sll $0,$0,23
sltu $5,$1,$3
slti $0,$1,4059
xor $4,$4,$3
sw $3,8($0)
addu $3,$3,$3
subu $0,$0,$3
sh $5,6($0)
andi $4,$2,12681
sra $4,$4,9
slt $1,$0,$3
nor $1,$1,$3
sllv $4,$3,$3
srl $6,$1,14
subu $3,$3,$3
srl $4,$4,15
addu $4,$0,$3
lw $3,8($0)
lw $4,12($0)
addiu $4,$4,2375
sllv $5,$4,$3
addiu $0,$5,1222
sra $3,$5,3
sll $4,$4,3
slt $3,$4,$3
sll $2,$2,16
sra $3,$1,13
xor $5,$6,$3
sb $3,11($0)
lhu $4,16($0)
addu $1,$3,$3
slt $4,$4,$3
lb $4,6($0)
ori $4,$5,2362
sra $0,$0,23
lh $3,0($0)
nor $4,$0,$3
slti $3,$1,19816
srav $1,$1,$3
subu $4,$3,$3
sll $1,$4,31
addu $0,$2,$3
sltu $4,$4,$3
sllv $1,$4,$3
subu $3,$4,$3
lh $0,12($0)
andi $5,$5,23137
lbu $4,15($0)
xori $3,$6,33188
xor $5,$5,$3
xori $3,$3,4628
sw $3,12($0)
addu $1,$3,$3
addu $1,$3,$3
addu $1,$3,$3
slti $4,$5,22857
slt $4,$3,$3
slt $3,$4,$3
and $1,$0,$3
srl $2,$2,29
sw $3,0($0)
xor $5,$4,$3
and $3,$6,$3
addiu $4,$4,8271
or $4,$4,$3
lbu $5,16($0)
srav $3,$3,$3
andi $3,$4,12219
srav $3,$3,$3
nor $4,$3,$3
slti $1,$1,-18418
sw $5,12($0)
or $6,$4,$3
lw $1,4($0)
slti $5,$0,-27831
srl $6,$1,23
sb $3,4($0)
sltu $3,$4,$3
sb $5,11($0)
sllv $3,$1,$3
sll $1,$1,23
srlv $3,$3,$3
sll $1,$1,12
nor $3,$3,$3
lbu $1,1($0)
slti $4,$0,-24066
lhu $6,6($0)
lh $5,16($0)
or $4,$5,$3
sll $6,$5,6
lhu $5,4($0)
sw $3,0($0)
srlv $3,$5,$3
lb $3,6($0)
sw $3,4($0)
addu $3,$1,$3
ori $1,$3,13772
sh $1,10($0)
lhu $4,4($0)
sw $1,12($0)
sh $4,6($0)
andi $5,$5,40918
sllv $4,$3,$3
sra $3,$1,17
sb $4,13($0)
slt $3,$1,$3
srav $6,$4,$3
sra $1,$4,14
sllv $1,$1,$3
sll $3,$0,15
sh $1,10($0)
lbu $6,2($0)
addu $3,$3,$3
lh $4,4($0)
addiu $0,$1,-5373
ori $0,$3,10911
nor $1,$1,$3
srlv $3,$3,$3
ori $4,$3,30707
lbu $4,11($0)
nor $3,$6,$3
addu $0,$3,$3
lw $4,4($0)
lbu $4,13($0)
srl $6,$3,7
addu $3,$2,$3
sw $3,0($0)
xori $3,$1,41501
lw $3,12($0)
srl $3,$0,10
slti $6,$3,7402
sltiu $6,$4,2150
srav $4,$4,$3
or $1,$4,$3
and $3,$1,$3
lbu $1,14($0)
slti $1,$6,-29822
lhu $3,16($0)
srlv $5,$3,$3
addu $5,$4,$3
sltu $4,$2,$3
sltiu $5,$4,-926
nor $4,$1,$3
sltu $4,$3,$3
lbu $1,10($0)
sra $4,$6,6
slt $3,$4,$3
subu $1,$3,$3
lw $4,0($0)
xori $5,$3,40035
lbu $3,14($0)
lw $3,4($0)
addiu $6,$5,-27616
nor $6,$3,$3
xori $3,$6,6068
addiu $6,$6,-1672
sll $4,$4,30
ori $4,$3,36403
sh $4,8($0)
lw $5,8($0)
lbu $4,15($0)
xori $5,$4,14575
lb $3,15($0)
sltu $5,$0,$3
xori $4,$4,21210
sll $3,$5,29
nor $4,$4,$3
lhu $3,16($0)
slti $4,$5,30043
lbu $5,1($0)
xori $5,$4,4531
addiu $4,$1,8010
srav $3,$4,$3
sltu $4,$1,$3
lbu $1,1($0)
andi $4,$4,2848
subu $0,$6,$3
addu $4,$5,$3
xori $4,$3,61272
slti $4,$4,-29228
lb $0,9($0)
and $4,$5,$3
ori $0,$3,11748
slti $1,$1,-29920
sb $3,16($0)
and $4,$1,$3
sra $4,$4,26
lw $4,8($0)
sllv $3,$5,$3
lbu $4,7($0)
addu $3,$4,$3
sll $3,$3,30
slti $0,$3,-7467
subu $4,$1,$3
addiu $4,$4,20267
andi $5,$4,1110
lbu $4,1($0)
lbu $6,1($0)
lhu $3,12($0)
addu $3,$3,$3
lhu $4,8($0)
sltiu $0,$2,17526
and $5,$4,$3
addu $1,$1,$3
lhu $3,8($0)
slt $3,$4,$3
lbu $5,13($0)
sw $5,16($0)
addiu $1,$4,6724
sh $1,2($0)
subu $0,$1,$3
ori $0,$4,21361
srl $6,$6,16
nor $3,$4,$3
lhu $1,4($0)
lb $3,0($0)
lw $3,4($0)
sh $4,6($0)
sllv $3,$3,$3
sllv $3,$3,$3
ori $3,$4,60042
sltu $3,$3,$3
slt $3,$5,$3
slti $1,$0,2196
subu $6,$6,$3
slti $1,$1,-16356
addu $4,$3,$3
xor $5,$5,$3
slt $4,$1,$3
slti $1,$4,31009
or $5,$3,$3
sw $3,8($0)
lbu $5,8($0)
and $1,$3,$3
srav $3,$3,$3
slt $0,$0,$3
subu $4,$3,$3
sllv $4,$0,$3
xori $1,$4,38139
addu $0,$4,$3
subu $4,$5,$3
sltu $3,$3,$3
sb $4,9($0)
srl $3,$3,4
srl $5,$5,10
andi $5,$5,15273
xori $4,$6,24378
andi $4,$4,23446
sra $4,$4,11
lb $3,6($0)
andi $3,$3,14128
nor $5,$4,$3
xori $1,$4,51543
sll $3,$1,27
subu $4,$4,$3
lhu $3,6($0)
lw $4,8($0)
lb $3,1($0)
sltu $4,$1,$3
sll $4,$4,14
srl $3,$1,13
xori $4,$5,49383
lb $4,9($0)
addiu $3,$3,-31164
srl $3,$3,6
lh $5,10($0)
lbu $4,1($0)
xori $3,$3,54488
and $4,$4,$3
sltiu $1,$3,-9857
slti $4,$5,29250
and $1,$3,$3
addiu $4,$0,19482
addiu $1,$3,13900
addiu $3,$3,-23732
sll $1,$4,29
srl $5,$4,12
sh $4,14($0)
nor $6,$6,$3
lhu $4,12($0)
sb $1,14($0)
lhu $3,14($0)
slti $4,$4,-17025
slt $0,$3,$3
ori $4,$4,31294
slti $5,$3,23048
sltiu $2,$2,-22344
andi $4,$6,25738
xor $1,$1,$3
sllv $1,$3,$3
addu $4,$4,$3
srl $5,$4,25
sltu $3,$0,$3
addu $0,$4,$3
slt $3,$3,$3
slt $4,$3,$3
sll $0,$1,0
xori $4,$4,34831
addu $3,$3,$3
addu $5,$5,$3
addiu $5,$5,-8307
addu $1,$3,$3
slt $6,$6,$3
addiu $1,$1,-772
slti $4,$3,-27016
slt $3,$3,$3
or $5,$4,$3
lbu $3,16($0)
ori $3,$3,30739
and $1,$6,$3
slti $5,$6,6160
nor $6,$6,$3
srav $1,$1,$3
slti $3,$0,-17751
addiu $4,$3,-5000
addu $3,$3,$3
ori $4,$4,59653
subu $3,$1,$3
addiu $0,$1,-11189
subu $3,$0,$3
srl $3,$3,25
sllv $3,$0,$3
addiu $5,$1,18726
addiu $3,$0,10431
sb $1,13($0)
srlv $4,$4,$3
subu $1,$0,$3
addu $4,$4,$3
srav $4,$4,$3
sh $5,10($0)
and $3,$1,$3
andi $4,$4,19524
sll $4,$4,26
and $6,$5,$3
sb $3,15($0)
lhu $4,8($0)
srlv $1,$4,$3
srl $3,$3,13
slti $3,$3,16789
addiu $3,$3,5476
srlv $3,$1,$3
sltu $4,$4,$3
addiu $0,$5,-5212
and $3,$3,$3
sltiu $3,$3,-9946
slt $3,$0,$3
lb $5,9($0)
and $4,$4,$3
lb $3,15($0)
srlv $3,$0,$3
subu $4,$4,$3
andi $6,$4,55601
nor $5,$4,$3
srav $1,$3,$3
andi $5,$4,20313
sll $6,$4,0
lbu $3,13($0)
slti $5,$6,30248
nor $3,$5,$3
lbu $4,11($0)
subu $4,$4,$3
ori $4,$4,48364
lw $3,4($0)
srl $3,$4,6
subu $4,$2,$3
lh $5,2($0)
addu $1,$0,$3
sb $1,13($0)
ori $3,$3,46631
addu $0,$3,$3
lh $3,4($0)
srlv $0,$0,$3
addu $1,$4,$3
sltu $3,$3,$3
lbu $3,11($0)
andi $6,$5,477
sra $4,$3,11
addiu $3,$5,10245
slti $4,$4,-7465
lbu $3,12($0)
sltu $4,$2,$3
srl $1,$4,19
subu $0,$5,$3
xori $4,$4,19359
srav $3,$5,$3
srl $5,$3,1
andi $4,$3,46643
addiu $3,$4,17753
lhu $4,4($0)
xori $4,$3,7387
subu $1,$5,$3
lw $4,8($0)
addiu $0,$0,22975
sra $6,$1,0
addu $3,$3,$3
xor $3,$1,$3
lw $1,4($0)
lb $5,14($0)
slt $4,$4,$3
srl $4,$3,27
lw $3,8($0)
sltu $5,$5,$3
sltiu $5,$3,23375
lw $1,12($0)
addu $3,$3,$3
xor $3,$3,$3
slt $3,$5,$3
sw $3,16($0)
srav $3,$3,$3
srl $3,$1,11
lb $5,3($0)
and $1,$3,$3
xor $1,$3,$3
nor $3,$4,$3
addu $3,$1,$3
xor $5,$3,$3
sll $1,$3,13
subu $5,$3,$3
sra $3,$4,3
andi $3,$3,44691
srl $3,$3,10
srl $0,$1,21
sltu $4,$4,$3
sltiu $1,$1,-3040
and $4,$0,$3
nor $6,$6,$3
lw $5,12($0)
andi $6,$4,50261
sb $3,9($0)
lw $3,0($0)
srav $3,$3,$3
addu $6,$5,$3
subu $4,$4,$3
sltu $3,$3,$3
subu $3,$4,$3
addu $1,$1,$3
srav $3,$3,$3
slt $1,$1,$3
lhu $4,12($0)
sllv $1,$3,$3
subu $4,$4,$3
subu $3,$3,$3
lh $4,16($0)
sh $3,0($0)
nor $6,$3,$3
xori $3,$3,35101
srl $4,$5,15
srl $5,$3,28
addiu $0,$3,6836
sll $3,$6,24
addu $1,$5,$3
addiu $4,$4,-963
sb $0,14($0)
subu $5,$4,$3
nor $4,$3,$3
xori $3,$3,45880
lhu $3,16($0)
addu $5,$4,$3
xor $3,$3,$3
nor $5,$4,$3
lh $1,0($0)
sra $1,$1,13
lb $3,13($0)
sh $3,0($0)
nor $3,$3,$3
ori $4,$3,40220
slt $4,$6,$3
addiu $1,$5,-24200
subu $3,$5,$3
or $3,$3,$3
and $3,$3,$3
slt $0,$4,$3
nor $3,$3,$3
lh $4,0($0)
lbu $3,3($0)
nor $4,$4,$3
and $5,$5,$3
sltiu $4,$6,27557
xori $1,$1,17145
andi $3,$5,51211
lhu $4,2($0)
and $5,$5,$3
addiu $4,$0,1133
sltu $1,$5,$3
lw $3,12($0)
subu $1,$3,$3
and $3,$1,$3
nor $4,$5,$3
sra $5,$5,23
srlv $3,$3,$3
nor $3,$5,$3
sltu $4,$5,$3
sra $1,$1,1
sll $4,$0,26
sltu $6,$3,$3
lw $3,0($0)
subu $5,$3,$3
lh $3,8($0)
srav $0,$1,$3
subu $5,$5,$3
andi $6,$5,60473
sw $1,0($0)
or $3,$4,$3
lh $3,14($0)
andi $6,$3,18745
sllv $5,$5,$3
lbu $6,2($0)
sltu $4,$5,$3
xori $5,$0,50327
slt $3,$5,$3
sra $4,$5,22
srlv $3,$4,$3
lh $1,2($0)
lb $5,3($0)
xor $3,$3,$3
sra $5,$5,7
sltu $1,$4,$3
addu $4,$4,$3
slt $4,$4,$3
xor $3,$6,$3
and $1,$3,$3
lhu $4,4($0)
sltiu $1,$3,25499
sw $3,0($0)
and $4,$0,$3
sll $1,$4,7
subu $1,$4,$3
lh $4,16($0)
lhu $3,0($0)
lhu $3,0($0)
lbu $5,11($0)
lhu $3,0($0)
addu $0,$1,$3
slti $4,$3,-19910
lh $5,0($0)
sw $3,4($0)
andi $6,$3,58984
xori $3,$3,20584
srl $5,$5,22
sltiu $1,$1,-29661
nor $3,$3,$3
nor $6,$3,$3
sll $3,$5,12
subu $4,$4,$3
sw $0,12($0)
slt $5,$6,$3
srl $0,$3,24
nor $5,$3,$3
lb $5,8($0)
sltu $1,$1,$3
sltu $0,$1,$3
srlv $4,$3,$3
subu $3,$1,$3
slti $1,$3,-20749
sra $3,$3,20
lbu $3,13($0)
lh $1,10($0)
lb $4,2($0)
srl $0,$3,4
xor $4,$3,$3
sll $3,$3,2
srav $1,$3,$3
lbu $1,8($0)
nor $4,$4,$3
sll $0,$0,5
sltiu $6,$4,31062
addu $1,$1,$3
lh $5,14($0)
lh $5,0($0)
xori $3,$1,23765
subu $2,$2,$3
addu $6,$3,$3
lbu $3,16($0)
lbu $3,1($0)
addu $4,$6,$3
slti $5,$5,-15740
lbu $0,12($0)
lw $0,16($0)
addu $1,$0,$3
and $3,$3,$3
sw $5,4($0)
addu $4,$0,$3
xor $3,$4,$3
sllv $3,$1,$3
subu $3,$1,$3
subu $1,$2,$3
subu $1,$3,$3
addu $3,$4,$3
sra $3,$3,14
lb $1,4($0)
subu $3,$1,$3
lb $4,5($0)
xori $1,$3,2091
xori $5,$4,41710
nor $0,$5,$3
subu $0,$4,$3
sllv $3,$6,$3
lbu $4,8($0)
subu $4,$4,$3
lh $3,10($0)
sra $0,$3,30
lb $1,5($0)
xori $3,$3,27995
or $4,$3,$3
srl $4,$4,4
addiu $1,$6,18882
addiu $5,$0,3175
slt $4,$3,$3
xor $5,$3,$3
srlv $4,$4,$3
srav $5,$6,$3
ori $1,$1,55410
sll $1,$5,15
sllv $1,$4,$3
ori $3,$3,24955
sw $1,4($0)
nor $3,$0,$3
subu $3,$3,$3
lhu $0,16($0)
lbu $4,7($0)
sll $4,$1,15
lh $3,12($0)
sw $4,0($0)
lhu $3,6($0)
addu $4,$4,$3
srav $4,$3,$3
subu $5,$3,$3
sllv $4,$0,$3
lbu $3,0($0)
sll $4,$0,25
andi $5,$4,48030
sltu $5,$3,$3
addiu $0,$5,-11482
slt $3,$3,$3
lh $5,14($0)
lw $0,4($0)
and $4,$3,$3
slti $3,$2,12129
addu $3,$3,$3
lb $3,12($0)
slti $3,$1,7310
slti $3,$2,17135
srlv $4,$3,$3
ori $3,$5,15380
srav $3,$5,$3
sllv $5,$0,$3
subu $3,$3,$3
lb $0,6($0)
srav $1,$1,$3
addu $4,$5,$3
andi $5,$0,52784
nor $4,$3,$3
lw $3,16($0)
srav $1,$5,$3
srlv $0,$0,$3
lb $3,13($0)
sllv $4,$1,$3
addiu $4,$4,11799
sll $1,$5,7
or $3,$4,$3
andi $6,$6,47193
sll $3,$3,25
andi $4,$4,48005
sltiu $5,$6,-24138
sltiu $3,$5,24
addiu $1,$1,-10098
addu $1,$0,$3
lhu $5,12($0)
nor $3,$4,$3
| 14.111361 | 18 | 0.524831 |
90ffeac6a96e2cb697aeda6ca81c9c2ffb362e76 | 267 | asm | Assembly | oeis/158/A158270.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/158/A158270.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/158/A158270.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A158270: Single-digit numbers in A061049.
; 0,9,5,3,1,3,3,5,7,9
mov $1,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$0
mul $2,$3
add $1,$2
mov $4,$0
cmp $4,0
mov $5,$0
add $5,$4
div $1,$5
mov $0,$1
add $1,10
div $2,$5
sub $3,1
lpe
mod $0,10
| 11.608696 | 43 | 0.516854 |
1c15c88c294cc4840a479009e4605d97a361a33e | 836 | asm | Assembly | consts.asm | picosonic/bbm | f3d8e3f7bedd36f6156bf8bc87068cc17800b41d | [
"MIT"
] | 4 | 2020-09-16T12:05:50.000Z | 2021-06-22T23:37:29.000Z | consts.asm | picosonic/bbm | f3d8e3f7bedd36f6156bf8bc87068cc17800b41d | [
"MIT"
] | null | null | null | consts.asm | picosonic/bbm | f3d8e3f7bedd36f6156bf8bc87068cc17800b41d | [
"MIT"
] | null | null | null | ; Constants
; Hardware specific
MODE8BASE = &4800
FPS = 50
MAIN_LOAD_ADDR = &1900
MAIN_RELOC_ADDR = &0E00
MAX_OBJ_SIZE = MODE8BASE-MAIN_RELOC_ADDR
DOWNLOADER_ADDR = MAIN_LOAD_ADDR+MAX_OBJ_SIZE
; Booleans for flags
NO = 0
YES = 1
PAD_RIGHT = &01
PAD_LEFT = &02
PAD_DOWN = &04
PAD_UP = &08
PAD_START = &10
PAD_SELECT = &20
PAD_B = &40
PAD_A = &80
; Sprites
; Tiles (8x8)
TILE_CURSOR = &40
; Tiles (16x16)
; Level specific
SECONDSPERLEVEL = 200
LIVESPERLEVEL = 3
MAP_WIDTH = 15
MAP_HEIGHT = 13
MAP_HERE = &00
MAP_RIGHT = &01
MAP_UP = &02
MAP_LEFT = &03
MAP_DOWN = &04
MAP_EMPTY = 0
MAP_CONCRETE = 1
MAP_BRICK = 2
MAP_BOMB = 3
MAP_HIDDEN_EXIT = 4
MAP_HIDDEN_BONUS = 5
MAP_BONUS = 6
MAP_EXIT = 8
MAX_BOMB = 10
MAX_FIRE = (MAX_BOMB*8)
MAX_PW_CHARS = 20
| 14.169492 | 45 | 0.65311 |
174e190dce68cd333acfdf1c570ec9359b3b5e67 | 1,836 | asm | Assembly | programs/oeis/228/A228294.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/228/A228294.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/228/A228294.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A228294: a(n) = Sum_{k=1..10} n^k.
; 0,10,2046,88572,1398100,12207030,72559410,329554456,1227133512,3922632450,11111111110,28531167060,67546215516,149346699502,311505013050,617839704240,1172812402960,2141993519226,3780494710542,6471681049900,10778947368420,17513875027110,27824681019586,43309534450632,66160049703000,99341074625650,146813779479510,213810021790596,307167017313772,435732491632350,610851724137930,846949229880160,1162219258676256,1579440828553962,2126934655697950,2839681099207260,3760620109779060,4942156160540566,6447893249285202,8354627297959800,10754625641025640,13758225792906210,17496788319767526,22126041415981492,27829857704427900,34824506845925070,43363430760171610,53742591632261136,66306446408726832,81454605178812250,99649234693877550,121423272304165260,147389519791195396,178250690949465222,214810491326522850,257985813269495080,308820134352407160,368498212375764306,438362175441500662,519929111116169700,614910264406779660,725231960190597310,853058371866181866,1000816264331497152,1171221845949812800,1367309870938873290,1592465140617115710,1850456559166182076,2145473907025228692,2482167502723212150,2865690931884057970,3301747030310022360,3796637316464268936,4357315077338329282,4991442320607327750,5707450815149255700,6514607451437807260,7423084163014966446,8444032660213292922,9589664237532319600,10873334926582278480,12309636277295140410,13914492061171318606,15705261201683973612,17700847248605297700,19921814724954078310,22390512687494871810,25131205854249889416,28170213665318835352,31536057656443072050,35259617538202247190,39374296387497531460,43916195372059512876,48924298443124202142,54440667446151152650,60510648114517017120,67183087426509579360,74510562821675042986,82549623788638757982,91361046352930249500
mov $2,10
lpb $2
add $1,2
mul $1,$0
sub $2,1
lpe
div $1,4
mul $1,2
mov $0,$1
| 141.230769 | 1,714 | 0.912309 |
4b376b4aa1776ad832cc730ae9be0ca3e9ec1ac2 | 109 | asm | Assembly | libsrc/target/tiki100/stdio/CRT_FONT.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/tiki100/stdio/CRT_FONT.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/tiki100/stdio/CRT_FONT.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION rodata_clib
PUBLIC CRT_FONT
EXTERN _font_8x8_zx_system
defc CRT_FONT = _font_8x8_zx_system
| 13.625 | 36 | 0.807339 |
b532fc691bacd977b32cf6be05c8eaf5f2a75f77 | 730 | asm | Assembly | oeis/062/A062144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/062/A062144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/062/A062144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A062144: Sixth (unsigned) column sequence of coefficient triangle A062137 of generalized Laguerre polynomials n!*L(n,3,x).
; Submitted by Jon Maiga
; 1,54,1890,55440,1496880,38918880,998917920,25686460800,667847980800,17660868825600,476843458291200,13178219210956800,373382877643776000,10856825211488256000,324153781314435072000,9940715960309342208000,313132552749744279552000,10130759059550550220800000,336566328756179390668800000,11478683212316012902809600000,401753912431060451598336000000,14424878570143789547864064000000,531097801900748615171358720000000,20043169219558686868206059520000000,775002543156269225570634301440000000
mov $1,$0
add $1,5
mov $0,$1
bin $0,5
add $1,3
lpb $1
mul $0,$1
sub $1,1
lpe
div $0,40320
| 48.666667 | 484 | 0.858904 |
65bd2def9fa01e634fa18e4e183ea90a9419921d | 21,432 | asm | Assembly | klc3-manual/examples/zjui_ece220_fa18/mp3/examples/mp3_tingkai.asm | liuzikai/klc3 | 0c7c1504158f1cce3e6bff32f69b4cb3067cffff | [
"NCSA"
] | null | null | null | klc3-manual/examples/zjui_ece220_fa18/mp3/examples/mp3_tingkai.asm | liuzikai/klc3 | 0c7c1504158f1cce3e6bff32f69b4cb3067cffff | [
"NCSA"
] | null | null | null | klc3-manual/examples/zjui_ece220_fa18/mp3/examples/mp3_tingkai.asm | liuzikai/klc3 | 0c7c1504158f1cce3e6bff32f69b4cb3067cffff | [
"NCSA"
] | null | null | null | ; This is mp3 by Tingkai Liu (3170111148)
; it will be based on mp2 (includes mp1) written by MYSELF. ALL RIGHT RESERVED
; in this program,
; it will find a best way to insert all extra event
; in a schedule that already have something inside
; with DFS by stack
; and print the new schedule out
; if it is impossible to insert all extra events
; error message will be output instead
; the extra event begins at address x6000
; each event has three field
; first is a string pointer for the address describing the event
; second is a bit vector for days (bit 0-4 indicate MON-FRI)
; third is a bit vector for POSSIBLE hours (bit 0-15 indicate 7 to 22 o'clock)
; The point of DFS is to find a suitable combination of hours for all events.
; the base of the stack is x8000
; The stack will stores the present slot number (0-15) of the event
; mp2 will be changed into subroutines for init schedule, print, etc.
; IS_OK is a subroutine to check if it is ok to insert event with present slot number, output the condition by memory
; TEST_SLOT is a subroutine to check which slot is possible and store it in memory, or -1 if no possibilities
; and delete the used possibility
; STR_EVENT is a subroutine for storing the present possible event into the schedule
; R0 is a address pointer for first field (event address pointer)
; R1 is a address pointer for second field (bit vector for days)
; R2 is a address pointer for third field (bit vector for possible hours)
; R3 is for temporary
; R4 is for temporary
; R5 is for the items in memory
; R6 is a stack pointer
; R7 is reserved for function calling
.ORIG x3000
LD R1,EXT_EVENT ; get the beginning address of extra event(x6000)
LD R2,COPY_EXT ; point to x7000 because I want to copy the extra events here so that I can make some modification
NOT R5,R2 ;
ADD R5,R5,#1 ; get -R2
ADD R5,R1,R5 ; get the difference between two list, with which I can easily get across lists
ST R5,DIFF_LIST ; store this difference in memory for use
COPYEVENT LDR R5,R1,#0 ;
BRz COPYDONE ;
STR R5,R2,#0 ;
ADD R1,R1,#1 ;
ADD R2,R2,#1 ;
BRnzp COPYEVENT ;
COPYDONE JSR INIT_SCHE ; initialize the schedule with the present event
; begin trying to insert event with DFS
LD R6,STACK_BASE ; point R6 to the stack base.
AND R5,R5,#0 ;
ADD R5,R5,#-1 ;
STR R5,R6,#0 ; let the base of the stack =-1
LD R0,COPY_EXT ; point to the address of the first field
NEXT_EX_EVENT ADD R6,R6,#-1 ; decrease the stack pointer
AND R5,R5,#0 ;
ADD R5,R5,#8 ;
ADD R5,R5,#8 ;
STR R5,R6,#0 ; store 16 in the stack as init, which is beyond the biggest possible slot number
GET_FIELD ADD R1,R0,#1 ; get address of the second field (bit vector for days)
ADD R2,R0,#2 ; get address of the third field (bit vector for possible hours)
NEXT_POS JSR TEST_SLOT ;
LD R5,POS_SLOT ; test whether it has possibilities
BRn GO_BACK ; if not, go back
JSR IS_OK ; test if the present possible slot is OK
LD R4,INSERT_OK ;
BRz NEXT_POS ; if not, test the next possible slot
STR R5,R6,#0 ; if yes, store this event in the schedule. store the present possible slot in the stack
JSR STR_EVENT ;
ADD R0,R0,#3 ; the address of the first field of the next event
LDR R3,R0,#0 ; test whether it is done with extra event
BRz F_SCHE ; if yes, finish the schedule
BRnp NEXT_EX_EVENT ; if not, get the next event
GO_BACK LDR R3,R6,#1 ; test whether it is the first event
BRn ERR_MP3 ; if the first event has to go back, means fail
ADD R1,R0,#1 ; get address of the second field (bit vector for days)
ADD R2,R0,#2 ; get address of the third field (bit vector for possible hours)
LDR R5,R6,#0 ; get the current slot number
ST R5,POS_SLOT ;
ADD R5,R5,#-15 ; test whether it is 16 (the event haven't been inserted)
BRp POPOUT ; if yes, means I don't need to clear the schedule, and I can pop directly
LDR R5,R6,#0 ; get the current slot in R5
LDR R3,R0,#0 ; R3 points to the address of the event
ST R3,CUR_EVENT ; store the address R0 points to
AND R3,R3,#0 ;
STR R3,R0,#0 ; clear the event being inserted
JSR STR_EVENT ;
LD R3,CUR_EVENT ;
STR R3,R0,#0 ; give the event address back
POPOUT LD R3,DIFF_LIST ;
ADD R4,R2,R3 ; point to the second field of the original list
LDR R4,R4,#0 ; get the original possible slot
STR R4,R2,#0 ; store the possible slot back in the copy list
ADD R6,R6,#1 ; pop the event out of the stack
ADD R0,R0,#-3 ; point to the previous event
LDR R5,R6,#0 ; get the current slot number
ADD R5,R5,#-15 ; test whether it is 16 (the event haven't been inserted)
BRp GET_FIELD ;
LDR R5,R6,#0 ; get the current slot in R5
LDR R3,R0,#0 ; R3 points to the address of the event
ST R3,CUR_EVENT ; store the address R0 points to
AND R3,R3,#0 ;
STR R3,R0,#0 ; clear the event being inserted
JSR STR_EVENT ;
LD R3,CUR_EVENT ;
STR R3,R0,#0 ; give the event address back
BRnzp GET_FIELD ;
F_SCHE JSR OUT_SCHE ; print out the schedule
MP3_DONE HALT
ERR_MP3 LEA R0,MP3_ERR_MES ;
PUTS
BRnzp MP3_DONE ;
STACK_BASE .FILL x8000
EXT_EVENT .FILL x6000
COPY_EXT .FILL x7000
DIFF_LIST .FILL x0000
CUR_EVENT .FILL x0000
MP3_ERR_MES .STRINGZ "Could not fit all events into schedule.\n"
; TEST_SLOT goes here
; R2 is the input, address of slot bit vector
; R6 is the input for the stack pointer pointing to the present slot
TEST_SLOT ST R0,TSSTOREA ; stores the registers
ST R1,TSSTOREB ;
ST R3,TSSTOREC ;
ST R4,TSSTORED ;
ST R5,TSSTOREE ;
AND R3,R3,#0 ; test from the slot 0 (07:00)
LDR R5,R2,#0 ; get the slot bit vector in R5
LD R4,TESTER ; get x0001 into R4 for testing the bit vector
ADD R0,R3,#0 ; get a copy of the present slot in R0
TESTERLOOP BRz TESTERDONE ;
ADD R4,R4,R4 ;
ADD R3,R3,#-1 ;
BRnzp TESTERLOOP ;
TESTERDONE AND R1,R5,R4 ; test whether the current slot is possible
BRz NEXT_POSS ; if it is not possible, try the next slot
NOT R4,R4 ;
ADD R4,R4,#1 ; get -R4 into R4
ADD R5,R5,R4 ; delete the possibility being used
STR R5,R2,#0 ;
ST R0,POS_SLOT ; store the possible slot
BRnzp POS_SLOT_G ;
NEXT_POSS ADD R3,R0,#1 ; next slot number
ADD R4,R3,#-15 ; test whether it is already 15
BRz NO_POSS ;
LD R4,TESTER ; R4=1
ADD R0,R3,#0 ; get the copy of the present slot
BRnzp TESTERLOOP ;
NO_POSS AND R3,R3,#0 ; store -1 into memory is no possibility remianed
ADD R3,R3,#-1 ;
ST R3,POS_SLOT ;
POS_SLOT_G LD R0,TSSTOREA ; load the registers back
LD R1,TSSTOREB ;
LD R3,TSSTOREC ;
LD R4,TSSTORED ;
LD R5,TSSTOREE ;
RET
POS_SLOT .FILL x0000
TESTER .FILL x0001
TSSTOREA .FILL x0000
TSSTOREB .FILL x0000
TSSTOREC .FILL x0000
TSSTORED .FILL x0000
TSSTOREE .FILL x0000
; IS_OK goes here
; TRY_INSET is a subroutine for it because I don't want to modify the registers from mp2
; R1 contains the address of the second field (days)
IS_OK ST R7,IOSTOREA ;
ST R4,IOSTOREB ;
ST R5,IOSTOREC ;
LDR R4,R1,#0 ; get the days in R4
LD R5,POS_SLOT ; get the slot in R5
JSR TRY_INSERT ;
LD R7,IOSTOREA ;
LD R4,IOSTOREB ;
LD R5,IOSTOREC ;
RET
IOSTOREA .FILL x0000
IOSTOREB .FILL x0000
IOSTOREC .FILL x0000
; input: R4 contains the days vector, R5 contains the slot number
TRY_INSERT ST R3,TISTOREA ; stores the registers
ST R4,TISTOREB ;
ST R6,TISTOREC ;
ST R7,TISTORED ;
ST R2,TISTOREE ;
AND R3,R3,#0 ;
ADD R3,R3,#1 ; pre-store the OK condition
ST R3,INSERT_OK ;
JSR TEST_DAY ;
LD R6,SCHEDULE ; calculate the address in schedule x4000+hour*5+day
LD R3,WU ; counter for multiply
MULTIPLY2 ADD R6,R6,R5 ;
ADD R3,R3,#-1 ;
BRp MULTIPLY2 ;
LD R3,WU ; count for five days
LEA R4,ISMON ; R4 for address pointer for testing the days
ADD R4,R4,#-1 ; (same as the next command)
ADD R6,R6,#-1 ; to suit the following loop, decrease the pointer and it will be added back afterwards
MANYDAYS2 ADD R4,R4,#1 ;
ADD R3,R3,#-1 ; test which day is arranged
BRn TEST_F ; stop after testing five days
ADD R6,R6,#1 ;
LDR R2,R4,#0 ;
BRz MANYDAYS2 ; if that day is not arranged, test the next day
LDR R2,R6,#0 ; if it is arranged, test whether there is a event already
BRnp EVENT_ERR2 ; if yes, output error and stop
BRnzp MANYDAYS2 ; next day
EVENT_ERR2 AND R3,R3,#0 ;
ST R3,INSERT_OK ;
TEST_F LD R3,TISTOREA ; load the registers
LD R4,TISTOREB ;
LD R6,TISTOREC ;
LD R7,TISTORED ;
LD R2,TISTOREE ;
RET
INSERT_OK .FILL x0000
TISTOREA .FILL x0000
TISTOREB .FILL x0000
TISTOREC .FILL x0000
TISTORED .FILL x0000
TISTOREE .FILL x0000
; STR_EVENT goes here
; R0 contains the address of the first field (event name address)
; R1 contains the address of the second field (days)
; R5 contains the slot number
STR_EVENT ST R4,IOSTOREA ;
ST R7,IOSTOREB ;
ST R0,IOSTOREC ;
LDR R0,R0,#0 ;
LDR R4,R1,#0 ; get the days in R4
JSR MP2STR ;
LD R4,IOSTOREA ;
LD R7,IOSTOREB ;
LD R0,IOSTOREC
RET
; (from mp2)
MP2STR ST R3,TISTOREA ; stores the registers
ST R4,TISTOREB ;
ST R6,TISTOREC ;
ST R7,TISTORED ;
ST R2,TISTOREE ;
JSR TEST_DAY ;
LD R6,SCHEDULE ; calculate the address in schedule x4000+hour*5+day
LD R3,WU ; counter for multiply
MULTIPLY3 ADD R6,R6,R5 ;
ADD R3,R3,#-1 ;
BRp MULTIPLY3 ;
LD R3,WU ; count for five days
LEA R4,ISMON ; temporary use R4 for address pointer for testing the days
ADD R4,R4,#-1 ; (same as the next command)
ADD R6,R6,#-1 ; to suit the following loop, decrease the pointer and it will be added back afterwards
MANYDAYS3 ADD R4,R4,#1 ;
ADD R3,R3,#-1 ; test which day is arranged
BRn NEW_STED ; stop after testing five days
ADD R6,R6,#1 ;
LDR R2,R4,#0 ;
BRz MANYDAYS3 ; if that day is not arranged, test the next day
STR R0,R6,#0 ; store the address of the event first char
BRnzp MANYDAYS3 ; next day
NEW_STED LD R3,TISTOREA ; load the registers
LD R4,TISTOREB ;
LD R6,TISTOREC ;
LD R7,TISTORED ;
LD R2,TISTOREE ;
RET
; the following is the copy of mp2 (which contains mp1)
; it is changed into subroutines
; INIT_SCHE is for getting events from x5000 to schedule
; OUT_SCHE is for printing the schedule
ASCNUL .FILL x0000
SCHEDULE .FILL x4000
EVENT .FILL x5000
SIZE .FILL x0050
INIT_SCHE ST R0,INITSTA ; stores the registers
ST R1,INITSTB ;
ST R2,INITSTC ;
ST R3,INITSTD ;
ST R4,INITSTE ;
ST R5,INITSTF ;
ST R6,INITSTG ;
ST R7,INITSTH ;
LD R3,SIZE ; initialize R3 to hold the size of the schedule 16*5=80=x50
LD R6,SCHEDULE ; get the begin address x4000 of the schedule into R6
LD R2,ASCNUL ; get x00 into R2 for write
SCHELOOP1 STR R2,R6,#0 ; initialize the schedule at x4000 (16*5)
ADD R6,R6,#1 ;
ADD R3,R3,#-1 ;
BRp SCHELOOP1 ;
LD R1,EVENT ; begin to get the event in x5000 and store it schedule
GETEVENT ADD R0,R1,#0 ; point the the address of the event string
GETDAY LDR R2,R1,#0 ; get the second field (day)
BRz GOTDAY ;
ADD R1,R1,#1 ;
BRnzp GETDAY ;
GOTDAY LDR R4,R1,#1 ; get the day into R4
LDR R5,R1,#2 ; get the third field (hour) into R5
BRn SLOT_ERR ; test whether the hour is valid
ADD R2,R5,#-15 ;
BRp SLOT_ERR ; if not, output error and stop
JSR TEST_DAY ;
LD R6,SCHEDULE ; calculate the address in schedule x4000+hour*5+day
LD R3,WU ; counter for multiply
MULTIPLY ADD R6,R6,R5 ;
ADD R3,R3,#-1 ;
BRp MULTIPLY ;
LD R3,WU ; count for five days
LEA R4,ISMON ; temporary use R4 for address pointer for testing the days
ADD R4,R4,#-1 ; (same as the next command)
ADD R6,R6,#-1 ; to suit the following loop, decrease the pointer and it will be added back afterwards
MANYDAYS ADD R4,R4,#1 ;
ADD R3,R3,#-1 ; test which day is arranged
BRn GNE ; stop after testing five days
ADD R6,R6,#1 ;
LDR R2,R4,#0 ;
BRz MANYDAYS ; if that day is not arranged, test the next day
LDR R2,R6,#0 ; if it is arranged, test whether there is a event already
BRnp EVENT_ERR ; if yes, output error end stop
STR R0,R6,#0 ; store the address of the event first char
BRnzp MANYDAYS ; next day
GNE ADD R1,R1,#3 ; get next event
LDR R2,R1,#0 ;
BRnp GETEVENT ; if it is not x00, means the events didn't finish
LD R0,INITSTA ; load the registers back
LD R1,INITSTB ;
LD R2,INITSTC ;
LD R3,INITSTD ;
LD R4,INITSTE ;
LD R5,INITSTF ;
LD R6,INITSTG ;
LD R7,INITSTH ;
RET
; memories for storing registers
INITSTA .FILL x0000
INITSTB .FILL x0000
INITSTC .FILL x0000
INITSTD .FILL x0000
INITSTE .FILL x0000
INITSTF .FILL x0000
INITSTG .FILL x0000
INITSTH .FILL x0000
; here comes OUT_SCHE
OUT_SCHE ST R0,OUTSTA ; stores the registers
ST R1,OUTSTB ;
ST R2,OUTSTC ;
ST R3,OUTSTD ;
ST R4,OUTSTE ;
ST R5,OUTSTF ;
ST R6,OUTSTG ;
ST R7,OUTSTH ;
LEA R1,ASCNUL ; store the address to be printed in R1
JSR PRINT_CENTERED ; print 6 spaces at the front
LD R0,ASCLINE ;
OUT
LD R3,WU ; print the headline with days
LEA R1,MON ;
DAYS JSR PRINT_CENTERED ;
ADD R1,R1,#4 ;
ADD R3,R3,#-1 ;
BRz HEADDONE ;
LD R0,ASCLINE ;
OUT ;
BRnzp DAYS ;
HEADDONE LD R0,ASCFEED ;
OUT ;
LD R3,SIZE ; init R3 for counting the size
LD R6,SCHEDULE ; address pointer of the schedule
AND R5,R5,#0 ; init R5 for counting the hours
P_NEXTH ADD R1,R5,#0 ; store the hour in R1
JSR PRINT_SLOT ; print each line leading with hour
ADD R5,R5,#1 ; point to the next hour
LD R0,ASCLINE ;
OUT ;
AND R4,R4,#0 ;
ADD R4,R4,#5 ; event counter
NEXTE LDR R1,R6,#0 ; get the pointer into R1
BRz NO_EVENT ;
NO_E_BACK JSR PRINT_CENTERED ; print the event
ADD R6,R6,#1 ; next event
ADD R3,R3,#-1 ; decrease the counter for the whole table
ADD R4,R4,#-1 ; decrease the counter for the events in this hour
BRz NEXTH
LD R0,ASCLINE ; print vertical line except for the last event
OUT ;
BRnzp NEXTE ;
NEXTH LD R0,ASCFEED ;
OUT ; change line at the end of each line
ADD R3,R3,#0 ; when five events have printed, next hour if didn't finish
BRp P_NEXTH ;
SCHEFINISH LD R0,OUTSTA ; load the registers back
LD R1,OUTSTB ;
LD R2,OUTSTC ;
LD R3,OUTSTD ;
LD R4,OUTSTE ;
LD R5,OUTSTF ;
LD R6,OUTSTG ;
LD R7,OUTSTH ;
RET
; memories for storing registers
OUTSTA .FILL x0000
OUTSTB .FILL x0000
OUTSTC .FILL x0000
OUTSTD .FILL x0000
OUTSTE .FILL x0000
OUTSTF .FILL x0000
OUTSTG .FILL x0000
OUTSTH .FILL x0000
NO_EVENT LEA R1,ASCNUL ; store the address of nul for printing 6 spaces
BRnzp NO_E_BACK ;
SLOT_ERR PUTS
LEA R0,SLOT_ERRM ; output " has an invalid slot number.\n"
PUTS
BRnzp SCHEFINISH
EVENT_ERR PUTS
LEA R0,EVENT_ERRM ; output " conflicts with an earlier event.\n"
PUTS
BRnzp SCHEFINISH
; R4 is the input as a bit vector for TEST_DAY
; TEST_DAY is used to get which day in the week is occupied and store the condition in certain memory
TEST_DAY ST R0,STOREA ; for testing the day
ST R1,STOREB ; address pointer
ST R2,STOREC ; counter
ST R6,STORED ; for temporary use
AND R0,R0,#0 ; init
AND R6,R6,#0 ; asc x00
LEA R1,ISMON ;
LD R2,WU ; count five days
CLEARLOOP STR R6,R1,#0 ;
ADD R1,R1,#1 ;
ADD R2,R2,#-1 ;
BRp CLEARLOOP ;
ADD R0,R0,#1 ; Monday bit
LD R2,WU ; count five days
LEA R1,ISMON ;
TESTLOOP AND R6,R4,R0 ;
STR R6,R1,#0 ; 0 means not that day, others numbers means yes
ADD R0,R0,R0 ; next day bit
ADD R1,R1,#1 ; point to the next day condition bit
ADD R2,R2,#-1 ; decrease the counter
BRp TESTLOOP ;
LD R0,STOREA ;
LD R1,STOREB ;
LD R2,STOREC ;
LD R6,STORED ;
RET
ASCLINE .FILL x007C
ASCFEED .FILL x000A
ISMON .FILL x0000
ISTUE .FILL x0000
ISWED .FILL x0000
ISTHU .FILL x0000
ISFRI .FILL x0000
WU .FILL x0005
MON .FILL x004D
.FILL x006F
.FILL x006E
.FILL x0000
TUE .FILL x0054
.FILL x0075
.FILL x0065
.FILL x0000
WED .FILL x0057
.FILL x0065
.FILL x0064
.FILL x0000
THU .FILL x0054
.FILL x0068
.FILL x0075
.FILL x0000
FRI .FILL x0046
.FILL x0072
.FILL x0069
.FILL x0000
SLOT_ERRM .FILL x0020
.FILL x0068
.FILL x0061
.FILL x0073
.FILL x0020
.FILL x0061
.FILL x006E
.FILL x0020
.FILL x0069
.FILL x006E
.FILL x0076
.FILL x0061
.FILL x006C
.FILL x0069
.FILL x0064
.FILL x0020
.FILL x0073
.FILL x006C
.FILL x006F
.FILL x0074
.FILL x0020
.FILL x006E
.FILL x0075
.FILL x006D
.FILL x0062
.FILL x0065
.FILL x0072
.FILL x002E
.FILL x000A
.FILL x0000
EVENT_ERRM .FILL x0020
.FILL x0063
.FILL x006F
.FILL x006E
.FILL x0066
.FILL x006C
.FILL x0069
.FILL x0063
.FILL x0074
.FILL x0073
.FILL x0020
.FILL x0077
.FILL x0069
.FILL x0074
.FILL x0068
.FILL x0020
.FILL x0061
.FILL x006E
.FILL x0020
.FILL x0065
.FILL x0061
.FILL x0072
.FILL x006C
.FILL x0069
.FILL x0065
.FILL x0072
.FILL x0020
.FILL x0065
.FILL x0076
.FILL x0065
.FILL x006E
.FILL x0074
.FILL x002E
.FILL x000A
.FILL x0000
; PRINT_SLOT goes here
; R1 contains needed time value 0-15, which means 7:00-22:00 and should not be modified
; R2 is used for the calculating the second digit, but the original value will be preserved
; other registers will be preserved for the main program, won't be used
PRINT_SLOT ST R2,STOREA ; store the original value of R2
ST R7,STOREB ; store R7 for safety
ADD R2,R1,#-2 ; judge whether R1 is bigger than 2
BRp MORETWO ;
LD R2,ASCZERO ; give R2 the value of '0'
JSR PRINT_ ; output '0' for the first character
LD R2,ASCSEVEN ; R1 isn't bigger than 2, then the second digit is '7'+R1
ADD R2,R2,R1 ;
JSR PRINT_ ; output R2+R1 as the second character
BRnzp FOLL ; to output the following
MORETWO ADD R2,R1,#-12 ; bigger than 2, judge whether is bigger than 12
BRp MORETWEL ;
LD R2,ASCONE ; output '1' for the first character
JSR PRINT_ ;
LD R2,ASCSEVEN ; R1 isn't bigger than 12, then the second digit is R1+'7'-10
ADD R2,R2,R1 ;
ADD R2,R2,#-10 ;
JSR PRINT_ ; output R2+R1-10 as the second character
BRnzp FOLL ; to output the following
MORETWEL LD R2,ASCTWO ; output the first character '2'
JSR PRINT_ ;
LD R2,ASCSEVEN ; bigger than 12, the second digit is R1+R2-20
ADD R2,R2,R1 ;
ADD R2,R2,#-10 ;
ADD R2,R2,#-10 ;
JSR PRINT_ ; output the R1+'7'-20 as the second character
FOLL LD R2,ASCM ; output ':00 ', which is the same for all condition
JSR PRINT_ ;
LD R2,ASCZERO ;
JSR PRINT_ ;
JSR PRINT_ ;
LD R2,ASCSPACE ;
JSR PRINT_ ;
LD R2,STOREA ; give the value of R2 back
LD R7,STOREB ; give the value of R7 back
RET
; PRINT_CENTERED goes here
; R1 contains the beginning address of the string which end with x00
; R2 is loading the characters, and the input of PRINT_
; R3 is used as a counter for leading space, after that it becomes a address pointer
; R4 is used as a counter for trailing space
; R5 is used for getting address
; other registers will be preserved for the main program, won't be used
PRINT_CENTERED ST R2,STOREA ; store the original value of R2
ST R3,STOREB ; store the original value of R3
ST R4,STOREC ; store the original value of R4
ST R5,STORED ; store the original value of R5
ST R7,STOREE ; store R7 for safety
AND R3,R3,#0 ; initialize R3 to 0
AND R4,R4,#0 ; initialize R4 to 0
AND R5,R5,#0 ; initialize R5 to 0
ADD R5,R1,#0 ; get the address into R5
LDR R2,R5,#0 ; Test whether the first character is x00
BRz ZERO ;
COUNT ADD R5,R5,#1 ; get the address being test
ADD R3,R3,#1 ; count how many (3-leading space)
LDR R2,R5,#0 ;
BRz COUNTED ;
ADD R5,R5,#1 ; get the next address
ADD R4,R4,#1 ; count how many (3-trailing space)
LDR R2,R5,#0 ;
BRz COUNTED ;
BRnzp COUNT ;
COUNTED ADD R5,R3,R4 ; temporary store the number of chars
NOT R4,R4 ;
ADD R4,R4,#1 ; get -R4
ADD R4,R4,#3 ; get the number of trailing spaces
NOT R3,R3 ;
ADD R3,R3,#1 ; get -R3
ADD R3,R3,#3 ; get the number of leading spaces
BRn MSIX ; if the result is negative, it means there are more than 6 chars
BRz NOLE ; if the result is zero, it means there are 5/6 chars, no leading spaces
BRnzp LEADING ;
ZERO ADD R3,R3,#6 ;
AND R5,R5,#0 ;
LEADING LD R2,ASCSPACE ; begin printing leading space
JSR PRINT_ ;
ADD R3,R3,#-1 ;
BRp LEADING ;
ADD R5,R5,#0 ;
BRz FINISH ; if no chars to print, finish
BRnp NOLE ; to print the chars
MSIX AND R5,R5,#0 ;
ADD R5,R5,#6 ; need to print exactly 6 chars
NOLE ADD R3,R1,#0 ; get the beginning address
NEXT LDR R2,R3,#0 ;
JSR PRINT_ ; print that char
ADD R3,R3,#1 ; point to the next address
ADD R5,R5,#-1 ; show how many chars left
BRp NEXT ;
ADD R4,R4,#0 ;
BRnz FINISH ; if no spaces to be printed, finish
TRAILING LD R2,ASCSPACE ;
JSR PRINT_ ;
ADD R4,R4,#-1 ;
BRp TRAILING ;
FINISH LD R2,STOREA ; give the value of R2 back
LD R3,STOREB ; give the value of R3 back
LD R4,STOREC ; give the value of R4 back
LD R5,STORED ; give the value of R5 back
LD R7,STOREE ; give the value of R7 back
RET
; what followed is a sub-subrountine used for output, taking R2 as input of what will be printed
; I write this because I want to try using DDR (but not R0) and using subroutines, haha
PRINT_ ST R5,STOREF ;
ST R2,STOREG ;
PLOOP LDI R5,DSR ;
BRzp PLOOP ;
STI R2,DDR ;
LD R5,STOREF ;
LD R2,STOREG ;
RET
DSR .FILL xFE04
DDR .FILL xFE06
STOREA .FILL x0000
STOREB .FILL x0000
STOREC .FILL x0000
STORED .FILL x0000
STOREE .FILL x0000
STOREF .FILL x0000
STOREG .FILL x0000
ASCZERO .FILL x0030
ASCONE .FILL x0031
ASCTWO .FILL x0032
ASCSEVEN .FILL x0037
ASCM .FILL x003A
ASCSPACE .FILL x0020
.END
| 27.232529 | 117 | 0.698442 |
875af85738c8de9993eccedfce0000a5a77e2f5a | 7,687 | asm | Assembly | nasm assembly/assignment 5/qs1.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/assignment 5/qs1.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/assignment 5/qs1.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | section .data
msg1 : db 'debug here --',10
l1 : equ $-msg1
msg2 : db 'Enter your string : '
l2 : equ $-msg2
msg3 : db 'Reversed string is : '
l3 : equ $-msg3
msg4 : db 'msg 4 here'
l4: equ $-msg4
msg5 : db 'msg 5 here',10
l5: equ $-msg5
space:db ' '
newline:db '',10
section .bss
num: resd 1
counter: resd 1
n: resd 10
string: resb 500
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, l2
int 80h
mov ebx, string
call read_array_string
call reverse_sentence ; funtion to reverse a sentence
call debugger ; add new line
mov eax, 4
mov ebx, 1
mov ecx, msg3
mov edx, l3
int 80h
mov ebx, reversed_sentence_val
call print_array_string
call debugger ; add new line
call debugger ; add new line
exit:
mov eax,1
mov ebx,0
int 80h
; section for procedures
;----------------------------
reverse_sentence:
;; usage
;--------
;; 1: the input string should be in ebx , length of the string in string_len
;; 2: reversed sentence string in "reversed_sentence_val"
;; 3: length of the reversed sentence in "reversed_sent_count"
;; 4: subprocedures used are "reverse_string_modified_for_sent"
section .bss
sent_word : resb 200
rev_s_counter: resd 1
temp_rev_sent: resb 1
sent_word_counter: resd 1
reversed_sentence_val: resb 500
reversed_sent_count: resd 1
section .text
push rax
push rbx
push rcx
push rdx
mov ax, word[string_len]
mov word[rev_s_counter],ax ; rev_s_counter=len(str)
mov dword[sent_word_counter],0
mov dword[reversed_sent_count],0
reverse_sent_loop:
mov ax,word[rev_s_counter] ; if rev_s_counter==0 exit
cmp ax,0
je exit_reverse_sent_loop
; call debugger
mov eax,[rev_s_counter]
dec eax
mov cl, byte[ebx+eax]
mov byte[temp_rev_sent],cl ; extract the character
dec dword[rev_s_counter]
cmp cl,' ' ; if the characted is a space then reverse the stored word and add it
jne add_to_word ; to the reversed sentence
push rbx
push rax
mov ebx, sent_word
mov eax, [sent_word_counter]
mov byte[ebx+eax],0
mov [string_len],eax ; string_len=len(word)
call reverse_string_modified_for_sent ; reverse the word and add to sentence
mov dword[sent_word_counter],0 ; reset the word_counter and clear the word
pop rax
pop rbx
jmp continue_reverse
add_to_word:
push rbx ; if character is not ' ' add it to the word
push rax
mov ebx, sent_word
mov eax, [sent_word_counter]
mov byte[ebx+eax],cl
inc dword[sent_word_counter]
pop rax
pop rbx
continue_reverse:
jmp reverse_sent_loop
exit_reverse_sent_loop:
push rbx
push rax
mov ebx, sent_word
mov eax, [sent_word_counter]
mov byte[ebx+eax],0 ; take the first word in the string
; this word is not captured in the loop
mov [string_len],eax
call reverse_string_modified_for_sent
mov dword[sent_word_counter],0
pop rax
pop rbx
push rbx
mov ebx,reversed_sentence_val
mov eax, [reversed_sent_count] ; rev_string[j]=reg(cl)
dec eax
mov byte[ebx+eax], 0 ; add the 0 to the end of reversed sentance
pop rbx
pop rdx
pop rcx
pop rbx
pop rax
ret
reverse_string_modified_for_sent:
;; usage
;-------
; base address should be in ebx, length in "string_len"
; the reversed string is added to another string variable "reversed_sent_count"
section .bss
counter_i : resd 1
section .text
push rax
push rbx
push rcx
mov eax,[string_len]
mov [counter_i],eax ;i=n
rev_loop:
mov ax,word[counter_i] ; if i<1 : break
cmp ax,1
jb exit_rev_loop
mov eax, [counter_i]
dec eax
mov cl,byte[ebx+eax] ; reg(cl) = string[i-1]
inc eax
mov [counter_i],eax
push rbx
mov ebx,reversed_sentence_val
mov eax, [reversed_sent_count] ; rev_string[j]=reg(cl)
mov byte[ebx+eax], cl
pop rbx
inc dword[reversed_sent_count] ;j++
dec dword[counter_i] ;i--
jmp rev_loop
exit_rev_loop:
; call debugger
mov ebx,reversed_sentence_val
mov eax, [reversed_sent_count] ; rev_string[j]=reg(cl)
mov byte[ebx+eax], ' '
inc dword[reversed_sent_count] ;j++
pop rcx
pop rbx
pop rax
ret
debugger:
section .data
msg_debugger : db '',10
msg_debugger_l : equ $-msg_debugger
section .text
push rax
push rbx
push rcx
push rdx
; debug----
mov eax, 4
mov ebx, 1
mov ecx, msg_debugger
mov edx, msg_debugger_l
int 80h
;debug ---
pop rdx
pop rcx
pop rbx
pop rax
; action
ret
read_array_string:
;; usage
;--------
; 1: string is read and stored in string variable
; 2: string length is stored in string_len
section .bss
string_len : resd 1
temp_read_str : resb 1
section .text
push rax
push rbx
push rcx
mov word[string_len],0
reading:
push rbx
mov eax, 3
mov ebx, 0
mov ecx, temp_read_str
mov edx, 1
int 80h
pop rbx
cmp byte[temp_read_str], 10 ;; check if the input is ’Enter’
je end_reading
inc byte[string_len]
mov al,byte[temp_read_str]
mov byte[ebx], al
inc ebx
jmp reading
end_reading:
;; Similar to putting a null character at the end of a string
mov byte[ebx], 0
pop rcx
pop rbx
pop rax
ret
print_array_string:
;; usage
;-----------
; 1: base address of string to print is stored in ebx
section .bss
temp_print_str : resb 1
section .text
push rax
push rbx
push rcx
printing:
mov al, byte[ebx]
mov byte[temp_print_str], al
cmp byte[temp_print_str], 0 ;; checks if the character is NULL character
je end_printing
push rbx
mov eax, 4
mov ebx, 1
mov ecx, temp_print_str
mov edx, 1
int 80h
pop rbx
inc ebx
jmp printing
end_printing:
pop rcx
pop rbx
pop rax
ret
print_num:
;usage
;------
; 1: create a variable num(word)
; 2: move number to print to num (word)
section .data
nwl_for_printnum :db ' ',10
nwl_l_printnum : equ $-nwl_for_printnum
section .bss
count_printnum : resb 10
temp_printnum : resb 1
section .text
push rax ; push all
push rbx
push rcx
mov byte[count_printnum],0
;call push_reg
extract_no:
cmp word[num], 0
je print_no
inc byte[count_printnum]
mov dx, 0
mov ax, word[num]
mov bx, 10
div bx
push dx ; recursion here
mov word[num], ax
jmp extract_no
print_no:
cmp byte[count_printnum], 0
je end_print
dec byte[count_printnum]
pop dx
mov byte[temp_printnum], dl ; dx is further divided into dh and dl
add byte[temp_printnum], 30h
mov eax, 4
mov ebx, 1
mov ecx, temp_printnum
mov edx, 1
int 80h
jmp print_no
end_print:
mov eax,4
mov ebx,1
mov ecx,nwl_for_printnum
mov edx,nwl_l_printnum
int 80h
;;The memory location ’newline’ should be declared with the ASCII key for new popa
;call pop_reg
pop rcx
pop rbx
pop rax ; pop all
ret
read_num:
;usage
;------
; 1: create a variable num(word)
; 2: the input number is stored into num(word)
section .bss
temp_for_read: resb 1
section .text
push rax ; push all
push rbx
push rcx
mov word[num], 0
loop_read:
;; read a digit
mov eax, 3
mov ebx, 0
mov ecx, temp_for_read
mov edx, 1
int 80h
;;check if the read digit is the end of number, i.e, the enter-key whose ASCII cmp byte[temp], 10
cmp byte[temp_for_read], 10
je end_read
mov ax, word[num]
mov bx, 10
mul bx
mov bl, byte[temp_for_read]
sub bl, 30h
mov bh, 0
add ax, bx
mov word[num], ax
jmp loop_read
end_read:
;;pop all the used registers from the stack using popa
;call pop_reg
pop rcx
pop rbx
pop rax
ret
| 15.282306 | 98 | 0.66671 |
08e585f2af829b453019054c6abdbb2f418e1d9c | 290 | asm | Assembly | Lab 4/Lab_4_3.asm | Vladicka/Assembler | 312d11db9dafaf12507b91beb28e1d4e4b16cade | [
"MIT"
] | null | null | null | Lab 4/Lab_4_3.asm | Vladicka/Assembler | 312d11db9dafaf12507b91beb28e1d4e4b16cade | [
"MIT"
] | null | null | null | Lab 4/Lab_4_3.asm | Vladicka/Assembler | 312d11db9dafaf12507b91beb28e1d4e4b16cade | [
"MIT"
] | null | null | null | code segment
start:
mov ah, 0
mov al, 10h
int 10h
push es
xor ax, ax
mov es, ax
mov ah, 6
mov al, 0
mov bh, 15
xor cx, cx
mov dh, es:[484h]
mov dl, es:[44Ah]
dec dl
int 10h
pop es
mov ax, 4c00h
int 21h
code ends
end start
| 13.181818 | 21 | 0.524138 |
91694f2f94d15ddf89e365d5a98bcd731565d737 | 3,907 | asm | Assembly | Util/Serial.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | Util/Serial.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | Util/Serial.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | ;===========================================================================
; Serial.asm
;---------------------------------------------------------------------------
; Assembly x86 library
;
;
; Author: Ahmed Hussein
; Created:
;
;
; This file provide procedures to communicate with another device
; through serial port
;
; Procedures included:
; * ConfigurePort
; * SendByte
; * CheckForData
; * RecieveByte
; * WaitForRecievedData
;===========================================================================
;-------------------- Definitions --------------------
DATA_READY EQU 00
DATA_NOT_READY EQU 01
LINE_STATUES_REGISTER EQU 03FDH
LINE_CONTROL_REGISTER EQU 03FBH
TRANSMIT_DATA_REGISTER EQU 03F8H
DIVISOR_LATCH_REGISTER EQU 03F9H
;-----------------------------------------------------
; CheckForData
;-----------------------------------------------------
; Check if there is a data recieved
; @return AL = DATA_READY or DATA_NOT_READY
;-----------------------------------------------------
CheckForData proc
PUSH DX
MOV DX, LINE_STATUES_REGISTER
IN AL, DX
TEST AL, DATA_NOT_READY
JZ @@ReturnNotReady
MOV AL, DATA_READY
JMP @@CheckForDataReturn
@@ReturnNotReady:
MOV AL, DATA_NOT_READY
@@CheckForDataReturn:
POP DX
RET
CheckForData endp
;-----------------------------------------------------
; RecieveByte
;-----------------------------------------------------
; @return AL = Character recieved
;-----------------------------------------------------
RecieveByte proc
PUSH DX
;Read the value
MOV DX, TRANSMIT_DATA_REGISTER
IN AL, DX
PUSH AX
;Reset Line Status Register flag
MOV AL, DATA_NOT_READY
MOV DX, LINE_STATUES_REGISTER
OUT DX,AL
POP AX
POP DX
RET
RecieveByte endp
;-----------------------------------------------------
; SendByte
;-----------------------------------------------------
; @param AL = Character to be sent
;-----------------------------------------------------
SendByte proc
PUSH DX
PUSH AX
;Check that Transimitter Holding Register is empty
MOV DX ,LINE_STATUES_REGISTER
@@CheckTHR:
IN AL,DX
AND AL, 00100000B
JZ @@CheckTHR
;Put the value in Transmit data register
POP AX
MOV DX, TRANSMIT_DATA_REGISTER
OUT DX, AL
POP DX
RET
SendByte endp
;-----------------------------------------------------
; ConfigurePort
;-----------------------------------------------------
; Configures the port for serial communication
;-----------------------------------------------------
ConfigurePort PROC
PUSH AX
PUSH DX
;Set divisor latch access bit
MOV DX,LINE_CONTROL_REGISTER
MOV AL,10000000B
OUT DX,AL
;Set LSB byte of the BaudRate Divisor latch register
MOV DX,TRANSMIT_DATA_REGISTER
MOV AL,0CH
OUT DX,AL
;Set MSB byte of the BaudRate Divisor latch register
MOV DX,DIVISOR_LATCH_REGISTER
MOV AL,00H
OUT DX,AL
;Set port configuration
MOV DX,LINE_CONTROL_REGISTER
MOV AL,00011011B
OUT DX,AL
POP DX
POP AX
RET
ConfigurePort ENDP
;-----------------------------------------------------
; WaitForRecievedData
;-----------------------------------------------------
; Wait untill there's data sent then read it
; @return AL = Character recieved
;-----------------------------------------------------
WaitForRecievedData PROC
PUSH DX
PUSH AX
;Check that Data Ready
MOV DX, LINE_STATUES_REGISTER
@@CheckForData:
IN AL,DX
AND AL, DATA_NOT_READY
JZ @@CheckForData
;Read the value recieved
POP AX
MOV DX, TRANSMIT_DATA_REGISTER
IN AL, DX
PUSH AX
;Reset Line Status Register flag
MOV AL, DATA_NOT_READY
MOV DX, LINE_STATUES_REGISTER
OUT DX,AL
POP AX
POP DX
RET
WaitForRecievedData ENDP | 21.826816 | 77 | 0.490914 |
294772c0671b78ef16c785656c4b44ebc6f0e5b7 | 739 | asm | Assembly | oeis/295/A295575.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/295/A295575.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/295/A295575.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A295575: a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^3.
; Submitted by Jamie Morken(s3)
; 0,1,1,1,9,1,36,28,73,28,225,126,441,153,416,496,1296,469,2025,1100,1710,1225,4356,1800,4959,2556,5581,4410,11025,3872,14400,8128,11090,8128,15822,8910,29241,13041,21996,16400,44100,15426,53361,27830,33716,29161,76176,27936,77652,37828,65720,54756,123201,43561,102780,67032,103302,76636,189225,52200,216225,101025,139302,130816,203886,96410,314721,161840,224246,138024,396900,140616,443556,209628,262316,253422,423990,189072,608400,257600,448813,319600,741321,216972,609192,388521,572852,430760
add $0,1
mov $2,$0
div $0,2
lpb $0
mov $3,$2
gcd $3,$0
pow $3,$0
mov $4,$0
sub $0,1
div $4,$3
mov $3,$4
pow $3,3
add $1,$3
lpe
mov $0,$1
| 36.95 | 495 | 0.713126 |
a69a9c3f204bb460518df5a49d5dc0f918f74fa2 | 2,608 | asm | Assembly | srcs/time/time.asm | gamozolabs/falkervisor_beta | 48e83a56badcf53dba94a5ab224eb37775a2f37d | [
"MIT"
] | 69 | 2018-09-09T01:30:53.000Z | 2021-07-27T18:56:39.000Z | srcs/time/time.asm | gamozolabs/falkervisor_beta | 48e83a56badcf53dba94a5ab224eb37775a2f37d | [
"MIT"
] | null | null | null | srcs/time/time.asm | gamozolabs/falkervisor_beta | 48e83a56badcf53dba94a5ab224eb37775a2f37d | [
"MIT"
] | 15 | 2018-09-09T05:46:41.000Z | 2022-02-16T01:46:38.000Z | [bits 64]
init_pit:
push rax
; Set the PIT mode, timer 0, square wave gen, hex
mov al, 0x34
out 0x43, al
; Lower bits
mov al, 0xFF
out 0x40, al
; Upper bits
mov al, 0xFF
out 0x40, al
pop rax
ret
; ecx -> Hardware P-state [0, 7] (not checked for validity!)
; rax <- Frequency of the corresponding P-state in MHz
amd_fam15h_hw_freq:
push rcx
push rdx
; Compute the P-state MSR which corresponds to this hardware P-state
add ecx, 0xc0010064
rdmsr
bextr ecx, eax, 0x0306 ; CpuDid, divisor ID
and eax, 0x3f ; CpuFid, frequency multiplier
; CoreCOF in MHz = ((CpuFid + 0x10) / (2^CpuDid)) * 100
; Compute CpuFid in MHz
add eax, 0x10
imul rax, 100
; Divide by CpuDid
shr rax, cl
pop rdx
pop rcx
ret
; rax <- Current frequency in MHz
amd_fam15h_cur_freq:
push rcx
push rdx
; Get the COFVID status, which contains the current hardware P-state
mov ecx, 0xc0010071
rdmsr
bextr ecx, eax, 0x0310
call amd_fam15h_hw_freq
pop rdx
pop rcx
ret
; rax <- Software P0 frequency in MHz
amd_fam15h_sw_p0_freq:
push rcx
call amd_fam15h_fetch_pcie_mmio
; Bus 0, Device 18, Function 4
; Get the number of boost states, this will be the hardware P-state that
; corresponds to hardware P0
bextr ecx, [rdx + 0x15c + ((0 << 20) | (0x18 << 15) | (0x4 << 12))], 0x0302
call amd_fam15h_hw_freq
pop rcx
ret
rdtsc64:
push rdx
rdtsc
shl rdx, 32
or rax, rdx
pop rdx
ret
; We use this function to calculate what the value of rdtsc will be x
; microseconds in the future. This way we don't have to do a rdtsc and div
; by calling rdtsc_uptime, we just rdtsc.
; rax -> Target number of microseconds to wait
; rax <- Value rdtsc will be upon specified milliseconds
rdtsc_future:
push rcx
push rdx
; Get number of cycles in n microseconds
xor rdx, rdx
mul qword [fs:globals.rdtsc_freq]
mov rcx, rax
; Get current time
rdtsc
shl rdx, 32
or rdx, rax
; Add the current time and the delay together
lea rax, [rcx + rdx]
pop rdx
pop rcx
ret
; rax <- Number of microseconds since rdtsc init
rdtsc_uptime:
push rdx
rdtsc
shl rdx, 32
or rax, rdx
xor rdx, rdx
div qword [fs:globals.rdtsc_freq]
pop rdx
ret
; rcx -> Number of microseconds to sleep
rdtsc_sleep:
push rax
push rcx
push rdx
; Get number of timestamp ticks that correspeonds to this request
imul rcx, qword [fs:globals.rdtsc_freq]
; Get the target timestamp counter that we're done sleeping at
rdtsc
shl rdx, 32
or rdx, rax
add rcx, rdx
.wait_rdtsc:
rdtsc
shl rdx, 32
or rdx, rax
cmp rdx, rcx
jb short .wait_rdtsc
pop rdx
pop rcx
pop rax
ret
| 16.825806 | 76 | 0.702454 |
3afa8cae1b1348c92637e31e6c7251d75d4ea8ff | 4,031 | asm | Assembly | source/operator/relational.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/operator/relational.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/operator/relational.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | ; ********************************************************************************************
; ********************************************************************************************
;
; Name : relational.asm
; Purpose : ..
; Created : 15th Nov 1991
; Updated : 4th Jan 2021
; Authors : Fred Bowen
;
; ********************************************************************************************
; ********************************************************************************************
; Time to perform a relational operator.
; (domask) contains the bits as to which relational operator it was.
; Carry bit on = string compare.
dorel jsr chkval ; check for match
bcs strcmp ; is it a string?
lda argsgn ; pack argument for fcomp
ora #$7f
and argho
sta argho
lda #<argexp
ldy #>argexp
jsr fcomp
tax
bra qcomp
strcmp lda #0
sta valtyp
dec opmask
jsr frefac ; free the faclo string
sta dsctmp ; save it for later
stx dsctmp+1
sty dsctmp+2
lda argmo ; get pointer to other string
ldy argmo+1
jsr fretmp ; frees first desc pointer
stx argmo
sty argmo+1
tax ; copy count into x
sec
sbc dsctmp ; which is greater. if 0, all set up
beq stasgn ; just put sign of difference away
lda #1
bcc stasgn ; sign is positive
ldx dsctmp ; length of fac is shorter
lda #$ff ; get a minus one for negatives
stasgn sta facsgn ; keep for later
ldy #255 ; set pointer to first string. (arg)
inx ; to loop properly
nxtcmp iny
dex ; any characters left to compare?
bne getcmp ; not done yet
ldx facsgn ; use sign of length difference
;since all characters are the same
qcomp bmi docmp ; c is always set then
clc
bra docmp ; always branch
getcmp lda #argmo
jsr lda_far_ram1 ; lda (argmo),y from RAM1
pha
lda #dsctmp+1
jsr lda_far_ram1 ; lda (dsctmp+1),y from RAM1
sta syntmp
pla
cmp syntmp
beq nxtcmp
ldx #$ff
bcs docmp
ldx #1
docmp
inx ; -1 to 1, 0 to 2, 1 to 4
txa
rol
and domask
beq l20_1
lda #$ff ; map 0 to 0, map all others to -1
l20_1 +lbra float ; float the one-byte result into FAC
;.end
; ********************************************************************************************
;
; Date Changes
; ==== =======
;
; ********************************************************************************************
| 41.132653 | 94 | 0.295212 |
59ed852e37bdcbb7cbc58727d11f8a16f1268463 | 233 | asm | Assembly | oeis/277/A277433.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/277/A277433.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/277/A277433.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A277433: Martin Gardner's minimal no-3-in-a-line problem, all slopes version.
; Submitted by Christian Krause
; 1,4,4,4,6,6,8,8,8,8
mov $2,$0
lpb $0
mov $0,$2
sub $2,$3
trn $3,1
add $3,3
trn $0,$3
lpe
mov $0,$3
add $0,1
| 15.533333 | 79 | 0.618026 |
4645ae4b5aa43d6cdf55dc37a6b41a969fff2445 | 174 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sdcc_iy/strupr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/string/c/sdcc_iy/strupr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/string/c/sdcc_iy/strupr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; char *strupr(char *s)
SECTION code_clib
SECTION code_string
PUBLIC _strupr
EXTERN asm_strupr
_strupr:
pop af
pop hl
push hl
push af
jp asm_strupr
| 8.7 | 23 | 0.683908 |
b9c88fc7fcb26c9471dc8cf338ac354303cf0add | 340 | asm | Assembly | programs/oeis/038/A038346.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/038/A038346.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/038/A038346.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A038346: Sum of first n primes of form 4k+1.
; 5,18,35,64,101,142,195,256,329,418,515,616,725,838,975,1124,1281,1454,1635,1828,2025,2254,2487,2728,2985,3254,3531,3812,4105,4418,4735,5072,5421,5774,6147,6536,6933
lpb $0
mov $2,$0
sub $0,1
seq $2,2144 ; Pythagorean primes: primes of form 4*k + 1.
add $1,$2
lpe
add $1,5
mov $0,$1
| 28.333333 | 166 | 0.685294 |
41ef3415e78139f90f200b361910f282fe9ba4f4 | 891 | asm | Assembly | 02-ilinux-print-method/boot.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | 02-ilinux-print-method/boot.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | 02-ilinux-print-method/boot.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | ; int 10h / ah = 0x13 document http://www.ablmcc.edu.hk/~scy/CIT/8086_bios_and_dos_interrupts.htm#int10h_13h
org 0x7c00
jmp START
nop
stack_base equ 0x7c00
START:
mov ax, cs
mov ds, ax
mov ss, ax
mov sp, stack_base
; 进行清屏操作
mov ax, 0x0600
mov bx, 0x0700
mov cx, 0
mov dx, 0x0184f
int 0x10
mov cx, 0x09
push cs
pop es
mov bp, boot_message
call print_string
jmp $ ; 跳转到当前地址,实现循环
%include "string.asm"
boot_message: dd "Booting......", 0 ; 定义一个字符串为 dd 类型,并且后要添加一个 0,表示字符串的结束
boot_message_len: ; boot_message_len - boot_message 刚好为字符串的大小
; ============================================================================
; time n m
; n: 重复多少次
; m: 重复的代码
;
;
; $ : 当前地址
; $$ : 代表上一个代码的地址减去起始地址
; ============================================================================
times 510-($-$$) db 0 ; 填充 0
dw 0xaa55 ; 可引导扇区标志,必须是 0xaa55,不然bios无法识别
| 17.470588 | 108 | 0.551066 |
59d6c762bb3877639aaa56768b5095db7b6851aa | 326 | asm | Assembly | programs/oeis/080/A080891.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/080/A080891.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/080/A080891.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A080891: Period 5: repeat [0, 1, -1, -1, 1].
; 0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1,0,1,-1,-1,1
pow $0,2
add $0,1
mod $0,5
sub $0,1
| 40.75 | 241 | 0.444785 |
e2721ce754dc78eb6580a9b2c98d48d3e2103bc9 | 533 | asm | Assembly | programs/oeis/314/A314685.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/314/A314685.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/314/A314685.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A314685: Coordination sequence Gal.3.16.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,9,13,17,22,27,31,35,39,44,49,53,57,61,66,71,75,79,83,88,93,97,101,105,110,115,119,123,127,132,137,141,145,149,154,159,163,167,171,176,181,185,189,193,198,203,207,211,215
mov $4,$0
mov $5,$0
lpb $0
sub $0,2
trn $0,2
mov $3,1
add $3,$0
trn $0,1
add $4,2
lpe
mov $2,$4
add $2,$3
mov $1,$2
trn $1,3
lpb $5
add $1,3
sub $5,1
lpe
add $1,1
| 23.173913 | 176 | 0.660413 |
e40ea098b626e57a66104fb0b0a64de55a70c579 | 17,643 | asm | Assembly | maps/intro.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 53 | 2017-08-25T01:27:33.000Z | 2021-08-30T19:55:57.000Z | maps/intro.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 6 | 2017-08-24T19:40:33.000Z | 2018-05-14T19:37:34.000Z | maps/intro.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 10 | 2017-08-24T18:37:35.000Z | 2019-10-02T04:35:39.000Z |
SECTION "Intro map", ROMX, ALIGN[5]
; MAKE SURE THIS DOES NOT CROSS A 256-BYTE BOUNDARY!!
; (Except for the last byte, which is allowed to)
IntroScripts::
dw IntroBoyGirlText
dw IntroChooseGender
dw IntroChoseGenderText
dw IntroFadeToNarrator
dw IntroGreetText
dw IntroResetDelayStep
dw IntroPressAText
dw IntroWaitNextState
dw IntroObjectNeededText
dw 0 ; Don't do anything, the NPC script advances the status by itself
dw IntroRemovedNPCText
dw IntroCheckStartMenu
IntroMap::
db $80
db MUSIC_NONE ; No music
db 0
db TILESET_INTRO
dw IntroMapScript
map_size 15, 18
dw NO_SCRIPT
IntroMapInteractions::
db 0
IntroMapNPCs::
db 6
dw NO_FLAG_DEP
npc $0128, $0070, 16, 16, 0, 1, DIR_DOWN, 1, 1, 1, 1, 0, 0 ; "FRIENDLY NPC"
dw NO_FLAG_DEP
npc $00D0, $0000, 0, 0, 0, 2, DIR_DOWN, 0, 0, 0, 0, 0, 0 ; Gender select camera focus point
dw NO_FLAG_DEP
npc $00C8, $0018, 0, 0, 0, 3, DIR_LEFT, 1, 1, 1, 1, 0, 0 ; Evie right eye
dw NO_FLAG_DEP
npc $00C8, $0020, 0, 0, 0, 4, DIR_LEFT, 1, 1, 1, 1, 0, 0 ; Evie left eye
dw NO_FLAG_DEP
npc $00C8, $0070, 0, 0, 0, 4, DIR_RIGHT, 1, 1, 1, 1, 0, 0 ; Tom right eye
dw NO_FLAG_DEP
npc $00C8, $0078, 0, 0, 0, 3, DIR_RIGHT, 1, 1, 1, 1, 0, 0 ; Tom left eye
db 1
dw IntroMapNPCScripts
db 4
full_ptr TestNPCTiles
full_ptr InvisibleTiles
; Cannot use full_ptr for these two due to the math causing a syntax error in "BANK(\1)"
db BANK(LeftEyeTiles)
dw LeftEyeTiles - 16 * 4 * 2 ; Make it so the actual tiles land in the slot for left/right, but without using padding
db BANK(RightEyeTiles)
dw RightEyeTiles - 16 * 4 * 2
IntroMapPalettes::
dw IntroNPCPalette
dw 0
dw 0
dw 0
dw 0
dw 0
dw 0
IntroMapWarpToPoints::
db 2
warp_to $0028, $0010, DIR_RIGHT, NO_WALKING, 2, THREAD2_DISABLED, CharSelectLoadingScript ; Char select entry point
TUTORIAL_STARTING_YPOS = $0028
TUTORIAL_STARTING_XPOS = $0010
warp_to TUTORIAL_STARTING_YPOS, TUTORIAL_STARTING_XPOS, DIR_RIGHT, NO_WALKING, 0, THREAD2_DISABLED, IntroMapLoadingScript ; Tutorial entry point
IntroMapBlocks::
INCBIN "maps/intro.blk"
InvisibleTiles::
dwfill 2 * 3 * 4 * 8, $0000 ; (1 "still" set + 1 "moving" set) * 3 directions * 4 tiles * 8 lines
; The NPCs that use these can't be interacted with, so only one side will be coded (two because it's both left and right, left for Evie and mirrored left = right for Tom)
LeftEyeTiles::
dw $F0F0, $F0F0, $68F8, $E8F8, $F0F0, $F0F0, $0000, $8080
dw $9090, $6060, $0000, $0101, $0101, $0101, $0202, $0202
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
RightEyeTiles::
dw $0000, $0101, $0101, $0001, $0001, $0001, $0001, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $83FF, $1FFF, $3CFF, $3CFF, $3FFF, $3FFF, $01C1, $20E0
dw $10F0, $0F3F, $0000, $0000, $0000, $0000, $0000, $0000
IntroMapNPCScripts::
dw IntroNPC0Script
set_text_prefix IntroNPC
IntroNPC0Script::
print_name
print_line_id 0
print_line_id 1
delay 100
text_bankswitch BANK(wIntroMapStatus)
text_lda wIntroMapStatus
text_inc
text_sta wIntroMapStatus
text_bankswitch 1
clear_box
print_line_id 2
close_quick
done
TestNPCTiles::
dw $0000, $0000, $0202, $0404, $0000, $0303, $0407, $080F
dw $101F, $101F, $101F, $101F, $080F, $0407, $0303, $0000
dw $0000, $0000, $8080, $4040, $0000, $C0C0, $20E0, $10F0
dw $08F8, $08F8, $08F8, $08F8, $10F0, $20E0, $C0C0, $0000
dw $0000, $0000, $0202, $0404, $0000, $0303, $0407, $0A0F
dw $121F, $121F, $101F, $101F, $090F, $0407, $0303, $0000
dw $0000, $0000, $8080, $4040, $0000, $C0C0, $20E0, $90F0
dw $88F8, $88F8, $08F8, $48F8, $90F0, $20E0, $C0C0, $0000
dw $0000, $0000, $0404, $0202, $0000, $0303, $0407, $080F
dw $141F, $141F, $141F, $101F, $0A0F, $0407, $0303, $0000
dw $0000, $0000, $0000, $0000, $0000, $C0C0, $20E0, $10F0
dw $08F8, $08F8, $08F8, $08F8, $10F0, $20E0, $C0C0, $0000
TestNPCWalkingTiles::
dw $0202, $0404, $0000, $0303, $0407, $080F, $101F, $101F
dw $101F, $101F, $080F, $0407, $0303, $0000, $0000, $0000
dw $8080, $4040, $0000, $C0C0, $20E0, $10F0, $08F8, $08F8
dw $08F8, $08F8, $10F0, $20E0, $C0C0, $0000, $0000, $0000
dw $0202, $0404, $0000, $0303, $0407, $0A0F, $121F, $101F
dw $131F, $121F, $090F, $0407, $0303, $0000, $0000, $0000
dw $8080, $4040, $0000, $C0C0, $20E0, $90F0, $88F8, $08F8
dw $C8F8, $48F8, $90F0, $20E0, $C0C0, $0000, $0000, $0000
dw $0404, $0202, $0000, $0303, $0407, $080F, $141F, $141F
dw $101F, $181F, $0407, $0407, $0303, $0000, $0000, $0000
dw $0000, $0000, $0000, $C0C0, $20E0, $10F0, $08F8, $08F8
dw $08F8, $08F8, $10F0, $20E0, $C0C0, $0000, $0000, $0000
; The caracter selection screen is actually part of the intro map (who would've known)
; The first loading script basically resets the tutorial
CharSelectLoadingScript::
ld a, BANK(wIntroMapStatus)
call SwitchRAMBanks
xor a ; Initialize the map's status
ld [wIntroMapStatus], a
ld [wIntroMapDelayStep], a
ldh [hOverworldButtonFilter], a
inc a
call SwitchRAMBanks
ld hl, GrayPalette
ld de, wBGPalette0_color0
ld bc, (BANK(GrayPalette) << 8) | (wBGPalette1_color0 - wBGPalette0_color0)
call CopyAcrossLite
jp PreventJoypadMovement ; Prevent player's movement, joypad input will only be used for the charselect, not to move the player
; Second loading script ; using a warp is more practical (notably because it provides an automated fade with some code exec in the middle)
; Also because it helps setting the map to a known state before the player is allowed to see the player even once
IntroMapLoadingScript::
callacross LoadPlayerGraphics ; Load the correct graphics
; Problem is, BG and OBJ palettes 0 is now non-black ! We need to fix this.
ld a, $80
ld [rBGPI], a
ld [rOBPI], a
ld b, 8
.writeBlackPalette
rst isVRAMOpen
jr nz, .writeBlackPalette
xor a
ld [rBGPD], a
ld [rOBPD], a
dec b
jr nz, .writeBlackPalette
xor a ; Close the textbox that was left open by the previous script
ld [wTextboxStatus], a
jp AllowJoypadMovement ; Cancel above prevention
; The map script is basically a dispatcher, which either calls a function or processes some text depending on wIntroMapStatus
IntroMapScript::
ld a, BANK(wIntroMapStatus)
call SwitchRAMBanks
ld a, [wIntroMapStatus] ; Read the index
ld b, a ; Save for both dispatching and advancing status
; Calculate status script pointer
and %1111 ; Only bits 0-3 are used for status
add a, a ; This is pretty standard, 2 bytes per pointer
add a, LOW(IntroScripts)
ld l, a
ld h, HIGH(IntroScripts) ; hl points to the next pointer (the purpose / usage of which differs based on index parity)
; Note : this assumes there's no carry. May not be true, if then move the pointer array around
; Depending on status parity, the pointer should be interpreted differently
bit 0, b ; If it's an even status, it's a text pointer
jr nz, .runSpecificScript ; If it's an odd status, it's a code pointer
inc b ; The text should only pop once
ld a, b
ld [wIntroMapStatus], a ; So we increment the status!
; Now, we process the text
ld c, BANK(IntroTexts)
ld a, [hli]
ld d, [hl]
ld e, a
jpacross ProcessText_Hook
.runSpecificScript
ld a, [hli]
ld h, [hl]
ld l, a
or h ; Check if that's not a NULL
jr nz, @+1 ; No script, don't run it
ld a, 1
jp SwitchRAMBanks
;SECTION "Intro map scripts", ROMX,ALIGN[5]
IntroChooseGender::
ld a, [wIntroMapDelayStep]
cp 20 ; Delay for a few frames to avoid A button spam skipping the sequence
jr z, .doneDelaying
ld b, a
ldh a, [hPressedButtons]
and BUTTON_A
ld a, b
jr z, .aNotPressed
xor a ; If A is pressed, reset the count : this makes spamming A less likely to accidentally skip the whole sequence
.aNotPressed
inc a ; Acknowledge one frame of delay
ld [wIntroMapDelayStep], a
cp 10 ; Halfway through, apply gray to a player
ret nz
ld a, [wPlayerGender]
and a
ret z ; Don't gray out Evie (this could happen if pressing A after graying out once)
; Gray out Tom
xor a
ldh [hOverworldPressedButtons], a ; Make sure no action will be taken
jr .toggleGender ; Gender loaded by default save file is Tom, so this will gray him out
.doneDelaying ; Run actual code
ld a, [wPlayerGender]
and a ; Z = Evie
ldh a, [hPressedButtons]
ldh [hOverworldPressedButtons], a
jr nz, .checkLeft ; Tom checks DPAD_LEFT, Evie checks DPAD_RIGHT
add a, a ; Roll DPAD_RIGHT into DPAD_LEFT
.checkLeft
and DPAD_LEFT ; Check if player has pressed the button that changes gender
jr z, .dontToggleGender
.toggleGender ; Hook for above
callacross ReloadPalettes ; Cancel previous "gray" effect (this is overkill but smaller code than reloading only the two palettes)
ld hl, wPlayerGender
ld a, [hl] ; Retrieve currently chosen gender
ld e, a ; Store it for gray out effect
xor 1 ; Flip gender
ld [hl], a
; Little explanation here :
; There are 2 palettes per player
; 1 palette is 4 colors
; In the GBC's memory, 1 color is 2 bytes large (post-processed size)
; In the game's storage, 1 color is 3 bytes large (pre-processing size)
; Thus, there are 2 * 4 * 2 bytes = 16 bytes per player in the GBC's memory
; and there are 2 * 4 * 3 bytes = 24 bytes per player in the game's storage
; e = gender
swap e ; e = gender * 16
ld a, e
add a, $80 | 32 ; This sets the base offset and sets the auto-increment bit
ld [rBGPI], a
ld a, e ; e = gender * 16
rrca ; a = gender * 8
add a, e ; a = gender * 24
ld hl, wBGPalette4_color0
add a, l
ld l, a
; Coming right up is graying out the two palettes of the character that's not chosen
ld e, 8 ; Two palettes, thus 8 colors
.grayOutOneColor ; Not using the built-in func, since this one needs to darken the character
; Recipe to gray out a color :
; 1. Sum the three shades in the color (R, G, B)
; 2. Divide that by 3, thusly getting the mean of the shades
; 3. Write that shade as the R, G and B shades
; Explanation : step 3 produces a grey color.
; Steps 1 and 2 ensure it's as close to the original color as possible.
; (It's probably possible to do slightly better in some cases, but this looks good enough)
ld a, [hli] ; Step 1 : sum
add [hl]
inc hl
add [hl]
inc hl
call DivideBy3 ; Step 2 : divide by 3
ld a, c ; Step 2.5 : we're going to darken the "inactive" character to emphasis a bit on it being "inactive"
cp $1F
jr z, .dontCap ; Don't darken white, it creates a weird outline (and doesn't make sense visually)
sub 4 ; Remove some intensity, this is purely arbitrary, but heh
jr nc, .dontCap
xor a
.dontCap
ld c, a ; Step 3 : convert the 3-byte format into the GBC's 2-byte one
and %111 ; Not going to comment it. You can easily figure it out.
rrca
rrca
rrca
or c
ld d, a ; Store for later
ld a, c
and %11000
rlca
rlca
rlca
or c
rlca
rlca
ld c, a
.waitVRAM
rst isVRAMOpen
jr nz, .waitVRAM
ld a, d
ld [rBGPD], a ; We write both bytes as shortly as possible to avoid doing so on different scanlines,
ld a, c
ld [rBGPD], a ; which produces "parasitic" colors (even more since the green shade is split across both bytes)
dec e
jr nz, .grayOutOneColor
.dontToggleGender
ldh a, [hOverworldPressedButtons]
and BUTTON_A | BUTTON_START | BUTTON_SELECT
ret z ; Don't advance status if A or START or SELECT aren't pressed
; Gender has been chosen!
inc b
ld a, b
ld [wIntroMapStatus], a ; Advance status
xor a ; Reset the delay counter for the following statuses
ld [wIntroMapDelayStep], a
; Apply gray effect to the palette in the palette array, otherwise color will suddenly re-appear during fade-out
ld hl, wBGPalette4_color0
ld a, [wPlayerGender]
and a
jr nz, .grayTom
ld l, wBGPalette6_color0 & $FF
.grayTom
ld b, 4 * 2 ; Gray two palettes, ie. 2 times 4 colors
.grayOneColor
ld a, [hli]
add a, [hl]
inc hl
add a, [hl]
dec hl
dec hl
call DivideBy3
ld a, c
cp $1F
jr z, .dontDarken
sub 4
jr nc, .dontDarken ; If there is an underflow, "cap" at black
xor a
.dontDarken
ld c, 3
rst fill
dec b
jr nz, .grayOneColor
ret
IntroFadeToNarrator::
inc b
ld a, b
ld [wIntroMapStatus], a
ld a, 1
ldh [hIgnorePlayerActions], a
; Reload map with warp-to #1
ld [wTargetWarpID], a ; Which sets things for the "tutorial" part instead of the "charselect" one
inc a
jp LoadMap
IntroResetDelayStep::
; Check if player is still at its starting position
; If warp-to #1's position is modified, update these accordingly
ld a, [wYPos]
cp TUTORIAL_STARTING_YPOS
jr nz, .playerMoved
ld a, [wXPos]
cp TUTORIAL_STARTING_XPOS
ret z
.playerMoved
inc b
ld a, b
ld [wIntroMapStatus], a
ret
IntroWaitNextState::
ld a, [wIntroMapDelayStep] ; Holds the frame count when entering this state, used to determine when 256 frames have passed
and a
ld c, a
ldh a, [hOverworldFrameCounter]
; Will trigger twice if the frame counter to be stored is 0
; Except when TASing this game, it wouldn't be a problem :D
jr z, .setDelayStep ; Step is uninitialized,
cp c ; Check if 256 frames passed (~ 4 seconds)
ret nz ; Nope
ld a, [wIntroMapStatus]
bit 6, a ; Check if 256 frames had already passed
ld c, $40
jr z, .first256block ; We're on the 256th frame, set the status flag to remember it
; We're on the 512th frame, go to next state
ld c, $1 - $40
.first256block
add a, c
ld [wIntroMapStatus], a
ret
.setDelayStep
ld [wIntroMapDelayStep], a
ret
IntroCheckStartMenu::
ld a, [wIntroMapStatus] ; Check bit 7, which is set if player answered "no" to previous text
add a, a
jr c, .playerTooSmart
ldh a, [hPressedButtons]
bit 3, a
ret z
ld de, IntroStartMenuText
ld c, BANK(IntroStartMenuText)
callacross ProcessText_Hook
ld a, 3
ld [wFadeSpeed], a
.playerTooSmart
ld a, $F9
ldh [hOverworldButtonFilter], a
pop bc ; Remove the return address, since LoadMap will return with the wrong ROM bank. Also, switching RAM banks back is done by LoadMap anyways
ld a, 1
ldh [hIgnorePlayerActions], a ; Prevent the player from moving so the cutscene has time to trigger
; ld a, 1
ld [wTargetWarpID], a ; Go to the player house's warp #1
ld a, MAP_PLAYER_HOUSE_2F
jp LoadMap
SECTION "Intro map texts", ROMX
IntroTexts::
set_text_prefix IntroBoyGirl
IntroBoyGirlText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
clear_box
print_line_id 3
print_line_id 4
print_line_id 5
wait_user
clear_box
print_line_id 6
delay 60
print_line_id 7
wait_user
clear_box
print_line_id 8
wait_user
print_line_id 9
print_line_id 10
print_line_id 11
wait_user
done
set_text_prefix IntroChoseGender
IntroChoseGenderText::
print_pic GameTiles
print_name GameName
print_line_id 0
wait_user
clear_box
print_line_id 1
print_line_id 2
print_line_id 3
wait_user
clear_box
print_line_id 4
print_line_id 5
wait_user
end_with_box
set_text_prefix IntroGreet
IntroGreetText::
disp_box
delay 60
print_line_id 0
wait_user
clear_box
print_line_id 1
print_line_id 2
wait_user
clear_box
print_line_id 3
wait_user
clear_box
print_line_id 4
print_line_id 5
wait_user
done
set_text_prefix IntroPressA
IntroPressAText::
delay 5
disp_box
print_line_id 0
delay 60
print_line_id 1
print_line_id 2
print_line_id 3
wait_user
done
set_text_prefix IntroObjectNeeded
IntroObjectNeededText::
disp_box
print_line_id 0
print_line_id 1
wait_user
clear_box
print_line_id 2
print_line_id 3
delay 20
.source1
choose YesNoChoice, (.branch1 - .source1)
clear_box
print_line_id 4
delay 60
clear_box
print_line_id 5
wait_user
print_line_id 6
print_line_id 7
print_line_id 8
wait_user
delay 30
text_lda_imm $00
text_sta wNPC1_ypos + 1
text_lda wXPos ; Check if player might intersect NPC
text_cmp $60
.source2
text_jr cond_c, (.branch2 - .source2)
text_lda_imm $50 ; If yes, move NPC to prevent this
text_sta wNPC1_xpos
.branch2
text_asmcall ProcessNPCs
text_lda_imm $F1
text_sta hOverworldButtonFilter
delay 30
print_line_id 9
wait_user
done
.branch1
clear_box
delay 20
print_line_id 10
delay 50
print_line_id 11
delay 50
wait_user
clear_box
print_line_id 12
print_line_id 13
print_line_id 14
wait_user
clear_box
print_line_id 15
text_bankswitch BANK(wIntroMapStatus)
text_lda_imm $8B ; Set bit 7 to flag player as "too smart" and advance to last status
text_sta wIntroMapStatus
text_bankswitch 1
delay 60
print_line_id 16
wait_user
done
set_text_prefix IntroRemovedNPC
IntroRemovedNPCText::
text_lda_imm $FF
text_sta wNPC1_ypos
text_asmcall ProcessNPCs
delay 20
disp_box
print_line_id 0
print_line_id 1
wait_user
clear_box
print_line_id 2
print_line_id 3
wait_user
done
set_text_prefix IntroStartMenu
IntroStartMenuText::
disp_box
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
print_line_id 3
print_line_id 4
print_line_id 5
wait_user
clear_box
print_line_id 6
print_line_id 7
wait_user
instant_str .endingLines
done
.endingLines
dstr "Man I hate"
dstr "this job."
db 0
| 26.372197 | 171 | 0.693533 |
1756156ce43855316506131a6ee78c35b72aa558 | 1,297 | asm | Assembly | programs/oeis/236/A236343.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/236/A236343.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236343.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A236343: Expansion of (1 - x + 2*x^2 - x^3) / ((1 - x)^2 * (1 - x^3)) in powers of x.
; 1,1,3,5,6,9,12,14,18,22,25,30,35,39,45,51,56,63,70,76,84,92,99,108,117,125,135,145,154,165,176,186,198,210,221,234,247,259,273,287,300,315,330,344,360,376,391,408,425,441,459,477,494,513,532,550,570,590,609,630,651,671,693,715,736,759,782,804,828,852,875,900,925,949,975,1001,1026,1053,1080,1106,1134,1162,1189,1218,1247,1275,1305,1335,1364,1395,1426,1456,1488,1520,1551,1584,1617,1649,1683,1717,1750,1785,1820,1854,1890,1926,1961,1998,2035,2071,2109,2147,2184,2223,2262,2300,2340,2380,2419,2460,2501,2541,2583,2625,2666,2709,2752,2794,2838,2882,2925,2970,3015,3059,3105,3151,3196,3243,3290,3336,3384,3432,3479,3528,3577,3625,3675,3725,3774,3825,3876,3926,3978,4030,4081,4134,4187,4239,4293,4347,4400,4455,4510,4564,4620,4676,4731,4788,4845,4901,4959,5017,5074,5133,5192,5250,5310,5370,5429,5490,5551,5611,5673,5735,5796,5859,5922,5984,6048,6112,6175,6240,6305,6369,6435,6501,6566,6633,6700,6766,6834,6902,6969,7038,7107,7175,7245,7315,7384,7455,7526,7596,7668,7740,7811,7884,7957,8029,8103,8177,8250,8325,8400,8474,8550,8626,8701,8778,8855,8931,9009,9087,9164,9243,9322,9400,9480,9560,9639,9720,9801,9881,9963,10045,10126,10209,10292,10374,10458,10542
add $0,1
mov $1,$0
lpb $0
sub $0,3
add $1,$0
lpe
| 129.7 | 1,154 | 0.749422 |
aa65c609243676462b3a45d5afce442fc705c784 | 1,299 | asm | Assembly | programs/oeis/004/A004959.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/004/A004959.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/004/A004959.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A004959: a(n) = ceiling(n*phi^4), where phi is the golden ratio, A001622.
; 0,7,14,21,28,35,42,48,55,62,69,76,83,90,96,103,110,117,124,131,138,144,151,158,165,172,179,186,192,199,206,213,220,227,234,240,247,254,261,268,275,282,288,295,302,309,316,323,329,336,343,350,357,364,371,377,384,391,398,405,412,419,425,432,439,446,453,460,467,473,480,487,494,501,508,515,521,528,535,542,549,556,563,569,576,583,590,597,604,611,617,624,631,638,645,652,658,665,672,679,686,693,700,706,713,720,727,734,741,748,754,761,768,775,782,789,796,802,809,816,823,830,837,844,850,857,864,871,878,885,892,898,905,912,919,926,933,940,946,953,960,967,974,981,987,994,1001,1008,1015,1022,1029,1035,1042,1049,1056,1063,1070,1077,1083,1090,1097,1104,1111,1118,1125,1131,1138,1145,1152,1159,1166,1173,1179,1186,1193,1200,1207,1214,1221,1227,1234,1241,1248,1255,1262,1269,1275,1282,1289,1296,1303,1310,1316,1323,1330,1337,1344,1351,1358,1364,1371,1378,1385,1392,1399,1406,1412,1419,1426,1433,1440,1447,1454,1460,1467,1474,1481,1488,1495,1502,1508,1515,1522,1529,1536,1543,1550,1556,1563,1570,1577,1584,1591,1598,1604,1611,1618,1625,1632,1639,1645,1652,1659,1666,1673,1680,1687,1693,1700,1707
mov $2,$0
mul $0,6
cal $0,189662 ; Positions of 0 in A189661; complement of A026356.
mov $1,$0
div $1,2
mov $3,$2
mul $3,2
add $1,$3
| 108.25 | 1,088 | 0.749808 |
a026eef6d74aad31ad45c15a92321e998cc9a013 | 249 | asm | Assembly | oeis/282/A282429.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/282/A282429.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/282/A282429.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A282429: List of distinct terms of A282026.
; Submitted by Jamie Morken(s2)
; 1,2,4,5,7,8,11,13,14,16,17,19,22,23,26,28,29,31
mov $2,$0
div $0,2
seq $0,25768 ; Expansion of 1/((1-x)*(1-x^3)*(1-x^7)).
add $0,$2
mul $0,6
add $0,3
div $0,4
sub $0,1
| 19.153846 | 54 | 0.614458 |
3f6dbf2cbaf9a57c27c3af19812ae7ea54889a70 | 555 | asm | Assembly | oeis/017/A017043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017043: a(n) = (7*n + 5)^3.
; 125,1728,6859,17576,35937,64000,103823,157464,226981,314432,421875,551368,704969,884736,1092727,1331000,1601613,1906624,2248091,2628072,3048625,3511808,4019679,4574296,5177717,5832000,6539203,7301384,8120601,8998912,9938375,10941048,12008989,13144256,14348907,15625000,16974593,18399744,19902511,21484952,23149125,24897088,26730899,28652616,30664297,32768000,34965783,37259704,39651821,42144192,44738875,47437928,50243409,53157376,56181887,59319000,62570773,65939264,69426531,73034632,76765625
mul $0,7
add $0,5
pow $0,3
| 79.285714 | 495 | 0.830631 |
f7fb4371c2dbac2cb4382439933f5bde132d810a | 895 | asm | Assembly | asm/grfics3.asm | metlinskyi/archive | b8882c4391b38d8021b02aa435e7225f6ee88a5b | [
"Unlicense"
] | null | null | null | asm/grfics3.asm | metlinskyi/archive | b8882c4391b38d8021b02aa435e7225f6ee88a5b | [
"Unlicense"
] | null | null | null | asm/grfics3.asm | metlinskyi/archive | b8882c4391b38d8021b02aa435e7225f6ee88a5b | [
"Unlicense"
] | null | null | null | RED EQU 04h
GREEN EQU 02h
LIGHTRED EQU 0Ch
LIGHTGREEN EQU 0Ah
LIGTHBLUE EQU 09h
DATASG SEGMENT PARA 'Data'
STRING DB 'LUCKY'
DATASG ENDS
CODESG SEGMENT PARA 'Code'
ASSUME CS: CODESG, DS:DATASG, SS: CODESG
ORG 100H
MAIN PROC NEAR
;------------ VIDEO MODE ---------------------------
MOV AH,00H
MOV AL,0DH
INT 10H
;---------------------------------------------------
;-------------- OUT TEXT ---------------------------
;-------------- DRAW LINE --------------------------
;------------- E X I T ----------------------------
;key press
exit: MOV AH,00H
INT 16H
;init text mode
MOV AH,00
MOV AL,03H
INT 10H
;quit programm:
MOV AL,0
MOV AH,04CH
INT 21H
RET
MAIN ENDP
CODESG ENDS
END
| 19.042553 | 52 | 0.385475 |
0e8a4d7f200f6376f3654ed3a91d26d4896abab9 | 2,134 | asm | Assembly | sem1/asc/MAC/a.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | sem1/asc/MAC/a.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | sem1/asc/MAC/a.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | bits 32
global start
extern exit , printf
import exit msvcrt.dll
import printf msvcrt.dll
segment data use32 class=data
n db "2a6" , 0
lng dd 3
rezultat dd 0
copie dd -1
mesaj db "Numarul convertit este : %d " , 0
segment code use32 class=code
start:
mov esi , n
mov ecx , dword[lng]
repeta:
xor eax , eax
lodsb
cmp al , '9'
ja is_letter
sub al , '0'
jmp conversie
is_letter:
cmp al , 'a'
je a_letter
cmp al , 'b'
je b_letter
cmp al , 'c'
je c_letter
cmp al , 'd'
je d_letter
cmp al , 'e'
je e_letter
cmp al , 'f'
je f_letter
a_letter:
mov al , 10
jmp conversie
b_letter:
mov al , 11
jmp conversie
c_letter:
mov al , 12
jmp conversie
d_letter:
mov al , 13
jmp conversie
e_letter:
mov al , 14
jmp conversie
f_letter:
mov al , 15
conversie:
mov dword[copie] , ecx
dec ecx
cmp ecx , 0
je ultima_poz
shiftare:
shl eax , 4
loop shiftare
ultima_poz:
xor ebx , ebx
mov ebx , dword[rezultat]
add ebx , eax
mov dword[rezultat] , ebx
mov ecx , dword[copie]
loop repeta
push dword [rezultat]
push dword mesaj
call [printf]
add esp , 4*2
push dword 0
call [exit]
| 23.450549 | 47 | 0.354264 |
28510945a0a5f7d2147c39df551b2fef54da6c7e | 169 | asm | Assembly | src/proc/tss.asm | Greyrat7490/haiirOS | 39959c33072a25247b2e17376d11d37cd2c75068 | [
"MIT"
] | 1 | 2021-10-10T09:30:42.000Z | 2021-10-10T09:30:42.000Z | src/proc/tss.asm | Greyrat7490/haiirOS | 39959c33072a25247b2e17376d11d37cd2c75068 | [
"MIT"
] | null | null | null | src/proc/tss.asm | Greyrat7490/haiirOS | 39959c33072a25247b2e17376d11d37cd2c75068 | [
"MIT"
] | null | null | null | [BITS 64]
section .text
global flush_tss
; GDT_TSS = 0x30
flush_tss:
mov ax, 0x30 ; requested privilege level is 0 (bits 0 and 1 are 0)
ltr ax
ret
| 14.083333 | 77 | 0.639053 |
da65f1d48591c300b481967c5e87cce7ceaedfc1 | 900 | asm | Assembly | i8254x/receive.asm | ssebs/xos | 8c50cb7753690ad67696131a8b9935947e1a8075 | [
"MIT"
] | 15 | 2020-05-02T22:04:24.000Z | 2021-08-31T16:56:59.000Z | i8254x/receive.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | null | null | null | i8254x/receive.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | 1 | 2019-07-20T10:10:36.000Z | 2019-07-20T10:10:36.000Z |
; Intel i8254x-series Network Driver for xOS
; Heavily based on BareMetal i8254x driver, by Ian Seyler
; https://github.com/ReturnInfinity/BareMetal-OS
use32
; receive:
; Receives a packet
; In\ EBX = Buffer to receive
; Out\ EAX = Number of bytes received
receive:
mov [.buffer], ebx
mov esi, [rx_buffer]
mov ax, [esi+12] ; status
test ax, 1 ; DD
jz .zero
and word[esi+12], not 1 ; clear DD
mov ecx, 0
mov esi, [rx_buffer]
mov cx, [esi+8] ; length
mov [.length], ecx
mov esi, [receive_buffer]
mov edi, [.buffer]
mov ecx, [.length]
rep movsb
mov eax, [receive_buffer]
mov ebp, XOS_VIRTUAL_TO_PHYSICAL
int 0x61
mov edi, [rx_buffer]
stosd
mov eax, 0
stosd
;stosd
;stosd
mov edi, [mmio]
mov eax, 0
mov [edi+I8254X_REG_RDH], eax
inc eax
mov [edi+I8254X_REG_RDT], eax
mov eax, [.length]
ret
.zero:
mov eax, 0
ret
align 4
.buffer dd 0
.length dd 0
| 14.754098 | 57 | 0.671111 |
56b2d847b22ed223a227896743347bf0aaeb22ff | 3,536 | asm | Assembly | audio/music/trainervictory.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | audio/music/trainervictory.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | audio/music/trainervictory.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | Music_TrainerVictory:
musicheader 3, 1, Music_TrainerVictory_Ch1
musicheader 1, 2, Music_TrainerVictory_Ch2
musicheader 1, 3, Music_TrainerVictory_Ch3
Music_TrainerVictory_Ch1:
tempo 120
volume $77
dutycycle $2
tone $0001
notetype $8, $b1
octave 4
note E_, 2
note E_, 2
note E_, 2
note E_, 2
note F#, 2
note G_, 2
intensity $b6
note A_, 12
stereopanning $f
Music_TrainerVictory_branch_ebecd:
intensity $72
callchannel Music_TrainerVictory_branch_ebf11
intensity $51
note C#, 2
note E_, 2
note F#, 2
note A_, 2
note B_, 2
octave 4
note C#, 2
intensity $72
octave 3
note A_, 2
note __, 2
octave 4
note C#, 2
note E_, 6
loopchannel 2, Music_TrainerVictory_branch_ebecd
callchannel Music_TrainerVictory_branch_ebf11
note A_, 2
note __, 2
note F_, 2
note A_, 6
note A#, 2
note __, 2
note G_, 2
note A#, 6
Music_TrainerVictory_branch_ebef2:
intensity $72
octave 4
note D_, 2
note C#, 2
octave 3
note A_, 2
loopchannel 3, Music_TrainerVictory_branch_ebef2
note F#, 2
note A_, 2
octave 4
note D_, 2
Music_TrainerVictory_branch_ebf01:
octave 4
note C#, 2
octave 3
note B_, 2
note A_, 2
loopchannel 3, Music_TrainerVictory_branch_ebf01
note E_, 2
note F#, 2
note G_, 2
loopchannel 0, Music_TrainerVictory_branch_ebecd
Music_TrainerVictory_branch_ebf11:
octave 3
note F#, 2
note __, 2
note D_, 2
note F#, 6
note G_, 2
note __, 2
note E_, 2
note G_, 6
endchannel
Music_TrainerVictory_Ch2:
vibrato $12, $34
dutycycle $3
notetype $8, $d1
octave 4
note A_, 2
note A_, 2
note A_, 2
note A_, 2
note B_, 2
octave 5
note C#, 2
intensity $d6
note D_, 12
stereopanning $f0
Music_TrainerVictory_branch_ebf30:
notetype $8, $82
callchannel Music_TrainerVictory_branch_ebf56
note F#, 2
note __, 2
note G_, 2
note A_, 6
note E_, 2
note __, 2
note F#, 2
note G_, 6
loopchannel 2, Music_TrainerVictory_branch_ebf30
callchannel Music_TrainerVictory_branch_ebf56
note F_, 2
note __, 2
note C_, 2
note F_, 6
note G_, 2
note __, 2
note D_, 2
note G_, 6
notetype $c, $88
note F#, 16
note E_, 16
loopchannel 0, Music_TrainerVictory_branch_ebf30
Music_TrainerVictory_branch_ebf56:
octave 4
note D_, 2
note __, 2
octave 3
note A_, 2
octave 4
note D_, 6
note E_, 2
note __, 2
octave 3
note B_, 2
octave 4
note E_, 6
endchannel
Music_TrainerVictory_Ch3:
notetype $8, $25
octave 3
note G_, 6
note G_, 1
note __, 1
note G_, 1
note __, 1
note G_, 1
note __, 1
note F#, 6
note D_, 2
note C#, 2
octave 2
note B_, 2
Music_TrainerVictory_branch_ebf74:
callchannel Music_TrainerVictory_branch_ebfb1
octave 3
note C#, 2
note __, 2
note C#, 2
note A_, 2
note F#, 2
note C#, 2
octave 2
note A_, 2
note __, 2
octave 3
note A_, 1
note __, 1
note A_, 6
loopchannel 2, Music_TrainerVictory_branch_ebf74
callchannel Music_TrainerVictory_branch_ebfb1
octave 3
note C_, 2
note __, 2
note C_, 2
note A_, 2
note F_, 2
note C_, 2
note D_, 2
note __, 2
note D_, 2
octave 4
note D_, 2
octave 3
note A#, 2
note G_, 2
note D_, 2
note F#, 2
note A_, 2
octave 4
note D_, 12
octave 3
note A_, 2
note F#, 2
note D_, 2
octave 2
note A_, 2
octave 3
note D_, 2
note E_, 2
note A_, 12
note G_, 2
note E_, 2
note C#, 2
loopchannel 0, Music_TrainerVictory_branch_ebf74
Music_TrainerVictory_branch_ebfb1:
octave 2
note A_, 2
note __, 2
note A_, 2
octave 3
note F#, 2
note D_, 2
octave 2
note A_, 2
note B_, 2
note __, 2
note B_, 2
octave 3
note G_, 2
note E_, 2
octave 2
note B_, 2
endchannel
| 15.373913 | 49 | 0.709276 |
93a984315933c66dad725170cd2334264b11168c | 1,530 | asm | Assembly | Driver/Printer/PrintCom/Text/textPrintRaw.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PrintCom/Text/textPrintRaw.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PrintCom/Text/textPrintRaw.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: Printer Drivers
FILE: textPrintRaw.asm
AUTHOR: Dave Durran
ROUTINES:
Name Description
---- -----------
PrintRaw Send raw bytes to the printer
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 3/1/90 Initial revision
Dave 3/92 Moved in a bunch of common test routines
Dave 5/92 Parsed up printcomText.asm
DESCRIPTION:
$Id: textPrintRaw.asm,v 1.1 97/04/18 11:50:04 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintRaw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: PrintRaw sends a buffer of bytes to the printer
CALLED BY: GLOBAL
PASS: bp - Segment of PSTATE
dx:si - buffer to send
cx - byte count
RETURN: carry - set if some error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 02/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintRaw proc far
uses es,ds
.enter
; just send the buffer on
mov es,bp ; get PSTATE seg.
mov ds, dx ; ds -> buffer
call PrintStreamWrite
.leave
ret
PrintRaw endp
| 20.958904 | 79 | 0.481699 |
916224bd5333a598a280969b12cf5e2d2c3f245f | 687 | asm | Assembly | oeis/318/A318833.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/318/A318833.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/318/A318833.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A318833: a(n) = n + A023900(n).
; Submitted by Jon Maiga
; 2,1,1,3,1,8,1,7,7,14,1,14,1,20,23,15,1,20,1,24,33,32,1,26,21,38,25,34,1,22,1,31,53,50,59,38,1,56,63,44,1,30,1,54,53,68,1,50,43,54,83,64,1,56,95,62,93,86,1,52,1,92,75,63,113,46,1,84,113,46,1,74,1,110,83,94,137,54,1,84,79,122,1,72,149,128,143,98,1,82,163,114,153,140,167,98,1,104,119,104
add $0,1
mov $1,1
mov $3,$0
mov $4,$0
lpb $3
sub $2,2
mov $5,$4
mov $6,0
lpb $5
sub $3,1
add $6,1
mov $7,$0
div $0,$2
mod $7,$2
cmp $7,0
sub $5,$7
lpe
cmp $6,0
cmp $6,0
mov $7,$2
add $7,1
pow $7,$6
mul $1,$7
add $2,1
mov $7,$0
cmp $7,1
cmp $7,0
sub $3,$7
lpe
add $4,$1
mov $0,$4
| 19.083333 | 287 | 0.541485 |
640131a9caa3c84d69ccd0893bc8b58e5b03c486 | 180 | asm | Assembly | target/analysis/Func004028E4.asm | katahiromz/DecodersTatami | 74df450ff66e28d9c7d185b5b4a064aa74c250b2 | [
"MIT"
] | 3 | 2021-06-27T13:11:40.000Z | 2021-06-28T13:08:29.000Z | target/analysis/Func004028E4.asm | katahiromz/DecodersTatami | 74df450ff66e28d9c7d185b5b4a064aa74c250b2 | [
"MIT"
] | 1 | 2021-06-28T13:48:17.000Z | 2021-06-28T13:48:17.000Z | target/analysis/Func004028E4.asm | katahiromz/DecodersTatami | 74df450ff66e28d9c7d185b5b4a064aa74c250b2 | [
"MIT"
] | 2 | 2021-06-27T14:26:41.000Z | 2021-10-06T04:51:46.000Z | proc imp.msvcrt.dll!_cexit Label_004028E4
attrs [[jumponly]]
# call_from : 004014C0
Label_004028E4:
004028E4: FF 25 C4 61 40 00 : jmp dword [0x4061c4]
end proc
| 25.714286 | 70 | 0.683333 |
875f4325187f4bd6b969dcd7aea25364c9a3aecf | 6,638 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_207.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_21829_207.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_21829_207.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 %r9
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x8d3c, %rsi
lea addresses_A_ht+0xeaac, %rdi
nop
nop
nop
nop
nop
add %rax, %rax
mov $15, %rcx
rep movsq
nop
nop
xor $3066, %r9
lea addresses_D_ht+0x448c, %rsi
lea addresses_WT_ht+0xadec, %rdi
nop
nop
nop
nop
and $24162, %rbp
mov $8, %rcx
rep movsb
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0x12668, %rcx
nop
nop
xor $60635, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%rcx)
nop
nop
nop
nop
nop
inc %rsi
lea addresses_normal_ht+0xc2ab, %rdi
nop
nop
add $34143, %rbx
mov (%rdi), %bp
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x68ac, %rbp
clflush (%rbp)
nop
nop
nop
sub %rsi, %rsi
movb (%rbp), %cl
nop
nop
nop
add %rsi, %rsi
lea addresses_UC_ht+0xb4cc, %rcx
nop
add %rsi, %rsi
movw $0x6162, (%rcx)
nop
nop
nop
dec %rax
lea addresses_D_ht+0x1dac, %rsi
lea addresses_WC_ht+0x5b76, %rdi
dec %rax
mov $59, %rcx
rep movsl
sub $56416, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rdi
push %rdx
push %rsi
// Store
lea addresses_RW+0x9eac, %r13
nop
and $39385, %r12
movl $0x51525354, (%r13)
nop
nop
nop
add %rdx, %rdx
// Store
lea addresses_D+0x14968, %rdi
sub $28896, %rsi
movb $0x51, (%rdi)
and %r15, %r15
// Store
lea addresses_WC+0x346c, %rsi
add %rdi, %rdi
movb $0x51, (%rsi)
nop
nop
nop
nop
and %rdi, %rdi
// Store
lea addresses_D+0x13f64, %r15
nop
nop
nop
nop
nop
dec %r12
mov $0x5152535455565758, %rsi
movq %rsi, (%r15)
nop
nop
nop
nop
nop
sub %r10, %r10
// Faulty Load
lea addresses_normal+0x14aac, %rsi
clflush (%rsi)
nop
nop
cmp $421, %rdx
mov (%rsi), %r15w
lea oracles, %r12
and $0xff, %r15
shlq $12, %r15
mov (%r12,%r15,1), %r15
pop %rsi
pop %rdx
pop %rdi
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 1}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 1}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 35.308511 | 2,999 | 0.655318 |
c11d26b8f79441c8c77261bb76d7eb563d5cd814 | 5,214 | asm | Assembly | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_clone.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_clone.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_clone.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"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.Implements\Palmtree.Math.Core.Implements\pmc_clone.c
.686P
.XMM
include listing.inc
.model flat
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
__15109A3D_pmc_clone@c DB 01H
msvcjmc ENDS
PUBLIC _Initialize_Clone
PUBLIC _PMC_Clone_X@8
PUBLIC __JustMyCode_Default
EXTRN _CheckNumber:PROC
EXTRN _DuplicateNumber:PROC
EXTRN @_RTC_CheckStackVars@8:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN __RTC_CheckEsp:PROC
EXTRN __RTC_InitBase:PROC
EXTRN __RTC_Shutdown:PROC
EXTRN _number_zero:BYTE
; 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
; 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
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_clone.c
_TEXT SEGMENT
_no$ = -16 ; size = 4
_result$ = -8 ; size = 4
_nx$ = -4 ; size = 4
_x$ = 8 ; size = 4
_o$ = 12 ; size = 4
_PMC_Clone_X@8 PROC
; 38 : {
push ebp
mov ebp, esp
sub esp, 20 ; 00000014H
mov eax, -858993460 ; ccccccccH
mov DWORD PTR [ebp-20], eax
mov DWORD PTR [ebp-16], eax
mov DWORD PTR [ebp-12], eax
mov DWORD PTR [ebp-8], eax
mov DWORD PTR [ebp-4], eax
mov ecx, OFFSET __15109A3D_pmc_clone@c
call @__CheckForDebuggerJustMyCode@4
; 39 : if (x == NULL)
cmp DWORD PTR _x$[ebp], 0
jne SHORT $LN2@PMC_Clone_
; 40 : return (PMC_STATUS_ARGUMENT_ERROR);
or eax, -1
jmp $LN1@PMC_Clone_
$LN2@PMC_Clone_:
; 41 : if (o == NULL)
cmp DWORD PTR _o$[ebp], 0
jne SHORT $LN3@PMC_Clone_
; 42 : return (PMC_STATUS_ARGUMENT_ERROR);
or eax, -1
jmp SHORT $LN1@PMC_Clone_
$LN3@PMC_Clone_:
; 43 : NUMBER_HEADER* nx = (NUMBER_HEADER*)x;
mov eax, DWORD PTR _x$[ebp]
mov DWORD PTR _nx$[ebp], eax
; 44 : PMC_STATUS_CODE result;
; 45 : if ((result = CheckNumber(nx)) != PMC_STATUS_OK)
mov ecx, DWORD PTR _nx$[ebp]
push ecx
call _CheckNumber
add esp, 4
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
je SHORT $LN4@PMC_Clone_
; 46 : return (result);
mov eax, DWORD PTR _result$[ebp]
jmp SHORT $LN1@PMC_Clone_
$LN4@PMC_Clone_:
; 47 : NUMBER_HEADER* no;
; 48 : if (nx->IS_ZERO)
mov edx, DWORD PTR _nx$[ebp]
mov eax, DWORD PTR [edx+24]
shr eax, 1
and eax, 1
je SHORT $LN5@PMC_Clone_
; 49 : no = &number_zero;
mov DWORD PTR _no$[ebp], OFFSET _number_zero
jmp SHORT $LN6@PMC_Clone_
$LN5@PMC_Clone_:
; 50 : else
; 51 : {
; 52 : if ((result = DuplicateNumber(nx, &no)) != PMC_STATUS_OK)
lea ecx, DWORD PTR _no$[ebp]
push ecx
mov edx, DWORD PTR _nx$[ebp]
push edx
call _DuplicateNumber
add esp, 8
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
je SHORT $LN6@PMC_Clone_
; 53 : return (result);
mov eax, DWORD PTR _result$[ebp]
jmp SHORT $LN1@PMC_Clone_
$LN6@PMC_Clone_:
; 54 : }
; 55 : *o = no;
mov eax, DWORD PTR _o$[ebp]
mov ecx, DWORD PTR _no$[ebp]
mov DWORD PTR [eax], ecx
; 56 : #ifdef _DEBUG
; 57 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
mov edx, DWORD PTR _o$[ebp]
mov eax, DWORD PTR [edx]
push eax
call _CheckNumber
add esp, 4
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
je SHORT $LN8@PMC_Clone_
; 58 : return (result);
mov eax, DWORD PTR _result$[ebp]
jmp SHORT $LN1@PMC_Clone_
$LN8@PMC_Clone_:
; 59 : #endif
; 60 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@PMC_Clone_:
; 61 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN12@PMC_Clone_
call @_RTC_CheckStackVars@8
pop eax
pop edx
add esp, 20 ; 00000014H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 8
$LN12@PMC_Clone_:
DD 1
DD $LN11@PMC_Clone_
$LN11@PMC_Clone_:
DD -16 ; fffffff0H
DD 4
DD $LN10@PMC_Clone_
$LN10@PMC_Clone_:
DB 110 ; 0000006eH
DB 111 ; 0000006fH
DB 0
_PMC_Clone_X@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_clone.c
_TEXT SEGMENT
_feature$ = 8 ; size = 4
_Initialize_Clone PROC
; 64 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __15109A3D_pmc_clone@c
call @__CheckForDebuggerJustMyCode@4
; 65 : return (PMC_STATUS_OK);
xor eax, eax
; 66 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_Initialize_Clone ENDP
_TEXT ENDS
END
| 21.281633 | 115 | 0.701189 |
29f72b3ef089acd31dd6a43df08ffff4135b3800 | 1,378 | asm | Assembly | asm/mips/progs/program5.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | 1 | 2017-02-02T12:48:33.000Z | 2017-02-02T12:48:33.000Z | asm/mips/progs/program5.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | null | null | null | asm/mips/progs/program5.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
##Author : Tom Regan <noreply.tom.regan@gmail.com> ##
##Last modified : 2011-07-22 ##
##Description : MIPS assembly program: Calculates factorial ##
## tail-recursively ##
##Modifies : registers : $a0, $v(0, 1), $hi, $lo, $ra ##
##Result : 120 in v1 ##
##########################################################################
#####################################################
##This block is the equivalent of a main function. ##
#####################################################
Main:
addi $a0, $zero, 5 # target (counter)
addi $v1, $zero, 1 #
jal Fact # call the function
addi $v0, $zero, 10 # exit call (delay slot)
syscall #
#####################################################
##This block is a factorial function. ##
#####################################################
Fact:
beq $a0, $zero, Exit # don't do any work if a0 is 0
mult $a0, $v1 #
mflo $v1 # store the result in v1
j Fact #
addi $a0, $a0, -1 # decrement a0
Exit: #
jr $ra #
| 45.933333 | 80 | 0.311321 |
c52baf5f08ddc82e4f23d30d426f2758c1a1fd3b | 586 | asm | Assembly | basic/print_rax.asm | py-paulo/assembly | 55de096dcc1f590169d71a322266bcd71f689ee8 | [
"MIT"
] | null | null | null | basic/print_rax.asm | py-paulo/assembly | 55de096dcc1f590169d71a322266bcd71f689ee8 | [
"MIT"
] | null | null | null | basic/print_rax.asm | py-paulo/assembly | 55de096dcc1f590169d71a322266bcd71f689ee8 | [
"MIT"
] | null | null | null | section .data
codes:
db '0123456789ABCDEF'
section .text
global _start
_start:
MOV rax, 0x1122334455667788
MOV rdi, 1
MOV rdx, 1
MOV rcx, 64
.loop:
PUSH rax
SUB rcx, 4
SAR rax, cl
AND rax, 0xf
LEA rsi, [codes + rax]
MOV rax, 1
PUSH rcx
syscall
POP rcx
POP rax
TEST rcx, rcx
JNZ .loop
MOV rax, 60
XOR rdi, rdi
syscall
; nasm -felf64 print_rax.asm -o bin/print_rax.o; ld -o bin/print_rax bin/print_rax.o; chmod u+x bin/print_rax | 15.837838 | 109 | 0.537543 |
ecb1f8eb95496a9d687cda7a55a9deb94d3d82e6 | 9,720 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_205.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_205.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_205.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xa098, %rsi
lea addresses_UC_ht+0x33d8, %rdi
nop
add $62927, %r13
mov $113, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x26a, %rsi
lea addresses_D_ht+0x1b588, %rdi
nop
nop
nop
nop
and $24529, %r8
mov $51, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $48014, %rcx
lea addresses_WT_ht+0x11ca0, %r15
nop
xor $35930, %r13
vmovups (%r15), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rdi
nop
nop
nop
nop
nop
sub %r13, %r13
lea addresses_WC_ht+0x1d8e8, %rsi
lea addresses_WT_ht+0xc9d8, %rdi
nop
nop
sub $37849, %r10
mov $44, %rcx
rep movsq
nop
nop
nop
nop
dec %r8
lea addresses_D_ht+0x1d8d8, %r8
nop
nop
dec %rdi
mov $0x6162636465666768, %r15
movq %r15, %xmm3
vmovups %ymm3, (%r8)
nop
cmp $60321, %r15
lea addresses_WC_ht+0x15688, %rsi
nop
nop
nop
nop
nop
add $19269, %r13
movb (%rsi), %r15b
nop
nop
nop
nop
nop
and $61990, %rcx
lea addresses_D_ht+0x9df8, %rsi
nop
nop
nop
nop
nop
and $10436, %r15
mov $0x6162636465666768, %r8
movq %r8, %xmm1
and $0xffffffffffffffc0, %rsi
vmovntdq %ymm1, (%rsi)
nop
nop
nop
xor $46358, %r10
lea addresses_UC_ht+0x19590, %rsi
lea addresses_WT_ht+0x7738, %rdi
nop
cmp %r13, %r13
mov $78, %rcx
rep movsl
nop
nop
nop
nop
nop
and %r10, %r10
lea addresses_D_ht+0x181d8, %rsi
lea addresses_A_ht+0x1d458, %rdi
dec %rbp
mov $109, %rcx
rep movsq
add $38867, %rsi
lea addresses_WC_ht+0xb38, %rcx
xor $30125, %r15
mov $0x6162636465666768, %rsi
movq %rsi, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
nop
nop
cmp $187, %r15
lea addresses_normal_ht+0xf418, %rsi
lea addresses_D_ht+0x2274, %rdi
nop
nop
nop
add $37324, %r10
mov $118, %rcx
rep movsq
nop
nop
nop
nop
xor $1065, %r13
lea addresses_D_ht+0x1d5d8, %r13
nop
nop
nop
nop
nop
inc %r8
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
movups %xmm2, (%r13)
nop
nop
nop
nop
nop
sub %r13, %r13
lea addresses_D_ht+0x11fd8, %rsi
lea addresses_UC_ht+0x51d8, %rdi
xor %r8, %r8
mov $13, %rcx
rep movsq
nop
add %rcx, %rcx
lea addresses_UC_ht+0x171d8, %r10
and $61846, %rdi
vmovups (%r10), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rsi
nop
add $7845, %r15
lea addresses_A_ht+0x1168e, %r10
nop
nop
nop
nop
nop
xor $35818, %r8
movw $0x6162, (%r10)
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_WT+0x758, %r9
clflush (%r9)
nop
nop
and %rsi, %rsi
movl $0x51525354, (%r9)
nop
nop
nop
nop
nop
sub $44132, %rdi
// Store
lea addresses_WC+0x8217, %rdx
xor %r12, %r12
movl $0x51525354, (%rdx)
nop
sub $60768, %r12
// REPMOV
lea addresses_WT+0x182b8, %rsi
lea addresses_WC+0x149d8, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
cmp %r10, %r10
mov $84, %rcx
rep movsq
nop
inc %rdx
// Store
lea addresses_A+0x17258, %r12
nop
nop
nop
cmp $43862, %rdx
mov $0x5152535455565758, %rax
movq %rax, (%r12)
nop
nop
xor %rcx, %rcx
// Store
lea addresses_WC+0x185d8, %rax
nop
nop
nop
nop
sub $1997, %r12
movl $0x51525354, (%rax)
and $22811, %r9
// REPMOV
lea addresses_D+0x16718, %rsi
lea addresses_WC+0x4fc0, %rdi
nop
nop
nop
nop
sub %r12, %r12
mov $78, %rcx
rep movsw
nop
nop
cmp %rdi, %rdi
// Faulty Load
lea addresses_normal+0x41d8, %rcx
nop
nop
inc %rsi
movups (%rcx), %xmm2
vpextrq $1, %xmm2, %rdi
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT', 'congruent': 6}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_A', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_D'}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 1}}
{'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 6}, 'OP': 'STOR'}
{'dst': {'same': True, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 0}, 'OP': 'STOR'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 29.815951 | 2,999 | 0.657407 |
3b48b59c1789aa8c9b576a63f9aa0117fbd0efd0 | 234 | asm | Assembly | programs/oeis/110/A110847.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/110/A110847.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/110/A110847.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A110847: Weight enumerator of [32,31,2] Reed-Muller code RM(4,5).
; 1,496,35960,906192,10518300,64512240,225792840,471435600,601080390,471435600,225792840,64512240,10518300,906192,35960,496,1
mul $0,2
mov $1,32
bin $1,$0
mov $0,$1
| 29.25 | 125 | 0.752137 |
e4cd3c02d1c1b109c0aaa827e17b0bb4e619611d | 2,243 | asm | Assembly | program.elf.x64.asm | sourcedennis/small-hello-world | 0a700459e10e6fdfa44c89ac8a484a6ab0e3768f | [
"Unlicense"
] | null | null | null | program.elf.x64.asm | sourcedennis/small-hello-world | 0a700459e10e6fdfa44c89ac8a484a6ab0e3768f | [
"Unlicense"
] | null | null | null | program.elf.x64.asm | sourcedennis/small-hello-world | 0a700459e10e6fdfa44c89ac8a484a6ab0e3768f | [
"Unlicense"
] | null | null | null | BITS 64
; ELF header
ehdr:
db 0x7F, "ELF" ; magic
db 2 ; 64-bit
db 1 ; little endian
db 1 ; ELF version, always 1
db 0x03 ; target Linux
times 8 db 0 ; padding
dw 0x02 ; executable
dw 0x3E ; x86-64 machine
dd 0x01 ; ELF version, always 1
dq _start ; execution entry (in memory)
dq phdr-ehdr ; program header (in file)
dq 0 ; section header table
dd 0 ; flags
dw ehdrsize ; size of this ELF header
dw phdrsize ; size of the program header table entry
dw 1 ; number of program headers
dw 0 ; size of the section header table entry
dw 0 ; number of sections headers
dw 0 ; name section index: no names section
ehdrsize equ $ - ehdr
; Program header
phdr:
dd 0x01 ; loadable segment
dd 5 ; read+execute segment
dq codestart ; segment content offset (in file)
dq _start ; virtual address in memory
dq _start ; physical address in memory
dq codesegsize ; size in the file
dq codesegsize ; size in memory
dq 0x1000 ; alignment
phdrsize equ $ - phdr
codestart equ $ - ehdr
; Code segment
_start:
org 0x400000
; the file start is at memory location 0x400000
; the code loads at 0x400078. this is necessary to ensure 0x1000
; alignment. (on my machine, lower alignments give segfaults)
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, msglen
syscall
mov rax, 60
mov rdi, 0
syscall
; data
msg: db "Hello, World",10
msglen equ $ - msg
codesegsize equ $ - _start
| 34.507692 | 76 | 0.444494 |
f20871d188e4d24c8e5f08cde6b130edbf6ea23f | 488 | asm | Assembly | libsrc/target/gb/gbdk/posy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/gb/gbdk/posy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/gb/gbdk/posy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE posy
SECTION code_driver
PUBLIC posy
PUBLIC _posy
EXTERN __mode
EXTERN __console_y
EXTERN tmode
INCLUDE "target/gb/def/gb_globals.def"
; int8_t posy(void);
posy:
_posy: ; Banked
LD A,(__mode)
AND T_MODE
JR NZ,posy_1
PUSH BC
CALL tmode
POP BC
posy_1:
LD A,(__console_y)
LD E,A
ld l,a
ld h,0
RET
| 15.25 | 46 | 0.47541 |
17fa753f5285617fbc9736fcb5029f55fb6f9f21 | 9,562 | asm | Assembly | Transynther/x86/_processed/US/_ht_st_zr_/i3-7100_9_0x84_notsx.log_10508_1484.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_ht_st_zr_/i3-7100_9_0x84_notsx.log_10508_1484.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_ht_st_zr_/i3-7100_9_0x84_notsx.log_10508_1484.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 %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x5dee, %rsi
add $29326, %rbx
vmovups (%rsi), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
nop
nop
nop
inc %r9
lea addresses_A_ht+0x2c6e, %rsi
lea addresses_D_ht+0x136ee, %rdi
nop
nop
nop
nop
inc %r15
mov $126, %rcx
rep movsb
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_WC_ht+0xb2be, %rsi
lea addresses_D_ht+0xedee, %rdi
nop
nop
xor $60754, %r13
mov $42, %rcx
rep movsq
and %r13, %r13
lea addresses_UC_ht+0x7fee, %rdi
nop
nop
nop
nop
and $26506, %rcx
mov $0x6162636465666768, %r13
movq %r13, %xmm4
movups %xmm4, (%rdi)
sub $30525, %r9
lea addresses_WT_ht+0xa07e, %rsi
lea addresses_WC_ht+0x19f0e, %rdi
nop
nop
nop
nop
nop
sub %r9, %r9
mov $63, %rcx
rep movsq
nop
dec %r15
lea addresses_UC_ht+0x1d9ee, %rsi
lea addresses_normal_ht+0x5dee, %rdi
nop
nop
nop
sub %r11, %r11
mov $53, %rcx
rep movsw
nop
nop
nop
sub %rdi, %rdi
lea addresses_A_ht+0x9dee, %r15
nop
nop
nop
nop
nop
dec %rbx
mov (%r15), %r11d
nop
nop
dec %r15
lea addresses_WT_ht+0x1ed3c, %rsi
nop
nop
nop
nop
nop
and %r13, %r13
movups (%rsi), %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
nop
nop
and $32662, %rdi
lea addresses_WC_ht+0x5cce, %rcx
nop
nop
nop
dec %rsi
mov $0x6162636465666768, %r13
movq %r13, (%rcx)
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WC_ht+0x89ee, %rsi
clflush (%rsi)
nop
nop
nop
nop
cmp %r9, %r9
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
xor $36685, %r13
lea addresses_normal_ht+0xfed4, %rbx
nop
and $29853, %r15
movl $0x61626364, (%rbx)
nop
nop
nop
nop
inc %r13
lea addresses_normal_ht+0x193ee, %rdi
clflush (%rdi)
nop
nop
nop
nop
xor $30865, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%rdi)
nop
nop
nop
nop
nop
mfence
lea addresses_WC_ht+0x1bd0e, %r11
nop
nop
nop
xor $27344, %r15
mov (%r11), %rsi
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x1326e, %rsi
lea addresses_WT_ht+0x14972, %rdi
sub $51835, %r13
mov $54, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $14141, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WT+0x1d5ee, %rsi
lea addresses_A+0xaa3a, %rdi
xor $48349, %rbx
mov $41, %rcx
rep movsw
nop
nop
add $11150, %rsi
// Load
lea addresses_RW+0x1f716, %rbx
nop
nop
xor %rdi, %rdi
vmovups (%rbx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r9
nop
nop
nop
nop
nop
and $45870, %rbx
// Load
lea addresses_WT+0xf46e, %rcx
nop
nop
add %rax, %rax
mov (%rcx), %r9w
nop
sub $49182, %rbx
// Store
mov $0x56e, %rdx
nop
nop
cmp $16173, %rax
movl $0x51525354, (%rdx)
nop
nop
nop
cmp $1202, %rax
// Store
lea addresses_WC+0xd89e, %rdx
nop
nop
nop
add %rax, %rax
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
movups %xmm2, (%rdx)
nop
add $41327, %rdi
// Store
lea addresses_D+0x91ee, %rbx
nop
nop
add $34843, %rax
movw $0x5152, (%rbx)
nop
nop
nop
nop
add $59307, %rax
// Store
mov $0xf6e, %rbx
nop
nop
and %rax, %rax
movb $0x51, (%rbx)
nop
nop
xor $52828, %rcx
// Faulty Load
lea addresses_US+0x145ee, %rcx
nop
nop
add %rdx, %rdx
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %rbx
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'48': 34, '32': 8818, '46': 68, '49': 22, '00': 1539, '45': 27}
00 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 00 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 00 32 00 32 32 00 32 32 32 32 32 32 49 00 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 00 32 32 32 32 00 32 32 32 32 32 00 32 00 00 32 00 32 00 32 32 00 32 32 32 32 32 32 32 32 32 00 49 00 00 32 00 32 32 32 32 32 32 32 00 32 00 32 00 32 00 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 32 32 00 32 00 32 32 00 32 32 32 32 32 00 32 32 32 32 32 32 32 45 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 00 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 45 32 00 32 32 00 32 32 32 32 32 32 32 48 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 00 32 00 32 00 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 00 00 00 32 32 32 32 00 32 32 00 00 00 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 00 32 32 32 32 32 32 32 00 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 00 32 32 32 00 46 32 32 00 32 32 00 00 32 32 32 32 00 32 32 32 32 32 32 00 32 00 32 32 48 32 32 32 32 00 32 48 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 46 32 32 32 00 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 00 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 00 32 32 32 32 32 00 32 32 00 00 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 00 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 00 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 00 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 00 32 00 32 00 32 32 32 32 32 32 00 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 45 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 00 32 00 32 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 00 46 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 00 32 32 32 00 00 32 32 00 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 00 32 32 32 32 32 00 32 32 32 32 46 32 32 32 32
*/
| 29.06383 | 2,999 | 0.652792 |
85b7b36d36e6f2c6d4d4d724b547ea0abc4d89f0 | 489 | asm | Assembly | programs/oeis/136/A136219.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/136/A136219.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/136/A136219.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A136219: Number of terms in rows of irregular triangle A136218.
; 1,3,7,13,22,33,47,64,84,106,131,159,190,224,261,301,343,388,436,487,541,598,658,721,787,856,928,1003,1081,1162,1245,1331,1420,1512,1607,1705,1806,1910,2017,2127,2240,2356,2475,2597,2722,2850,2981,3115,3252
lpb $0
cal $1,186354 ; Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) before g(j) when f(i)=g(j), where f(i)=3i and g(j)=j(j+1)/2 (triangular number). Complement of A186355.
sub $0,1
lpe
add $1,1
| 54.333333 | 207 | 0.705521 |
6a2248ab9ad21e11dbf96bf9b8e56acba997d05e | 348 | asm | Assembly | programs/oeis/160/A160929.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/160/A160929.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/160/A160929.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A160929: a(n)= n * reversal(n-1)
; 0,2,6,12,20,30,42,56,72,90,11,132,273,434,615,816,1037,1278,1539,1820,42,264,506,768,1050,1352,1674,2016,2378,2760,93,416,759,1122,1505,1908,2331,2774,3237,3720,164,588,1032,1496,1980,2484,3008,3552,4116,4700
mov $1,$0
add $0,1
seq $1,4086 ; Read n backwards (referred to as R(n) in many sequences).
mul $0,$1
| 43.5 | 210 | 0.704023 |
bd65a4731bd687566042b17be982dd47b2c94739 | 6,455 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_21829_324.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_21829_324.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_21829_324.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xc377, %rsi
lea addresses_UC_ht+0x18c97, %rdi
clflush (%rdi)
sub %r13, %r13
mov $93, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r10, %r10
lea addresses_UC_ht+0x1fd7, %rsi
nop
nop
nop
nop
xor $46579, %r8
movb (%rsi), %r13b
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0xfbd7, %rsi
lea addresses_A_ht+0xba9f, %rdi
nop
nop
nop
nop
and %r12, %r12
mov $37, %rcx
rep movsq
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x1d057, %rsi
lea addresses_WT_ht+0x10ed7, %rdi
nop
nop
nop
sub $36734, %r8
mov $76, %rcx
rep movsb
cmp $62909, %rdi
lea addresses_A_ht+0x1d996, %rcx
nop
xor $10785, %rdi
movb $0x61, (%rcx)
nop
nop
nop
inc %r10
lea addresses_A_ht+0xe7d7, %rsi
lea addresses_WT_ht+0x3fd7, %rdi
nop
nop
nop
nop
add $51119, %r9
mov $125, %rcx
rep movsw
nop
sub $27653, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %rax
push %rbx
push %rdi
push %rdx
// Load
lea addresses_UC+0xf0a7, %r11
nop
nop
cmp %rax, %rax
movb (%r11), %bl
nop
nop
add %rdi, %rdi
// Store
lea addresses_PSE+0x136d7, %r13
clflush (%r13)
xor $30534, %rdx
movb $0x51, (%r13)
sub %rax, %rax
// Store
mov $0x5969000000055e, %rbx
nop
nop
cmp %rax, %rax
movl $0x51525354, (%rbx)
nop
nop
nop
nop
nop
sub $37387, %rdi
// Store
lea addresses_WC+0x57d7, %rdi
nop
add %r13, %r13
movl $0x51525354, (%rdi)
nop
nop
nop
nop
nop
and $49567, %r11
// Faulty Load
lea addresses_WC+0x57d7, %rbx
xor $28234, %r11
movups (%rbx), %xmm0
vpextrq $0, %xmm0, %rax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdx
pop %rdi
pop %rbx
pop %rax
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 36.885714 | 2,999 | 0.655461 |
d017493d61fbca1a4aa7bc341114fdf88eaa0b2a | 836 | asm | Assembly | data/pokemon/base_stats/dialga.asm | TastySnax12/pokecrystal16-493-plus | 9de36c8803c9bdf4b8564ed547f988b0b66f0c41 | [
"blessing"
] | 2 | 2021-07-31T07:05:06.000Z | 2021-10-16T03:32:26.000Z | data/pokemon/base_stats/dialga.asm | TastySnax12/pokecrystal16-493-plus | 9de36c8803c9bdf4b8564ed547f988b0b66f0c41 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/dialga.asm | TastySnax12/pokecrystal16-493-plus | 9de36c8803c9bdf4b8564ed547f988b0b66f0c41 | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db 0 ; species ID placeholder
db 100, 120, 120, 90, 150, 100
; hp atk def spd sat sdf
db STEEL, DRAGON ; type
db 3 ; catch rate
db 255 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_UNKNOWN ; gender ratio
db 100 ; unknown 1
db 120 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/dialga/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_SLOW ; growth rate
dn EGG_NONE, EGG_NONE ; egg groups
; tm/hm learnset
tmhm HEADBUTT, CURSE, ROAR, TOXIC, ZAP_CANNON, ROCK_SMASH, PSYCH_UP, HIDDEN_POWER, SUNNY_DAY, SNORE, BLIZZARD, HYPER_BEAM, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, IRON_TAIL, DRAGONBREATH, THUNDER, EARTHQUAKE, RETURN, MUD_SLAP, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SANDSTORM, FIRE_BLAST, SWIFT, DETECT, REST, FURY_CUTTER, CUT, STRENGTH, FLASH, FLAMETHROWER, ICE_BEAM, THUNDERBOLT
; end
| 38 | 378 | 0.733254 |
260928a63e9ed14547f26126e6d08b1a5e8d48e7 | 291 | asm | Assembly | programs/oeis/225/A225593.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/225/A225593.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/225/A225593.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A225593: The integer closest to n/e.
; 0,1,1,1,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,18,19,19,19,20,20,21,21,21,22,22,22,23,23,24,24,24,25,25,25,26,26,26
add $0,7
mul $0,18
add $0,15
div $0,49
mov $1,$0
sub $1,2
| 29.1 | 192 | 0.618557 |
269ff22651c01221bd75ffcaa1599f4e55d3909c | 169 | asm | Assembly | pkgs/tools/yasm/src/modules/parsers/gas/tests/jmpcall.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/parsers/gas/tests/jmpcall.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/parsers/gas/tests/jmpcall.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #.text
label:
call *%eax
call %eax
call *(%eax)
call (%eax)
call label(,1)
call label
call label+5
call *label
call *label(%eax)
jmp %fs:label
jmp *%fs:label
| 12.071429 | 18 | 0.633136 |
b1bb7c1577d3321adc2c580ef1f7d52a6958295e | 671 | asm | Assembly | oeis/268/A268462.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/268/A268462.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/268/A268462.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A268462: Expansion of (2 x^4*(5 - 12*x + 8*x^2))/(1 - 2*x)^4.
; 0,0,0,0,10,56,224,768,2400,7040,19712,53248,139776,358400,901120,2228224,5431296,13074432,31129600,73400320,171573248,397934592,916455424,2097152000,4771020800,10796138496,24310185984,54492397568,121634816000,270448721920,599147937792,1322849927168,2911450955776,6388763852800,13980118548480,30511447670784,66425964199936,144276541407232,312673619148800,676199651082240,1459464246919168,3144053499625472,6760896999194624,14513553486643200,31105183949783040,66560035899047936,142215231983058944
add $0,1
mov $2,$0
bin $2,3
sub $2,$0
mov $1,$2
lpb $0
sub $0,1
mul $1,2
lpe
div $1,32
mul $1,2
mov $0,$1
| 41.9375 | 495 | 0.800298 |
ec8bb668bffe747e14bcf1de499f47d6130ca1d7 | 283 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccix_log2_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccix_log2_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccix_log2_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; float log2(float x) __z88dk_fastcall
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sdccix_log2_fastcall
EXTERN cm48_sdccixp_dx2m48, am48_log2, cm48_sdccixp_m482d
cm48_sdccix_log2_fastcall:
call cm48_sdccixp_dx2m48
call am48_log2
jp cm48_sdccixp_m482d
| 15.722222 | 57 | 0.819788 |
523debf74905f7e33f436b48fcdb1b819c1c40ff | 4,199 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i3-7100_9_0x84_notsx.log_264_144.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i3-7100_9_0x84_notsx.log_264_144.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i3-7100_9_0x84_notsx.log_264_144.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 %r8
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xe759, %r8
clflush (%r8)
nop
inc %r11
movw $0x6162, (%r8)
xor $33947, %r13
lea addresses_A_ht+0x4611, %rsi
lea addresses_WC_ht+0x16b59, %rdi
nop
nop
add %r12, %r12
mov $6, %rcx
rep movsl
nop
nop
nop
and %r12, %r12
lea addresses_A_ht+0xaf59, %rsi
lea addresses_WC_ht+0xfff9, %rdi
add %r11, %r11
mov $76, %rcx
rep movsq
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WT_ht+0x1944d, %rsi
lea addresses_UC_ht+0xb159, %rdi
nop
nop
nop
nop
add %r8, %r8
mov $113, %rcx
rep movsb
nop
nop
nop
nop
sub %r8, %r8
lea addresses_WT_ht+0x15f59, %r13
nop
nop
nop
nop
cmp $18650, %rdi
movl $0x61626364, (%r13)
nop
nop
nop
nop
inc %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r9
push %rbx
push %rcx
push %rdx
// Store
lea addresses_WC+0x14959, %rcx
nop
nop
add %r9, %r9
movl $0x51525354, (%rcx)
nop
nop
inc %r10
// Store
lea addresses_normal+0x2b59, %rbx
nop
nop
nop
nop
inc %r13
movl $0x51525354, (%rbx)
sub %rcx, %rcx
// Store
mov $0x4da9a00000000359, %r15
and $2225, %r9
movb $0x51, (%r15)
nop
nop
nop
nop
nop
sub %r15, %r15
// Store
lea addresses_UC+0x1b359, %rdx
nop
nop
nop
and %r9, %r9
movw $0x5152, (%rdx)
nop
nop
nop
xor $26477, %r15
// Store
lea addresses_WT+0x4159, %rcx
nop
xor $4746, %r9
movb $0x51, (%rcx)
nop
and $32986, %r13
// Faulty Load
lea addresses_RW+0x19959, %r15
nop
nop
nop
nop
nop
add %r13, %r13
movaps (%r15), %xmm3
vpextrq $0, %xmm3, %rdx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 4, 'congruent': 11, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'54': 254, '00': 8, '0c': 1, '6a': 1}
54 54 54 54 54 54 54 54 6a 54 54 54 54 00 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 0c 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 23.589888 | 791 | 0.645868 |
5b2f1bcd3e1625925401321211e8445850b3f3d8 | 5,117 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_140.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_140.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_140.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1bcfb, %r9
nop
nop
nop
nop
nop
and $25039, %rdi
movl $0x61626364, (%r9)
nop
nop
sub %rsi, %rsi
lea addresses_D_ht+0x1a7c5, %rsi
lea addresses_WC_ht+0x1a075, %rdi
clflush (%rsi)
nop
nop
dec %r13
mov $66, %rcx
rep movsb
nop
and %rsi, %rsi
lea addresses_D_ht+0xd875, %rsi
nop
nop
nop
nop
lfence
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
dec %r13
lea addresses_UC_ht+0xd375, %rsi
lea addresses_WC_ht+0x1e09b, %rdi
nop
nop
dec %r9
mov $28, %rcx
rep movsb
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0xb76f, %r13
nop
sub %rcx, %rcx
mov (%r13), %r9w
nop
nop
nop
nop
nop
sub $44782, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r9
push %rcx
push %rdi
// Faulty Load
lea addresses_normal+0x14875, %rdi
nop
nop
nop
nop
sub %rcx, %rcx
movb (%rdi), %r11b
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rdi
pop %rcx
pop %r9
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 43.364407 | 2,999 | 0.661911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.