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 
			 | 
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
	3a7ff00f2df847ac9c37afa81dea24afa8736a61 
 | 271 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/strings/rindex.asm 
 | 
	grancier/z180 
 | 
	e83f35e36c9b4d1457e40585019430e901c86ed9 
 | 
	[
  "ClArtistic"
]  | 8 
							 | 
	2017-01-18T12:02:17.000Z 
 | 
	2021-06-12T09:40:28.000Z 
 | 
	libsrc/strings/rindex.asm 
 | 
	grancier/z180 
 | 
	e83f35e36c9b4d1457e40585019430e901c86ed9 
 | 
	[
  "ClArtistic"
]  | 1 
							 | 
	2017-03-06T07:41:56.000Z 
 | 
	2017-03-06T07:41:56.000Z 
 | 
	libsrc/strings/rindex.asm 
 | 
	RC2014Z80/z88dk 
 | 
	e5b9447b970e5fae26544b6d8aa5957c98ba0e6a 
 | 
	[
  "ClArtistic"
]  | 3 
							 | 
	2017-03-07T03:19:40.000Z 
 | 
	2021-09-15T17:59:19.000Z 
 | 
	; CALLER linkage for function pointers
SECTION code_clib
PUBLIC rindex
PUBLIC _rindex
EXTERN strrchr_callee
EXTERN ASMDISP_STRRCHR_CALLEE
.rindex
._rindex
   pop hl
   pop bc
   pop de
   push de
   push bc
   push hl
   
   jp strrchr_callee + ASMDISP_STRRCHR_CALLEE
 
 | 13.55 
							 | 45 
							 | 0.756458 
							 | 
					
	d76dca06c9026aab14553230eaba741d6c854c9b 
 | 471 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/176/A176213.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/176/A176213.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/176/A176213.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A176213: Decimal expansion of 2+sqrt(6).
; Submitted by Jon Maiga
; 4,4,4,9,4,8,9,7,4,2,7,8,3,1,7,8,0,9,8,1,9,7,2,8,4,0,7,4,7,0,5,8,9,1,3,9,1,9,6,5,9,4,7,4,8,0,6,5,6,6,7,0,1,2,8,4,3,2,6,9,2,5,6,7,2,5,0,9,6,0,3,7,7,4,5,7,3,1,5,0,2,6,5,3,9,8,5,9,4,3,3,1,0,4,6,4,0,2,3,4
mov $2,4
mov $3,$0
mul $3,4
mov $5,56
lpb $3
  add $1,$5
  mov $5,$1
  add $5,$2
  mov $2,$1
  mul $1,2
  sub $3,1
  mul $5,2
lpe
add $1,$5
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
 
 | 18.84 
							 | 201 
							 | 0.530786 
							 | 
					
	900b0d26e496e01e442a6f0421212991ad19fd39 
 | 794 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/141/A141974.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/141/A141974.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/141/A141974.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A141974: Primes congruent to 23 mod 28.
; Submitted by Jon Maiga
; 23,79,107,163,191,331,359,443,499,751,863,919,947,1031,1087,1171,1283,1367,1423,1451,1619,1759,1787,1871,2011,2039,2179,2207,2347,2459,2543,2683,2711,2767,2851,2879,2963,3019,3187,3271,3299,3467,3607,3691,3719,3803,3943,4027,4111,4139,4363,4391,4447,4643,4783,4951,5119,5147,5231,5399,5483,5623,5651,5791,5903,5987,6043,6211,6323,6379,6491,6547,6659,6827,6883,6911,6967,7079,7219,7247,7331,7499,7583,7639,7723,7919,8059,8087,8171,8311,8423,8563,8647,8731,9011,9067,9151,9319,9403,9431
mov $2,$0
add $2,6
pow $2,2
mov $4,22
lpb $2
  mov $3,$4
  seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
  sub $0,$3
  mov $1,$0
  max $1,0
  cmp $1,$0
  mul $2,$1
  sub $2,1
  add $4,28
lpe
mov $0,$4
add $0,1
 
 | 36.090909 
							 | 486 
							 | 0.716625 
							 | 
					
	2f27f192ea51831ed5cbaec6059195d389b87cf9 
 | 3,967 
							 | 
	asm 
 | 
	Assembly 
 | 
	buildTools/win32-x64/gbdk/libc/reverse.asm 
 | 
	asiekierka/gb-studio 
 | 
	0ff8b7c5bd661a13c2b574e844ae7f2299b439e2 
 | 
	[
  "MIT"
]  | 6,433 
							 | 
	2019-04-17T14:58:27.000Z 
 | 
	2022-03-31T08:41:22.000Z 
 | 
	buildTools/win32-x64/gbdk/libc/reverse.asm 
 | 
	asiekierka/gb-studio 
 | 
	0ff8b7c5bd661a13c2b574e844ae7f2299b439e2 
 | 
	[
  "MIT"
]  | 878 
							 | 
	2019-04-18T18:57:48.000Z 
 | 
	2022-03-31T19:42:20.000Z 
 | 
	buildTools/win32-x64/gbdk/libc/reverse.asm 
 | 
	asiekierka/gb-studio 
 | 
	0ff8b7c5bd661a13c2b574e844ae7f2299b439e2 
 | 
	[
  "MIT"
]  | 440 
							 | 
	2019-04-18T18:10:50.000Z 
 | 
	2022-03-31T21:30:57.000Z 
 | 
	;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.3.1 Wed Sep 04 21:56:18 2019
;--------------------------------------------------------
	.module reverse
	
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _reverse
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; special function bits 
;--------------------------------------------------------
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area _DATA
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area _OVERLAY
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
	.area _ISEG
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
	.area _BSEG
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area _XSEG
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area _GSINIT
	.area _GSFINAL
	.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area _HOME
	.area _CODE
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area _CODE
;	reverse.c 5
;	genLabel
;	genFunction
;	---------------------------------
; Function reverse
; ---------------------------------
___reverse_start:
_reverse:
	lda	sp,-5(sp)
;	reverse.c 11
;	genIpush
; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0
;	AOP_STK for 
	lda	hl,7(sp)
	ld	a,(hl+)
	ld	h,(hl)
	ld	l,a
	push	hl
;	genCall
	call	_strlen
	ld	b,d
	ld	c,e
	lda	sp,2(sp)
;	genMinus
	dec	bc
;	genCast
; Removed redundent load
;	reverse.c 12
;	genAssign
;	AOP_STK for _reverse_i_1_1
	lda	hl,4(sp)
	ld	(hl),#0x00
;	genAssign
;	AOP_STK for _reverse_j_1_1
	dec	hl
	ld	(hl),c
;	genLabel
00101$:
;	genCmpLt
;	AOP_STK for _reverse_i_1_1
;	AOP_STK for _reverse_j_1_1
	lda	hl,4(sp)
	ld	a,(hl)
	dec	hl
	sub	a,(hl)
	jp	nc,00103$
;	reverse.c 13
;	genPlus
;	AOP_STK for 
;	AOP_STK for _reverse_i_1_1
;	AOP_STK for _reverse_sloc0_1_0
;	Can't optimise plus by inc, falling back to the normal way
	lda	hl,7(sp)
	ld	e,(hl)
	inc	hl
	ld	d,(hl)
	lda	hl,4(sp)
	ld	l,(hl)
	ld	h,#0x00
	add	hl,de
	ld	a,l
	ld	d,h
	lda	hl,0(sp)
;	genPointerGet
;	AOP_STK for _reverse_sloc0_1_0
	ld	(hl+),a
	ld	(hl),d
	ld	e,a
	ld	a,(de)
	ld	c,a
;	genAssign
;	AOP_STK for _reverse_c_1_1
	inc	hl
	ld	(hl),c
;	reverse.c 14
;	genPlus
;	AOP_STK for 
;	AOP_STK for _reverse_j_1_1
;	Can't optimise plus by inc, falling back to the normal way
	lda	hl,7(sp)
	ld	e,(hl)
	inc	hl
	ld	d,(hl)
	lda	hl,3(sp)
	ld	l,(hl)
	ld	h,#0x00
	add	hl,de
	ld	c,l
	ld	b,h
;	genPointerGet
	ld	a,(bc)
;	genAssign (pointer)
;	AOP_STK for _reverse_sloc0_1_0
	lda	hl,0(sp)
	ld	e,(hl)
	inc	hl
	ld	d,(hl)
	ld	(de),a
;	reverse.c 15
;	genAssign (pointer)
;	AOP_STK for _reverse_c_1_1
	inc	hl
	ld	a,(hl)
	ld	(bc),a
;	reverse.c 16
;	genPlus
;	AOP_STK for _reverse_i_1_1
;	genPlusIncr
	inc	hl
	inc	hl
	inc	(hl)
;	reverse.c 17
;	genMinus
;	AOP_STK for _reverse_j_1_1
	dec	hl
	dec	(hl)
;	genGoto
	jp	00101$
;	genLabel
00103$:
;	reverse.c 19
;	genRet
;	AOP_STK for 
	lda	hl,7(sp)
	ld	e,(hl)
	inc	hl
	ld	d,(hl)
;	genLabel
00104$:
;	genEndFunction
	lda	sp,5(sp)
	ret
___reverse_end:
	.area _CODE
 
 | 21.213904 
							 | 69 
							 | 0.437358 
							 | 
					
	bfebca80ad9e33117cd51d822b17c4b5c5d04c0c 
 | 269 
							 | 
	asm 
 | 
	Assembly 
 | 
	mc-sema/validator/x86_64/tests/FBLD.asm 
 | 
	randolphwong/mcsema 
 | 
	eb5b376736e7f57ff0a61f7e4e5a436bbb874720 
 | 
	[
  "BSD-3-Clause"
]  | 2 
							 | 
	2021-08-07T16:21:29.000Z 
 | 
	2021-11-17T10:58:37.000Z 
 | 
	mc-sema/validator/x86_64/tests/FBLD.asm 
 | 
	randolphwong/mcsema 
 | 
	eb5b376736e7f57ff0a61f7e4e5a436bbb874720 
 | 
	[
  "BSD-3-Clause"
]  | null  | null  | null  | 
	mc-sema/validator/x86_64/tests/FBLD.asm 
 | 
	randolphwong/mcsema 
 | 
	eb5b376736e7f57ff0a61f7e4e5a436bbb874720 
 | 
	[
  "BSD-3-Clause"
]  | null  | null  | null  | 
	BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
;TEST_BEGIN_RECORDING
lea rdi, [rsp-0x10]
mov dword [rdi], 0x12345678
mov dword [rdi+04], 0x12345678
mov dword [rdi+08], 0x00001234
FBLD tword [rdi]
mov edi, 0
;TEST_END_RECORDING
 
 | 16.8125 
							 | 30 
							 | 0.788104 
							 | 
					
	9086dea7203608990e748357372925eb4a1a50c3 
 | 237 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/gfx/common/cclg.asm 
 | 
	ahjelm/z88dk 
 | 
	c4de367f39a76b41f6390ceeab77737e148178fa 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/gfx/common/cclg.asm 
 | 
	C-Chads/z88dk 
 | 
	a4141a8e51205c6414b4ae3263b633c4265778e6 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/gfx/common/cclg.asm 
 | 
	C-Chads/z88dk 
 | 
	a4141a8e51205c6414b4ae3263b633c4265778e6 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	;
;      Colour graphics routines
;
;      cls ()  -- clear screen
;
;      Stefano Bodrato - 2018
;
;
;      $Id: cclg.asm $
;
    	SECTION	code_graphics
    	PUBLIC    cclg
        PUBLIC    _cclg
	EXTERN	clg
	
.cclg
._cclg
	jp clg
 
 | 10.772727 
							 | 31 
							 | 0.535865 
							 | 
					
	d34da9eeaa98d55ffc4e50b97e9fd9dcce4db933 
 | 5,093 
							 | 
	asm 
 | 
	Assembly 
 | 
	Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2908.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_2908.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_2908.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 %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xfc17, %rsi
lea addresses_normal_ht+0x16e2f, %rdi
nop
nop
nop
nop
dec %r10
mov $1, %rcx
rep movsw
mfence
lea addresses_D_ht+0x129ff, %rdx
sub $32043, %r13
mov (%rdx), %rcx
nop
nop
nop
nop
nop
inc %rsi
lea addresses_normal_ht+0x14e7f, %rdx
nop
nop
nop
nop
add %r10, %r10
movb $0x61, (%rdx)
nop
nop
dec %rcx
lea addresses_WC_ht+0x12f2b, %rdx
nop
nop
nop
xor %rdi, %rdi
movw $0x6162, (%rdx)
nop
nop
nop
nop
sub $30459, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r13
pop %r10
ret
    .global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rax
push %rbp
push %rdx
push %rsi
// Store
lea addresses_normal+0x1d67f, %r11
clflush (%r11)
nop
nop
dec %r10
movl $0x51525354, (%r11)
nop
nop
nop
cmp $48320, %rax
// Faulty Load
lea addresses_RW+0xa67f, %rdx
nop
nop
nop
nop
add $24736, %rbp
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %rax
lea oracles, %rdx
and $0xff, %rax
shlq $12, %rax
mov (%rdx,%rax,1), %rax
pop %rsi
pop %rdx
pop %rbp
pop %rax
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': True, 'NT': True}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
 
 | 43.905172 
							 | 2,999 
							 | 0.661496 
							 | 
					
	f90db332e1912816e7b2d946adc741dbd4795343 
 | 1,215 
							 | 
	asm 
 | 
	Assembly 
 | 
	Testcases/Own Testcases/sum_sq/sum_sq20.asm 
 | 
	swapnil96/Cache_simulator 
 | 
	df7b0dd6132e45660ef2731fa4ec722fd7dab2c6 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	Testcases/Own Testcases/sum_sq/sum_sq20.asm 
 | 
	swapnil96/Cache_simulator 
 | 
	df7b0dd6132e45660ef2731fa4ec722fd7dab2c6 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	Testcases/Own Testcases/sum_sq/sum_sq20.asm 
 | 
	swapnil96/Cache_simulator 
 | 
	df7b0dd6132e45660ef2731fa4ec722fd7dab2c6 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	lui      $1, 0x00000000 
ori      $t4,$1,0x00000014     # t4(Input register) is initialized to 10.
and      $t0, $0, $0       	   # i = 0
lui      $1, 0x00001001 	   # Address of a
ori      $t1,$1,0x00000010 
loop1:
    sll      $t2, $t0, 2       # byte offset for ith element
    add      $t2, $t2, $t1     # address of a[i]
    sw       $t0, 0($t2)       # put i into a[i]
    addi     $t0, $t0, 1       # increment i
    slt      $t5, $t0, $t4     # is $t0 < $t4 ?
    bne      $t5, $0, loop1    # branch if so
# Sum the array values
    and      $s0, $0, $0       # sum = 0, Result Register
    and      $t0, $0, $0       # i = 0
    add      $t2, $t1, $0      # address of a[i]
loop2:
    lw       $t3, 0($t2)       # load a[i]
    mult	 $t3, $t3		   # multiply a[i] with a[i]
    mflo	 $t3 			   # move product to $t3
    add      $s0, $s0, $t3     # increment sum
    addi     $t0, $t0, 1       # increment i
    addi     $t2, $t2, 4       # increment address of a[i]
    slt      $t5, $t0, $t4     # is $t0 < $t4 ?
    bne      $t5, $0, loop2    # branch if so
# Output Sum
    li       $v0, 1            # Load 1=print_int into $v0
    add      $a0, $s0, $zero   # Load first number into $a0
    jr	$ra 
 | 36.818182 
							 | 73 
							 | 0.450206 
							 | 
					
	0cedde06287f35085eb8846a6b7a35c69fa2ed1f 
 | 6,524 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/test/ref/examples/cx16/cx16-rasterbars.asm 
 | 
	jbrandwood/kickc 
 | 
	d4b68806f84f8650d51b0e3ef254e40f38b0ffad 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2022-03-01T02:21:14.000Z 
 | 
	2022-03-01T04:33:35.000Z 
 | 
	src/test/ref/examples/cx16/cx16-rasterbars.asm 
 | 
	jbrandwood/kickc 
 | 
	d4b68806f84f8650d51b0e3ef254e40f38b0ffad 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	src/test/ref/examples/cx16/cx16-rasterbars.asm 
 | 
	jbrandwood/kickc 
 | 
	d4b68806f84f8650d51b0e3ef254e40f38b0ffad 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	// Example program for the Commander X16
// Displays raster bars in the border
.cpu _65c02
  // Commodore 64 PRG executable file
.file [name="cx16-rasterbars.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(__start)
  .const VERA_DCSEL = 2
  .const VERA_LINE = 2
  .const SIZEOF_CHAR = 1
  /// $9F25	CTRL Control
  /// Bit 7: Reset
  /// Bit 1: DCSEL
  /// Bit 2: ADDRSEL
  .label VERA_CTRL = $9f25
  /// $9F26	IEN		Interrupt Enable
  /// Bit 7: IRQ line (8)
  /// Bit 3: AFLOW
  /// Bit 2: SPRCOL
  /// Bit 1: LINE
  /// Bit 0: VSYNC
  .label VERA_IEN = $9f26
  /// $9F27	ISR     Interrupt Status
  /// Interrupts will be generated for the interrupt sources set in the lower 4 bits of IEN. ISR will indicate the interrupts that have occurred.
  /// Writing a 1 to one of the lower 3 bits in ISR will clear that interrupt status. AFLOW can only be cleared by filling the audio FIFO for at least 1/4.
  /// Bit 4-7: Sprite Collisions. This field indicates which groups of sprites have collided.
  /// Bit 3: AFLOW
  /// Bit 2: SPRCOL
  /// Bit 1: LINE
  /// Bit 0: VSYNC
  .label VERA_ISR = $9f27
  /// $9F28	IRQLINE_L	IRQ line (7:0)
  /// IRQ_LINE specifies at which line the LINE interrupt will be generated.
  /// Note that bit 8 of this value is present in the IEN register.
  /// For interlaced modes the interrupt will be generated each field and the bit 0 of IRQ_LINE is ignored.
  .label VERA_IRQLINE_L = $9f28
  /// $9F2C	DC_BORDER (DCSEL=0)	Border Color
  .label VERA_DC_BORDER = $9f2c
  /// $9F29	DC_HSTART (DCSEL=1)	Active Display H-Start (9:2)
  .label VERA_DC_HSTART = $9f29
  /// $9F2A	DC_HSTOP (DCSEL=1)	Active Display H-Stop (9:2)
  .label VERA_DC_HSTOP = $9f2a
  /// $9F2B	DC_VSTART (DCSEL=1)	Active Display V-Start (8:1)
  .label VERA_DC_VSTART = $9f2b
  /// $9F2C	DC_VSTOP (DCSEL=1)	Active Display V-Stop (8:1)
  .label VERA_DC_VSTOP = $9f2c
  /// $0314	(RAM) IRQ vector - The vector used when the KERNAL serves IRQ interrupts
  .label KERNEL_IRQ = $314
  // The horizontal start
  .label hstart = 6
  // The horizontal stop
  .label hstop = 7
  // The vertical start
  .label vstart = 8
  // The vertical stop
  .label vstop = 9
  // The countdown
  .label cnt = 5
  // The sin idx
  .label sin_idx = $a
.segment Code
__start: {
    // volatile char hstart = 0/4
    lda #0
    sta.z hstart
    // volatile char hstop = 640/4
    lda #$280/4
    sta.z hstop
    // volatile char vstart = 0/2
    lda #0
    sta.z vstart
    // volatile char vstop = 480/2
    lda #$1e0/2
    sta.z vstop
    // volatile char cnt = 2
    lda #2
    sta.z cnt
    // volatile char sin_idx = 100
    lda #$64
    sta.z sin_idx
    jsr main
    rts
}
// LINE Interrupt Routine
irq_line: {
    .label idx = 4
    .label bar = 2
    // *VERA_CTRL |= VERA_DCSEL
    // Update the border
    lda #VERA_DCSEL
    ora VERA_CTRL
    sta VERA_CTRL
    // *VERA_DC_HSTART = hstart
    lda.z hstart
    sta VERA_DC_HSTART
    // *VERA_DC_HSTOP = hstop
    lda.z hstop
    sta VERA_DC_HSTOP
    // *VERA_DC_VSTART = vstart
    lda.z vstart
    sta VERA_DC_VSTART
    // *VERA_DC_VSTOP = vstop
    lda.z vstop
    sta VERA_DC_VSTOP
    // *VERA_CTRL &= ~VERA_DCSEL
    // Show color raster bars in the border
    lda #VERA_DCSEL^$ff
    and VERA_CTRL
    sta VERA_CTRL
    ldx #0
  __b2:
    // for(char l=0;l!=230;l++)
    cpx #$e6
    bne __b3
    // if(--cnt==0)
    dec.z cnt
    lda.z cnt
    bne __b1
    // cnt = 2
    lda #2
    sta.z cnt
    // if(hstart<=320/4)
    lda.z hstart
    cmp #$140/4+1
    bcs __b1
    // hstart++;
    inc.z hstart
    // hstop--;
    dec.z hstop
    // vstart++;
    inc.z vstart
    // vstop--;
    dec.z vstop
  __b1:
    // memset(BARS, 0, sizeof(BARS))
  // Animate the bars
    jsr memset
    // char idx = sin_idx--
    lda.z sin_idx
    sta.z idx
    dec.z sin_idx
    ldx #0
  __b13:
    // for(char b=0;b<8;b++)
    cpx #8
    bcc __b14
    // *VERA_ISR = VERA_LINE
    // Reset the LINE interrupt
    lda #VERA_LINE
    sta VERA_ISR
    // }
    jmp $e049
  __b14:
    // char * bar = BARS + SIN[idx]
    ldy.z idx
    lda SIN,y
    clc
    adc #<BARS
    sta.z bar
    lda #>BARS
    adc #0
    sta.z bar+1
    ldy #0
  __b16:
    // for(char i=0;i<sizeof(BAR);i++)
    cpy #$20*SIZEOF_CHAR
    bcc __b17
    // idx += 13
    lda #$d
    clc
    adc.z idx
    sta.z idx
    // for(char b=0;b<8;b++)
    inx
    jmp __b13
  __b17:
    // bar[i] = BAR[i]
    lda BAR,y
    sta (bar),y
    // for(char i=0;i<sizeof(BAR);i++)
    iny
    jmp __b16
  __b3:
    // *VERA_DC_BORDER = BARS[l]
    lda BARS,x
    sta VERA_DC_BORDER
    lda #0
  __b5:
    // for(char i=0;i<24;i++)
    cmp #$18
    bcc __b6
    // *VERA_DC_BORDER = 0
    // Wait exactly long enough to go to the next raster line
    lda #0
    sta VERA_DC_BORDER
  __b8:
    // for(char i=0;i<23;i++)
    cmp #$17
    bcc __b9
    // asm
    // Wait exactly long enough to go to the next raster line
    nop
    nop
    // for(char l=0;l!=230;l++)
    inx
    jmp __b2
  __b9:
    // for(char i=0;i<23;i++)
    inc
    jmp __b8
  __b6:
    // for(char i=0;i<24;i++)
    inc
    jmp __b5
}
main: {
    // asm
    sei
    // *KERNEL_IRQ = &irq_line
    lda #<irq_line
    sta KERNEL_IRQ
    lda #>irq_line
    sta KERNEL_IRQ+1
    // *VERA_IEN = VERA_LINE
    lda #VERA_LINE
    sta VERA_IEN
    // *VERA_IRQLINE_L = 5
    lda #5
    sta VERA_IRQLINE_L
    // asm
    cli
  __b1:
    jmp __b1
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(void *str, char c, unsigned int num)
memset: {
    .const num = $e6*SIZEOF_CHAR
    .const c = 0
    .label str = BARS
    .label end = str+num
    .label dst = 2
    lda #<str
    sta.z dst
    lda #>str
    sta.z dst+1
  __b1:
    // for(char* dst = str; dst!=end; dst++)
    lda.z dst+1
    cmp #>end
    bne __b2
    lda.z dst
    cmp #<end
    bne __b2
    // }
    rts
  __b2:
    // *dst = c
    lda #c
    ldy #0
    sta (dst),y
    // for(char* dst = str; dst!=end; dst++)
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    jmp __b1
}
.segment Data
  .align $100
SIN:
.fill 256, 99+99*sin(i*2*PI/256)
  .align $100
  BARS: .fill $e6, 0
  .align $100
  BAR: .byte $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1a, $1b, $1c, $1d, $1e, $1f, $1f, $1e, $1d, $1c, $1b, $1a, $19, $18, $17, $16, $15, $14, $13, $12, $11, $10
 
 | 23.134752 
							 | 171 
							 | 0.588903 
							 | 
					
	8aa31d160c1801f247f038ae3fcdb58140c449c3 
 | 1,039 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	
; 2016 aralbrec
SECTION code_clib
SECTION code_math
PUBLIC l_small_divu_64_64x8
PUBLIC l0_small_divu_64_64x8
EXTERN error_llmc, error_divide_by_zero_mc
l_small_divu_64_64x8:
   ; unsigned division of a 64-bit number
   ; by an 8-bit number
   ;
   ; enter : dehl'dehl = 64-bit dividend
   ;                 c = 8-bit divisor
   ;
   ; exit  : success
   ;
   ;            dehl'dehl = 64-bit quotient
   ;                    a = remainder
   ;            carry reset
   ;
   ;         divide by zero
   ;
   ;            dehl'dehl = ULLONG_MAX
   ;            (dividend is lost)
   ;            carry set, errno = EDOM
   ;
   ; uses  : af, b, de, hl, de', hl'
   ld a,c
   or a
   jr z, divide_by_zero
   
l0_small_divu_64_64x8:
   xor a
   ld b,64
loop_11:
   add hl,hl
   rl e
   rl d
   exx
   adc hl,hl
   rl e
   rl d
   exx
   
   rla
   jr c, loop_02
   
   cp c
   jr c, loop_03
loop_02:
   sub c
   inc l
loop_03:
   djnz loop_11
   
   or a
   ret
divide_by_zero:
   call error_llmc
   jp error_divide_by_zero_mc
 
 | 13.671053 
							 | 43 
							 | 0.555342 
							 | 
					
	5e586cf9a8d440f37d3ca53023b0fa6153a62496 
 | 659 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/102/A102370.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/102/A102370.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/102/A102370.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A102370: "Sloping binary numbers": write numbers in binary under each other (right-justified), read diagonals in upward direction, convert to decimal.
; Submitted by Christian Krause
; 0,3,6,5,4,15,10,9,8,11,14,13,28,23,18,17,16,19,22,21,20,31,26,25,24,27,30,61,44,39,34,33,32,35,38,37,36,47,42,41,40,43,46,45,60,55,50,49,48,51,54,53,52,63,58,57,56,59,126,93,76,71,66,65,64,67,70,69,68,79,74,73,72,75,78,77,92,87,82,81,80,83,86,85,84,95,90,89,88,91,94,125,108,103,98,97,96,99,102,101
add $0,1
mov $1,$0
mov $2,$0
mov $4,1
lpb $2
  mul $4,2
  mov $3,$4
  mov $5,$0
  add $0,1
  mod $5,$4
  cmp $5,0
  mul $3,$5
  add $1,$3
  div $2,2
lpe
mov $0,$1
sub $0,1
 
 | 29.954545 
							 | 300 
							 | 0.649469 
							 | 
					
	c5b4688b2e3e8b4ddf027cc1f70fb0b039041469 
 | 57,166 
							 | 
	asm 
 | 
	Assembly 
 | 
	grep.asm 
 | 
	Tookerton21/Xv6_OS 
 | 
	ed9ab1648952b2f62e60db2ca8e6aa42e69bd340 
 | 
	[
  "Xnet",
  "X11"
]  | null  | null  | null  | 
	grep.asm 
 | 
	Tookerton21/Xv6_OS 
 | 
	ed9ab1648952b2f62e60db2ca8e6aa42e69bd340 
 | 
	[
  "Xnet",
  "X11"
]  | null  | null  | null  | 
	grep.asm 
 | 
	Tookerton21/Xv6_OS 
 | 
	ed9ab1648952b2f62e60db2ca8e6aa42e69bd340 
 | 
	[
  "Xnet",
  "X11"
]  | null  | null  | null  | 
	
_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 b6 00 00 00       	jmp    c8 <grep+0xc8>
    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 80 0e 00 00       	add    $0xe80,%eax
  20:	c6 00 00             	movb   $0x0,(%eax)
    p = buf;
  23:	c7 45 f0 80 0e 00 00 	movl   $0xe80,-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 9a 01 00 00       	call   1da <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 88 05 00 00       	call   5f2 <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 89 03 00 00       	call   40c <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 80 0e 00 00 	cmpl   $0xe80,-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 23                	jle    c8 <grep+0xc8>
      m -= p - buf;
  a5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  a8:	ba 80 0e 00 00       	mov    $0xe80,%edx
  ad:	29 d0                	sub    %edx,%eax
  af:	29 45 f4             	sub    %eax,-0xc(%ebp)
      memmove(buf, p, m);
  b2:	83 ec 04             	sub    $0x4,%esp
  b5:	ff 75 f4             	pushl  -0xc(%ebp)
  b8:	ff 75 f0             	pushl  -0x10(%ebp)
  bb:	68 80 0e 00 00       	push   $0xe80
  c0:	e8 c8 04 00 00       	call   58d <memmove>
  c5:	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){
  c8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  cb:	ba ff 03 00 00       	mov    $0x3ff,%edx
  d0:	29 c2                	sub    %eax,%edx
  d2:	89 d0                	mov    %edx,%eax
  d4:	89 c2                	mov    %eax,%edx
  d6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  d9:	05 80 0e 00 00       	add    $0xe80,%eax
  de:	83 ec 04             	sub    $0x4,%esp
  e1:	52                   	push   %edx
  e2:	50                   	push   %eax
  e3:	ff 75 0c             	pushl  0xc(%ebp)
  e6:	e8 ff 04 00 00       	call   5ea <read>
  eb:	83 c4 10             	add    $0x10,%esp
  ee:	89 45 ec             	mov    %eax,-0x14(%ebp)
  f1:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  f5:	0f 8f 17 ff ff ff    	jg     12 <grep+0x12>
    if(m > 0){
      m -= p - buf;
      memmove(buf, p, m);
    }
  }
}
  fb:	90                   	nop
  fc:	c9                   	leave  
  fd:	c3                   	ret    
000000fe <main>:
int
main(int argc, char *argv[])
{
  fe:	8d 4c 24 04          	lea    0x4(%esp),%ecx
 102:	83 e4 f0             	and    $0xfffffff0,%esp
 105:	ff 71 fc             	pushl  -0x4(%ecx)
 108:	55                   	push   %ebp
 109:	89 e5                	mov    %esp,%ebp
 10b:	53                   	push   %ebx
 10c:	51                   	push   %ecx
 10d:	83 ec 10             	sub    $0x10,%esp
 110:	89 cb                	mov    %ecx,%ebx
  int fd, i;
  char *pattern;
  
  if(argc <= 1){
 112:	83 3b 01             	cmpl   $0x1,(%ebx)
 115:	7f 17                	jg     12e <main+0x30>
    printf(2, "usage: grep pattern [file ...]\n");
 117:	83 ec 08             	sub    $0x8,%esp
 11a:	68 40 0b 00 00       	push   $0xb40
 11f:	6a 02                	push   $0x2
 121:	e8 63 06 00 00       	call   789 <printf>
 126:	83 c4 10             	add    $0x10,%esp
    exit();
 129:	e8 a4 04 00 00       	call   5d2 <exit>
  }
  pattern = argv[1];
 12e:	8b 43 04             	mov    0x4(%ebx),%eax
 131:	8b 40 04             	mov    0x4(%eax),%eax
 134:	89 45 f0             	mov    %eax,-0x10(%ebp)
  
  if(argc <= 2){
 137:	83 3b 02             	cmpl   $0x2,(%ebx)
 13a:	7f 15                	jg     151 <main+0x53>
    grep(pattern, 0);
 13c:	83 ec 08             	sub    $0x8,%esp
 13f:	6a 00                	push   $0x0
 141:	ff 75 f0             	pushl  -0x10(%ebp)
 144:	e8 b7 fe ff ff       	call   0 <grep>
 149:	83 c4 10             	add    $0x10,%esp
    exit();
 14c:	e8 81 04 00 00       	call   5d2 <exit>
  }
  for(i = 2; i < argc; i++){
 151:	c7 45 f4 02 00 00 00 	movl   $0x2,-0xc(%ebp)
 158:	eb 74                	jmp    1ce <main+0xd0>
    if((fd = open(argv[i], 0)) < 0){
 15a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 15d:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
 164:	8b 43 04             	mov    0x4(%ebx),%eax
 167:	01 d0                	add    %edx,%eax
 169:	8b 00                	mov    (%eax),%eax
 16b:	83 ec 08             	sub    $0x8,%esp
 16e:	6a 00                	push   $0x0
 170:	50                   	push   %eax
 171:	e8 9c 04 00 00       	call   612 <open>
 176:	83 c4 10             	add    $0x10,%esp
 179:	89 45 ec             	mov    %eax,-0x14(%ebp)
 17c:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 180:	79 29                	jns    1ab <main+0xad>
      printf(1, "grep: cannot open %s\n", argv[i]);
 182:	8b 45 f4             	mov    -0xc(%ebp),%eax
 185:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
 18c:	8b 43 04             	mov    0x4(%ebx),%eax
 18f:	01 d0                	add    %edx,%eax
 191:	8b 00                	mov    (%eax),%eax
 193:	83 ec 04             	sub    $0x4,%esp
 196:	50                   	push   %eax
 197:	68 60 0b 00 00       	push   $0xb60
 19c:	6a 01                	push   $0x1
 19e:	e8 e6 05 00 00       	call   789 <printf>
 1a3:	83 c4 10             	add    $0x10,%esp
      exit();
 1a6:	e8 27 04 00 00       	call   5d2 <exit>
    }
    grep(pattern, fd);
 1ab:	83 ec 08             	sub    $0x8,%esp
 1ae:	ff 75 ec             	pushl  -0x14(%ebp)
 1b1:	ff 75 f0             	pushl  -0x10(%ebp)
 1b4:	e8 47 fe ff ff       	call   0 <grep>
 1b9:	83 c4 10             	add    $0x10,%esp
    close(fd);
 1bc:	83 ec 0c             	sub    $0xc,%esp
 1bf:	ff 75 ec             	pushl  -0x14(%ebp)
 1c2:	e8 33 04 00 00       	call   5fa <close>
 1c7:	83 c4 10             	add    $0x10,%esp
  if(argc <= 2){
    grep(pattern, 0);
    exit();
  }
  for(i = 2; i < argc; i++){
 1ca:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 1ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1d1:	3b 03                	cmp    (%ebx),%eax
 1d3:	7c 85                	jl     15a <main+0x5c>
      exit();
    }
    grep(pattern, fd);
    close(fd);
  }
  exit();
 1d5:	e8 f8 03 00 00       	call   5d2 <exit>
000001da <match>:
int matchhere(char*, char*);
int matchstar(int, char*, char*);
int
match(char *re, char *text)
{
 1da:	55                   	push   %ebp
 1db:	89 e5                	mov    %esp,%ebp
 1dd:	83 ec 08             	sub    $0x8,%esp
  if(re[0] == '^')
 1e0:	8b 45 08             	mov    0x8(%ebp),%eax
 1e3:	0f b6 00             	movzbl (%eax),%eax
 1e6:	3c 5e                	cmp    $0x5e,%al
 1e8:	75 17                	jne    201 <match+0x27>
    return matchhere(re+1, text);
 1ea:	8b 45 08             	mov    0x8(%ebp),%eax
 1ed:	83 c0 01             	add    $0x1,%eax
 1f0:	83 ec 08             	sub    $0x8,%esp
 1f3:	ff 75 0c             	pushl  0xc(%ebp)
 1f6:	50                   	push   %eax
 1f7:	e8 38 00 00 00       	call   234 <matchhere>
 1fc:	83 c4 10             	add    $0x10,%esp
 1ff:	eb 31                	jmp    232 <match+0x58>
  do{  // must look at empty string
    if(matchhere(re, text))
 201:	83 ec 08             	sub    $0x8,%esp
 204:	ff 75 0c             	pushl  0xc(%ebp)
 207:	ff 75 08             	pushl  0x8(%ebp)
 20a:	e8 25 00 00 00       	call   234 <matchhere>
 20f:	83 c4 10             	add    $0x10,%esp
 212:	85 c0                	test   %eax,%eax
 214:	74 07                	je     21d <match+0x43>
      return 1;
 216:	b8 01 00 00 00       	mov    $0x1,%eax
 21b:	eb 15                	jmp    232 <match+0x58>
  }while(*text++ != '\0');
 21d:	8b 45 0c             	mov    0xc(%ebp),%eax
 220:	8d 50 01             	lea    0x1(%eax),%edx
 223:	89 55 0c             	mov    %edx,0xc(%ebp)
 226:	0f b6 00             	movzbl (%eax),%eax
 229:	84 c0                	test   %al,%al
 22b:	75 d4                	jne    201 <match+0x27>
  return 0;
 22d:	b8 00 00 00 00       	mov    $0x0,%eax
}
 232:	c9                   	leave  
 233:	c3                   	ret    
00000234 <matchhere>:
// matchhere: search for re at beginning of text
int matchhere(char *re, char *text)
{
 234:	55                   	push   %ebp
 235:	89 e5                	mov    %esp,%ebp
 237:	83 ec 08             	sub    $0x8,%esp
  if(re[0] == '\0')
 23a:	8b 45 08             	mov    0x8(%ebp),%eax
 23d:	0f b6 00             	movzbl (%eax),%eax
 240:	84 c0                	test   %al,%al
 242:	75 0a                	jne    24e <matchhere+0x1a>
    return 1;
 244:	b8 01 00 00 00       	mov    $0x1,%eax
 249:	e9 99 00 00 00       	jmp    2e7 <matchhere+0xb3>
  if(re[1] == '*')
 24e:	8b 45 08             	mov    0x8(%ebp),%eax
 251:	83 c0 01             	add    $0x1,%eax
 254:	0f b6 00             	movzbl (%eax),%eax
 257:	3c 2a                	cmp    $0x2a,%al
 259:	75 21                	jne    27c <matchhere+0x48>
    return matchstar(re[0], re+2, text);
 25b:	8b 45 08             	mov    0x8(%ebp),%eax
 25e:	8d 50 02             	lea    0x2(%eax),%edx
 261:	8b 45 08             	mov    0x8(%ebp),%eax
 264:	0f b6 00             	movzbl (%eax),%eax
 267:	0f be c0             	movsbl %al,%eax
 26a:	83 ec 04             	sub    $0x4,%esp
 26d:	ff 75 0c             	pushl  0xc(%ebp)
 270:	52                   	push   %edx
 271:	50                   	push   %eax
 272:	e8 72 00 00 00       	call   2e9 <matchstar>
 277:	83 c4 10             	add    $0x10,%esp
 27a:	eb 6b                	jmp    2e7 <matchhere+0xb3>
  if(re[0] == '$' && re[1] == '\0')
 27c:	8b 45 08             	mov    0x8(%ebp),%eax
 27f:	0f b6 00             	movzbl (%eax),%eax
 282:	3c 24                	cmp    $0x24,%al
 284:	75 1d                	jne    2a3 <matchhere+0x6f>
 286:	8b 45 08             	mov    0x8(%ebp),%eax
 289:	83 c0 01             	add    $0x1,%eax
 28c:	0f b6 00             	movzbl (%eax),%eax
 28f:	84 c0                	test   %al,%al
 291:	75 10                	jne    2a3 <matchhere+0x6f>
    return *text == '\0';
 293:	8b 45 0c             	mov    0xc(%ebp),%eax
 296:	0f b6 00             	movzbl (%eax),%eax
 299:	84 c0                	test   %al,%al
 29b:	0f 94 c0             	sete   %al
 29e:	0f b6 c0             	movzbl %al,%eax
 2a1:	eb 44                	jmp    2e7 <matchhere+0xb3>
  if(*text!='\0' && (re[0]=='.' || re[0]==*text))
 2a3:	8b 45 0c             	mov    0xc(%ebp),%eax
 2a6:	0f b6 00             	movzbl (%eax),%eax
 2a9:	84 c0                	test   %al,%al
 2ab:	74 35                	je     2e2 <matchhere+0xae>
 2ad:	8b 45 08             	mov    0x8(%ebp),%eax
 2b0:	0f b6 00             	movzbl (%eax),%eax
 2b3:	3c 2e                	cmp    $0x2e,%al
 2b5:	74 10                	je     2c7 <matchhere+0x93>
 2b7:	8b 45 08             	mov    0x8(%ebp),%eax
 2ba:	0f b6 10             	movzbl (%eax),%edx
 2bd:	8b 45 0c             	mov    0xc(%ebp),%eax
 2c0:	0f b6 00             	movzbl (%eax),%eax
 2c3:	38 c2                	cmp    %al,%dl
 2c5:	75 1b                	jne    2e2 <matchhere+0xae>
    return matchhere(re+1, text+1);
 2c7:	8b 45 0c             	mov    0xc(%ebp),%eax
 2ca:	8d 50 01             	lea    0x1(%eax),%edx
 2cd:	8b 45 08             	mov    0x8(%ebp),%eax
 2d0:	83 c0 01             	add    $0x1,%eax
 2d3:	83 ec 08             	sub    $0x8,%esp
 2d6:	52                   	push   %edx
 2d7:	50                   	push   %eax
 2d8:	e8 57 ff ff ff       	call   234 <matchhere>
 2dd:	83 c4 10             	add    $0x10,%esp
 2e0:	eb 05                	jmp    2e7 <matchhere+0xb3>
  return 0;
 2e2:	b8 00 00 00 00       	mov    $0x0,%eax
}
 2e7:	c9                   	leave  
 2e8:	c3                   	ret    
000002e9 <matchstar>:
// matchstar: search for c*re at beginning of text
int matchstar(int c, char *re, char *text)
{
 2e9:	55                   	push   %ebp
 2ea:	89 e5                	mov    %esp,%ebp
 2ec:	83 ec 08             	sub    $0x8,%esp
  do{  // a * matches zero or more instances
    if(matchhere(re, text))
 2ef:	83 ec 08             	sub    $0x8,%esp
 2f2:	ff 75 10             	pushl  0x10(%ebp)
 2f5:	ff 75 0c             	pushl  0xc(%ebp)
 2f8:	e8 37 ff ff ff       	call   234 <matchhere>
 2fd:	83 c4 10             	add    $0x10,%esp
 300:	85 c0                	test   %eax,%eax
 302:	74 07                	je     30b <matchstar+0x22>
      return 1;
 304:	b8 01 00 00 00       	mov    $0x1,%eax
 309:	eb 29                	jmp    334 <matchstar+0x4b>
  }while(*text!='\0' && (*text++==c || c=='.'));
 30b:	8b 45 10             	mov    0x10(%ebp),%eax
 30e:	0f b6 00             	movzbl (%eax),%eax
 311:	84 c0                	test   %al,%al
 313:	74 1a                	je     32f <matchstar+0x46>
 315:	8b 45 10             	mov    0x10(%ebp),%eax
 318:	8d 50 01             	lea    0x1(%eax),%edx
 31b:	89 55 10             	mov    %edx,0x10(%ebp)
 31e:	0f b6 00             	movzbl (%eax),%eax
 321:	0f be c0             	movsbl %al,%eax
 324:	3b 45 08             	cmp    0x8(%ebp),%eax
 327:	74 c6                	je     2ef <matchstar+0x6>
 329:	83 7d 08 2e          	cmpl   $0x2e,0x8(%ebp)
 32d:	74 c0                	je     2ef <matchstar+0x6>
  return 0;
 32f:	b8 00 00 00 00       	mov    $0x0,%eax
}
 334:	c9                   	leave  
 335:	c3                   	ret    
00000336 <stosb>:
               "cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
 336:	55                   	push   %ebp
 337:	89 e5                	mov    %esp,%ebp
 339:	57                   	push   %edi
 33a:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
 33b:	8b 4d 08             	mov    0x8(%ebp),%ecx
 33e:	8b 55 10             	mov    0x10(%ebp),%edx
 341:	8b 45 0c             	mov    0xc(%ebp),%eax
 344:	89 cb                	mov    %ecx,%ebx
 346:	89 df                	mov    %ebx,%edi
 348:	89 d1                	mov    %edx,%ecx
 34a:	fc                   	cld    
 34b:	f3 aa                	rep stos %al,%es:(%edi)
 34d:	89 ca                	mov    %ecx,%edx
 34f:	89 fb                	mov    %edi,%ebx
 351:	89 5d 08             	mov    %ebx,0x8(%ebp)
 354:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
 357:	90                   	nop
 358:	5b                   	pop    %ebx
 359:	5f                   	pop    %edi
 35a:	5d                   	pop    %ebp
 35b:	c3                   	ret    
0000035c <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
 35c:	55                   	push   %ebp
 35d:	89 e5                	mov    %esp,%ebp
 35f:	83 ec 10             	sub    $0x10,%esp
  char *os;
  os = s;
 362:	8b 45 08             	mov    0x8(%ebp),%eax
 365:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
 368:	90                   	nop
 369:	8b 45 08             	mov    0x8(%ebp),%eax
 36c:	8d 50 01             	lea    0x1(%eax),%edx
 36f:	89 55 08             	mov    %edx,0x8(%ebp)
 372:	8b 55 0c             	mov    0xc(%ebp),%edx
 375:	8d 4a 01             	lea    0x1(%edx),%ecx
 378:	89 4d 0c             	mov    %ecx,0xc(%ebp)
 37b:	0f b6 12             	movzbl (%edx),%edx
 37e:	88 10                	mov    %dl,(%eax)
 380:	0f b6 00             	movzbl (%eax),%eax
 383:	84 c0                	test   %al,%al
 385:	75 e2                	jne    369 <strcpy+0xd>
    ;
  return os;
 387:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 38a:	c9                   	leave  
 38b:	c3                   	ret    
0000038c <strcmp>:
int
strcmp(const char *p, const char *q)
{
 38c:	55                   	push   %ebp
 38d:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
 38f:	eb 08                	jmp    399 <strcmp+0xd>
    p++, q++;
 391:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 395:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
 399:	8b 45 08             	mov    0x8(%ebp),%eax
 39c:	0f b6 00             	movzbl (%eax),%eax
 39f:	84 c0                	test   %al,%al
 3a1:	74 10                	je     3b3 <strcmp+0x27>
 3a3:	8b 45 08             	mov    0x8(%ebp),%eax
 3a6:	0f b6 10             	movzbl (%eax),%edx
 3a9:	8b 45 0c             	mov    0xc(%ebp),%eax
 3ac:	0f b6 00             	movzbl (%eax),%eax
 3af:	38 c2                	cmp    %al,%dl
 3b1:	74 de                	je     391 <strcmp+0x5>
    p++, q++;
  return (uchar)*p - (uchar)*q;
 3b3:	8b 45 08             	mov    0x8(%ebp),%eax
 3b6:	0f b6 00             	movzbl (%eax),%eax
 3b9:	0f b6 d0             	movzbl %al,%edx
 3bc:	8b 45 0c             	mov    0xc(%ebp),%eax
 3bf:	0f b6 00             	movzbl (%eax),%eax
 3c2:	0f b6 c0             	movzbl %al,%eax
 3c5:	29 c2                	sub    %eax,%edx
 3c7:	89 d0                	mov    %edx,%eax
}
 3c9:	5d                   	pop    %ebp
 3ca:	c3                   	ret    
000003cb <strlen>:
uint
strlen(char *s)
{
 3cb:	55                   	push   %ebp
 3cc:	89 e5                	mov    %esp,%ebp
 3ce:	83 ec 10             	sub    $0x10,%esp
  int n;
  for(n = 0; s[n]; n++)
 3d1:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
 3d8:	eb 04                	jmp    3de <strlen+0x13>
 3da:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 3de:	8b 55 fc             	mov    -0x4(%ebp),%edx
 3e1:	8b 45 08             	mov    0x8(%ebp),%eax
 3e4:	01 d0                	add    %edx,%eax
 3e6:	0f b6 00             	movzbl (%eax),%eax
 3e9:	84 c0                	test   %al,%al
 3eb:	75 ed                	jne    3da <strlen+0xf>
    ;
  return n;
 3ed:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 3f0:	c9                   	leave  
 3f1:	c3                   	ret    
000003f2 <memset>:
void*
memset(void *dst, int c, uint n)
{
 3f2:	55                   	push   %ebp
 3f3:	89 e5                	mov    %esp,%ebp
  stosb(dst, c, n);
 3f5:	8b 45 10             	mov    0x10(%ebp),%eax
 3f8:	50                   	push   %eax
 3f9:	ff 75 0c             	pushl  0xc(%ebp)
 3fc:	ff 75 08             	pushl  0x8(%ebp)
 3ff:	e8 32 ff ff ff       	call   336 <stosb>
 404:	83 c4 0c             	add    $0xc,%esp
  return dst;
 407:	8b 45 08             	mov    0x8(%ebp),%eax
}
 40a:	c9                   	leave  
 40b:	c3                   	ret    
0000040c <strchr>:
char*
strchr(const char *s, char c)
{
 40c:	55                   	push   %ebp
 40d:	89 e5                	mov    %esp,%ebp
 40f:	83 ec 04             	sub    $0x4,%esp
 412:	8b 45 0c             	mov    0xc(%ebp),%eax
 415:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
 418:	eb 14                	jmp    42e <strchr+0x22>
    if(*s == c)
 41a:	8b 45 08             	mov    0x8(%ebp),%eax
 41d:	0f b6 00             	movzbl (%eax),%eax
 420:	3a 45 fc             	cmp    -0x4(%ebp),%al
 423:	75 05                	jne    42a <strchr+0x1e>
      return (char*)s;
 425:	8b 45 08             	mov    0x8(%ebp),%eax
 428:	eb 13                	jmp    43d <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 42a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 42e:	8b 45 08             	mov    0x8(%ebp),%eax
 431:	0f b6 00             	movzbl (%eax),%eax
 434:	84 c0                	test   %al,%al
 436:	75 e2                	jne    41a <strchr+0xe>
    if(*s == c)
      return (char*)s;
  return 0;
 438:	b8 00 00 00 00       	mov    $0x0,%eax
}
 43d:	c9                   	leave  
 43e:	c3                   	ret    
0000043f <gets>:
char*
gets(char *buf, int max)
{
 43f:	55                   	push   %ebp
 440:	89 e5                	mov    %esp,%ebp
 442:	83 ec 18             	sub    $0x18,%esp
  int i, cc;
  char c;
  for(i=0; i+1 < max; ){
 445:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 44c:	eb 42                	jmp    490 <gets+0x51>
    cc = read(0, &c, 1);
 44e:	83 ec 04             	sub    $0x4,%esp
 451:	6a 01                	push   $0x1
 453:	8d 45 ef             	lea    -0x11(%ebp),%eax
 456:	50                   	push   %eax
 457:	6a 00                	push   $0x0
 459:	e8 8c 01 00 00       	call   5ea <read>
 45e:	83 c4 10             	add    $0x10,%esp
 461:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 464:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 468:	7e 33                	jle    49d <gets+0x5e>
      break;
    buf[i++] = c;
 46a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 46d:	8d 50 01             	lea    0x1(%eax),%edx
 470:	89 55 f4             	mov    %edx,-0xc(%ebp)
 473:	89 c2                	mov    %eax,%edx
 475:	8b 45 08             	mov    0x8(%ebp),%eax
 478:	01 c2                	add    %eax,%edx
 47a:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 47e:	88 02                	mov    %al,(%edx)
    if(c == '\n' || c == '\r')
 480:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 484:	3c 0a                	cmp    $0xa,%al
 486:	74 16                	je     49e <gets+0x5f>
 488:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 48c:	3c 0d                	cmp    $0xd,%al
 48e:	74 0e                	je     49e <gets+0x5f>
gets(char *buf, int max)
{
  int i, cc;
  char c;
  for(i=0; i+1 < max; ){
 490:	8b 45 f4             	mov    -0xc(%ebp),%eax
 493:	83 c0 01             	add    $0x1,%eax
 496:	3b 45 0c             	cmp    0xc(%ebp),%eax
 499:	7c b3                	jl     44e <gets+0xf>
 49b:	eb 01                	jmp    49e <gets+0x5f>
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
 49d:	90                   	nop
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
 49e:	8b 55 f4             	mov    -0xc(%ebp),%edx
 4a1:	8b 45 08             	mov    0x8(%ebp),%eax
 4a4:	01 d0                	add    %edx,%eax
 4a6:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 4a9:	8b 45 08             	mov    0x8(%ebp),%eax
}
 4ac:	c9                   	leave  
 4ad:	c3                   	ret    
000004ae <stat>:
int
stat(char *n, struct stat *st)
{
 4ae:	55                   	push   %ebp
 4af:	89 e5                	mov    %esp,%ebp
 4b1:	83 ec 18             	sub    $0x18,%esp
  int fd;
  int r;
  fd = open(n, O_RDONLY);
 4b4:	83 ec 08             	sub    $0x8,%esp
 4b7:	6a 00                	push   $0x0
 4b9:	ff 75 08             	pushl  0x8(%ebp)
 4bc:	e8 51 01 00 00       	call   612 <open>
 4c1:	83 c4 10             	add    $0x10,%esp
 4c4:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 4c7:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 4cb:	79 07                	jns    4d4 <stat+0x26>
    return -1;
 4cd:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 4d2:	eb 25                	jmp    4f9 <stat+0x4b>
  r = fstat(fd, st);
 4d4:	83 ec 08             	sub    $0x8,%esp
 4d7:	ff 75 0c             	pushl  0xc(%ebp)
 4da:	ff 75 f4             	pushl  -0xc(%ebp)
 4dd:	e8 48 01 00 00       	call   62a <fstat>
 4e2:	83 c4 10             	add    $0x10,%esp
 4e5:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 4e8:	83 ec 0c             	sub    $0xc,%esp
 4eb:	ff 75 f4             	pushl  -0xc(%ebp)
 4ee:	e8 07 01 00 00       	call   5fa <close>
 4f3:	83 c4 10             	add    $0x10,%esp
  return r;
 4f6:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 4f9:	c9                   	leave  
 4fa:	c3                   	ret    
000004fb <atoi>:
// new atoi added 4/22/17 to be able to handle negative numbers
int
atoi(const char *s)
{
 4fb:	55                   	push   %ebp
 4fc:	89 e5                	mov    %esp,%ebp
 4fe:	83 ec 10             	sub    $0x10,%esp
  int n, sign;
  
  n=0;
 501:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while(*s==' ')s++;//Remove leading spaces
 508:	eb 04                	jmp    50e <atoi+0x13>
 50a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 50e:	8b 45 08             	mov    0x8(%ebp),%eax
 511:	0f b6 00             	movzbl (%eax),%eax
 514:	3c 20                	cmp    $0x20,%al
 516:	74 f2                	je     50a <atoi+0xf>
  sign =(*s=='-')?-1 : 1;
 518:	8b 45 08             	mov    0x8(%ebp),%eax
 51b:	0f b6 00             	movzbl (%eax),%eax
 51e:	3c 2d                	cmp    $0x2d,%al
 520:	75 07                	jne    529 <atoi+0x2e>
 522:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 527:	eb 05                	jmp    52e <atoi+0x33>
 529:	b8 01 00 00 00       	mov    $0x1,%eax
 52e:	89 45 f8             	mov    %eax,-0x8(%ebp)
  if(*s=='+' || *s=='-')
 531:	8b 45 08             	mov    0x8(%ebp),%eax
 534:	0f b6 00             	movzbl (%eax),%eax
 537:	3c 2b                	cmp    $0x2b,%al
 539:	74 0a                	je     545 <atoi+0x4a>
 53b:	8b 45 08             	mov    0x8(%ebp),%eax
 53e:	0f b6 00             	movzbl (%eax),%eax
 541:	3c 2d                	cmp    $0x2d,%al
 543:	75 2b                	jne    570 <atoi+0x75>
    s++;
 545:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  while('0' <= *s&&*s<='9')
 549:	eb 25                	jmp    570 <atoi+0x75>
    n = n*10 + *s++ - '0';
 54b:	8b 55 fc             	mov    -0x4(%ebp),%edx
 54e:	89 d0                	mov    %edx,%eax
 550:	c1 e0 02             	shl    $0x2,%eax
 553:	01 d0                	add    %edx,%eax
 555:	01 c0                	add    %eax,%eax
 557:	89 c1                	mov    %eax,%ecx
 559:	8b 45 08             	mov    0x8(%ebp),%eax
 55c:	8d 50 01             	lea    0x1(%eax),%edx
 55f:	89 55 08             	mov    %edx,0x8(%ebp)
 562:	0f b6 00             	movzbl (%eax),%eax
 565:	0f be c0             	movsbl %al,%eax
 568:	01 c8                	add    %ecx,%eax
 56a:	83 e8 30             	sub    $0x30,%eax
 56d:	89 45 fc             	mov    %eax,-0x4(%ebp)
  n=0;
  while(*s==' ')s++;//Remove leading spaces
  sign =(*s=='-')?-1 : 1;
  if(*s=='+' || *s=='-')
    s++;
  while('0' <= *s&&*s<='9')
 570:	8b 45 08             	mov    0x8(%ebp),%eax
 573:	0f b6 00             	movzbl (%eax),%eax
 576:	3c 2f                	cmp    $0x2f,%al
 578:	7e 0a                	jle    584 <atoi+0x89>
 57a:	8b 45 08             	mov    0x8(%ebp),%eax
 57d:	0f b6 00             	movzbl (%eax),%eax
 580:	3c 39                	cmp    $0x39,%al
 582:	7e c7                	jle    54b <atoi+0x50>
    n = n*10 + *s++ - '0';
  return sign*n;
 584:	8b 45 f8             	mov    -0x8(%ebp),%eax
 587:	0f af 45 fc          	imul   -0x4(%ebp),%eax
}
 58b:	c9                   	leave  
 58c:	c3                   	ret    
0000058d <memmove>:
  return n;
}
*/
void*
memmove(void *vdst, void *vsrc, int n)
{
 58d:	55                   	push   %ebp
 58e:	89 e5                	mov    %esp,%ebp
 590:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;
  
  dst = vdst;
 593:	8b 45 08             	mov    0x8(%ebp),%eax
 596:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 599:	8b 45 0c             	mov    0xc(%ebp),%eax
 59c:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 59f:	eb 17                	jmp    5b8 <memmove+0x2b>
    *dst++ = *src++;
 5a1:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5a4:	8d 50 01             	lea    0x1(%eax),%edx
 5a7:	89 55 fc             	mov    %edx,-0x4(%ebp)
 5aa:	8b 55 f8             	mov    -0x8(%ebp),%edx
 5ad:	8d 4a 01             	lea    0x1(%edx),%ecx
 5b0:	89 4d f8             	mov    %ecx,-0x8(%ebp)
 5b3:	0f b6 12             	movzbl (%edx),%edx
 5b6:	88 10                	mov    %dl,(%eax)
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 5b8:	8b 45 10             	mov    0x10(%ebp),%eax
 5bb:	8d 50 ff             	lea    -0x1(%eax),%edx
 5be:	89 55 10             	mov    %edx,0x10(%ebp)
 5c1:	85 c0                	test   %eax,%eax
 5c3:	7f dc                	jg     5a1 <memmove+0x14>
    *dst++ = *src++;
  return vdst;
 5c5:	8b 45 08             	mov    0x8(%ebp),%eax
}
 5c8:	c9                   	leave  
 5c9:	c3                   	ret    
000005ca <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret
SYSCALL(fork)
 5ca:	b8 01 00 00 00       	mov    $0x1,%eax
 5cf:	cd 40                	int    $0x40
 5d1:	c3                   	ret    
000005d2 <exit>:
SYSCALL(exit)
 5d2:	b8 02 00 00 00       	mov    $0x2,%eax
 5d7:	cd 40                	int    $0x40
 5d9:	c3                   	ret    
000005da <wait>:
SYSCALL(wait)
 5da:	b8 03 00 00 00       	mov    $0x3,%eax
 5df:	cd 40                	int    $0x40
 5e1:	c3                   	ret    
000005e2 <pipe>:
SYSCALL(pipe)
 5e2:	b8 04 00 00 00       	mov    $0x4,%eax
 5e7:	cd 40                	int    $0x40
 5e9:	c3                   	ret    
000005ea <read>:
SYSCALL(read)
 5ea:	b8 05 00 00 00       	mov    $0x5,%eax
 5ef:	cd 40                	int    $0x40
 5f1:	c3                   	ret    
000005f2 <write>:
SYSCALL(write)
 5f2:	b8 10 00 00 00       	mov    $0x10,%eax
 5f7:	cd 40                	int    $0x40
 5f9:	c3                   	ret    
000005fa <close>:
SYSCALL(close)
 5fa:	b8 15 00 00 00       	mov    $0x15,%eax
 5ff:	cd 40                	int    $0x40
 601:	c3                   	ret    
00000602 <kill>:
SYSCALL(kill)
 602:	b8 06 00 00 00       	mov    $0x6,%eax
 607:	cd 40                	int    $0x40
 609:	c3                   	ret    
0000060a <exec>:
SYSCALL(exec)
 60a:	b8 07 00 00 00       	mov    $0x7,%eax
 60f:	cd 40                	int    $0x40
 611:	c3                   	ret    
00000612 <open>:
SYSCALL(open)
 612:	b8 0f 00 00 00       	mov    $0xf,%eax
 617:	cd 40                	int    $0x40
 619:	c3                   	ret    
0000061a <mknod>:
SYSCALL(mknod)
 61a:	b8 11 00 00 00       	mov    $0x11,%eax
 61f:	cd 40                	int    $0x40
 621:	c3                   	ret    
00000622 <unlink>:
SYSCALL(unlink)
 622:	b8 12 00 00 00       	mov    $0x12,%eax
 627:	cd 40                	int    $0x40
 629:	c3                   	ret    
0000062a <fstat>:
SYSCALL(fstat)
 62a:	b8 08 00 00 00       	mov    $0x8,%eax
 62f:	cd 40                	int    $0x40
 631:	c3                   	ret    
00000632 <link>:
SYSCALL(link)
 632:	b8 13 00 00 00       	mov    $0x13,%eax
 637:	cd 40                	int    $0x40
 639:	c3                   	ret    
0000063a <mkdir>:
SYSCALL(mkdir)
 63a:	b8 14 00 00 00       	mov    $0x14,%eax
 63f:	cd 40                	int    $0x40
 641:	c3                   	ret    
00000642 <chdir>:
SYSCALL(chdir)
 642:	b8 09 00 00 00       	mov    $0x9,%eax
 647:	cd 40                	int    $0x40
 649:	c3                   	ret    
0000064a <dup>:
SYSCALL(dup)
 64a:	b8 0a 00 00 00       	mov    $0xa,%eax
 64f:	cd 40                	int    $0x40
 651:	c3                   	ret    
00000652 <getpid>:
SYSCALL(getpid)
 652:	b8 0b 00 00 00       	mov    $0xb,%eax
 657:	cd 40                	int    $0x40
 659:	c3                   	ret    
0000065a <sbrk>:
SYSCALL(sbrk)
 65a:	b8 0c 00 00 00       	mov    $0xc,%eax
 65f:	cd 40                	int    $0x40
 661:	c3                   	ret    
00000662 <sleep>:
SYSCALL(sleep)
 662:	b8 0d 00 00 00       	mov    $0xd,%eax
 667:	cd 40                	int    $0x40
 669:	c3                   	ret    
0000066a <uptime>:
SYSCALL(uptime)
 66a:	b8 0e 00 00 00       	mov    $0xe,%eax
 66f:	cd 40                	int    $0x40
 671:	c3                   	ret    
00000672 <halt>:
SYSCALL(halt)
 672:	b8 16 00 00 00       	mov    $0x16,%eax
 677:	cd 40                	int    $0x40
 679:	c3                   	ret    
0000067a <date>:
//Project additions
SYSCALL(date)
 67a:	b8 17 00 00 00       	mov    $0x17,%eax
 67f:	cd 40                	int    $0x40
 681:	c3                   	ret    
00000682 <getuid>:
SYSCALL(getuid)
 682:	b8 18 00 00 00       	mov    $0x18,%eax
 687:	cd 40                	int    $0x40
 689:	c3                   	ret    
0000068a <getgid>:
SYSCALL(getgid)
 68a:	b8 19 00 00 00       	mov    $0x19,%eax
 68f:	cd 40                	int    $0x40
 691:	c3                   	ret    
00000692 <getppid>:
SYSCALL(getppid)
 692:	b8 1a 00 00 00       	mov    $0x1a,%eax
 697:	cd 40                	int    $0x40
 699:	c3                   	ret    
0000069a <setuid>:
SYSCALL(setuid)
 69a:	b8 1b 00 00 00       	mov    $0x1b,%eax
 69f:	cd 40                	int    $0x40
 6a1:	c3                   	ret    
000006a2 <setgid>:
SYSCALL(setgid)
 6a2:	b8 1c 00 00 00       	mov    $0x1c,%eax
 6a7:	cd 40                	int    $0x40
 6a9:	c3                   	ret    
000006aa <getprocs>:
SYSCALL(getprocs)
 6aa:	b8 1d 00 00 00       	mov    $0x1d,%eax
 6af:	cd 40                	int    $0x40
 6b1:	c3                   	ret    
000006b2 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
 6b2:	55                   	push   %ebp
 6b3:	89 e5                	mov    %esp,%ebp
 6b5:	83 ec 18             	sub    $0x18,%esp
 6b8:	8b 45 0c             	mov    0xc(%ebp),%eax
 6bb:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 6be:	83 ec 04             	sub    $0x4,%esp
 6c1:	6a 01                	push   $0x1
 6c3:	8d 45 f4             	lea    -0xc(%ebp),%eax
 6c6:	50                   	push   %eax
 6c7:	ff 75 08             	pushl  0x8(%ebp)
 6ca:	e8 23 ff ff ff       	call   5f2 <write>
 6cf:	83 c4 10             	add    $0x10,%esp
}
 6d2:	90                   	nop
 6d3:	c9                   	leave  
 6d4:	c3                   	ret    
000006d5 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
 6d5:	55                   	push   %ebp
 6d6:	89 e5                	mov    %esp,%ebp
 6d8:	53                   	push   %ebx
 6d9:	83 ec 24             	sub    $0x24,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;
  neg = 0;
 6dc:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 6e3:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 6e7:	74 17                	je     700 <printint+0x2b>
 6e9:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 6ed:	79 11                	jns    700 <printint+0x2b>
    neg = 1;
 6ef:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 6f6:	8b 45 0c             	mov    0xc(%ebp),%eax
 6f9:	f7 d8                	neg    %eax
 6fb:	89 45 ec             	mov    %eax,-0x14(%ebp)
 6fe:	eb 06                	jmp    706 <printint+0x31>
  } else {
    x = xx;
 700:	8b 45 0c             	mov    0xc(%ebp),%eax
 703:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }
  i = 0;
 706:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 70d:	8b 4d f4             	mov    -0xc(%ebp),%ecx
 710:	8d 41 01             	lea    0x1(%ecx),%eax
 713:	89 45 f4             	mov    %eax,-0xc(%ebp)
 716:	8b 5d 10             	mov    0x10(%ebp),%ebx
 719:	8b 45 ec             	mov    -0x14(%ebp),%eax
 71c:	ba 00 00 00 00       	mov    $0x0,%edx
 721:	f7 f3                	div    %ebx
 723:	89 d0                	mov    %edx,%eax
 725:	0f b6 80 4c 0e 00 00 	movzbl 0xe4c(%eax),%eax
 72c:	88 44 0d dc          	mov    %al,-0x24(%ebp,%ecx,1)
  }while((x /= base) != 0);
 730:	8b 5d 10             	mov    0x10(%ebp),%ebx
 733:	8b 45 ec             	mov    -0x14(%ebp),%eax
 736:	ba 00 00 00 00       	mov    $0x0,%edx
 73b:	f7 f3                	div    %ebx
 73d:	89 45 ec             	mov    %eax,-0x14(%ebp)
 740:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 744:	75 c7                	jne    70d <printint+0x38>
  if(neg)
 746:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 74a:	74 2d                	je     779 <printint+0xa4>
    buf[i++] = '-';
 74c:	8b 45 f4             	mov    -0xc(%ebp),%eax
 74f:	8d 50 01             	lea    0x1(%eax),%edx
 752:	89 55 f4             	mov    %edx,-0xc(%ebp)
 755:	c6 44 05 dc 2d       	movb   $0x2d,-0x24(%ebp,%eax,1)
  while(--i >= 0)
 75a:	eb 1d                	jmp    779 <printint+0xa4>
    putc(fd, buf[i]);
 75c:	8d 55 dc             	lea    -0x24(%ebp),%edx
 75f:	8b 45 f4             	mov    -0xc(%ebp),%eax
 762:	01 d0                	add    %edx,%eax
 764:	0f b6 00             	movzbl (%eax),%eax
 767:	0f be c0             	movsbl %al,%eax
 76a:	83 ec 08             	sub    $0x8,%esp
 76d:	50                   	push   %eax
 76e:	ff 75 08             	pushl  0x8(%ebp)
 771:	e8 3c ff ff ff       	call   6b2 <putc>
 776:	83 c4 10             	add    $0x10,%esp
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';
  while(--i >= 0)
 779:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 77d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 781:	79 d9                	jns    75c <printint+0x87>
    putc(fd, buf[i]);
}
 783:	90                   	nop
 784:	8b 5d fc             	mov    -0x4(%ebp),%ebx
 787:	c9                   	leave  
 788:	c3                   	ret    
00000789 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 789:	55                   	push   %ebp
 78a:	89 e5                	mov    %esp,%ebp
 78c:	83 ec 28             	sub    $0x28,%esp
  char *s;
  int c, i, state;
  uint *ap;
  state = 0;
 78f:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 796:	8d 45 0c             	lea    0xc(%ebp),%eax
 799:	83 c0 04             	add    $0x4,%eax
 79c:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 79f:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 7a6:	e9 59 01 00 00       	jmp    904 <printf+0x17b>
    c = fmt[i] & 0xff;
 7ab:	8b 55 0c             	mov    0xc(%ebp),%edx
 7ae:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7b1:	01 d0                	add    %edx,%eax
 7b3:	0f b6 00             	movzbl (%eax),%eax
 7b6:	0f be c0             	movsbl %al,%eax
 7b9:	25 ff 00 00 00       	and    $0xff,%eax
 7be:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 7c1:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 7c5:	75 2c                	jne    7f3 <printf+0x6a>
      if(c == '%'){
 7c7:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 7cb:	75 0c                	jne    7d9 <printf+0x50>
        state = '%';
 7cd:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 7d4:	e9 27 01 00 00       	jmp    900 <printf+0x177>
      } else {
        putc(fd, c);
 7d9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 7dc:	0f be c0             	movsbl %al,%eax
 7df:	83 ec 08             	sub    $0x8,%esp
 7e2:	50                   	push   %eax
 7e3:	ff 75 08             	pushl  0x8(%ebp)
 7e6:	e8 c7 fe ff ff       	call   6b2 <putc>
 7eb:	83 c4 10             	add    $0x10,%esp
 7ee:	e9 0d 01 00 00       	jmp    900 <printf+0x177>
      }
    } else if(state == '%'){
 7f3:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 7f7:	0f 85 03 01 00 00    	jne    900 <printf+0x177>
      if(c == 'd'){
 7fd:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 801:	75 1e                	jne    821 <printf+0x98>
        printint(fd, *ap, 10, 1);
 803:	8b 45 e8             	mov    -0x18(%ebp),%eax
 806:	8b 00                	mov    (%eax),%eax
 808:	6a 01                	push   $0x1
 80a:	6a 0a                	push   $0xa
 80c:	50                   	push   %eax
 80d:	ff 75 08             	pushl  0x8(%ebp)
 810:	e8 c0 fe ff ff       	call   6d5 <printint>
 815:	83 c4 10             	add    $0x10,%esp
        ap++;
 818:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 81c:	e9 d8 00 00 00       	jmp    8f9 <printf+0x170>
      } else if(c == 'x' || c == 'p'){
 821:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 825:	74 06                	je     82d <printf+0xa4>
 827:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 82b:	75 1e                	jne    84b <printf+0xc2>
        printint(fd, *ap, 16, 0);
 82d:	8b 45 e8             	mov    -0x18(%ebp),%eax
 830:	8b 00                	mov    (%eax),%eax
 832:	6a 00                	push   $0x0
 834:	6a 10                	push   $0x10
 836:	50                   	push   %eax
 837:	ff 75 08             	pushl  0x8(%ebp)
 83a:	e8 96 fe ff ff       	call   6d5 <printint>
 83f:	83 c4 10             	add    $0x10,%esp
        ap++;
 842:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 846:	e9 ae 00 00 00       	jmp    8f9 <printf+0x170>
      } else if(c == 's'){
 84b:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 84f:	75 43                	jne    894 <printf+0x10b>
        s = (char*)*ap;
 851:	8b 45 e8             	mov    -0x18(%ebp),%eax
 854:	8b 00                	mov    (%eax),%eax
 856:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 859:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 85d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 861:	75 25                	jne    888 <printf+0xff>
          s = "(null)";
 863:	c7 45 f4 76 0b 00 00 	movl   $0xb76,-0xc(%ebp)
        while(*s != 0){
 86a:	eb 1c                	jmp    888 <printf+0xff>
          putc(fd, *s);
 86c:	8b 45 f4             	mov    -0xc(%ebp),%eax
 86f:	0f b6 00             	movzbl (%eax),%eax
 872:	0f be c0             	movsbl %al,%eax
 875:	83 ec 08             	sub    $0x8,%esp
 878:	50                   	push   %eax
 879:	ff 75 08             	pushl  0x8(%ebp)
 87c:	e8 31 fe ff ff       	call   6b2 <putc>
 881:	83 c4 10             	add    $0x10,%esp
          s++;
 884:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 888:	8b 45 f4             	mov    -0xc(%ebp),%eax
 88b:	0f b6 00             	movzbl (%eax),%eax
 88e:	84 c0                	test   %al,%al
 890:	75 da                	jne    86c <printf+0xe3>
 892:	eb 65                	jmp    8f9 <printf+0x170>
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 894:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 898:	75 1d                	jne    8b7 <printf+0x12e>
        putc(fd, *ap);
 89a:	8b 45 e8             	mov    -0x18(%ebp),%eax
 89d:	8b 00                	mov    (%eax),%eax
 89f:	0f be c0             	movsbl %al,%eax
 8a2:	83 ec 08             	sub    $0x8,%esp
 8a5:	50                   	push   %eax
 8a6:	ff 75 08             	pushl  0x8(%ebp)
 8a9:	e8 04 fe ff ff       	call   6b2 <putc>
 8ae:	83 c4 10             	add    $0x10,%esp
        ap++;
 8b1:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 8b5:	eb 42                	jmp    8f9 <printf+0x170>
      } else if(c == '%'){
 8b7:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 8bb:	75 17                	jne    8d4 <printf+0x14b>
        putc(fd, c);
 8bd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 8c0:	0f be c0             	movsbl %al,%eax
 8c3:	83 ec 08             	sub    $0x8,%esp
 8c6:	50                   	push   %eax
 8c7:	ff 75 08             	pushl  0x8(%ebp)
 8ca:	e8 e3 fd ff ff       	call   6b2 <putc>
 8cf:	83 c4 10             	add    $0x10,%esp
 8d2:	eb 25                	jmp    8f9 <printf+0x170>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 8d4:	83 ec 08             	sub    $0x8,%esp
 8d7:	6a 25                	push   $0x25
 8d9:	ff 75 08             	pushl  0x8(%ebp)
 8dc:	e8 d1 fd ff ff       	call   6b2 <putc>
 8e1:	83 c4 10             	add    $0x10,%esp
        putc(fd, c);
 8e4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 8e7:	0f be c0             	movsbl %al,%eax
 8ea:	83 ec 08             	sub    $0x8,%esp
 8ed:	50                   	push   %eax
 8ee:	ff 75 08             	pushl  0x8(%ebp)
 8f1:	e8 bc fd ff ff       	call   6b2 <putc>
 8f6:	83 c4 10             	add    $0x10,%esp
      }
      state = 0;
 8f9:	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++){
 900:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 904:	8b 55 0c             	mov    0xc(%ebp),%edx
 907:	8b 45 f0             	mov    -0x10(%ebp),%eax
 90a:	01 d0                	add    %edx,%eax
 90c:	0f b6 00             	movzbl (%eax),%eax
 90f:	84 c0                	test   %al,%al
 911:	0f 85 94 fe ff ff    	jne    7ab <printf+0x22>
        putc(fd, c);
      }
      state = 0;
    }
  }
}
 917:	90                   	nop
 918:	c9                   	leave  
 919:	c3                   	ret    
0000091a <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
 91a:	55                   	push   %ebp
 91b:	89 e5                	mov    %esp,%ebp
 91d:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;
  bp = (Header*)ap - 1;
 920:	8b 45 08             	mov    0x8(%ebp),%eax
 923:	83 e8 08             	sub    $0x8,%eax
 926:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 929:	a1 68 0e 00 00       	mov    0xe68,%eax
 92e:	89 45 fc             	mov    %eax,-0x4(%ebp)
 931:	eb 24                	jmp    957 <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 933:	8b 45 fc             	mov    -0x4(%ebp),%eax
 936:	8b 00                	mov    (%eax),%eax
 938:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 93b:	77 12                	ja     94f <free+0x35>
 93d:	8b 45 f8             	mov    -0x8(%ebp),%eax
 940:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 943:	77 24                	ja     969 <free+0x4f>
 945:	8b 45 fc             	mov    -0x4(%ebp),%eax
 948:	8b 00                	mov    (%eax),%eax
 94a:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 94d:	77 1a                	ja     969 <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)
 94f:	8b 45 fc             	mov    -0x4(%ebp),%eax
 952:	8b 00                	mov    (%eax),%eax
 954:	89 45 fc             	mov    %eax,-0x4(%ebp)
 957:	8b 45 f8             	mov    -0x8(%ebp),%eax
 95a:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 95d:	76 d4                	jbe    933 <free+0x19>
 95f:	8b 45 fc             	mov    -0x4(%ebp),%eax
 962:	8b 00                	mov    (%eax),%eax
 964:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 967:	76 ca                	jbe    933 <free+0x19>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
 969:	8b 45 f8             	mov    -0x8(%ebp),%eax
 96c:	8b 40 04             	mov    0x4(%eax),%eax
 96f:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 976:	8b 45 f8             	mov    -0x8(%ebp),%eax
 979:	01 c2                	add    %eax,%edx
 97b:	8b 45 fc             	mov    -0x4(%ebp),%eax
 97e:	8b 00                	mov    (%eax),%eax
 980:	39 c2                	cmp    %eax,%edx
 982:	75 24                	jne    9a8 <free+0x8e>
    bp->s.size += p->s.ptr->s.size;
 984:	8b 45 f8             	mov    -0x8(%ebp),%eax
 987:	8b 50 04             	mov    0x4(%eax),%edx
 98a:	8b 45 fc             	mov    -0x4(%ebp),%eax
 98d:	8b 00                	mov    (%eax),%eax
 98f:	8b 40 04             	mov    0x4(%eax),%eax
 992:	01 c2                	add    %eax,%edx
 994:	8b 45 f8             	mov    -0x8(%ebp),%eax
 997:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 99a:	8b 45 fc             	mov    -0x4(%ebp),%eax
 99d:	8b 00                	mov    (%eax),%eax
 99f:	8b 10                	mov    (%eax),%edx
 9a1:	8b 45 f8             	mov    -0x8(%ebp),%eax
 9a4:	89 10                	mov    %edx,(%eax)
 9a6:	eb 0a                	jmp    9b2 <free+0x98>
  } else
    bp->s.ptr = p->s.ptr;
 9a8:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9ab:	8b 10                	mov    (%eax),%edx
 9ad:	8b 45 f8             	mov    -0x8(%ebp),%eax
 9b0:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 9b2:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9b5:	8b 40 04             	mov    0x4(%eax),%eax
 9b8:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 9bf:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9c2:	01 d0                	add    %edx,%eax
 9c4:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 9c7:	75 20                	jne    9e9 <free+0xcf>
    p->s.size += bp->s.size;
 9c9:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9cc:	8b 50 04             	mov    0x4(%eax),%edx
 9cf:	8b 45 f8             	mov    -0x8(%ebp),%eax
 9d2:	8b 40 04             	mov    0x4(%eax),%eax
 9d5:	01 c2                	add    %eax,%edx
 9d7:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9da:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 9dd:	8b 45 f8             	mov    -0x8(%ebp),%eax
 9e0:	8b 10                	mov    (%eax),%edx
 9e2:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9e5:	89 10                	mov    %edx,(%eax)
 9e7:	eb 08                	jmp    9f1 <free+0xd7>
  } else
    p->s.ptr = bp;
 9e9:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9ec:	8b 55 f8             	mov    -0x8(%ebp),%edx
 9ef:	89 10                	mov    %edx,(%eax)
  freep = p;
 9f1:	8b 45 fc             	mov    -0x4(%ebp),%eax
 9f4:	a3 68 0e 00 00       	mov    %eax,0xe68
}
 9f9:	90                   	nop
 9fa:	c9                   	leave  
 9fb:	c3                   	ret    
000009fc <morecore>:
static Header*
morecore(uint nu)
{
 9fc:	55                   	push   %ebp
 9fd:	89 e5                	mov    %esp,%ebp
 9ff:	83 ec 18             	sub    $0x18,%esp
  char *p;
  Header *hp;
  if(nu < 4096)
 a02:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 a09:	77 07                	ja     a12 <morecore+0x16>
    nu = 4096;
 a0b:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 a12:	8b 45 08             	mov    0x8(%ebp),%eax
 a15:	c1 e0 03             	shl    $0x3,%eax
 a18:	83 ec 0c             	sub    $0xc,%esp
 a1b:	50                   	push   %eax
 a1c:	e8 39 fc ff ff       	call   65a <sbrk>
 a21:	83 c4 10             	add    $0x10,%esp
 a24:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 a27:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 a2b:	75 07                	jne    a34 <morecore+0x38>
    return 0;
 a2d:	b8 00 00 00 00       	mov    $0x0,%eax
 a32:	eb 26                	jmp    a5a <morecore+0x5e>
  hp = (Header*)p;
 a34:	8b 45 f4             	mov    -0xc(%ebp),%eax
 a37:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 a3a:	8b 45 f0             	mov    -0x10(%ebp),%eax
 a3d:	8b 55 08             	mov    0x8(%ebp),%edx
 a40:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 a43:	8b 45 f0             	mov    -0x10(%ebp),%eax
 a46:	83 c0 08             	add    $0x8,%eax
 a49:	83 ec 0c             	sub    $0xc,%esp
 a4c:	50                   	push   %eax
 a4d:	e8 c8 fe ff ff       	call   91a <free>
 a52:	83 c4 10             	add    $0x10,%esp
  return freep;
 a55:	a1 68 0e 00 00       	mov    0xe68,%eax
}
 a5a:	c9                   	leave  
 a5b:	c3                   	ret    
00000a5c <malloc>:
void*
malloc(uint nbytes)
{
 a5c:	55                   	push   %ebp
 a5d:	89 e5                	mov    %esp,%ebp
 a5f:	83 ec 18             	sub    $0x18,%esp
  Header *p, *prevp;
  uint nunits;
  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 a62:	8b 45 08             	mov    0x8(%ebp),%eax
 a65:	83 c0 07             	add    $0x7,%eax
 a68:	c1 e8 03             	shr    $0x3,%eax
 a6b:	83 c0 01             	add    $0x1,%eax
 a6e:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 a71:	a1 68 0e 00 00       	mov    0xe68,%eax
 a76:	89 45 f0             	mov    %eax,-0x10(%ebp)
 a79:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 a7d:	75 23                	jne    aa2 <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 a7f:	c7 45 f0 60 0e 00 00 	movl   $0xe60,-0x10(%ebp)
 a86:	8b 45 f0             	mov    -0x10(%ebp),%eax
 a89:	a3 68 0e 00 00       	mov    %eax,0xe68
 a8e:	a1 68 0e 00 00       	mov    0xe68,%eax
 a93:	a3 60 0e 00 00       	mov    %eax,0xe60
    base.s.size = 0;
 a98:	c7 05 64 0e 00 00 00 	movl   $0x0,0xe64
 a9f:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 aa2:	8b 45 f0             	mov    -0x10(%ebp),%eax
 aa5:	8b 00                	mov    (%eax),%eax
 aa7:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 aaa:	8b 45 f4             	mov    -0xc(%ebp),%eax
 aad:	8b 40 04             	mov    0x4(%eax),%eax
 ab0:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 ab3:	72 4d                	jb     b02 <malloc+0xa6>
      if(p->s.size == nunits)
 ab5:	8b 45 f4             	mov    -0xc(%ebp),%eax
 ab8:	8b 40 04             	mov    0x4(%eax),%eax
 abb:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 abe:	75 0c                	jne    acc <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 ac0:	8b 45 f4             	mov    -0xc(%ebp),%eax
 ac3:	8b 10                	mov    (%eax),%edx
 ac5:	8b 45 f0             	mov    -0x10(%ebp),%eax
 ac8:	89 10                	mov    %edx,(%eax)
 aca:	eb 26                	jmp    af2 <malloc+0x96>
      else {
        p->s.size -= nunits;
 acc:	8b 45 f4             	mov    -0xc(%ebp),%eax
 acf:	8b 40 04             	mov    0x4(%eax),%eax
 ad2:	2b 45 ec             	sub    -0x14(%ebp),%eax
 ad5:	89 c2                	mov    %eax,%edx
 ad7:	8b 45 f4             	mov    -0xc(%ebp),%eax
 ada:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 add:	8b 45 f4             	mov    -0xc(%ebp),%eax
 ae0:	8b 40 04             	mov    0x4(%eax),%eax
 ae3:	c1 e0 03             	shl    $0x3,%eax
 ae6:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 ae9:	8b 45 f4             	mov    -0xc(%ebp),%eax
 aec:	8b 55 ec             	mov    -0x14(%ebp),%edx
 aef:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 af2:	8b 45 f0             	mov    -0x10(%ebp),%eax
 af5:	a3 68 0e 00 00       	mov    %eax,0xe68
      return (void*)(p + 1);
 afa:	8b 45 f4             	mov    -0xc(%ebp),%eax
 afd:	83 c0 08             	add    $0x8,%eax
 b00:	eb 3b                	jmp    b3d <malloc+0xe1>
    }
    if(p == freep)
 b02:	a1 68 0e 00 00       	mov    0xe68,%eax
 b07:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 b0a:	75 1e                	jne    b2a <malloc+0xce>
      if((p = morecore(nunits)) == 0)
 b0c:	83 ec 0c             	sub    $0xc,%esp
 b0f:	ff 75 ec             	pushl  -0x14(%ebp)
 b12:	e8 e5 fe ff ff       	call   9fc <morecore>
 b17:	83 c4 10             	add    $0x10,%esp
 b1a:	89 45 f4             	mov    %eax,-0xc(%ebp)
 b1d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 b21:	75 07                	jne    b2a <malloc+0xce>
        return 0;
 b23:	b8 00 00 00 00       	mov    $0x0,%eax
 b28:	eb 13                	jmp    b3d <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){
 b2a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 b2d:	89 45 f0             	mov    %eax,-0x10(%ebp)
 b30:	8b 45 f4             	mov    -0xc(%ebp),%eax
 b33:	8b 00                	mov    (%eax),%eax
 b35:	89 45 f4             	mov    %eax,-0xc(%ebp)
      return (void*)(p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
 b38:	e9 6d ff ff ff       	jmp    aaa <malloc+0x4e>
}
 b3d:	c9                   	leave  
 b3e:	c3                   	ret    
 
 | 35.028186 
							 | 63 
							 | 0.423836 
							 | 
					
	512005be8b5d0b3a284ce22254e49f4c0ad7815c 
 | 561 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/313/A313778.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/313/A313778.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/313/A313778.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A313778: Coordination sequence Gal.6.203.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Simon Strandgaard
; 1,5,10,15,21,26,30,34,39,45,50,55,60,65,70,75,81,86,90,94,99,105,110,115,120,125,130,135,141,146,150,154,159,165,170,175,180,185,190,195
seq $0,315768 ; Coordination sequence Gal.6.628.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
mul $0,6
add $0,3
div $0,7
 
 | 62.333333 
							 | 182 
							 | 0.752228 
							 | 
					
	f72e800b2c700b1ab59b99e9bf7b068e6bc7c80a 
 | 13,665 
							 | 
	asm 
 | 
	Assembly 
 | 
	crd2consl/crd2consl.asm 
 | 
	s390guy/simh_tests 
 | 
	545ca36d735f1136594c14ccabc8f5020a9d75e8 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2021-12-01T01:32:22.000Z 
 | 
	2021-12-01T01:32:22.000Z 
 | 
	crd2consl/crd2consl.asm 
 | 
	s390guy/simh_tests 
 | 
	545ca36d735f1136594c14ccabc8f5020a9d75e8 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	crd2consl/crd2consl.asm 
 | 
	s390guy/simh_tests 
 | 
	545ca36d735f1136594c14ccabc8f5020a9d75e8 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	* Copyright 2021 Harold Grovesteen
*
* MIT License:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
         TITLE 'CRD2CONSL - SEND CARD CONTENTS TO CONSOLE'
* Program Description:
*
* CRD2CONSL is a bare-metal program.  It requires input/output commands to
* the IPL card stream to read a card's contents and then send the card's
* contents to the consolde device.
*
* The program is executed by means of an IPL from a card deck containing as
* the last card the one that is sent to the console.  The card contains
* EBCDIC data and is part of the IPL deck.
*
* Target Architecture: S/360
*
* Devices Used:
*   10C - IPL card reader
*   01F - Console device
*
* Program Register Usage:
*
*   R0   Base register for access to the ASA.  Required by DSECT usage
*   R1   Device Channel and Unit Address for I/O instructions
*   R11  Contains zero for STATUS clearing (zero from CPU reset).
*   R12  The program base register
*   R15  Subroutine return register
*
* Disabled Wait State PSW's address field values used by the program:
*    X'000000' - Successful execution of the program
*    X'000008' - Unexpected Restart interruption occurred. Old Restart PSW at
*                address X'8'
*    X'000018' - Unexpected External interruption occurred.  Old External PSW at
*                address X'18'
*    X'000020' - Unexpected Supervisor interruption occurred.  Old Supervisor
*                PSW at address X'20'
*    X'000028' - Unexpected Program interruption occurred. Old Program PSW at
*                address X'28'
*    X'000030' - Unexpected Machine Check interruption occurred.  Old Machine
*                Check PSW at address X'30'
*    X'000038' - Unexpected Input/Output interruption occurred.  Old Input/Output
*                PSW at address X'38'
*    X'010004' - Console Device X'01F' or channel not operational
*    X'010008' - Console Device X'01F' or channel busy
*    X'01000C' - Console Device X'01F' or channel had a problem. See CSW.
*    X'010010' - Unexpected interruption from some other device. See ASA X'BA'
*    X'010014' - Console channel error occurred
*    X'010018' - Console device did not complete the I/O without a problem
*    X'020004' - Reader Device X'00C' or channel not operational
*    X'020008' - Reader Device X'00C' or channel busy
*    X'02000C' - Reader Device X'00C' or channel had a problem. See CSW.
*    X'020010' - Not used
*    X'020014' - Reader channel error occurred
*    X'020018' - Reader device did not complete the I/O without a problem
         EJECT
* See all object data and macro generated model statements in the listing
         PRINT DATA,GEN
         SPACE 1
* Inform the SATK macros of the architecture being targeted.  Inferred from
* the ASMA -t command-line argument.
         ARCHLVL
* Ensure interrupt traps are loaded by iplasma.py before program execution
* begins.  This macro will create the memory region that will also contain
* the IPL PSW.  The region name defaults to ASAREGN.  iplasma.py knows how
* to deal with this situation.
ASASECT  ASALOAD
         ASAIPL IA=PGMSTART    Define the bare-metal program's IPL PSW
         SPACE 2
*
* The Bare-Metal Hello World Program
*
         SPACE 1
PGMSECT  START X'2000',CRD2CSL Start a second region for the program itself
* This results in CRD2CSL.bin being created in the list directed IPL directory
         USING ASA,0           Give me instruction access to the ASA CSECT
PGMSTART BALR  12,0            Establish my base register
         USING *,12            Tell the assembler
         SPACE 1
         LH    1,2         Get the card reader device address (stored by IPL)
* Do this before bytes 2 and 3 are overlayed by the restart trap PSW.
         SPACE 1
* Ensure program is not re-entered by a Hercules console initiated restart.
* Address 0 changed from its absolute storage role (IPL PSW) to its real
* storage role (Restart New PSW) after the IPL.
* Change from the IPL PSW at address 0 to Restart New PSW trap
         MVC   RSTNPSW,PGMRS
         SPACE 3
* Most systems pass control to the CPU following receipt of CE and DE from
* the IPL device.  On some systems, the transfer occurs upon receipt of
* CE allowing the device to later supply the DE.  The following code is
* used to effect the same wait for DE that usually happens by the hardware
* executing the IPL function.
IPLWAIT  TIO   0(1)     Request the IPL device status
         BC    B'0001',RNOAVL  If CC=3, device unavailable.  Tell someone.
* IF CC=2 or 1, busy or CSW stored, wait until the device is available.
* The assumption is that the CSW contains the DE that the program is waiting
* to see.  The program does not really care about the received status.  
* It is just looking for the IPL device to be available.
         BC    B'0110',IPLWAIT
* CC=0, available, allows the program to continue.
         SPACE 1
* Note: For systems the do NOT transfer control to the CPU until DE IS
* received, the above sequence will return CC=0 on the first TIO and proceed
* into the program as it would normally.
         SPACE 3
* Read a card from the IPL device
* No need to validate that the IPL device is present.  The fact that this
* program got loaded and is executing proves the reader device is present and
* working.
         MVC   CAW(4),RCCWADDR   Identify the IPL device CCW to be executed
         SIO   0(1)        Request the reader channel program to start, did it?
         BC    B'0001',RNOAVL  ..No, CC=3 don't know why, but tell someone.
         BC    B'0010',RBUSY   ..No, CC=2 console device or channel is busy
         BC    B'0100',RCSW    ..No, CC=1 CSW stored in ASA at X'40'
* Reader device is now sending the card's contents (CC=0)
* Wait for an I/O interruption
RDRWAIT  BAL   15,DOWAIT       WAIT FOR I/O interrupt
         SPACE 1
* I/O results can now be checked.
*   Yes, check the CSW conditions to determine if the console I/O worked
         OC    STATUS,CSW+4        Accummulate Device and Channel status
         CLI   STATUS+1,X'00'      Did the channel have, a problem?
         BNE   RCHLERR             ..Yes, end with a reader channel error
         TM    STATUS,X'F3'        Did the unit encounter a problem?
         BNZ   RUNTERR             ..No, end with a unit error
         TM    STATUS,X'0C'        Did both channel and unit end?
         BNO   RDRWAIT             Wait again for both to be done
* CARD HAS BEEN SUCCESSFULLY READ!
         SPACE 3
* Determine if the console device, subchannel and channel are ready for use.
         LH    1,CONDEV    Set up I/O device address in I/O instruction register
         TIO   0(1)        Determine if the console is there
         BC    B'0001',DEVNOAVL  ..No, CC=3 might have a different config address
         BC    B'0010',DEVBUSY   ..No, CC=2 console device or channel is busy
         BC    B'0100',DEVCSW    ..No, CC=1 CSW stored in ASA at X'40'
* Console device is available (CC=0)!
         SPACE 1
* Prepare for I/O to console
         STH   11,STATUS         Clear status for console I/O operation
         MVC   CAW(4),CCWADDR    Identify in ASA where first CCW resides
         SPACE 1
* Send the Hello World message to the console
         SIO   0(1)        Request console channel program to start, did it?
         BC    B'0001',DEVNOAVL  ..No, CC=3 don't know why, but tell someone.
         BC    B'0010',DEVBUSY   ..No, CC=2 console device or channel is busy
         BC    B'0100',DEVCSW    ..No, CC=1 CSW stored in ASA at X'40'
* Console device is now receiving the card contents (CC=0)
         SPACE 1
* Wait for an I/O interruption
CONWAIT  BAL   15,DOWAIT
         SPACE 1
* I/O results can now be checked.
*   Yes, check the CSW conditions to determine if the console I/O worked
         OC    STATUS,CSW+4        Accummulate Device and Channel status
         CLI   STATUS+1,X'00'      Did the channel have, a problem?
         BNE   CHNLERR             ..Yes, end with a channel error
         TM    STATUS,X'F3'        Did the unit encounter a problem?
         BNZ   UNITERR             ..No, end with a unit error
         TM    STATUS,X'0C'        Did both channel and unit end?
         BNO   CONWAIT              Wait again for both to be done
* Both channel and unit have ended
         SPACE 1
* HURRAY!  CARD CONTENTS HAVE BEEN SENT TO THE CONSOLE!
         LPSW  DONE      Normal program termination
         SPACE 3
*
* I/O WAIT SUBROUTINE
*
DOWAIT   MVC   IONPSW(8),CONT  Set up continuation PSW for after I/O interrupt
         LPSW  WAIT       Wait for I/O interruption and CSW from channel
IODONE   EQU   *          The bare-metal program continues here after I/O
         MVC   IONPSW(8),IOTRAP     Restore I/O trap PSW
*   Did the interruption come from the expected device?
         CH    1,IOOPSW+2          Is the interrupt from the expected device?
         BER   15                  ..Yes, return to caller
         B     DEVUNKN             ..No, end program with an error
         SPACE 3
* End the bare-metal program with an error indicated in PSW
DEVNOAVL LPSW  NODEV     Code 004 End console device is not available
DEVBUSY  LPSW  BUSYDEV   Code 008 End because device is busy (no wait)
DEVCSW   LPSW  CSWSTR    Code 00C End because CSW stored in ASA
DEVUNKN  LPSW  NOTCON    Code 010 End unexpected device caused I/O interruption
CHNLERR  LPSW  CHERROR   Code 014 End because console channel error occurred
UNITERR  LPSW  DVERROR   Code 018 End because console device error occurred
RNOAVL   LPSW  RNODEV    Code 004 End reader device is not available
RBUSY    LPSW  RBUSYDEV  Code 008 End because reader device is busy (no wait)
RCSW     LPSW  RCSWSTR   Code 00C End because CSW stored in ASA for reader
*RUNKN    LPSW  RNOTCON   Code 010 End unexpected device caused I/O interruption
RCHLERR  LPSW  RCHERROR  Code 014 End because reader channel error occurred
RUNTERR  LPSW  RDVERROR  Code 018 End because reader device error occurred
         SPACE 1
* I/O related information
CCWADDR  DC    A(CONCCW) Address of first CCW to be executed by console device.
RCCWADDR DC    A(RDRCCW) Address of first CCW to be executed by reader device.
CONDEV   DC    XL2'001F'   Console device address
STATUS   DC    XL2'0000'   Used to accumulate unit and channel status
         SPACE 1
* CCW used by the program to write the card contents to the console
CONCCW   CCW0  X'09',RIOAREA,0,L'RIOAREA     Write card to console with CR
*         CCW0  X'03',0,0,1                   ..then a NOP.
* If the preceding NOP CCW command is enabled, then the CONCCW must set
* command chaining in the flag byte, setting the third operand to X'40'
         SPACE 1
* CCW used to read the card from the IPL device stream on X'00C'
RDRCCW   CCW   X'02',RIOAREA,0,L'RIOAREA    Read the card into memory
*         CCW0  X'03',0,0,1                   ..then a NOP.
* If the preceding NOP CCW command is enabled, then the RDRCW must set
* command chaining in the flag byte, setting the third operand to X'40'
         SPACE 1
* PSW's used by the bare-metal program
PGMRS    DWAIT CODE=008     Restart New PSW trap.  Points to Restart Old PSW
WAIT     PSW360 X'F8',0,2,0,0    Causes CPU to wait for I/O interruption
CONT     PSW360 0,0,0,0,IODONE   Causes the CPU to continue after waiting
IOTRAP   PSW360 0,0,2,0,X'38'    I/O trap New PSW (restored after I/O)
         SPACE 1
* PSW's terminating program execution
DONE     DWAITEND              Successful execution of the program
NODEV    DWAIT PGM=01,CMP=0,CODE=004  Console device not available
BUSYDEV  DWAIT PGM=01,CMP=0,CODE=008  Console device busy
CSWSTR   DWAIT PGM=01,CMP=0,CODE=00C  CSW stored in ASA
NOTCON   DWAIT PGM=01,CMP=0,CODE=010  Unexpected interruption from other device
CHERROR  DWAIT PGM=01,CMP=0,CODE=014  Console channel error occurred
DVERROR  DWAIT PGM=01,CMP=0,CODE=018  Console device error occurred
RNODEV   DWAIT PGM=02,CMP=0,CODE=004  Reader device not available
RBUSYDEV DWAIT PGM=02,CMP=0,CODE=008  Reader device busy
RCSWSTR  DWAIT PGM=02,CMP=0,CODE=00C  CSW stored in ASA
*RNOTCON DWAIT PGM=02,CMP=0,CODE=010  Unexpected interruption from other device
RCHERROR DWAIT PGM=02,CMP=0,CODE=014  Reader channel error occurred
RDVERROR DWAIT PGM=02,CMP=0,CODE=018  Reader device error occurred
         SPACE 3
* No constants should be placed below this area.  Base register not needed
* because this area is only referenced by CCW's
RIOAREA  DS    0CL80
* Note: the 0 ensures no space is reserved in IPL deck for this area.
         SPACE 3
*
* Hardware Assigned Storage Locations
*
         SPACE 1
* This DSECT allows symbolic access to these locations.  The DSECT created is
* named ASA.
ASA      ASAREA DSECT=YES
         END
 
 | 51.958175 
							 | 81 
							 | 0.68723 
							 | 
					
	0ac6e7bb3d515be8f1d37c2103f54f4b4fe038fb 
 | 382 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/246/A246146.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/246/A246146.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/246/A246146.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A246146: Limiting block extension of A010060 (Thue-Morse sequence) with first term as initial block.
; 0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0
add $0,180
lpb $0
  sub $0,1
  sub $1,$0
  add $0,1
  div $0,2
lpe
mov $0,$1
mod $0,2
add $0,2
mod $0,2
 
 | 25.466667 
							 | 173 
							 | 0.581152 
							 | 
					
	f8efa029234348b0453513352a4e4ef983257edb 
 | 1,090 
							 | 
	asm 
 | 
	Assembly 
 | 
	micro/assembler/sub_test.asm 
 | 
	andrewparlane/fiuba6633_lab_de_sistemas_digitales 
 | 
	909b33d640315f38220d268f113fc2ab8fa5e322 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	micro/assembler/sub_test.asm 
 | 
	andrewparlane/fiuba6633_lab_de_sistemas_digitales 
 | 
	909b33d640315f38220d268f113fc2ab8fa5e322 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	micro/assembler/sub_test.asm 
 | 
	andrewparlane/fiuba6633_lab_de_sistemas_digitales 
 | 
	909b33d640315f38220d268f113fc2ab8fa5e322 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	# ----------------------------------------------------------------------
# Test_name: sub_test
# ----------------------------------------------------------------------
#
# RAM memory will be structured in the following manner:
#
# +---------+----------+
# | Address | Variable |
# +---------+----------+
# | RAM[00] | A        |
# | RAM[01] | B        |
# | RAM[02] | Y        |
# +---------+----------+
#
# Where:
#  - Y = A - B
#
#
# ROM Memory will be loaded with the following program:
# ----------------------------------------------------------------------
$begin:
LOAD  A,0;    # Load A operand
SUB   A,1;    # ALU Operation to be tested.
STORE A,2;    # Save result
LOAD  A,0;    # Load A operand
ADDI  A,1;    # Add +1 to A operand
STORE A,0;    # Save A operand
JZ    $incb;  # Jump to increase B operand if A operand is 0
JUMP  $begin; # Start again the operation
$incb:
LOAD  A,1;    # Load B operand
ADDI  A,1;    # Add +1 to B operand
STORE A,1;    # Save B operand
JZ    $end;   # Go to end
JUMP  $begin; # Start again the operation
$end:
JUMP  $end;   # End, Finish test
 
 | 26.585366 
							 | 72 
							 | 0.431193 
							 | 
					
	c18a95064a8e7b93bacb8d725fecf4dfcbdbe291 
 | 228 
							 | 
	asm 
 | 
	Assembly 
 | 
	wof/lcs/base/1F8.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | 6 
							 | 
	2020-10-14T15:29:10.000Z 
 | 
	2022-02-12T18:58:54.000Z 
 | 
	wof/lcs/base/1F8.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	wof/lcs/base/1F8.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2020-12-17T08:59:10.000Z 
 | 
	2020-12-17T08:59:10.000Z 
 | 
	copyright	zengfr	site:http://github.com/zengfr/romhack
012A70	clr.b   ($1f8,A5)		[base+1DC]
012A74	clr.b   ($200,A5)		
012B0E	bne     $12b30		
01A610	dbra    D1, $1a60e		
copyright	zengfr	site:http://github.com/zengfr/romhack
 
 | 25.333333 
							 | 54 
							 | 0.692982 
							 | 
					
	67d8b2c0ec8fdae8a4677ed22b1d2422be8ad89b 
 | 502 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/097/A097075.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/097/A097075.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/097/A097075.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A097075: Expansion of (1-x-x^2)/(1-x-3*x^2-x^3).
; Submitted by Jon Maiga
; 1,0,2,3,9,20,50,119,289,696,1682,4059,9801,23660,57122,137903,332929,803760,1940450,4684659,11309769,27304196,65918162,159140519,384199201,927538920,2239277042,5406093003,13051463049,31509019100,76069501250
mov $2,$0
mov $4,2
lpb $4
  mov $0,$2
  sub $4,1
  add $0,$4
  trn $0,1
  seq $0,133654 ; a(n) = 2*A000129(n) - 1.
  div $0,4
  add $0,1
  mov $5,$4
  mul $5,$0
  add $3,$5
lpe
min $2,1
mul $2,$0
mov $0,$3
sub $0,$2
 
 | 21.826087 
							 | 208 
							 | 0.653386 
							 | 
					
	a00904b5f0f8baff56953c73492c8a9399892b56 
 | 9,238 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/game_of_life_graphics.asm 
 | 
	Kippiii/Assembly-Game-Of-Life 
 | 
	45c1d85a16855ad22264a1a437f6d01553a9bb9e 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	src/game_of_life_graphics.asm 
 | 
	Kippiii/Assembly-Game-Of-Life 
 | 
	45c1d85a16855ad22264a1a437f6d01553a9bb9e 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	src/game_of_life_graphics.asm 
 | 
	Kippiii/Assembly-Game-Of-Life 
 | 
	45c1d85a16855ad22264a1a437f6d01553a9bb9e 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	; main PROC for Game of Life
; prompts user for input
; displays current board
; IDEAS
; Nicer cursor?
; Random boards
include Irvine32.inc
include backend.inc
.data
MAXIMUM_HEIGHT BYTE 255
MAXIMUM_WIDTH  BYTE 255
carriage_X_pos BYTE 0
carriage_Y_pos BYTE 0
prev_map DWORD ?
world_map DWORD ?
board_size DWORD ?
current_key_stroke BYTE ?, 0
array_position WORD 0
hHeap DWORD ?
WELCOME_PROMPT BYTE "<->                                          John Conway's Game of Life                                           <->", 0AH, 0DH, 0
MAIN_MENU      BYTE "<->.......Controls......<->", 0AH, 0DH, 0
PROMPT_1       BYTE "w Shift carriage up.....<->", 0AH, 0DH, 0
PROMPT_2       BYTE "a Shift carriage left...<->", 0AH, 0DH, 0
PROMPT_3       BYTE "s Shift carriage down...<->", 0AH, 0DH, 0
PROMPT_4       BYTE "d Shift carriage right..<->", 0AH, 0DH, 0
PROMPT_5       BYTE "q Quit Game.............<->", 0AH, 0DH, 0
PROMPT_6       BYTE "p Toggle pause/continue.<->", 0AH, 0DH, 0
PROMPT_7       BYTE "f Step one frame........<->", 0AH, 0DH, 0
PROMPT_8       BYTE "x Flip Cell.............<->", 0AH, 0DH, 0
PROMPT_9       BYTE "c Clear all cells.......<->", 0AH, 0DH, 0
PROMPT_10      BYTE "r Randomize the grid....<->", 0AH, 0DH, 0
BOTTOM_FRAME   BYTE "<->.....................<->", 0AH, 0DH, 0
P_CHAR BYTE "p", 0
F_CHAR BYTE "f", 0
Q_CHAR BYTE "q", 0
X_CHAR BYTE "x", 0
W_CHAR BYTE "w", 0
A_CHAR BYTE "a", 0
S_CHAR BYTE "s", 0
D_CHAR BYTE "d", 0
C_CHAR BYTE "c", 0
R_CHAR BYTE "r", 0
SPACE_CHAR BYTE " ", 0
LEAVING_SET_CELL BYTE "LEAVING set_cell", 0
.code
display_WELCOME PROC
; INPUT: NONE
    mov EDX, OFFSET WELCOME_PROMPT
    call WriteString ; Print WELCOME_PROMPT
    call WaitMsg ; Stop program, Print "Press any key to continue..."
    call Clrscr
    ret
; OUTPUT: NONE
display_WELCOME ENDP
.code
display_MAIN_MENU PROC
; INPUT: NONE
    mov EDX, OFFSET MAIN_MENU
    call WriteString ; Print MAIN_MENU
    mov EDX, OFFSET PROMPT_1
    call WriteString ; Print PROMPT_1
    mov EDX, OFFSET PROMPT_2
    call WriteString ; Print PROMPT_2
    mov EDX, OFFSET PROMPT_3
    call WriteString ; Print PROMPT_3
    mov EDX, OFFSET PROMPT_4
    call WriteString ; Print PROMPT_4
    mov EDX, OFFSET PROMPT_5
    call WriteString ; Print PROMPT_5
    mov EDX, OFFSET PROMPT_6
    call WriteString ; Print PROMPT_6
    mov EDX, OFFSET PROMPT_7
    call WriteString ; Print PROMPT_7
    mov EDX, OFFSET PROMPT_8
    call WriteString ; Print PROMPT_8
    mov EDX, OFFSET PROMPT_9
    call WriteString ; Print PROMPT_9
    mov EDX, OFFSET PROMPT_10
    call WriteString ; Print PROMPT_10
    mov EDX, OFFSET BOTTOM_FRAME
    call WriteString ; Print BOTTOM_FRAME
    call WaitMsg
    call Clrscr
    ret
; OUTPUT: NONE
display_MAIN_MENU ENDP
.code
set_cell PROC
; INPUT: NONE
    mov EAX, 0
    mov AL, carriage_Y_pos
    mul MAXIMUM_WIDTH
    mov BX, 0
    mov BL, carriage_X_pos
    add AX, BX
    mov ESI, world_map
    add ESI, EAX
    xor BYTE PTR [ESI], 1
    ret
; OUTPUT: NONE
set_cell ENDP
.code
initialize_world_map PROC
; INPUT: NONE
    call Randomize
    mov ESI, 0
    mov ECX, board_size
L1:
    mov EDI, world_map
    add EDI, ESI
    mov AL, BYTE PTR [EDI]
    mov EAX, 2d ; generate random integers
    call RandomRange ; 0 or 1 in EAX
    mov BYTE PTR [EDI], BYTE PTR AL ; store in the array
    add ESI, 1 ; next array position
    loop L1
    ret
; OUTPUT: NONE
initialize_world_map ENDP
.code
display_board PROC
; INPUT: NONE
    and edx, 0 ; Set the values for Gotoxy at the origin, DL, DH
    call Gotoxy
    mov esi, 0          ; Start counter
    mov ecx, board_size ; Maximum loops
    cld
L1:
    ; Only updating when the value has been updating
    mov edi, world_map
    add edi, esi
    mov al, byte ptr [edi]
    mov edi, prev_map
    add edi, esi
    cmp al, byte ptr [edi]
    jz CONTINUE_L1
    mov eax, esi
    mov bl, MAXIMUM_WIDTH
    div bl
    mov dl, ah
    mov dh, al
    call Gotoxy
FIRST_RUN:
    mov edi, world_map
    add edi, esi
    mov al, BYTE PTR [edi]
    cmp al, 1
    jz PRINT_X_CHAR_LABEL
    jnz PRINT_SPACE_CHAR_LABEL
CONTINUE_L1:
    add ESI, 1
    cmp ECX, 1
    jz RET_LABEL
    loop L1
PRINT_X_CHAR_LABEL:
    mov EAX, black + (white * 16)
    call SetTextColor
    mov EDX, OFFSET SPACE_CHAR
    call WriteString
    jmp CONTINUE_L1
PRINT_SPACE_CHAR_LABEL:
    mov EAX, white + (black * 16)
    call SetTextColor
    mov EDX, OFFSET SPACE_CHAR
    call WriteString
    jmp CONTINUE_L1
RET_LABEL:
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    push world_map
    push prev_map
    push board_size
    call copy_array
    ret
; OUTPUT: NONE
display_board ENDP
; MAIN PROGRAM
game_of_life_main PROC
    ; Initializing the heap TODO (Handle errors?)
    invoke GetProcessHeap
    mov hHeap, eax
    ; get board measurements
    call GetMaxXY
    mov MAXIMUM_HEIGHT, AL
    mov MAXIMUM_WIDTH, DL
    mov eax, 0
    mov al, MAXIMUM_HEIGHT
    mul MAXIMUM_WIDTH
    mov board_size, eax
    invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, board_size
    mov world_map, eax
    invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, board_size
    mov prev_map, eax
    mov esi, prev_map
    mov ecx, board_size
PREV_ARR_MAP:
    mov byte ptr [esi], 2
    inc esi
    loop PREV_ARR_MAP
    ; display WELCOME_PROMPT
    call display_WELCOME
    ; display MAIN_MENU
    call display_MAIN_MENU
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    ; while user doesnt press "q"
MAIN_LABEL:
    mov EAX, white + (blue * 16)
    call SetTextColor
    call Clrscr
    
    call display_board
    jmp PAUSE_LABEL
INPUT_LABEL:
    mov ESI, world_map
    mov EAX, 0
    mov AL, MAXIMUM_HEIGHT
    mov EBX, 0
    mov BL, MAXIMUM_WIDTH
    push ESI
    push EAX
    push EBX
    call update_board
    call display_board
    mov EAX, 50
    call Delay
    call ReadKey ; Get keyboard input
    jz INPUT_LABEL ; If no input was given, repeat INPUT_LABEL
    mov current_key_stroke, AL ; current_key_stroke = ReadKey()
    ; check if p
    mov AL, P_CHAR
    cmp AL, current_key_stroke
    jz PAUSE_LABEL ; if current_key_stroke == 'p'
    ; check if q
    mov AL, Q_CHAR
    cmp AL, current_key_stroke
    jz EXIT_LABEL ; if current_key_stroke == 'q'
    ; check if w, a, s, OR d
    jnz INPUT_LABEL ; if no match to p, f, q, w, a, s, d, jump to INPUT_LABEL
PAUSE_LABEL:
    mov EAX, 10
    call Delay
    call ReadKey ; Get keyboard input
    jz PAUSE_LABEL ; If no input was given, repeat PAUSE_LABEL
    mov current_key_stroke, AL ; current_key_stroke = ReadKey()
    mov AL, Q_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'q'
    jz EXIT_LABEL
    mov AL, P_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'p'
    jz INPUT_LABEL
    mov AL, F_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'f'
    jz FRAME_LABEL
    mov AL, X_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'x'
    jz CALL_SET_CELL_LABEL
    mov AL, W_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'w'
    jz MOVE_CELL_UP_LABEL
    mov AL, A_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'a'
    jz MOVE_CELL_LEFT_LABEL
    mov AL, S_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 's'
    jz MOVE_CELL_DOWN_LABEL
    mov AL, D_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'd'
    jz MOVE_CELL_RIGHT_LABEL
    mov AL, C_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'c'
    jz CLEAR_MAP
    mov AL, R_CHAR
    cmp AL, current_key_stroke ; if current_key_stroke == 'r'
    jz RANDOM_MAP
    jmp PAUSE_LABEL
MOVE_CELL_UP_LABEL:
    cmp carriage_Y_pos, 0
    je PAUSE_LABEL
    sub carriage_Y_pos, 1
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    jmp PAUSE_LABEL
MOVE_CELL_LEFT_LABEL:
    cmp carriage_X_pos, 0
    je PAUSE_LABEL
    sub carriage_X_pos, 1
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    jmp PAUSE_LABEL
MOVE_CELL_DOWN_LABEL:
    mov AL, MAXIMUM_HEIGHT
    sub AL, 1
    cmp carriage_Y_pos, AL
    je PAUSE_LABEL
    add carriage_Y_pos, 1
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    jmp PAUSE_LABEL
MOVE_CELL_RIGHT_LABEL:
    mov AL, MAXIMUM_WIDTH
    sub AL, 1
    cmp carriage_X_pos, AL
    je PAUSE_LABEL
    add carriage_X_pos, 1
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    jmp PAUSE_LABEL
CALL_SET_CELL_LABEL:
    call set_cell
    call display_board
    jmp PAUSE_LABEL
FRAME_LABEL:
    mov ESI, world_map
    mov EAX, 0
    mov AL, MAXIMUM_HEIGHT
    mov EBX, 0
    mov BL, MAXIMUM_WIDTH
    push ESI
    push EAX
    push EBX
    call update_board
    call display_board
    mov DL, carriage_X_pos
    mov DH, carriage_Y_pos
    call Gotoxy
    jmp PAUSE_LABEL
CLEAR_MAP:
    mov ecx, board_size
    mov esi, world_map
CLEAR_MAP_LOOP:
    mov byte ptr [esi], 0
    inc esi
    loop CLEAR_MAP_LOOP
    call display_board
    jmp PAUSE_LABEL
RANDOM_MAP:
    call initialize_world_map ; initialize a random board
    call display_board
    jmp PAUSE_LABEL
EXIT_LABEL:
    INVOKE HeapFree, hHeap, 0, world_map
    exit
game_of_life_main ENDP
END game_of_life_main
 
 | 22.153477 
							 | 152 
							 | 0.666703 
							 | 
					
	f4294ea9bf5123d636a3145fc7e1ae75a65ea05f 
 | 381 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm 
 | 
	ahjelm/z88dk 
 | 
	c4de367f39a76b41f6390ceeab77737e148178fa 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm 
 | 
	C-Chads/z88dk 
 | 
	a4141a8e51205c6414b4ae3263b633c4265778e6 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm 
 | 
	C-Chads/z88dk 
 | 
	a4141a8e51205c6414b4ae3263b633c4265778e6 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	; void PSGSFXPlayLoop(void *sfx,unsigned char channels)
SECTION code_clib
SECTION code_PSGlib
PUBLIC PSGSFXPlayLoop_callee
EXTERN asm_PSGlib_SFXPlayLoop
PSGSFXPlayLoop_callee:
   pop af
   pop bc
   pop de
   push af
   jp asm_PSGlib_SFXPlayLoop
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _PSGSFXPlayLoop_callee
defc _PSGSFXPlayLoop_callee = PSGSFXPlayLoop_callee
ENDIF
 
 | 15.24 
							 | 55 
							 | 0.816273 
							 | 
					
	761b5ecd9784a325fd60dff471b254339fabd126 
 | 453 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/296/A296081.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/296/A296081.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/296/A296081.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A296081: a(n) = gcd(tau(n)-1, sigma(n)-1), where tau = A000005 and sigma = A000203.
; Submitted by Christian Krause
; 0,1,1,2,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,3,5,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,3,2,1,1,1,1,7,1,7,1,1,1,1,1,1,1,6,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,5,5,8
add $0,1
mov $2,$0
lpb $0
  add $1,$4
  mov $3,$2
  dif $3,$0
  sub $0,1
  cmp $3,$2
  cmp $3,0
  add $4,$3
lpe
gcd $1,$4
mov $0,$1
 
 | 25.166667 
							 | 201 
							 | 0.534216 
							 | 
					
	57a8c7a10f61f1e915362fc3dc12e408e7aef965 
 | 1,085 
							 | 
	asm 
 | 
	Assembly 
 | 
	chap18/ex33/double_div_26.asm 
 | 
	JamesType/optimization-manual 
 | 
	61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a 
 | 
	[
  "0BSD"
]  | 374 
							 | 
	2021-06-08T10:42:01.000Z 
 | 
	2022-03-29T14:21:45.000Z 
 | 
	chap18/ex33/double_div_26.asm 
 | 
	JamesType/optimization-manual 
 | 
	61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a 
 | 
	[
  "0BSD"
]  | 1 
							 | 
	2021-06-11T20:24:02.000Z 
 | 
	2021-06-11T20:24:02.000Z 
 | 
	chap18/ex33/double_div_26.asm 
 | 
	JamesType/optimization-manual 
 | 
	61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a 
 | 
	[
  "0BSD"
]  | 39 
							 | 
	2021-06-08T11:25:29.000Z 
 | 
	2022-03-05T05:14:17.000Z 
 | 
	;
; Copyright (C) 2021 by Intel Corporation
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
;
;	.globl double_div_26
	; void double_div_26(double *a, double *b, double *out);
	; On entry:
	;     rcx = a
	;     rdx = b
	;     r8 = out
.code
double_div_26 PROC public
	vmovupd zmm0, [rcx]
	vmovupd zmm1, [rdx]
	vrcp14pd zmm2, zmm1
	vmulpd zmm3, zmm0, zmm2
	vmovapd zmm4, zmm0
	vfnmadd231pd zmm4, zmm3, zmm1
	vfmadd231pd zmm3, zmm4, zmm2
	vmovupd [r8], zmm3
	vzeroupper
	ret
double_div_26 ENDP
end 
 | 24.111111 
							 | 79 
							 | 0.737327 
							 | 
					
	75ada34c4e5bb2790373e03a113a8e68c333ca7c 
 | 720 
							 | 
	asm 
 | 
	Assembly 
 | 
	sse/main.asm 
 | 
	DaveAxiom/simd 
 | 
	8140b8e12bf4f9cb24b7601b98b44525b8ba9e72 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2020-07-09T04:06:17.000Z 
 | 
	2021-08-07T17:40:46.000Z 
 | 
	sse/main.asm 
 | 
	DaveAxiom/simd 
 | 
	8140b8e12bf4f9cb24b7601b98b44525b8ba9e72 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2020-10-05T12:23:51.000Z 
 | 
	2020-10-05T12:23:51.000Z 
 | 
	sse/main.asm 
 | 
	DaveAxiom/simd 
 | 
	8140b8e12bf4f9cb24b7601b98b44525b8ba9e72 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2020-10-02T00:26:40.000Z 
 | 
	2020-10-02T00:26:40.000Z 
 | 
	%define SYS_EXIT 60
segment .data
src:   db 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15
shift: db 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
cap:   db 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
cap0:   db 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26
segment .text
global _start
rot13_16b:
    movaps xmm0, [rax]
    movaps xmm1, [shift]
    paddb xmm0, xmm1
    movaps xmm2, xmm0
    movaps xmm1, [cap]
    pcmpgtb xmm0, xmm1
    movaps xmm1, [cap0]
    pand xmm0, xmm1
    psubb xmm2, xmm0
    movaps [rax], xmm2
    ret
_start:
    mov rax, src
    call rot13_16b
    call rot13_16b
    mov rax, SYS_EXIT
    mov rdi, 0
    syscall
    ret
 
 | 18.947368 
							 | 73 
							 | 0.572222 
							 | 
					
	fb674e1a1c9afb2ea3af6183edf20073e2ce64ac 
 | 195 
							 | 
	asm 
 | 
	Assembly 
 | 
	gfx/pokemon/sentret/anim.asm 
 | 
	pokeachromicdevs/pokeoctober 
 | 
	db74bb68bbfceac07eec6d64674bc24fd4c0b67f 
 | 
	[
  "blessing"
]  | 1 
							 | 
	2021-07-05T23:48:37.000Z 
 | 
	2021-07-05T23:48:37.000Z 
 | 
	gfx/pokemon/sentret/anim.asm 
 | 
	AtmaBuster/pokeoctober 
 | 
	12652b84eb2df1a0ed2f654a0ffcfb78202e515f 
 | 
	[
  "blessing"
]  | 1 
							 | 
	2020-12-16T01:11:20.000Z 
 | 
	2020-12-16T22:53:56.000Z 
 | 
	gfx/pokemon/sentret/anim.asm 
 | 
	AtmaBuster/pokeoctober 
 | 
	12652b84eb2df1a0ed2f654a0ffcfb78202e515f 
 | 
	[
  "blessing"
]  | 1 
							 | 
	2021-07-05T23:33:22.000Z 
 | 
	2021-07-05T23:33:22.000Z 
 | 
		frame 0, 15
    frame 1, 15
    frame 2, 15
    frame 1, 15
    frame 2, 15
    frame 1, 15
    frame 3, 7
    frame 1, 7
    frame 3, 7
    frame 1, 7
    frame 3, 7
    frame 0, 15
    endanim 
 | 15 
							 | 15 
							 | 0.502564 
							 | 
					
	1f7755ab598ce970f2d484b806c28e8bbd3e9930 
 | 2,636 
							 | 
	asm 
 | 
	Assembly 
 | 
	sys.asm 
 | 
	lybrown/edfries-chess-xasm 
 | 
	81d716492c7276bffa815caa4077f046f092d89a 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2021-08-12T08:52:52.000Z 
 | 
	2021-08-12T08:52:52.000Z 
 | 
	sys.asm 
 | 
	lybrown/edfries-chess-xasm 
 | 
	81d716492c7276bffa815caa4077f046f092d89a 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	sys.asm 
 | 
	lybrown/edfries-chess-xasm 
 | 
	81d716492c7276bffa815caa4077f046f092d89a 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	;       SCREEN
ROWCRS equ $54
COLCRS equ $55
TEMP1 equ $312+1                   ;TEMP LOCATIONS
;       IOCB OFFSETS
IOCB equ $340                   ;I/O CONTROL BLOCKS
ICHID equ $340                   ;HANDLER INDEX ($FF = FREE)
ICDNO equ $341                   ;DEVICE NUMBER (DRIVE NUMBER)
ICCOM equ $342                   ;COMMAND CODE
ICSTA equ $343                   ;STATUS
ICBAL equ $344                   ;BUFFER ADDRESS
ICBAH equ $345                   ; ...
ICPTL equ $346                   ;PUT BYTE ROUTINE ADDRESS - 1
ICPTH equ $347                   ; ...
ICBLL equ $348                   ;BUFFER LENGTH
ICBLH equ $349                   ; ...
ICAX1 equ $34A                   ;AUXILLARY INFO
ICAX2 equ $34B                   ; ...
ICSPR equ $34C                   ;4 SPARE BYTES
;       JUMP VECTOR TABLE
DISKIV equ $E450                  ;DISK INITIALIZATION
DSKINV equ $E453                  ;DISK INTERFACE
CIOV equ $E456                  ;CIO ROUTINE
SIOV equ $E459                  ;SIO ROUTINE
SETVBV equ $E45C                  ;SET VERTICAL BLANK VECTORS
SYSVBV equ $E45F                  ;SYSTEM VERTICAL BLANK ROUTINE
XITVBV equ $E462                  ;EXIT VERTICAL BLANK ROUTINE
SIOINV equ $E465                  ;SIO INIT
SENDEV equ $E468                  ;SEND ENABLE ROUTINE
INTINV equ $E46B                  ;INTERRUPT HANDLER INIT
CIOINV equ $E46E                  ;CIO INIT
BLKBDV equ $E471                  ;BLACKBOARD MODE
WARMSV equ $E474                  ;WARM START ENTRY POINT
COLDSV equ $E477                  ;COLD START ENTRY POINT
RBLOKV equ $E47A                  ;CASSETTE READ BLOCK VECTOR
CSOPIV equ $E47D                  ;CASSETTE OPEN VECTOR
DSOPIV equ $E480                  ;CASSETTE OPEN FOR INPUT VECTOR
;       COMMAND CODES FOR IOCB
OPEN equ $03                    ;OPEN FOR INPUT/OUTPUT
GETREC equ $05                    ;GET RECORD (TEXT)
GETCHR equ $07                    ;GET CHARACTER(S)
PUTREC equ $09                    ;PUT RECORD (TEXT)
PUTCHR equ $0B                    ;PUT CHARACTER(S)
CLOSE equ $0C                    ;CLOSE DEVICE
STATIS equ $0D                    ;STATUS REQUEST
SPECIL equ $0E                    ;SPECIAL ENTRY COMMANDS
;       AUX1 VALUES FOR OPEN
APPEND equ $01                    ;OPEN FOR APPEND
DIRECT equ $02                    ;OPEN FOR DIRECTORY ACCESS
OPNIN equ $04                    ;OPEN FOR INPUT
OPNOT equ $08                    ;OPEN FOR OUTPUT
OPNINO equ [OPNIN|OPNOT]            ;OPEN FOR INPUT/OUTPUT
MXDMOD equ $10                    ;OPEN FOR MIXED MODE
INSCLR equ $20                    ;OPEN WITHOUT CLEARING SCREEN
 
 | 40.553846 
							 | 65 
							 | 0.502276 
							 | 
					
	9d25fbb6d979cbaf26cd495924726880fca6841d 
 | 387 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/047/A047599.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/047/A047599.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/047/A047599.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A047599: Numbers that are congruent to {0, 3, 4, 5} mod 8.
; 0,3,4,5,8,11,12,13,16,19,20,21,24,27,28,29,32,35,36,37,40,43,44,45,48,51,52,53,56,59,60,61,64,67,68,69,72,75,76,77,80,83,84,85,88,91,92,93,96,99,100,101,104,107,108,109,112,115,116,117,120,123,124
add $0,7
mov $1,$0
div $1,4
mul $1,2
mov $2,$0
lpb $2,1
  mov $3,$0
  add $3,2
  mov $0,$3
  sub $2,4
lpe
add $1,$0
sub $1,13
 
 | 22.764706 
							 | 198 
							 | 0.614987 
							 | 
					
	1fcc712012fb0238c0e9b515833df948f4b76a83 
 | 748 
							 | 
	asm 
 | 
	Assembly 
 | 
	base/atari/putchar.asm 
 | 
	zbyti/Mad-Pascal 
 | 
	546cae9724828f93047080109488be7d0d07d47e 
 | 
	[
  "MIT"
]  | 7 
							 | 
	2020-05-02T15:37:57.000Z 
 | 
	2021-02-17T01:59:41.000Z 
 | 
	base/atari/putchar.asm 
 | 
	michalkolodziejski/Mad-Pascal 
 | 
	0a7a1e2f379e50b0a23878b0d881ff3407269ed6 
 | 
	[
  "MIT"
]  | 14 
							 | 
	2020-05-03T02:02:35.000Z 
 | 
	2020-08-10T08:41:19.000Z 
 | 
	base/atari/putchar.asm 
 | 
	michalkolodziejski/Mad-Pascal 
 | 
	0a7a1e2f379e50b0a23878b0d881ff3407269ed6 
 | 
	[
  "MIT"
]  | 5 
							 | 
	2020-06-02T18:34:14.000Z 
 | 
	2020-07-09T18:13:44.000Z 
 | 
	
; unit GRAPH: InitGraph, PutPixel, LineTo
; unit S2: SetGraphMode
/*
  PUT CHAR
  Procedura wyprowadza znak na ekran na pozycji X/Y kursora okreslonej przez zmienne odpowiednio
  COLCRS ($55-$56) i ROWCRS ($54). Zaklada sie, ze obowiazuja przy tym domyslne ustawienia OS-u,
  to jest ekran jest w trybie Graphics 0, a kanal IOCB 0 jest otwarty dla edytora ekranowego.
  Wyprowadzenie znaku polega na zaladowaniu jego kodu ATASCII do akumulatora i wykonaniu rozkazu
  JSR PUTCHR.
*/
.proc	@putchar (.byte a) .reg
vbxe	bit *			; jsr vbxe_cmap
	ldx #$00		; $60 -> S2:
chn	equ *-1
	.ifdef MAIN.CRT.TextAttr
	ora MAIN.CRT.TextAttr
	.endif
main
	tay
	lda icputb+1,x
	pha
	lda icputb,x
	pha
	tya
	rts
.endp
 
 | 19.684211 
							 | 97 
							 | 0.684492 
							 | 
					
	d3ac540def68d91aaff88dab8bd58061dff2eb7b 
 | 223 
							 | 
	asm 
 | 
	Assembly 
 | 
	Assembler/AssemblyCode/NOT.asm 
 | 
	KPU-RISC/KPU 
 | 
	9f85c322e1b8489eef31f0696799e0c6c7273c0e 
 | 
	[
  "MIT"
]  | 8 
							 | 
	2017-04-16T16:53:03.000Z 
 | 
	2021-09-14T22:29:28.000Z 
 | 
	Assembler/AssemblyCode/TTL/NOT.asm 
 | 
	KPU-RISC/KPU 
 | 
	9f85c322e1b8489eef31f0696799e0c6c7273c0e 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	Assembler/AssemblyCode/TTL/NOT.asm 
 | 
	KPU-RISC/KPU 
 | 
	9f85c322e1b8489eef31f0696799e0c6c7273c0e 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	; Write register D to the Output Port
MOV D, 11110000b
MOV E, 00001111b
NOT D
NOT D
SHR D
NOT E
NOT E
SHL E
NOT D
NOT D
SHR D
NOT E
NOT E
SHL E
NOT D
NOT D
SHR D
NOT E
NOT E
SHL E
NOT D
NOT D
SHR D
NOT E
NOT E
SHL E 
 | 6.371429 
							 | 37 
							 | 0.67713 
							 | 
					
	6c48a7c6898bacfc2853935b4027acb2dce936c3 
 | 526 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/asm/define_music.asm 
 | 
	h1romas4/z88dk-msx-template 
 | 
	8667669ba30f343c59f5ba394ac8be899cc8a8e6 
 | 
	[
  "MIT"
]  | 5 
							 | 
	2021-09-06T15:25:33.000Z 
 | 
	2022-03-24T06:38:12.000Z 
 | 
	src/asm/define_music.asm 
 | 
	h1romas4/z88dk-msx-template 
 | 
	8667669ba30f343c59f5ba394ac8be899cc8a8e6 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	src/asm/define_music.asm 
 | 
	h1romas4/z88dk-msx-template 
 | 
	8667669ba30f343c59f5ba394ac8be899cc8a8e6 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	; license:MIT License
; copyright-holders:Hiromasa Tanaka
; rodata_user
; https://github.com/z88dk/z88dk/blob/master/doc/overview.md#a-quick-note-for-asm-code
; rodata_user if for constant data
; kept in rom if program is in rom
SECTION rodata_user
PUBLIC _music_title, _music_main, _music_game_over, _sound_extend, _sound_get
include "../resources/music_title.asm"
include "../resources/music_main.asm"
include "../resources/music_game_over.asm"
include "../resources/sound_extend.asm"
include "../resources/sound_get.asm"
 
 | 32.875 
							 | 86 
							 | 0.790875 
							 | 
					
	b1fa223bb51f0b628f775f515ebb0de3a7e5fc29 
 | 13,807 
							 | 
	asm 
 | 
	Assembly 
 | 
	2001-fall/mp4/mp4.asm 
 | 
	ece291/machine-problems 
 | 
	5f91f9f2ddceb7cda1e14c2973d83023a42d9929 
 | 
	[
  "RSA-MD"
]  | 3 
							 | 
	2016-07-16T04:33:49.000Z 
 | 
	2021-07-13T16:18:17.000Z 
 | 
	2001-fall/mp4/mp4.asm 
 | 
	ece291/machine-problems 
 | 
	5f91f9f2ddceb7cda1e14c2973d83023a42d9929 
 | 
	[
  "RSA-MD"
]  | null  | null  | null  | 
	2001-fall/mp4/mp4.asm 
 | 
	ece291/machine-problems 
 | 
	5f91f9f2ddceb7cda1e14c2973d83023a42d9929 
 | 
	[
  "RSA-MD"
]  | null  | null  | null  | 
	; ECE 291 Fall 2001 MP4    
; -- Paint291 --
;
; Completed By:
;  Your Name
;
; Josh Potts
; Guest Author - Ryan Chmiel
; University of Illinois Urbana Champaign
; Dept. of Electrical & Computer Engineering
;
; Ver 1.0
%include "lib291.inc"
%include "libmp4.inc"
	BITS 32
	GLOBAL _main
; Define functions and variables used by main()
EXTERN _LoadPNG
_LoadPNG_arglen		EQU	18
; Define Contstants
	DOWNARROW	EQU	80
	RIGHTARROW	EQU	77
	LEFTARROW	EQU	75
	UPARROW		EQU	72
	CANVAS_X	EQU	20
	CANVAS_Y	EQU	20
	NUM_MENU_ITEMS	EQU	11
	BKSP		EQU	8
	ESC		EQU	1
	ENTERKEY	EQU	13
	SPACE		EQU	57
	LSHIFT		EQU	42
	RSHIFT		EQU	54
	SECTION .bss
_GraphicsMode	resw	1	; Graphics mode #
_kbINT		resb	1	; Keyboard interrupt #
_kbIRQ		resb	1	; Keyboard IRQ
_kbPort		resw	1	; Keyboard port
_MouseSeg	resw	1       ; real mode segment for MouseCallback
_MouseOff	resw	1	; real mode offset for MouseCallback
_MouseX		resw	1       ; X coordinate position of mouse on screen
_MouseY		resw	1       ; Y coordinate position of mouse on screen
					
_ScreenOff	resd	1	; Screen image offset
_CanvasOff	resd	1	; Canvas image offset
_OverlayOff	resd	1	; Overlay image offset
_FontOff	resd	1	; Font image offset
_MenuOff	resd	1	; Menu image offset
_TitleOff	resd	1	; Title Bar image offset
_MPFlags	resb	1	; program flags
				; Bit 0 - Exit program
				; Bit 1 - Left mouse button (LMB) status: set if down, cleared if up
				; Bit 2 - Change in LMB status: set if button status
				;         moves from pressed->released or vice-versa
				; Bit 3 - Right shift key status: set if down, cleared if up
				; Bit 4 - Left shift key status: set if down, cleared if up
				; Bit 5 - Key other than shift was pressed
				; Bit 6 - Not Used Anymore
				; Bit 7 - Status of chosen color: set if obtained with user input,
                                ;         cleared if obtained with eyedrop (you do not have to deal
				;         with this - the library code uses it)
				
_MenuItem	resb	1	; selected menu item
; line algorithm variables				
_x		resw	1
_y		resw	1
_dx		resw	1
_dy		resw	1
_lineerror	resw	1
_xhorizinc	resw	1
_xdiaginc	resw	1
_yvertinc	resw	1
_ydiaginc	resw	1
_errordiaginc	resw	1
_errornodiaginc	resw	1
 
; circle algorithm variables
_radius		resw	1
_circleerror	resw	1
_xdist		resw	1
_ydist		resw	1
; flood fill variables
_PointQueue	resd	1
_QueueHead	resd	1
_QueueTail	resd	1
_key		resb	1
	SECTION .data
	
; Required image files
_FontFN		db	'font.png',0   
_MenuFN		db	'menu.png',0
_TitleFN	db	'title.png',0
; Defined color values
_CurrentColor	dd	0ffff0000h	; current color
_ColorBlue	dd	0ff0033ffh
_ColorWhite	dd	0ffffffffh
_ColorBlack	dd	0ff000000h
_ColorHalfBlack dd	0cc000000h
_buffer		db	'       ','$'
_ColorString1	db	'Enter numerical values for','$'
_ColorString2	db	'each channel (ARGB), and','$'
_ColorString3	db	'separate each number by a','$'
_ColorString4	db	'space (ex. 127 255 255 0).','$'
 
_QwertyNames
	db	0	; filler
	db	0,'1','2','3','4','5','6','7','8','9','0','-','=',BKSP
	db	0, 'q','w','e','r','t','y','u','i','o','p','[',']',ENTERKEY
	db	0,'a','s','d','f','g','h','j','k','l',';',"'","`"
	db	0,'\','z','x','c','v','b','n','m',",",'.','/',0,'*'
	db	0, ' ', 0, 0,0,0,0,0,0,0,0,0,0 ; F1-F10
	db	0,0	; numlock, scroll lock
	db	0, 0, 0, '-'
	db	0, 0, 0, '+'
	db	0, 0, 0, 0
	db	0, 0; sysrq
_QwertyNames_end resb 0
_QwertyShift
	db	0	; filler
	db	0,'!','@','#','$','%','^','&','*','(',')','_','+',BKSP
	db	0, 'Q','W','E','R','T','Y','U','I','O','P','{','}',ENTERKEY
	db	0,'A','S','D','F','G','H','J','K','L',':','"','~'
	db	0,'|','Z','X','C','V','B','N','M',"<",'>','?',0,'*'
	db	0, ' ', 0, 0,0,0,0,0,0,0,0,0,0 ; F1-F10
	db	0,0	; numlock, scroll lock
	db	0, 0, 0, '-'
	db	0, 0, 0, '+'
	db	0, 0, 0, 0
	db	0, 0; sysrq
_QwertyShift_end resb 0
_TextInputString	times 80 db 0,'$'
_ColorInputString	times 15 db 0,'$'
_RoundingFactor	dd	000800080h, 00000080h
	SECTION .text
_main
	call	_LibInit
	; Allocate Screen Image buffer
	invoke	_AllocMem, dword 640*480*4
	cmp	eax, -1
	je	near .memerror
	mov	[_ScreenOff], eax
	; Allocate Canvas Image buffer
	invoke	_AllocMem, dword 480*400*4
	cmp	eax, -1
	je	near .memerror
	mov	[_CanvasOff], eax
	; Allocate Overlay Image buffer
	invoke	_AllocMem, dword 480*400*4
	cmp	eax, -1
	je	near .memerror
	mov	[_OverlayOff], eax
	; Allocate Font Image buffer
	invoke	_AllocMem, dword 2048*16*4
	cmp	eax, -1
	je	near .memerror
	mov	[_FontOff], eax  
	; Allocate Menu Image buffer
	invoke	_AllocMem, dword 400*100*4
	cmp	eax, -1
	je	near .memerror
	mov	[_MenuOff], eax 
	; Allocate Title Bar Image buffer
	invoke	_AllocMem, dword 640*20*4
	cmp	eax, -1
	je	near .memerror
	mov	[_TitleOff], eax 
	; Allocate Point Queue
	invoke	_AllocMem, dword 480*400*4*40
	cmp	eax, -1
	je	near .memerror
	mov	[_PointQueue], eax
	; Load image files
	invoke	_LoadPNG, dword _FontFN, ds, dword [_FontOff], dword 0, dword 0
	invoke	_LoadPNG, dword _MenuFN, ds, dword [_MenuOff], dword 0, dword 0
	invoke	_LoadPNG, dword _TitleFN, ds, dword [_TitleOff], dword 0, dword 0
 
	; Graphics init
	invoke	_InitGraphics, dword _kbINT, dword _kbIRQ, dword _kbPort
	test	eax, eax
	jnz	near .graphicserror
	; Find graphics mode: 640x480x32, allow driver-emulated modes
	invoke	_FindGraphicsMode, word 640, word 480, word 32, dword 1
	mov	[_GraphicsMode], ax
	; Keyboard/Mouse init
	call	_InstallKeyboard
	test	eax, eax
	jnz	near .keyboarderror
	invoke	_SetGraphicsMode, word [_GraphicsMode]
	test	eax, eax
	jnz	.setgraphicserror
	call	_InstallMouse
	test	eax, eax
	jnz	.mouseerror
	; Show mouse cursor	
	mov	dword [DPMI_EAX], 01h
	mov	bx, 33h
	call	DPMI_Int
	call	_MP4Main	
	; Shutdown and cleanup	      
.mouseerror
	call	_RemoveMouse
.setgraphicserror
	call	_UnsetGraphicsMode
.keyboarderror
	call	_RemoveKeyboard
.graphicserror
	call	_ExitGraphics
.memerror
	call	_MP4LibExit
	call	_LibExit
	ret
;--------------------------------------------------------------
;--          Replace Library Calls with your Code!           --
;--          Do not forget to add Function Headers           --
;--------------------------------------------------------------
;--------------------------------------------------------------
;--                      PointInBox()                        --
;--------------------------------------------------------------
proc _PointInBox
.X		arg	2
.Y		arg	2
.BoxULCornerX	arg	2
.BoxULCornerY	arg	2
.BoxLRCornerX	arg	2
.BoxLRCornerY	arg	2
	invoke	_libPointInBox, word [ebp+.X], word [ebp+.Y], word [ebp+.BoxULCornerX], word [ebp+.BoxULCornerY], word [ebp+.BoxLRCornerX], word [ebp+.BoxLRCornerY]
	ret
endproc
_PointInBox_arglen	EQU	12	   
;--------------------------------------------------------------
;--                       GetPixel()                         --
;--------------------------------------------------------------
proc _GetPixel
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
	invoke	_libGetPixel, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y]
	ret
endproc
_GetPixel_arglen	EQU	12
;--------------------------------------------------------------
;--                      DrawPixel()                         --
;--------------------------------------------------------------
proc _DrawPixel
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
.Color		arg	4
	invoke	_libDrawPixel, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color]
	ret
endproc
_DrawPixel_arglen	EQU	16
;--------------------------------------------------------------
;--                       DrawLine()                         --
;--------------------------------------------------------------
proc _DrawLine
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X1		arg	2
.Y1		arg	2
.X2		arg	2
.Y2		arg	2
.Color		arg	4
	invoke	_libDrawLine, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X1], word [ebp+.Y1], word [ebp+.X2], word [ebp+.Y2], dword [ebp+.Color]
	ret
endproc
_DrawLine_arglen	EQU	20
	  
;--------------------------------------------------------------
;--                       DrawRect()                         --
;--------------------------------------------------------------
proc _DrawRect
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X1		arg	2
.Y1		arg	2
.X2		arg	2
.Y2		arg	2
.Color		arg	4
.FillRectFlag	arg	4
	invoke	_libDrawRect, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X1], word [ebp+.Y1], word [ebp+.X2], word [ebp+.Y2], dword [ebp+.Color], dword [ebp+.FillRectFlag]
	ret
endproc
_DrawRect_arglen	EQU	24
;--------------------------------------------------------------
;--                      DrawCircle()                        --
;--------------------------------------------------------------
proc _DrawCircle
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
.Radius		arg	2
.Color		arg	4
.FillCircleFlag	arg	4
	invoke	_libDrawCircle, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], word [ebp+.Radius], dword [ebp+.Color], dword [ebp+.FillCircleFlag]
	ret
endproc
_DrawCircle_arglen	EQU	22
;--------------------------------------------------------------
;--                        DrawText()                        --
;--------------------------------------------------------------
proc _DrawText
.StringOff	arg	4
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
.Color		arg	4
	invoke	_libDrawText, dword [ebp+.StringOff], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color]
	ret
endproc
_DrawText_arglen	EQU	20
;--------------------------------------------------------------
;--                       ClearBuffer()                      --
;--------------------------------------------------------------
proc _ClearBuffer
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.Color		arg	4
	invoke	_libClearBuffer, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], dword [ebp+.Color]
	ret
endproc
_ClearBuffer_arglen	EQU	12
;--------------------------------------------------------------
;--                      CopyBuffer()                        --
;--------------------------------------------------------------
proc _CopyBuffer
.SrcOff		arg	4
.SrcWidth	arg	2
.SrcHeight	arg	2
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
	invoke	_libCopyBuffer, dword [ebp+.SrcOff], word [ebp+.SrcWidth], word [ebp+.SrcHeight], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y]
	ret
endproc
_CopyBuffer_arglen	EQU	20
;--------------------------------------------------------------
;--                    ComposeBuffers()                      --
;--------------------------------------------------------------
proc _ComposeBuffers
.SrcOff		arg	4
.SrcWidth	arg	2
.SrcHeight	arg	2
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X	        arg	2
.Y		arg	2
	invoke	_libComposeBuffers, dword [ebp+.SrcOff], word [ebp+.SrcWidth], word [ebp+.SrcHeight], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y]
	ret
endproc
_ComposeBuffers_arglen	EQU	20
;--------------------------------------------------------------
;--                        BlurBuffer()                      --
;--------------------------------------------------------------
proc _BlurBuffer
.SrcOff		arg	4
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
	invoke	_libBlurBuffer, dword [ebp+.SrcOff], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight]
	ret
endproc
_BlurBuffer_arglen	EQU	12
;--------------------------------------------------------------
;--                        FloodFill()                       --
;--------------------------------------------------------------
proc _FloodFill
.DestOff	arg	4
.DestWidth	arg	2
.DestHeight	arg	2
.X		arg	2
.Y		arg	2
.Color		arg	4
.ComposeFlag	arg	4
	invoke	_libFloodFill, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color], dword [ebp+.ComposeFlag]
	ret
endproc
_FloodFill_arglen	EQU	20
;--------------------------------------------------------------
;--                    InstallKeyboard()                     --
;--------------------------------------------------------------
_InstallKeyboard
        call	_libInstallKeyboard
	ret
;--------------------------------------------------------------
;--                    RemoveKeyboard()                      --
;--------------------------------------------------------------
_RemoveKeyboard
	call	_libRemoveKeyboard
	ret
;--------------------------------------------------------------
;--                        KeyboardISR()                     --
;--------------------------------------------------------------
_KeyboardISR
	call	_libKeyboardISR	
	ret
_KeyboardISR_end
;--------------------------------------------------------------
;--                      InstallMouse()                      --
;--------------------------------------------------------------
_InstallMouse
        call	_libInstallMouse
        ret			    
;--------------------------------------------------------------
;--                        RemoveMouse()                     --
;--------------------------------------------------------------
_RemoveMouse
        call	_libRemoveMouse
        ret
;--------------------------------------------------------------
;--                        MouseCallback()                   --
;--------------------------------------------------------------
proc _MouseCallback
.DPMIRegsPtr   arg     4
	invoke	_libMouseCallback, dword [ebp+.DPMIRegsPtr]
	ret
endproc
_MouseCallback_end
_MouseCallback_arglen	EQU	4
 
 | 26.001883 
							 | 200 
							 | 0.52372 
							 | 
					
	af9f1c6db7a11c385cb38a878d3339adc633b565 
 | 241 
							 | 
	asm 
 | 
	Assembly 
 | 
	ffight/lcs/boss/9A.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | 6 
							 | 
	2020-10-14T15:29:10.000Z 
 | 
	2022-02-12T18:58:54.000Z 
 | 
	ffight/lcs/boss/9A.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	ffight/lcs/boss/9A.asm 
 | 
	zengfr/arcade_game_romhacking_sourcecode_top_secret_data 
 | 
	a4a0c86c200241494b3f1834cd0aef8dc02f7683 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2020-12-17T08:59:10.000Z 
 | 
	2020-12-17T08:59:10.000Z 
 | 
	copyright	zengfr	site:http://github.com/zengfr/romhack
03DB86	move.b  #$1, ($95,A6)		[boss+9A, boss+9C]
03DD02	move.l  A0, ($9a,A6)		[boss+4]
03DD06	bra     $40b46		[boss+9A, boss+9C]
copyright	zengfr	site:http://github.com/zengfr/romhack
 
 | 30.125 
							 | 54 
							 | 0.688797 
							 | 
					
	9ca186f3f118ea2b7ce949d9bcb364e08d61823a 
 | 8,681 
							 | 
	asm 
 | 
	Assembly 
 | 
	asm/msvc/ax.asm 
 | 
	awesie/aes_dust 
 | 
	34706d884921fcaedd84f3b517e82bca1ef8962b 
 | 
	[
  "Unlicense"
]  | 46 
							 | 
	2018-10-01T12:14:08.000Z 
 | 
	2021-11-17T02:58:34.000Z 
 | 
	asm/msvc/ax.asm 
 | 
	awesie/aes_dust 
 | 
	34706d884921fcaedd84f3b517e82bca1ef8962b 
 | 
	[
  "Unlicense"
]  | 1 
							 | 
	2020-11-17T17:47:35.000Z 
 | 
	2020-11-17T17:47:35.000Z 
 | 
	asm/msvc/ax.asm 
 | 
	awesie/aes_dust 
 | 
	34706d884921fcaedd84f3b517e82bca1ef8962b 
 | 
	[
  "Unlicense"
]  | 20 
							 | 
	2019-01-25T01:18:27.000Z 
 | 
	2021-05-07T10:32:04.000Z 
 | 
	;
; This is free and unencumbered software released into the public domain.
;
; Anyone is free to copy, modify, publish, use, compile, sell, or
; distribute this software, either in source code form or as a compiled
; binary, for any purpose, commercial or non-commercial, and by any
; means.
; In jurisdictions that recognize copyright laws, the author or authors
; of this software dedicate any and all copyright interest in the
; software to the public domain. We make this dedication for the benefit
; of the public at large and to the detriment of our heirs and
; successors. We intend this dedication to be an overt act of
; relinquishment in perpetuity of all present and future rights to this
; software under copyright law.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
; OTHER DEALINGS IN THE SOFTWARE.
;
; For more information, please refer to <http://unlicense.org/>
;
; -----------------------------------------------
; AES-128 Encryption in x86 assembly
;
; size: 188 bytes for ECB, 255 for CTR
;
; global calls use cdecl convention
;
; -----------------------------------------------
    bits 32
    
    %ifndef BIN
      global _aes_ecb_asm
      global aes_ecb_asm
    %endif
    
    ; *****************************
    ; void aes_ecb_asm(void *s);
    ; *****************************
_aes_ecb_asm:
aes_ecb_asm:
    pusha
    xor    ecx, ecx           ; ecx = 0
    mul    ecx                ; eax = 0, edx = 0
    inc    eax                ; c = 1
    mov    cl, 4
    pusha                     ; alloca(32)
    
    ; F(8)x[i]=((W*)s)[i]
    mov    esi, [esp+64+4]    ; esi = s
    mov    edi, esp
    pusha
    add    ecx, ecx           ; copy state + master key to stack
    rep    movsd
    popa
    ; *****************************
    ; Multiplication over GF(2**8)
    ; *****************************
    call   $+21               ; save address      
    push   ecx                ; save ecx
    mov    cl, 4              ; 4 bytes
    add    al, al             ; al <<= 1
    jnc    $+4                ;
    xor    al, 27             ;
    ror    eax, 8             ; rotate for next byte
    loop   $-9                ; 
    pop    ecx                ; restore ecx
    ret
    pop    ebp
enc_main:
    ; *****************************
    ; AddRoundKey, AddRoundConstant, ExpandRoundKey
    ; *****************************
    ; w=k[3]; F(4)w=(w&-256)|S(w),w=R(w,8),((W*)s)[i]=x[i]^k[i];
    ; w=R(w,8)^c;F(4)w=k[i]^=w;
    pusha
    xchg   eax, edx
    xchg   esi, edi
    mov    eax, [esi+16+12]  ; w=R(k[3],8)
    ror    eax, 8
xor_key:
    mov    ebx, [esi+16]     ; t=k[i]
    xor    [esi], ebx        ; x[i]^=t
    movsd                    ; s[i]=x[i]
    ; w=(w&-256)|S(w)
    call   S                 ; al=S(al)
    ror    eax, 8            ; w=R(w,8)
    loop   xor_key
    ; w=R(w,8)^c
    xor    eax, edx          ; w^=c
    ; F(4)w=k[i]^=w
    mov    cl, 4
exp_key:
    xor    [esi], eax        ; k[i]^=w
    lodsd                    ; w=k[i]
    loop   exp_key
    popa
    
    ; ****************************
    ; if(c==108) break;
    cmp    al, 108
    jne    upd_con
    popa
    popa
    ret
upd_con:
    call   ebp
    ; ***************************
    ; ShiftRows and SubBytes
    ; ***************************
    ; F(16)((u8*)x)[w]=S(((u8*)s)[i]), w=(w-3)&15;
    pusha
shift_rows:
    lodsb                    ; al = S(s[i])
    call   S
    mov    [edi+edx], al
    sub    edx, 3
    and    edx, 15
    jnz    shift_rows
    popa
    ; *****************************
    ; if(c!=108){
    cmp    al, 108
    je     enc_main
    ; *****************************
    ; MixColumns
    ; *****************************
    ; F(4)w=x[i],x[i]=R(w,8)^R(w,16)^R(w,24)^M(R(w, 8)^w);
    pusha
mix_cols:
    mov    eax, [edi]       ; w = x[i]
    mov    edx, eax         ; t = R(w, 8)
    ror    edx, 8           ; 
    xor    eax, edx         ; w ^= t
    call   ebp              ; 
    xor    eax, edx
    ror    edx, 8
    xor    eax, edx
    ror    edx, 8
    xor    eax, edx
    stosd
    loop   mix_cols
    popa
    jmp    enc_main
    ; *****************************
    ; B SubByte(B x)
    ; *****************************
S:
%ifndef DYNAMIC
    push   ebx
    call   init_sbox
    db 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5
    db 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76
    db 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0 
    db 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0
    db 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc 
    db 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15
    db 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a 
    db 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75
    db 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0 
    db 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84
    db 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b 
    db 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf
    db 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85 
    db 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8
    db 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5 
    db 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2
    db 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17 
    db 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73
    db 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88 
    db 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb
    db 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c 
    db 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79
    db 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9 
    db 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08
    db 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6 
    db 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a
    db 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e 
    db 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e
    db 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94 
    db 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf
    db 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68 
    db 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16    
init_sbox:
    pop    ebx
    xlatb
    pop    ebx
%else
    pusha 
    test   al, al            ; if(x){
    jz     sb_l6
    xchg   eax, edx
    mov    cl, -1            ; i=255 
; for(c=i=0,y=1;--i;y=(!c&&y==x)?c=1:y,y^=M(y))
sb_l0:
    mov    al, 1             ; y=1
sb_l1:
    test   ah, ah            ; !c
    jnz    sb_l2    
    cmp    al, dl            ; y!=x
    setz   ah
    jz     sb_l0
sb_l2:
    mov    dh, al            ; y^=M(y)
    call   ebp               ;
    xor    al, dh
    loop   sb_l1             ; --i
; F(4)x^=y=(y<<1)|(y>>7);
    mov    dl, al            ; dl=y
    mov    cl, 4             ; i=4  
sb_l5:
    rol    dl, 1             ; y=R(y,1)
    xor    al, dl            ; x^=y
    loop   sb_l5             ; i--
sb_l6:
    xor    al, 99            ; return x^99
    mov    [esp+28], al
    popa
%endif
    ret
    
%ifdef CTR
    global aes_ctr
    global _aes_ctr
      
    ; void aes_ctr(W len, B *ctr, B *in, B *key)
_aes_ctr:
aes_ctr:
    pusha
    lea    esi,[esp+32+4]
    lodsd
    xchg   eax, ecx          ; ecx = len
    lodsd
    xchg   eax, ebp          ; ebp = ctr
    lodsd
    xchg   eax, edx          ; edx = in
    lodsd
    xchg   esi, eax          ; esi = key
    pusha                    ; alloca(32)
    
    ; copy master key to local buffer
    ; F(16)t[i+16]=key[i]
    lea    edi, [esp+16]     ; edi = &t[16]
    movsd
    movsd
    movsd
    movsd
aes_l0:
    xor    eax, eax
    jecxz  aes_l3            ; while(len){
    
    ; copy counter+nonce to local buffer
    ; F(16)t[i]=ctr[i]
    mov    edi, esp          ; edi = t
    mov    esi, ebp          ; esi = ctr
    push   edi
    movsd
    movsd
    movsd
    movsd
    ; encrypt t    
    call   aes_ecb_asm       ; E(t)
    pop    edi
aes_l1:
    ; xor plaintext with ciphertext
    ; r=len>16?16:len
    ; F(r)in[i]^=t[i]
    mov    bl, [edi+eax]     ; 
    xor    [edx], bl         ; *in++^=t[i]
    inc    edx               ; 
    inc    eax               ; i++
    cmp    al, 16            ;
    loopne aes_l1            ; while(i!=16 && --ecx!=0)
    
    ; update counter
    xchg   eax, ecx          ; 
    mov    cl, 16
aes_l2:
    inc    byte[ebp+ecx-1]   ;
    loopz  aes_l2            ; while(++c[i]==0 && --ecx!=0)
    xchg   eax, ecx
    jmp    aes_l0
aes_l3:
    popa
    popa
    ret
%endif
 
 
 | 29.327703 
							 | 73 
							 | 0.478401 
							 | 
					
	5da987fae3e5ebcef8b516a52a85165c469c7bbe 
 | 1,357 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/zx81/tape/tape_load_block_callee.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/zx81/tape/tape_load_block_callee.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/zx81/tape/tape_load_block_callee.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | 1 
							 | 
	2019-12-03T23:57:48.000Z 
 | 
	2019-12-03T23:57:48.000Z 
 | 
	;
;      Tape load routine
;
;
;      int __CALLEE__ tape_load_block_callee(void *addr, size_t len, unsigned char type)
;
;
;	$Id: tape_load_block_callee.asm,v 1.6 2015/08/11 07:16:36 stefano Exp $
;
PUBLIC tape_load_block_callee
PUBLIC ASMDISP_TAPE_LOAD_BLOCK_CALLEE
EXTERN zx_fast
EXTERN zx_slow
; Very simple header, only check the 'type' byte in a Spectrum-ish way.
; For design reasons, we test a whole word..
;-----
.header
	defw 0	; LEN
	defw 0	; LOC
.header2
	defw 0	; file type (2 bytes)
;-----
EXTERN  musamy_load
.tape_load_block_callee
	pop de
	pop bc
	ld a,c
	pop bc
	pop hl
	push de
.asmentry
		LD (header+2),hl	; LOC
		LD (header),bc	; LEN
		
		ld	e,a
.ld_retry
		push de
		ld hl,rethere
		push hl
		LD HL,header
		PUSH HL
		LD BC,2	; file type len
		PUSH BC
		LD HL,header2
		PUSH HL
		call zx_fast
		;LD L,40h		; VERIFY MODE
		LD L,0			; LOAD MODE
		jp musamy_load
.rethere
		push hl
		call zx_slow
IF FORlambda
		call $1C28	; BREAK-1 on Lambda
ELSE
		call $f46	; BREAK-1 on ZX81
ENDIF
		pop hl
		pop de
		ret nc	; if BREAK is pressed, return; timeout error code is valid for BREAK too
		ld a,3
		cp l	; timeout ?
		jr z,ld_retry
		xor a
		or l
		ret nz	; other errors
		ld a,(header2)
		cp e
		ret z	; all OK
		ld l,4	; file type error		
		ret
DEFC ASMDISP_TAPE_LOAD_BLOCK_CALLEE = # asmentry - tape_load_block_callee
 
 | 14.43617 
							 | 88 
							 | 0.675018 
							 | 
					
	676e0978ab335d8f1859aa7f48a8138e79620249 
 | 1,076 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/060/A060264.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/060/A060264.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/060/A060264.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A060264: First prime after 2n.
; 2,3,5,7,11,11,13,17,17,19,23,23,29,29,29,31,37,37,37,41,41,43,47,47,53,53,53,59,59,59,61,67,67,67,71,71,73,79,79,79,83,83,89,89,89,97,97,97,97,101,101,103,107,107,109,113,113,127,127,127,127,127,127,127,131,131,137,137,137,139,149,149,149,149,149,151,157,157,157,163,163,163,167,167,173,173,173,179,179,179,181,191,191,191,191,191,193,197,197,199,211,211,211,211,211,211,223,223,223,223,223,223,227,227,229,233,233,239,239,239,241,251,251,251,251,251,257,257,257,263,263,263,269,269,269,271,277,277,277,281,281,283,293,293,293,293,293,307,307,307,307,307,307,307,311,311,313,317,317,331,331,331,331,331,331,331,337,337,337,347,347,347,347,347,349,353,353,359,359,359,367,367,367,367,373,373,373,379,379,379,383,383,389,389,389,397,397,397,397,401,401,409,409,409,409,419,419,419,419,419,421,431,431,431,431,431,433,439,439,439,443,443,449,449,449,457,457,457,457,461,461,463,467,467,479,479,479,479,479,479,487,487,487,487,491,491,499,499,499,499
mul $0,2
cal $0,151800 ; Least prime > n (version 2 of the "next prime" function).
mov $1,$0
 
 | 153.714286 
							 | 948 
							 | 0.726766 
							 | 
					
	16f16ba03179ef64e96ec11c8ed6ddf70e4e73aa 
 | 420 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/159/A159721.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/159/A159721.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/159/A159721.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A159721: Number of permutations of 3 indistinguishable copies of 1..n arranged in a circle with exactly 1 local maximum.
; 6,36,192,960,4608,21504,98304,442368,1966080,8650752,37748736,163577856,704643072,3019898880,12884901888,54760833024,231928233984,979252543488,4123168604160,17317308137472,72567767433216,303465209266176,1266637395197952,5277655813324800
mov $1,$0
add $1,2
mov $2,4
pow $2,$0
mul $1,$2
mul $1,3
 
 | 42 
							 | 238 
							 | 0.811905 
							 | 
					
	af42318f112a2de87c03243b68c2f0f99a93c224 
 | 4,826 
							 | 
	asm 
 | 
	Assembly 
 | 
	10a-interrupts/boot.asm 
 | 
	starsheriff/train-os 
 | 
	218f446fd0a6be12e7f51664631a17d00dca94de 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2019-10-23T06:21:45.000Z 
 | 
	2022-01-25T13:00:02.000Z 
 | 
	10a-interrupts/boot.asm 
 | 
	starsheriff/train-os 
 | 
	218f446fd0a6be12e7f51664631a17d00dca94de 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	10a-interrupts/boot.asm 
 | 
	starsheriff/train-os 
 | 
	218f446fd0a6be12e7f51664631a17d00dca94de 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; boot.asm
; The label start is our entry point. We have to make it
; public so that the linker can use it.
global start
extern c_start
extern init_idt
extern print_interrupt
global flush_idt
; we are still in 32-bit protected mode so we have to use
; 32-bit wide instructions
bits 32
;
PTE_PRESENT equ 1 << 7
; Flags for _large_ p2 aka. PDE page table entries
PDE_PRESENT  equ 1 << 0
PDE_WRITABLE equ 1 << 1
PDE_LARGE    equ 1 << 7
; number of entries in
IDT_ENTRIES equ 32
; GDT Flags
start:
    ; Set stack pointer
    mov esp, stack_top
    
    ; Switching to long mode
    ;
    ; Step 1: Disable paging
    ;
    ; to disable paging set `CR0.PG` to `0`.
    mov eax, cr0
    and eax, ~(1 << 31)
    mov cr0, eax
    ; Step 2: Enable Physical Address Extension
    mov eax, cr4
    or eax, (1 << 5)
    mov cr4, eax
    ; Step 3: Set `cr3` register
    mov eax, p4_table
    mov cr3, eax
    ; Step 4: Set the p2[1] entry to point to the _second_ 2 MiB frame
    mov eax, (0x20_0000 | PDE_PRESENT | PDE_WRITABLE | PDE_LARGE)
    mov [p2_table + 8], eax
    ; point the 0th entry to the first frame
    ; TODO: explain
    mov eax, (0x00_0000 | PDE_PRESENT | PDE_WRITABLE | PDE_LARGE)
    mov [p2_table], eax
    ; Step 5: Set the 0th entry of p3 to point to our p2 table
    mov eax, p2_table ; load the address of the p2 table
	or eax, (PDE_PRESENT | PDE_WRITABLE)
	mov [p3_table], eax
	; Step 6: Set the 0th entry of p4 to point to our p3 table
	mov eax, p3_table
	or eax, (PDE_PRESENT | PDE_WRITABLE)
	mov [p4_table], eax
	; Step 7: Set EFER.LME to 1 to enable the long mode
	mov ecx, 0xC0000080
	rdmsr
	or  eax, 1 << 8
	wrmsr
	; Step 8: enable paging
	mov eax, cr0
	or eax, 1 << 31
	mov cr0, eax
    ; Now we set up the IDT
    
	; Step 9: Disable Interrupts
    lgdt [gdt64.pointer]
	; Step 11: Enable Interrupts
    ; cli ; disable interrupts
    jmp gdt64.code:longstart
   
section .text
bits 64
longstart:
    mov rsp, stack_top
    ; not sure if we have to reload the lgdt once we are in 64-bit mode.
    lgdt [gdt64.pointer]
    ; load the interrupt descriptor table register. This allows the cpu to find the
    ; interrupt descriptor table (IDT).
    lidt [idt.idtr]
    ; call populate_idt ; asm code
    call init_idt ; c code
    ;mov word [0xb8000], 0x0e4f ; 'O', yellow on black
    ;mov word [0xb8002], 0x0e4b ; 'K', yellow on black
    ; sti
    ; immediately clear interupts to avoid reboots
    ; cli
    ; uncomment the next line and you will have a page fault
    ;mov eax, [0xFF_FFFF]
    call c_start
; dummy handler that does _nothing_
global idt_handler
idt_handler:
    ; jmp $
    call print_interrupt
    iretq
global disable_interrupts
disable_interrupts:
    cli
    ret
global trigger_interrupt
trigger_interrupt:
    int 0x03
    ret
; *************************************** IDT *********************
FLAG_INTERRUPT equ 0xe
FLAG_R0 equ (0 << 5)    ;Rings 0 - 3
FLAG_P equ (1 << 7)
CODE_SEL equ 0x08
GLOBAL populate_idt
populate_idt:
    mov eax, idt
    mov ebx, idt_handler
    ; or ebx, (VIRT_BASE & 0xFFFFFFFF)
 
idt_init_one:
    ; /* Target Low (word) */
    mov ecx, ebx
    mov word [eax], cx
    add eax, 2
 
    ; /* Code Selector (word) */
    mov word[eax], CODE_SEL
    add eax, 2
 
    ; /* IST (byte) */
    mov byte[eax], 0
    add eax, 1
 
    ; /* Flags (byte) */
    mov byte[eax], (FLAG_P|FLAG_R0|FLAG_INTERRUPT)
    add eax, 1
 
    ; /* Target High (word) */
    shr ecx, 16
    mov word[eax], cx
    add eax, 2
 
    ; /* Long Mode Target High 32 */
    shr ecx, 16
    mov dword[eax], ecx ;(idt_handler >> 32)
    add eax, 4
 
    mov dword[eax], 0
    add eax, 4
 
    cmp eax, idt.idtend
    jl idt_init_one
 
    ; lidt[IDTR]
    ret
flush_idt:
    ; changed from +8 to +16, that did the trick!
    mov rax, [rsp+16]
    lidt[rax]
    ret
    
section .bss
; must be page aligned
align 4096
p4_table:
    resb 4096
p3_table:
    resb 4096
p2_table:
    resb 4096
stack_bottom:
	resb 4096
stack_top:
section .rodata
gdt64:
	dq 0
.code: equ $ - gdt64
	dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53)
.pointer:
	dw $ - gdt64 - 1 ; length of the gdt64 table
	dq gdt64         ; address of the gdt64 table
section .data
; bits 64
;
; the IDT table contains 256 64-bit entries.
; Hence, we reserve 256 double quad words (64-bit) entries.
;
; The IDT must be 16-bit aligned.
align 16
; global idt
idt:
    times IDT_ENTRIES dq 0 ; a double quad per entry
    times IDT_ENTRIES dq 0 ; a double quad per entry
; Figure 4-8 shows the format of the `IDTR` in long-mode. The format is identical to the
; format in protected mode, except the size of the base address.
.idtr:
    dw $ - idt - 1  ; two bytes (word), declaring the size of the IDT in bytes
    dq idt          ; 64-bit (double quad word) base address of the idt
.idtend:
 
 | 20.891775 
							 | 88 
							 | 0.636345 
							 | 
					
	fc275a25bcd0a969f9293a34dc5d2cebdf8410a5 
 | 747 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/204/A204267.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/204/A204267.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/204/A204267.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A204267: Symmetric matrix: f(i,j)=(i+j+1 mod 3), by antidiagonals.
; 0,1,1,2,2,2,0,0,0,0,1,1,1,1,1,2,2,2,2,2,2,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mov $2,$0
mov $4,$0
lpb $2
  add $3,1
  lpb $4
    add $3,1
    trn $4,$3
    add $5,$4
  lpe
  lpb $5
    sub $3,3
    sub $5,$3
  lpe
  mov $1,$3
  sub $1,1
  sub $2,$2
lpe
 
 | 35.571429 
							 | 501 
							 | 0.499331 
							 | 
					
	1d7db4f6c2b073fef562bdaf12842ec62b79e6bd 
 | 3,650 
							 | 
	asm 
 | 
	Assembly 
 | 
	agent/io/memory.asm 
 | 
	jephthai/EvilVM 
 | 
	429fcc9df6f1168d38c21f37b377c36cf7bcc957 
 | 
	[
  "MIT"
]  | 141 
							 | 
	2019-05-18T20:46:47.000Z 
 | 
	2022-02-28T05:10:43.000Z 
 | 
	agent/io/memory.asm 
 | 
	jephthai/EvilVM 
 | 
	429fcc9df6f1168d38c21f37b377c36cf7bcc957 
 | 
	[
  "MIT"
]  | 6 
							 | 
	2019-06-04T15:33:21.000Z 
 | 
	2021-05-07T15:27:58.000Z 
 | 
	agent/io/memory.asm 
 | 
	jephthai/EvilVM 
 | 
	429fcc9df6f1168d38c21f37b377c36cf7bcc957 
 | 
	[
  "MIT"
]  | 21 
							 | 
	2019-05-22T02:48:30.000Z 
 | 
	2021-11-03T05:34:48.000Z 
 | 
	;;; memory.asm
;;;
;;; An IO stream layer implemented around shared memory.  It should make sense
;;; in both inter-process and same-process shared memory regions.
;;; Put a number on the stack identifying which IO engine this is.  Each IO layer
;;; needs to have its own unique ID.  This allows payloads to make decisions
;;; based on the configured IO.
	
start_def ASM, engine, "engine"
	pushthing 4
end_def engine
;;; This function will be called before any IO is performed.  This can be used to
;;; set up streams, initialize IO layer global variables, make network connections,
;;; etc.
;;;
;;; In the case of the memory I/O layer, we should have received a pointer to the
;;; memory buffer used for transfer in the first argument to the compiler's entry
;;; point.  This has been saved in the arbitrary data pointer in the TEB.  
	
start_def ASM, initio, "initio"
	mov rbp, rsp
	sub rsp, 0x20
	and rsp, -16
	
	xor ebx, ebx
	AddGlobal G_IOVAL, rbx
	mov bl, 0x28
	mov rcx, [gs:rbx]
	AddGlobal G_IOBUF, rcx
	xor ecx, ecx		; clear the ADP so later code won't try to use it
	mov [gs:rbx], rcx
	
	;; Get function pointers for WinINet interface
	InlineString "api-ms-win-core-synch-l1-2-0.dll", rcx, rax
	call W32_LoadLibraryA
	AddGlobal G_SYNCHDLL, rax
	mov rsi, W32_GetProcAddress
	mov rdi, G_SYNCHDLL
	GetProcAddress "WaitOnAddress",		W32_WaitOnAddress
	
	mov rsp, rbp
end_def initio
	
%assign dbgoffset1 code_initio - main
%warning Initio is at dbgoffset1 bytes
	
;;; Take a value from the stack and emit it to the output stream as a single byte.
start_def ASM, emit, "emit"
	mov rbp, rsp
	sub rsp, 0x20
	and rsp, -16
	
	mov rbx, G_IOBUF	; get pointer to IO buffer
.lp:
	mov al, [rbx+0]		; get flag for outbound byte waiting
	and al, al		; test it
	jz .continue		; no data waitin to be read by upstream
	
	mov rax, [rbx]
	mov G_IOVAL, rax
	mov rcx, rbx
	lea rdx, [r15 + G_IOVAL_OFF]
	mov r8, 1
	mov r9, 100
	call W32_WaitOnAddress
	jmp .lp
	
.continue:
	mov al, dil		; byte to send
	mov ah, 255		; set flag
	xchg ah, al
	mov [rbx+0], ax		; send the byte
	popthing rsp
	mov rsp, rbp
end_def emit
%assign where code_emit - main
%warning Emit is at byte where
	
;;; Read a single byte from the input stream and put its value on top of the stkack.
	
start_def ASM, key, "key"
	mov rbp, rsp
	sub rsp, 0x20
	and rsp, -16
	mov rbx, G_IOBUF
.lp:
	mov al, [rbx+2]		; get flag for byte available
	and al, al		; test it
	jnz .continue		; there's a byte available to read
	
	mov rax, [rbx + 2]
	mov G_IOVAL, rax
	lea rcx, [rbx + 2]
	lea rdx, [r15 + G_IOVAL_OFF]
	mov r8, 1
	mov r9, 100
	call W32_WaitOnAddress
	jmp .lp
	
.continue:
	xor eax, eax		; blank the A register
	mov al, [rbx+3]		; get the byte
	pushthing rax		; put it on the stack
	xor ax, ax		; get 16 bits of zero
	mov [rbx+2], ax		; clear the flag
	
	mov rsp, rbp
end_def key
;;; Given a buffer and length, send multiple bytes to the output stream.  This is
;;; largely provided as a convenience for situations where IO can be optimized
;;; for block communications.
start_def ASM, type, "type"
	popthing rcx
	popthing rsi
.loop:
	pushthing [rsi]
	and rdi, 0xff
	push rcx
	push rsi
	call code_emit
	pop rsi
	pop rcx
	inc rsi
	loop .loop
end_def type
;;; Enable and disable echoing of input to the output stream.  Some IO
;;; layers may prefer to allow this to be configurable.  Leave them empty
;;; if they don't make sense for your IO layer.
	
start_def ASM, echooff, "-echo"
end_def echooff
start_def ASM, echoon, "+echo"
end_def echoon
start_def ASM, setecho, "!echo"
end_def setecho
start_def ASM, keyq, "key?"
	pushthing G_IOBUF
	mov rdi, [rdi]
	and rdi, 0xff0000
end_def keyq
 
 | 23.548387 
							 | 84 
							 | 0.710411 
							 | 
					
	656f4b422bda6e6e88a750f48c020b81ad0b6bcb 
 | 433 
							 | 
	asm 
 | 
	Assembly 
 | 
	tests/parsing/string_expressions_db.asm 
 | 
	cizo2000/sjasmplus 
 | 
	615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4 
 | 
	[
  "BSD-3-Clause"
]  | 220 
							 | 
	2016-10-22T19:44:39.000Z 
 | 
	2022-03-29T20:57:04.000Z 
 | 
	tests/parsing/string_expressions_db.asm 
 | 
	ped7g/sjasmplus 
 | 
	487635c8057cd5594c372d9b70bc00a3f3a1ecc4 
 | 
	[
  "BSD-3-Clause"
]  | 153 
							 | 
	2018-05-07T10:31:23.000Z 
 | 
	2022-03-30T04:35:59.000Z 
 | 
	tests/parsing/string_expressions_db.asm 
 | 
	ped7g/sjasmplus 
 | 
	487635c8057cd5594c372d9b70bc00a3f3a1ecc4 
 | 
	[
  "BSD-3-Clause"
]  | 51 
							 | 
	2016-05-12T21:27:36.000Z 
 | 
	2022-03-27T15:16:16.000Z 
 | 
	        OUTPUT      "string_expressions_db.bin"
        DB          'A','A'+1,2|'A',3+'A'               ; ABCD (41 42 43 44)
        DB          'A'|4,'F'&$46, $47&'G', 9^'A'       ; EFGH (45 46 47 48)
        DB          'A'^8, low 'AJ', high 'KA', 'M'-1   ; IJKL (49 4A 4B 4C)
        DB          'M'*1, 'N'/1, 'O'%128, '('<<1       ; MNOP (4D 4E 4F 50)
        DB          'Q'<?'Z', 'R'>?'A', 'S'%'T',~~'T'   ; QRST (51 52 53 54)
 
 | 61.857143 
							 | 76 
							 | 0.341801 
							 | 
					
	356d9e1020d1ef5e07b7e321ead38e03b66ca753 
 | 823 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/273/A273407.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/273/A273407.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/273/A273407.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A273407: First differences of number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 673", based on the 5-celled von Neumann neighborhood.
; 3,17,23,33,39,49,55,65,71,81,87,97,103,113,119,129,135,145,151,161,167,177,183,193,199,209,215,225,231,241,247,257,263,273,279,289,295,305,311,321,327,337,343,353,359,369,375,385,391,401,407,417,423,433,439,449,455,465,471,481,487,497,503,513,519,529,535,545,551,561,567,577,583,593,599,609,615,625,631,641,647,657,663,673,679,689,695,705,711,721,727,737,743,753,759,769,775,785,791,801,807,817,823,833,839,849,855,865,871,881,887,897,903,913,919,929,935,945,951,961,967,977,983,993,999,1009,1015,1025
mov $2,$0
lpb $0,1
  mov $1,4
  sub $1,$0
  trn $0,2
lpe
add $1,4
mul $1,2
lpb $2,1
  add $1,8
  sub $2,1
lpe
sub $1,5
 
 | 48.411765 
							 | 503 
							 | 0.71932 
							 | 
					
	495c8fa0fe266bb2c15ee2c2dd90fdc30b26c47d 
 | 142 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/in/platform.asm 
 | 
	phiwen96/asm_mac 
 | 
	f50a463e38a32e35eacfed8a48b4c5a0745900ac 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	src/in/platform.asm 
 | 
	phiwen96/asm_mac 
 | 
	f50a463e38a32e35eacfed8a48b4c5a0745900ac 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	src/in/platform.asm 
 | 
	phiwen96/asm_mac 
 | 
	f50a463e38a32e35eacfed8a48b4c5a0745900ac 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	%define System @_System@
%define Darwin 0
%define Linux 1
%define Windows 2
%define x86_64 0
%define arm64 1
%define Processor @_Processor@
 
 | 14.2 
							 | 30 
							 | 0.760563 
							 | 
					
	2169621dea8194ce8b07effe2ec0b655ceb068c0 
 | 442 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/246/A246706.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/246/A246706.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/246/A246706.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A246706: Position of last n in A246694 (read as a sequence, with offset changed to 1); complement of A246705.
; 2,5,7,9,12,14,16,18,20,23,25,27,29,31,33,35,38,40,42,44,46,48,50,52,54,57,59,61,63,65,67,69,71,73,75,77,80,82,84,86,88,90,92,94,96,98,100,102,104,107,109,111,113,115,117,119,121,123,125,127,129,131
add $0,1
mov $1,2
mul $1,$0
mov $2,1
lpb $0
  sub $0,$2
  sub $0,1
  add $1,1
  add $2,2
lpe
mul $1,4
sub $1,8
div $1,4
add $1,2
 
 | 24.555556 
							 | 199 
							 | 0.651584 
							 | 
					
	2fb49c9bf20b394aad5c7de8d5b08276fee5c0ed 
 | 876 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/008/A008355.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/008/A008355.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/008/A008355.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A008355: Coordination sequence for D_5 lattice.
; 1,40,370,1640,4930,11752,24050,44200,75010,119720,182002,265960,376130,517480,695410,915752,1184770,1509160,1896050,2353000,2888002,3509480,4226290,5047720,5983490,7043752,8239090,9580520,11079490,12747880,14598002,16642600,18894850,21368360,24077170,27035752,30259010,33762280,37561330,41672360,46112002,50897320,56045810,61575400,67504450,73851752,80636530,87878440,95597570,103814440,112550002,121825640,131663170,142084840,153113330,164771752,177083650,190073000,203764210,218182120,233352002
mov $1,$0
trn $1,1
mov $3,$0
sub $0,$1
add $0,1
mov $4,$3
mov $6,$3
lpb $6
  add $5,$4
  sub $6,1
lpe
mov $2,20
mov $4,$5
lpb $2
  add $0,$4
  sub $2,1
lpe
mov $5,0
mov $6,$3
lpb $6
  add $5,$4
  sub $6,1
lpe
mov $4,$5
mov $5,0
mov $6,$3
lpb $6
  add $5,$4
  sub $6,1
lpe
mov $2,18
mov $4,$5
lpb $2
  add $0,$4
  sub $2,1
lpe
 
 | 21.9 
							 | 498 
							 | 0.734018 
							 | 
					
	da98fd5cd0a14b23e18bf36700f67aba6f6266e1 
 | 3,072 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/compress/zx7/z80/asm_dzx7_standard_back.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/_DEVELOPMENT/compress/zx7/z80/asm_dzx7_standard_back.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/_DEVELOPMENT/compress/zx7/z80/asm_dzx7_standard_back.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	
; ===============================================================
; Feb 2016 by Einar Saukas
; "Standard" version (70 bytes) - BACKWARDS VARIANT
; ===============================================================
;
; void dzx7_standard_back(void *src, void *dst)
;
; Decompress backwards the compressed block at last address src 
; to last address dst.
;
; ===============================================================
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_compress_zx7
PUBLIC asm_dzx7_standard_back
EXTERN l_ret
asm_dzx7_standard_back:
   ; enter : hl = void *src
   ;         de = void *dst
   ;
   ; exit  : hl = & previous uncompressed block
   ;
   ; uses  : af, bc, de, hl
        ld      a, $80
dzx7s_copy_byte_loop_b:
        ldd                              ; copy literal byte
dzx7s_main_loop_b:
        call    dzx7s_next_bit_b
        jr      nc, dzx7s_copy_byte_loop_b ; next bit indicates either literal or sequence
; determine number of bits used for length (Elias gamma coding)
        push    de
        ld      bc, 0
        ld      d, b
dzx7s_len_size_loop_b:
        inc     d
        call    dzx7s_next_bit_b
        jr      nc, dzx7s_len_size_loop_b
; determine length
dzx7s_len_value_loop_b:
        call    nc, dzx7s_next_bit_b
        rl      c
        rl      b
;;        jr      c, dzx7s_exit_b         ; check end marker
        jp      c, l_ret - 1
        dec     d
        jr      nz, dzx7s_len_value_loop_b
        inc     bc                      ; adjust length
; determine offset
        ld      e, (hl)                 ; load offset flag (1 bit) + offset value (7 bits)
        dec     hl
IF __CPU_INFO & $01
        defb $cb, $33                   ; opcode for undocumented instruction "SLL E" aka "SLS E"
ELSE
        sla e
        inc e
ENDIF
        jr      nc, dzx7s_offset_end_b  ; if offset flag is set, load 4 extra bits
        ld      d, $10                  ; bit marker to load 4 bits
dzx7s_rld_next_bit_b:
        call    dzx7s_next_bit_b
        rl      d                       ; insert next bit into D
        jr      nc, dzx7s_rld_next_bit_b ; repeat 4 times, until bit marker is out
        inc     d                       ; add 128 to DE
        srl	d			; retrieve fourth bit from D
dzx7s_offset_end_b:
        rr      e                       ; insert fourth bit into E
; copy previous sequence
        ex      (sp), hl                ; store source, restore destination
        push    hl                      ; store destination
        adc     hl, de                  ; HL = destination + offset + 1
        pop     de                      ; DE = destination
        lddr
dzx7s_exit_b:
        pop     hl                      ; restore source address (compressed data)
        jr      nc, dzx7s_main_loop_b
dzx7s_next_bit_b:
        add     a, a                    ; check next bit
        ret     nz                      ; no more bits left?
        ld      a, (hl)                 ; load another group of 8 bits
        dec     hl
        rla
        ret
 
 | 25.6 
							 | 97 
							 | 0.485352 
							 | 
					
	a7deb515bfc1509d5e97fb19421c5253f3a75b61 
 | 56,758 
							 | 
	asm 
 | 
	Assembly 
 | 
	Win32/Win32.Ramlide/bitmap.asm 
 | 
	fengjixuchui/Family 
 | 
	2abe167082817d70ff2fd6567104ce4bcf0fe304 
 | 
	[
  "MIT"
]  | 3 
							 | 
	2021-05-15T15:57:13.000Z 
 | 
	2022-03-16T09:11:05.000Z 
 | 
	Win32/Win32.Ramlide/bitmap.asm 
 | 
	fengjixuchui/Family 
 | 
	2abe167082817d70ff2fd6567104ce4bcf0fe304 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	Win32/Win32.Ramlide/bitmap.asm 
 | 
	fengjixuchui/Family 
 | 
	2abe167082817d70ff2fd6567104ce4bcf0fe304 
 | 
	[
  "MIT"
]  | 3 
							 | 
	2021-05-15T15:57:15.000Z 
 | 
	2022-01-08T20:51:04.000Z 
 | 
	;; Imagen del Payload ;;
@BitMap:
DB       042h, 01Ch, 04Dh, 0B6h, 0F4h, 02Ah, 001h, 033h
DB       036h, 004h, 008h, 028h, 010h, 011h, 09Eh, 001h
DB       022h, 094h, 0CAh, 00Eh, 008h, 018h, 08Eh, 080h
DB       0F0h, 014h, 001h, 0ECh, 080h, 0ABh, 003h, 078h
DB       008h, 0A4h, 007h, 0A3h, 002h, 036h, 013h, 0C0h
DB       002h, 008h, 040h, 0DCh, 0F0h, 031h, 0CAh, 0A6h
DB       01Ah, 020h, 040h, 091h, 009h, 060h, 022h, 080h
DB       044h, 0A0h, 0C0h, 089h, 0E0h, 006h, 02Fh, 0DFh
DB       008h, 062h, 0F3h, 012h, 060h, 024h, 080h, 048h
DB       0A0h, 091h, 0C0h, 064h, 041h, 060h, 05Dh, 022h
DB       0F1h, 017h, 0C8h, 0BEh, 045h, 0F2h, 02Fh, 091h
DB       07Fh, 08Ah, 0ADh, 071h, 041h, 0E2h, 02Fh, 091h
DB       07Ch, 08Bh, 0E4h, 05Fh, 022h, 0F9h, 017h, 0B8h
DB       0BFh, 0C5h, 0E2h, 02Fh, 091h, 07Ch, 08Bh, 0E4h
DB       05Fh, 022h, 0F9h, 017h, 078h, 0BDh, 0C5h, 0FEh
DB       02Fh, 091h, 07Ch, 08Bh, 0E4h, 05Fh, 022h, 0F9h
DB       017h, 038h, 0BBh, 0C5h, 0EEh, 02Fh, 0F1h, 07Ch
DB       08Bh, 0E4h, 05Fh, 022h, 0F9h, 005h, 035h, 0BFh
DB       01Ah, 0C9h, 008h, 0A6h, 002h, 060h, 009h, 044h
DB       080h, 0A0h, 089h, 0C0h, 012h, 0E0h, 0B3h, 0DBh
DB       0A6h, 041h, 0F1h, 017h, 0C8h, 0BEh, 045h, 0FEh
DB       02Fh, 091h, 07Ch, 08Bh, 0ECh, 05Fh, 062h, 0FBh
DB       017h, 0D8h, 0BEh, 0C5h, 0F6h, 02Fh, 0F1h, 07Dh
DB       089h, 060h, 017h, 048h, 0BCh, 045h, 0F2h, 02Fh
DB       091h, 07Ch, 08Bh, 0E4h, 05Fh, 0E2h, 0FFh, 017h
DB       048h, 0BCh, 045h, 0F2h, 02Fh, 091h, 07Ch, 08Bh
DB       0E4h, 05Fh, 022h, 0F7h, 017h, 0F8h, 0BCh, 045h
DB       0F2h, 02Fh, 091h, 07Ch, 08Bh, 0E4h, 05Fh, 022h
DB       0EFh, 017h, 0B8h, 0BFh, 0C5h, 0F2h, 02Fh, 091h
DB       07Ch, 08Bh, 0E4h, 05Fh, 022h, 0E7h, 017h, 078h
DB       0BDh, 0C5h, 0FEh, 02Fh, 091h, 07Ch, 08Bh, 0E4h
DB       05Fh, 020h, 093h, 0F0h, 014h, 020h, 0F6h, 0D9h
DB       008h, 060h, 026h, 0FCh, 049h, 000h, 07Ch, 08Bh
DB       0E4h, 05Fh, 0A2h, 0F9h, 017h, 0C8h, 0BEh, 045h
DB       0F2h, 02Fh, 091h, 07Ch, 08Bh, 0E4h, 05Fh, 0A2h
DB       0F9h, 017h, 0C8h, 0BEh, 045h, 0F2h, 02Fh, 091h
DB       07Ch, 08Bh, 0E4h, 05Fh, 0A2h, 0F9h, 017h, 0C8h
DB       0BEh, 045h, 0F2h, 02Fh, 091h, 07Ch, 08Bh, 0E4h
DB       05Fh, 0A2h, 0F9h, 017h, 0C8h, 0BEh, 045h, 0FEh
DB       02Fh, 0F1h, 07Fh, 08Bh, 0FCh, 05Fh, 0E2h, 0FFh
DB       017h, 0F8h, 0BFh, 0C5h, 0F2h, 02Fh, 091h, 07Ch
DB       08Bh, 0E4h, 05Fh, 0A2h, 0F9h, 017h, 0C8h, 0BEh
DB       045h, 0F2h, 02Fh, 091h, 07Ch, 08Bh, 0E4h, 05Fh
DB       0A2h, 0F9h, 017h, 0C8h, 0BEh, 045h, 0F2h, 02Fh
DB       091h, 07Ch, 08Bh, 0E4h, 05Dh, 0A2h, 0F5h, 017h
DB       0E9h, 019h, 0F2h, 060h, 04Dh, 0F6h, 091h, 008h
DB       0A0h, 050h, 002h, 0E0h, 09Bh, 05Bh, 03Ah, 06Fh
DB       041h, 011h, 07Ch, 08Bh, 0E4h, 05Fh, 0E2h, 0F9h
DB       017h, 0C8h, 091h, 040h, 074h, 08Bh, 0C4h, 05Fh
DB       022h, 0F9h, 017h, 0C8h, 0BFh, 0C5h, 0F2h, 024h
DB       060h, 05Dh, 022h, 0F1h, 017h, 0C8h, 0BEh, 045h
DB       0F2h, 02Fh, 091h, 07Fh, 08Bh, 0FCh, 05Dh, 022h
DB       0F1h, 017h, 0C8h, 0BEh, 045h, 0F2h, 02Fh, 091h
DB       07Ch, 08Bh, 0DCh, 05Fh, 0E2h, 0F1h, 017h, 0C8h
DB       0BEh, 045h, 0F2h, 02Fh, 091h, 07Ch, 08Bh, 0ECh
DB       05Fh, 062h, 0FFh, 017h, 0D8h, 0BEh, 0C5h, 087h
DB       06Bh, 0F0h, 0FBh, 0FFh, 006h, 0A4h, 050h, 091h
DB       050h, 0B7h, 002h, 0CAh, 003h, 0B7h, 008h, 08Ah
DB       007h, 04Ah, 002h, 028h, 013h, 0D5h, 00Bh, 001h
DB       0FFh, 0EFh, 022h, 010h, 0A7h, 02Dh, 072h, 045h
DB       05Fh, 0F5h, 0C9h, 03Fh, 03Dh, 04Dh, 069h, 0CEh
DB       047h, 0A2h, 05Ah, 089h, 02Ch, 017h, 0A2h, 07Fh
DB       024h, 032h, 07Ah, 04Dh, 03Dh, 0DBh, 036h, 063h
DB       018h, 003h, 071h, 0A5h, 02Dh, 0FAh, 04Dh, 0A2h
DB       07Fh, 0A9h, 0CFh, 0BAh, 0D7h, 001h, 0A5h, 079h
DB       020h, 077h, 07Ah, 09Ah, 02Bh, 0B4h, 00Ah, 0A7h
DB       011h, 0A4h, 032h, 0ABh, 011h, 035h, 017h, 02Eh
DB       028h, 06Ah, 025h, 008h, 0D2h, 04Dh, 0D0h, 08Dh
DB       018h, 002h, 003h, 0D6h, 0B4h, 014h, 0FDh, 05Ah
DB       0B5h, 094h, 02Dh, 06Bh, 0E0h, 037h, 074h, 0B5h
DB       02Ah, 03Fh, 0EBh, 0D4h, 015h, 0A4h, 0A3h, 069h
DB       092h, 02Bh, 00Ch, 056h, 045h, 0B7h, 009h, 0BFh
DB       030h, 065h, 010h, 06Eh, 001h, 0D4h, 03Bh, 0BFh
DB       024h, 018h, 05Eh, 0EAh, 00Bh, 0D2h, 09Dh, 001h
DB       04Ch, 06Ah, 028h, 071h, 030h, 0E7h, 0A6h, 070h
DB       046h, 057h, 0A9h, 02Dh, 036h, 058h, 0CBh, 091h
DB       0A2h, 0F9h, 010h, 04Ah, 001h, 0ADh, 0A4h, 08Ch
DB       0D3h, 05Dh, 0BFh, 0CCh, 0D3h, 0F9h, 028h, 0CCh
DB       0BBh, 053h, 009h, 097h, 037h, 03Fh, 05Ah, 001h
DB       0F4h, 0AFh, 020h, 029h, 03Bh, 0CAh, 007h, 0ABh
DB       00Ah, 04Ah, 011h, 052h, 044h, 032h, 03Ah, 031h
DB       06Ah, 052h, 010h, 07Bh, 0F3h, 0EEh, 04Ch, 069h
DB       0A5h, 04Fh, 04Ah, 008h, 0D3h, 0F5h, 038h, 025h
DB       002h, 015h, 030h, 073h, 0B3h, 038h, 09Dh, 02Bh
DB       095h, 0D2h, 0A0h, 02Dh, 031h, 0B4h, 06Ah, 030h
DB       08Bh, 04Ah, 002h, 02Fh, 016h, 055h, 07Ah, 04Fh
DB       0EBh, 0F5h, 029h, 015h, 0AEh, 00Ah, 00Bh, 05Ah
DB       095h, 0E6h, 03Ah, 056h, 045h, 0B4h, 0A2h, 0A0h
DB       0D2h, 07Fh, 0B3h, 04Dh, 0E0h, 0B9h, 0CFh, 0AFh
DB       05Ah, 001h, 0F4h, 0AFh, 020h, 037h, 0E1h, 00Bh
DB       096h, 07Ah, 0A2h, 01Dh, 0B4h, 00Ah, 0A5h, 026h
DB       026h, 0D1h, 042h, 0F6h, 069h, 0B3h, 011h, 0CFh
DB       0BBh, 032h, 00Ah, 0BEh, 04Fh, 0E3h, 05Ah, 008h
DB       07Eh, 0A7h, 025h, 0A4h, 0A0h, 004h, 008h, 0FFh
DB       029h, 099h, 0A1h, 0D2h, 0BDh, 095h, 02Ah, 001h
DB       090h, 0A0h, 072h, 0FFh, 06Ah, 030h, 036h, 046h
DB       0EEh, 05Ch, 026h, 0E8h, 0DBh, 053h, 033h, 0EBh
DB       0FDh, 04Ah, 015h, 04Ah, 029h, 069h, 05Fh, 087h
DB       051h, 011h, 05Ah, 045h, 0DAh, 06Eh, 0EDh, 037h
DB       0C9h, 09Fh, 03Dh, 0A6h, 0A7h, 07Ah, 0EEh, 03Fh
DB       0A3h, 005h, 0C1h, 031h, 029h, 0B9h, 00Ch, 0FFh
DB       0D4h, 017h, 004h, 0B3h, 031h, 0FDh, 033h, 020h
DB       029h, 0D7h, 0FAh, 015h, 04Fh, 03Ah, 04Ch, 04Ah
DB       02Dh, 0E7h, 07Ah, 0A9h, 03Dh, 029h, 00Ah, 0B5h
DB       04Fh, 067h, 04Bh, 0D9h, 01Bh, 0B2h, 0F9h, 0B4h
DB       008h, 0FBh, 0CDh, 01Ch, 011h, 0B7h, 02Fh, 0B9h
DB       012h, 03Ch, 093h, 039h, 052h, 002h, 050h, 028h
DB       031h, 04Fh, 0A2h, 011h, 0B2h, 008h, 0A9h, 018h
DB       013h, 0ABh, 0FAh, 029h, 093h, 01Dh, 053h, 028h
DB       038h, 053h, 039h, 095h, 095h, 0DAh, 041h, 0AFh
DB       006h, 0F4h, 099h, 0A6h, 010h, 048h, 069h, 0CDh
DB       09Fh, 0E9h, 0A7h, 0C9h, 045h, 02Dh, 04Ah, 07Ah
DB       05Ah, 096h, 0E7h, 0D4h, 05Ah, 0F3h, 0A4h, 08Bh
DB       00Bh, 095h, 057h, 055h, 0BEh, 028h, 069h, 0A5h
DB       037h, 0E8h, 019h, 01Eh, 00Ch, 0ABh, 011h, 02Bh
DB       01Ch, 031h, 045h, 049h, 014h, 006h, 0A9h, 03Ch
DB       018h, 062h, 0BCh, 0F4h, 09Eh, 0A1h, 069h, 041h
DB       015h, 0DFh, 0A8h, 05Bh, 019h, 029h, 0FFh, 072h
DB       0B1h, 0F6h, 020h, 046h, 0B3h, 0F3h, 0EBh, 07Dh
DB       00Ch, 0F9h, 047h, 010h, 0F9h, 0AFh, 085h, 03Ch
DB       0F7h, 018h, 0D9h, 0AFh, 0BAh, 0BFh, 0EAh, 0F1h
DB       06Fh, 031h, 012h, 0DFh, 028h, 019h, 07Dh, 073h
DB       0C9h, 003h, 029h, 03Bh, 0A0h, 049h, 03Eh, 07Ch
DB       052h, 042h, 072h, 0A3h, 015h, 051h, 022h, 027h
DB       0AAh, 088h, 026h, 07Dh, 0B3h, 091h, 065h, 0B7h
DB       096h, 0DFh, 0F5h, 03Fh, 051h, 053h, 0BDh, 030h
DB       048h, 07Bh, 0DAh, 0DEh, 08Ah, 047h, 050h, 037h
DB       033h, 0C9h, 02Ah, 050h, 07Dh, 03Fh, 0B3h, 06Ah
DB       010h, 031h, 053h, 030h, 061h, 06Fh, 04Bh, 09Bh
DB       04Dh, 09Eh, 02Bh, 0A2h, 057h, 045h, 0EEh, 0A9h
DB       039h, 0B5h, 0E1h, 058h, 06Eh, 014h, 06Ah, 0F6h
DB       0A6h, 011h, 0C8h, 05Bh, 069h, 039h, 028h, 06Ah
DB       07Ah, 0D4h, 036h, 050h, 095h, 0A8h, 04Ah, 069h
DB       047h, 094h, 032h, 072h, 062h, 094h, 0DFh, 094h
DB       0D2h, 052h, 0E7h, 099h, 0FCh, 072h, 056h, 008h
DB       0ADh, 0A6h, 0CEh, 093h, 00Bh, 04Fh, 094h, 050h
DB       06Fh, 0AAh, 0F1h, 069h, 06Eh, 0B9h, 05Fh, 029h
DB       0BAh, 0E9h, 07Fh, 052h, 073h, 0ABh, 0D4h, 0E1h
DB       06Ch, 023h, 082h, 0B3h, 0A7h, 045h, 0A9h, 0F5h
DB       0B5h, 00Eh, 04Fh, 0D4h, 0F6h, 097h, 03Ah, 036h
DB       051h, 014h, 027h, 09Fh, 093h, 02Dh, 09Eh, 036h
DB       0A7h, 094h, 085h, 0D8h, 0B0h, 069h, 031h, 0AAh
DB       0ADh, 08Fh, 087h, 032h, 079h, 0A0h, 045h, 097h
DB       055h, 070h, 0EFh, 076h, 0EAh, 073h, 091h, 006h
DB       09Fh, 0B4h, 074h, 012h, 0CBh, 0CDh, 07Eh, 091h
DB       070h, 024h, 0A0h, 05Ah, 044h, 01Ch, 0D2h, 03Eh
DB       053h, 001h, 024h, 058h, 094h, 08Bh, 08Dh, 065h
DB       0A4h, 01Eh, 027h, 036h, 097h, 07Eh, 0EFh, 0B7h
DB       010h, 041h, 0F9h, 032h, 0B6h, 061h, 0E5h, 0F6h
DB       0EBh, 02Ah, 002h, 029h, 0FDh, 07Bh, 06Ah, 05Dh
DB       008h, 0F6h, 049h, 055h, 07Dh, 0DCh, 04Ah, 0FCh
DB       06Fh, 06Fh, 0FAh, 032h, 093h, 025h, 038h, 0FBh
DB       069h, 0DCh, 0DBh, 094h, 0FEh, 049h, 0EEh, 092h
DB       062h, 0A0h, 072h, 0ADh, 039h, 0E1h, 053h, 035h
DB       031h, 0DEh, 04Dh, 0D4h, 0E8h, 087h, 075h, 0D4h
DB       018h, 04Ah, 048h, 0C2h, 0DDh, 0B4h, 0D5h, 096h
DB       0FBh, 01Ch, 094h, 074h, 0DBh, 0ECh, 098h, 0A0h
DB       0B3h, 0A3h, 042h, 050h, 0F5h, 0ABh, 06Ah, 0A5h
DB       0E7h, 034h, 009h, 09Ah, 05Bh, 049h, 00Bh, 0B4h
DB       08Bh, 0A0h, 0D8h, 059h, 06Ah, 029h, 091h, 00Ch
DB       0CAh, 011h, 093h, 031h, 034h, 0CCh, 09Ah, 0A0h
DB       051h, 025h, 0A6h, 029h, 0FCh, 06Bh, 0B4h, 036h
DB       0EFh, 023h, 07Eh, 08Eh, 010h, 032h, 06Dh, 0A0h
DB       042h, 0FEh, 0B4h, 086h, 001h, 06Ah, 0DEh, 0ABh
DB       008h, 048h, 0B8h, 0A0h, 0A7h, 04Ah, 08Dh, 06Dh
DB       020h, 0E6h, 045h, 0A0h, 06Fh, 010h, 0CAh, 031h
DB       0A4h, 094h, 028h, 019h, 038h, 008h, 0D7h, 05Bh
DB       04Dh, 08Ch, 09Ah, 088h, 047h, 0A0h, 0A4h, 036h
DB       06Ah, 038h, 02Eh, 093h, 049h, 03Bh, 0A0h, 0F6h
DB       033h, 0FDh, 044h, 03Fh, 089h, 022h, 0ABh, 0D1h
DB       0E2h, 090h, 0B3h, 07Ah, 0B3h, 0B7h, 024h, 0ACh
DB       0BDh, 0D2h, 034h, 06Fh, 03Bh, 0B4h, 038h, 04Dh
DB       039h, 0D4h, 010h, 09Bh, 077h, 07Ah, 05Bh, 048h
DB       0F6h, 01Ah, 0B5h, 0D8h, 0DFh, 072h, 0B3h, 0D9h
DB       0B5h, 039h, 0CAh, 0F2h, 07Ch, 0A4h, 011h, 09Ah
DB       0C8h, 0F1h, 028h, 052h, 08Eh, 0F6h, 036h, 074h
DB       0C2h, 09Dh, 013h, 0E6h, 06Eh, 030h, 055h, 029h
DB       030h, 047h, 07Ah, 0D9h, 01Fh, 0A0h, 0A4h, 00Bh
DB       0D2h, 0E5h, 0E0h, 0CAh, 086h, 0CFh, 0D2h, 03Dh
DB       00Ch, 0F2h, 0B2h, 03Dh, 04Dh, 0A0h, 0A8h, 0F5h
DB       0ACh, 0BFh, 0EBh, 0FEh, 0BAh, 037h, 0A4h, 001h
DB       031h, 08Bh, 087h, 048h, 0A0h, 0EBh, 04Ch, 0C3h
DB       048h, 01Ah, 0CFh, 0B3h, 052h, 03Fh, 0A0h, 051h
DB       014h, 049h, 074h, 072h, 080h, 0D7h, 035h, 0DFh
DB       01Ch, 0E5h, 0A4h, 0A0h, 054h, 0AEh, 0ACh, 07Ah
DB       0F6h, 0A2h, 099h, 045h, 0A0h, 0B9h, 059h, 037h
DB       09Fh, 0E4h, 0A0h, 071h, 028h, 055h, 073h, 095h
DB       0FBh, 012h, 084h, 036h, 0BEh, 092h, 0ACh, 0F1h
DB       092h, 009h, 0FDh, 0EEh, 094h, 0CFh, 0D5h, 05Bh
DB       005h, 06Fh, 03Ch, 02Bh, 029h, 0AAh, 0ADh, 04Fh
DB       06Dh, 0E3h, 0A4h, 0D4h, 0A0h, 052h, 0E5h, 0F1h
DB       034h, 0C2h, 0D9h, 014h, 04Ch, 0AEh, 0B4h, 0D7h
DB       085h, 054h, 0A3h, 033h, 0D4h, 0ECh, 092h, 01Bh
DB       0ADh, 00Bh, 0A4h, 08Eh, 0A0h, 029h, 028h, 05Dh
DB       069h, 017h, 0A0h, 0A4h, 00Bh, 0D2h, 079h, 020h
DB       05Ah, 045h, 0A0h, 024h, 00Ch, 072h, 0E4h, 010h
DB       0B0h, 0F7h, 049h, 0B4h, 0A0h, 0E6h, 07Bh, 0A6h
DB       062h, 024h, 0B3h, 06Ah, 0A0h, 05Fh, 0AEh, 0E0h
DB       07Eh, 04Ah, 008h, 053h, 088h, 055h, 063h, 0CAh
DB       059h, 040h, 0BDh, 04Dh, 0B9h, 021h, 048h, 0F3h
DB       0EFh, 0E4h, 0B4h, 0A6h, 075h, 063h, 022h, 0B3h
DB       073h, 0DEh, 0F8h, 091h, 0A0h, 04Fh, 030h, 0E5h
DB       089h, 0FBh, 0A4h, 0A4h, 0A0h, 05Ah, 0ABh, 03Fh
DB       01Eh, 040h, 0E3h, 056h, 03Dh, 017h, 0A5h, 0C4h
DB       0B4h, 007h, 09Dh, 07Ch, 0B4h, 079h, 028h, 08Bh
DB       0A0h, 021h, 028h, 01Eh, 06Ah, 079h, 07Ch, 071h
DB       008h, 0FFh, 00Bh, 078h, 0F3h, 01Bh, 05Ch, 0DFh
DB       07Bh, 0A2h, 034h, 064h, 014h, 09Ah, 0F7h, 0D5h
DB       052h, 030h, 04Bh, 012h, 00Dh, 074h, 0E7h, 08Ah
DB       0A0h, 0D7h, 04Bh, 0E0h, 06Ah, 0B2h, 075h, 047h
DB       0A0h, 044h, 028h, 024h, 08Fh, 00Bh, 051h, 092h
DB       079h, 060h, 0F4h, 08Ah, 0A0h, 049h, 00Ch, 0E3h
DB       0B3h, 0D7h, 0FDh, 016h, 04Eh, 045h, 04Dh, 07Ch
DB       058h, 0A2h, 0A7h, 0CBh, 0BFh, 0E0h, 0C6h, 008h
DB       0B7h, 0A2h, 0CEh, 087h, 03Fh, 069h, 0C5h, 073h
DB       0CCh, 0ECh, 031h, 096h, 078h, 09Ch, 0F6h, 064h
DB       0A0h, 0C6h, 0B3h, 0F1h, 0FFh, 0F7h, 04Bh, 008h
DB       052h, 03Dh, 057h, 090h, 02Dh, 039h, 092h, 033h
DB       069h, 032h, 044h, 06Ah, 059h, 099h, 0B4h, 0E6h
DB       08Bh, 0A0h, 06Bh, 006h, 096h, 050h, 0D4h, 064h
DB       0AEh, 04Ah, 025h, 09Bh, 0B5h, 00Bh, 0A5h, 0B8h
DB       0B2h, 0BCh, 0A9h, 019h, 009h, 026h, 017h, 0A0h
DB       0A8h, 02Dh, 0B9h, 0E0h, 04Fh, 054h, 07Dh, 069h
DB       0E2h, 066h, 0A1h, 05Ch, 029h, 049h, 0A5h, 0B2h
DB       028h, 024h, 0B3h, 0A0h, 0C9h, 04Bh, 01Eh, 0DCh
DB       0A2h, 04Dh, 06Eh, 009h, 0C9h, 06Ah, 044h, 02Dh
DB       092h, 07Ch, 0AAh, 051h, 0D1h, 05Bh, 04Bh, 0BEh
DB       0E0h, 09Eh, 0ABh, 069h, 044h, 061h, 0A4h, 0EBh
DB       048h, 008h, 0A0h, 0B4h, 095h, 05Fh, 062h, 0E3h
DB       028h, 045h, 00Bh, 0B5h, 0F4h, 0B2h, 006h, 0A6h
DB       0A5h, 0ACh, 0E0h, 0D2h, 053h, 09Ah, 045h, 056h
DB       045h, 0D5h, 0B7h, 028h, 031h, 066h, 0ABh, 0D1h
DB       0B7h, 0CBh, 0BFh, 0E0h, 0ECh, 0A9h, 031h, 0D6h
DB       02Ah, 094h, 002h, 0B5h, 067h, 068h, 011h, 055h
DB       004h, 028h, 085h, 0D5h, 0D1h, 05Ah, 00Bh, 0C0h
DB       0F6h, 04Ch, 070h, 05Ah, 0B4h, 065h, 027h, 0A2h
DB       085h, 079h, 0B9h, 053h, 096h, 029h, 08Dh, 03Fh
DB       0ACh, 045h, 040h, 07Ah, 061h, 0C7h, 073h, 03Dh
DB       00Ah, 0DFh, 06Dh, 032h, 0C0h, 079h, 06Bh, 034h
DB       076h, 0E6h, 0B4h, 04Ch, 0C2h, 0D7h, 072h, 0E0h
DB       0B4h, 032h, 05Ah, 065h, 0D2h, 032h, 077h, 0C5h
DB       01Bh, 0B9h, 041h, 0B3h, 04Ah, 025h, 048h, 0A0h
DB       0E5h, 036h, 095h, 0F1h, 0B4h, 046h, 052h, 070h
DB       0F0h, 0B1h, 031h, 0A6h, 0DAh, 0CDh, 026h, 02Ah
DB       046h, 007h, 008h, 069h, 0D7h, 09Eh, 020h, 05Ch
DB       0BCh, 057h, 0C4h, 008h, 099h, 0A9h, 0A4h, 052h
DB       0A0h, 052h, 094h, 0F7h, 0F1h, 0FEh, 04Dh, 00Bh
DB       0A4h, 047h, 0A5h, 0CDh, 0D6h, 024h, 0E4h, 052h
DB       04Fh, 00Ch, 012h, 008h, 065h, 030h, 02Dh, 045h
DB       026h, 034h, 029h, 008h, 0BBh, 04Bh, 0BDh, 0E0h
DB       0EBh, 0C4h, 037h, 0EFh, 09Eh, 02Ah, 06Ah, 079h
DB       051h, 01Ch, 065h, 02Ah, 0E6h, 085h, 004h, 069h
DB       09Dh, 09Fh, 0F2h, 0F9h, 050h, 037h, 020h, 019h
DB       044h, 0E5h, 06Bh, 069h, 04Ah, 0ECh, 09Fh, 0B6h
DB       0C9h, 0B2h, 00Bh, 073h, 0F9h, 006h, 03Dh, 051h
DB       032h, 0A8h, 0F4h, 02Bh, 0EDh, 0FFh, 069h, 01Dh
DB       04Ch, 06Eh, 046h, 045h, 008h, 0AAh, 07Eh, 05Ch
DB       0F9h, 0EEh, 079h, 0CAh, 069h, 0B1h, 085h, 008h
DB       0C6h, 079h, 078h, 093h, 0B3h, 0CAh, 020h, 052h
DB       008h, 059h, 040h, 0D4h, 085h, 0D5h, 091h, 052h
DB       056h, 059h, 040h, 0A7h, 0E9h, 0E4h, 01Bh, 05Fh
DB       06Ah, 04Ah, 086h, 031h, 09Ah, 034h, 0F2h, 0F3h
DB       062h, 06Fh, 059h, 0D1h, 06Ah, 03Ch, 071h, 0AFh
DB       0BEh, 076h, 0FBh, 023h, 0A0h, 09Ah, 054h, 0ADh
DB       022h, 0D5h, 0A7h, 0B0h, 0B3h, 0D3h, 0CDh, 037h
DB       0B5h, 0F9h, 032h, 004h, 047h, 00Bh, 092h, 069h
DB       02Fh, 047h, 05Dh, 010h, 050h, 07Ah, 069h, 0A5h
DB       0E6h, 0B7h, 07Ch, 0BAh, 0ABh, 06Ah, 045h, 07Ah
DB       04Ch, 044h, 091h, 0A0h, 02Eh, 0E0h, 057h, 0A5h
DB       04Dh, 000h, 0C2h, 0B4h, 072h, 089h, 0EAh, 0A9h
DB       0BBh, 0DBh, 0BCh, 03Ch, 052h, 009h, 055h, 00Dh
DB       055h, 05Bh, 087h, 002h, 02Ah, 014h, 0A4h, 048h
DB       0ABh, 025h, 0A5h, 019h, 085h, 069h, 0F6h, 0ECh
DB       085h, 03Eh, 0F6h, 073h, 0D3h, 036h, 056h, 05Ch
DB       04Fh, 09Dh, 007h, 063h, 041h, 06Ah, 018h, 053h
DB       0CBh, 014h, 03Fh, 090h, 05Bh, 0BCh, 03Bh, 016h
DB       0F6h, 037h, 051h, 025h, 029h, 0C9h, 0D0h, 057h
DB       085h, 08Bh, 0B2h, 00Ch, 0D8h, 0F6h, 09Eh, 05Bh
DB       0EBh, 0B2h, 0A4h, 071h, 0A1h, 0C9h, 065h, 080h
DB       0A9h, 095h, 024h, 045h, 00Ah, 0F6h, 029h, 06Ch
DB       04Dh, 04Dh, 035h, 062h, 0CBh, 0F7h, 045h, 06Ah
DB       079h, 082h, 0EAh, 074h, 02Dh, 056h, 0BCh, 060h
DB       052h, 0AAh, 038h, 062h, 017h, 073h, 05Ah, 006h
DB       0ADh, 0B4h, 0F7h, 049h, 018h, 00Bh, 0E4h, 08Ah
DB       047h, 0DBh, 0DBh, 09Dh, 069h, 0E6h, 02Eh, 077h
DB       0ABh, 0DAh, 045h, 0D2h, 04Eh, 012h, 0D2h, 0CDh
DB       0A2h, 000h, 0B9h, 02Fh, 06Ah, 040h, 05Ch, 027h
DB       0D6h, 01Ah, 075h, 094h, 0D4h, 0FCh, 0CDh, 02Fh
DB       05Dh, 0E5h, 0F6h, 047h, 0A0h, 028h, 014h, 091h
DB       0A0h, 0ADh, 06Eh, 021h, 0A2h, 01Ch, 04Ah, 0D4h
DB       046h, 0A6h, 091h, 0A0h, 0B4h, 06Dh, 0E2h, 04Bh
DB       0D6h, 0B2h, 047h, 0D4h, 0CDh, 094h, 037h, 0D2h
DB       052h, 01Ch, 0A2h, 03Ah, 092h, 0B4h, 055h, 008h
DB       096h, 091h, 025h, 06Eh, 098h, 0D2h, 022h, 0B3h
DB       0D2h, 05Ch, 0AEh, 0CBh, 0B4h, 0C5h, 060h, 0B4h
DB       0A6h, 0F9h, 001h, 0A4h, 09Dh, 0A0h, 0FBh, 0F4h
DB       024h, 099h, 03Ch, 0F6h, 045h, 08Fh, 02Eh, 06Eh
DB       04Dh, 0C1h, 05Ah, 082h, 04Eh, 0CAh, 0F6h, 092h
DB       0B3h, 0A0h, 094h, 093h, 092h, 06Dh, 0A0h, 04Eh
DB       0F7h, 069h, 070h, 03Ch, 00Bh, 097h, 015h, 0E7h
DB       024h, 08Dh, 06Ah, 0E6h, 0D2h, 076h, 0EBh, 0CDh
DB       0F0h, 04Fh, 045h, 06Ah, 011h, 0C8h, 05Ah, 05Eh
DB       040h, 055h, 0B8h, 05Ah, 0DAh, 01Fh, 0D7h, 0DDh
DB       0D2h, 03Eh, 039h, 0FFh, 055h, 04Dh, 094h, 0B7h
DB       0B9h, 092h, 058h, 0C4h, 0A5h, 0C9h, 0E9h, 03Fh
DB       038h, 0F8h, 030h, 09Dh, 033h, 091h, 0CFh, 0AAh
DB       03Fh, 0DAh, 0DEh, 055h, 07Ah, 09Ch, 0CDh, 0B5h
DB       09Ch, 089h, 0FDh, 03Ah, 074h, 080h, 0E9h, 0D8h
DB       0D3h, 0A6h, 021h, 07Eh, 0A9h, 010h, 031h, 072h
DB       034h, 0D6h, 025h, 06Eh, 0ACh, 0CCh, 0E9h, 037h
DB       0E1h, 07Fh, 0A7h, 0F7h, 03Eh, 0CEh, 0CBh, 054h
DB       05Bh, 0DEh, 0CCh, 04Bh, 08Eh, 0A3h, 092h, 099h
DB       0A3h, 0A7h, 0C4h, 04Ch, 0C4h, 052h, 06Ah, 0C1h
DB       09Ah, 009h, 0BCh, 0C0h, 091h, 047h, 079h, 018h
DB       04Bh, 07Ah, 07Eh, 0B5h, 0B6h, 02Bh, 0FFh, 04Eh
DB       045h, 052h, 00Ch, 049h, 038h, 04Ch, 0FDh, 096h
DB       0B2h, 0D5h, 0BDh, 06Bh, 02Fh, 0C0h, 051h, 06Dh
DB       03Eh, 03Dh, 0C2h, 0C2h, 0D4h, 03Ch, 05Eh, 0F3h
DB       07Ah, 03Dh, 088h, 04Bh, 038h, 055h, 0E4h, 05Bh
DB       03Fh, 06Bh, 036h, 07Bh, 084h, 0C9h, 0FBh, 056h
DB       0C9h, 09Eh, 06Fh, 0B5h, 01Ch, 018h, 0D2h, 022h
DB       09Bh, 079h, 057h, 070h, 09Ah, 096h, 0F6h, 00Ch
DB       0F2h, 0CEh, 0ADh, 0F7h, 05Eh, 0ABh, 05Ah, 08Ah
DB       0BAh, 049h, 000h, 0ADh, 0ADh, 04Eh, 045h, 082h
DB       0E9h, 0F9h, 0C2h, 0F3h, 085h, 02Fh, 047h, 06Ah
DB       021h, 07Ah, 07Ah, 08Bh, 014h, 0DBh, 049h, 079h
DB       018h, 072h, 0CBh, 0D6h, 0F6h, 073h, 0B9h, 06Fh
DB       069h, 01Eh, 07Bh, 03Dh, 07Fh, 0ADh, 09Bh, 0E7h
DB       07Ch, 035h, 01Ah, 069h, 096h, 05Ah, 0A5h, 076h
DB       0A5h, 03Fh, 069h, 056h, 0CAh, 073h, 05Bh, 00Eh
DB       09Eh, 096h, 04Ch, 06Fh, 0F5h, 0BCh, 058h, 0F7h
DB       0A9h, 04Dh, 079h, 0B4h, 05Eh, 0AAh, 02Fh, 038h
DB       04Ch, 0A7h, 0A9h, 07Ah, 069h, 08Fh, 072h, 034h
DB       0A6h, 013h, 0ADh, 0EEh, 0EDh, 002h, 06Fh, 03Ah
DB       027h, 053h, 09Ch, 053h, 03Eh, 0DAh, 08Fh, 057h
DB       035h, 072h, 0B4h, 00Bh, 0BAh, 02Ah, 025h, 051h
DB       045h, 07Eh, 06Dh, 0B6h, 02Ah, 0CEh, 000h, 0B5h
DB       0F9h, 0A0h, 0EDh, 07Eh, 07Ah, 0BCh, 070h, 095h
DB       045h, 03Bh, 0C9h, 097h, 00Eh, 04Dh, 030h, 02Ah
DB       08Bh, 01Bh, 09Ah, 00Ah, 0FEh, 0C7h, 075h, 0AEh
DB       000h, 0F6h, 0FFh, 04Bh, 0C7h, 0A5h, 0F8h, 0A0h
DB       0BFh, 04Bh, 0B3h, 0B2h, 0BBh, 051h, 05Eh, 02Ah
DB       08Ah, 042h, 0BDh, 02Ah, 0DEh, 0FCh, 094h, 096h
DB       0E9h, 02Ah, 0CAh, 091h, 0D4h, 0CDh, 0AAh, 048h
DB       0DFh, 0ADh, 0A4h, 010h, 0B3h, 0FBh, 084h, 0ABh
DB       07Dh, 034h, 04Fh, 04Dh, 0DAh, 039h, 05Dh, 0B7h
DB       01Bh, 04Bh, 0B5h, 097h, 0A5h, 0F9h, 080h, 057h
DB       0CAh, 001h, 0DDh, 0FFh, 0DEh, 053h, 049h, 0B7h
DB       0EFh, 0D4h, 001h, 070h, 0EDh, 019h, 04Eh, 0F0h
DB       0EAh, 02Bh, 049h, 0E9h, 0D4h, 0D4h, 003h, 00Ch
DB       0E7h, 0FAh, 027h, 07Ch, 0A7h, 025h, 0BFh, 0D6h
DB       067h, 0B9h, 0A4h, 06Ch, 0A0h, 05Dh, 0EAh, 055h
DB       0D7h, 015h, 049h, 048h, 0E4h, 09Eh, 05Ah, 0A2h
DB       049h, 09Fh, 059h, 0E5h, 049h, 06Fh, 001h, 052h
DB       0E9h, 0F9h, 04Fh, 031h, 094h, 054h, 0EFh, 057h
DB       067h, 0F4h, 08Ah, 0A0h, 0B8h, 052h, 0E3h, 05Bh
DB       052h, 0B6h, 056h, 091h, 0A0h, 05Eh, 0D4h, 02Ch
DB       0BEh, 0ADh, 04Ah, 024h, 0A4h, 08Bh, 0A0h, 0A9h
DB       0FEh, 015h, 01Ch, 04Ah, 064h, 07Eh, 057h, 03Fh
DB       0C9h, 0A1h, 0FEh, 008h, 049h, 052h, 04Ah, 05Fh
DB       0C5h, 052h, 032h, 001h, 04Ah, 031h, 00Ah, 04Eh
DB       039h, 0A2h, 04Ah, 09Eh, 07Dh, 0A7h, 03Bh, 04Ah
DB       0A2h, 054h, 049h, 00Ah, 023h, 052h, 0A2h, 0A2h
DB       04Ah, 04Fh, 091h, 0CAh, 059h, 056h, 029h, 04Ah
DB       052h, 001h, 0F2h, 092h, 0C2h, 0B1h, 02Fh, 049h
DB       05Ah, 039h, 07Fh, 0D4h, 0F9h, 033h, 0EDh, 04Bh
DB       071h, 029h, 00Ah, 026h, 0CFh, 075h, 001h, 092h
DB       03Bh, 068h, 08Ah, 00Ah, 038h, 06Ah, 041h, 069h
DB       015h, 0A1h, 058h, 00Ah, 053h, 0A6h, 001h, 049h
DB       04Bh, 09Fh, 09Ah, 002h, 097h, 039h, 0E9h, 03Ch
DB       039h, 091h, 0DCh, 0F2h, 092h, 0FDh, 0B7h, 036h
DB       024h, 0E9h, 0C4h, 00Ah, 09Fh, 0F9h, 095h, 032h
DB       0F1h, 04Ah, 053h, 05Ch, 001h, 04Bh, 0F7h, 01Bh
DB       054h, 0C6h, 00Ah, 0A5h, 0C4h, 03Ch, 0D3h, 039h
DB       094h, 016h, 065h, 020h, 053h, 02Fh, 039h, 06Ah
DB       051h, 026h, 072h, 09Ch, 019h, 0D2h, 002h, 06Ah
DB       017h, 089h, 04Bh, 032h, 049h, 0B3h, 042h, 049h
DB       072h, 09Fh, 0FEh, 071h, 053h, 054h, 001h, 021h
DB       04Bh, 09Ch, 00Bh, 069h, 08Bh, 07Eh, 0D5h, 073h
DB       08Ah, 076h, 0A5h, 00Fh, 028h, 0F0h, 0FFh, 022h
DB       0A1h, 0F6h, 02Ch, 093h, 025h, 0C6h, 00Bh, 06Dh
DB       0D2h, 0C2h, 07Bh, 0E9h, 07Ch, 0ADh, 033h, 0A9h
DB       059h, 053h, 02Bh, 026h, 054h, 0B6h, 0CAh, 001h
DB       072h, 08Ah, 0C2h, 0C3h, 029h, 001h, 03Dh, 052h
DB       039h, 095h, 00Fh, 06Dh, 002h, 071h, 05Ah, 03Ah
DB       056h, 00Bh, 06Ah, 03Ch, 026h, 05Ch, 0A2h, 04Dh
DB       09Bh, 053h, 0CCh, 08Eh, 016h, 0A5h, 014h, 031h
DB       05Bh, 0E6h, 072h, 093h, 0A2h, 0F4h, 0C5h, 078h
DB       001h, 055h, 047h, 001h, 04Dh, 04Ch, 014h, 00Ch
DB       063h, 001h, 052h, 0A5h, 039h, 0E9h, 0A4h, 066h
DB       06Bh, 05Ah, 0ADh, 098h, 01Ch, 0ABh, 01Eh, 03Ah
DB       0C9h, 029h, 05Dh, 034h, 090h, 0C5h, 04Dh, 00Ch
DB       055h, 079h, 027h, 025h, 0E9h, 026h, 081h, 0D2h
DB       079h, 0F9h, 04Bh, 059h, 099h, 01Ah, 04Ch, 045h
DB       0B5h, 02Dh, 0B7h, 05Bh, 001h, 052h, 0C2h, 065h
DB       003h, 00Bh, 01Ah, 06Ch, 072h, 09Bh, 049h, 06Ah
DB       01Bh, 026h, 0DDh, 045h, 04Dh, 06Dh, 039h, 0DEh
DB       09Bh, 00Ch, 053h, 0C3h, 026h, 06Dh, 04Fh, 0BCh
DB       022h, 014h, 0A6h, 002h, 048h, 00Bh, 016h, 0BFh
DB       06Ah, 0EAh, 035h, 06Eh, 0F4h, 043h, 0D2h, 034h
DB       050h, 09Eh, 09Fh, 0F7h, 015h, 04Eh, 032h, 001h
DB       00Dh, 03Ah, 0ADh, 0A3h, 0A2h, 04Ah, 039h, 0F3h
DB       04Dh, 04Ch, 0FCh, 079h, 0B6h, 01Eh, 043h, 00Dh
DB       094h, 0AFh, 0F2h, 04Ch, 047h, 090h, 0AAh, 026h
DB       0A2h, 036h, 0A9h, 0B2h, 035h, 0E9h, 02Bh, 010h
DB       06Ah, 059h, 05Ch, 0C5h, 029h, 04Dh, 04Eh, 02Ah
DB       0B6h, 053h, 001h, 0C8h, 001h, 0CAh, 039h, 0C9h
DB       0AAh, 0C2h, 00Fh, 0B2h, 003h, 04Eh, 01Ch, 0FFh
DB       04Ah, 010h, 056h, 093h, 052h, 026h, 0A2h, 04Dh
DB       09Ch, 053h, 0D2h, 044h, 02Eh, 04Fh, 0D5h, 032h
DB       0D5h, 066h, 0DAh, 028h, 04Fh, 0A1h, 05Ah, 068h
DB       031h, 00Eh, 00Fh, 0ACh, 001h, 0F5h, 01Dh, 0A8h
DB       0A2h, 08Bh, 0A5h, 039h, 07Bh, 094h, 08Bh, 039h
DB       064h, 01Fh, 00Dh, 03Dh, 04Fh, 0AFh, 024h, 04Dh
DB       0C6h, 0D3h, 051h, 04Dh, 036h, 0A4h, 020h, 0A1h
DB       0A4h, 0E9h, 07Ch, 091h, 0F9h, 05Ah, 095h, 059h
DB       035h, 045h, 03Dh, 0B5h, 0E6h, 00Dh, 019h, 04Ah
DB       0C4h, 0D5h, 0C5h, 06Ah, 0D9h, 039h, 06Eh, 055h
DB       079h, 06Ah, 003h, 02Ch, 07Ah, 09Ch, 044h, 090h
DB       047h, 0B0h, 021h, 0A5h, 026h, 029h, 050h, 073h
DB       0CAh, 001h, 045h, 016h, 0F3h, 056h, 0D1h, 06Ah
DB       092h, 02Fh, 050h, 096h, 08Eh, 05Ah, 085h, 00Ah
DB       04Ah, 084h, 08Eh, 080h, 0E7h, 0F7h, 0A4h, 09Bh
DB       0E2h, 05Bh, 0AEh, 001h, 071h, 052h, 0D4h, 0C4h
DB       0ADh, 058h, 093h, 0ABh, 04Ch, 029h, 089h, 055h
DB       016h, 039h, 091h, 033h, 0BFh, 0A4h, 04Eh, 0A1h
DB       054h, 0A4h, 0AFh, 049h, 04Dh, 0C6h, 0A5h, 01Ch
DB       026h, 064h, 0A1h, 0F2h, 08Dh, 024h, 072h, 026h
DB       091h, 0B5h, 02Ch, 059h, 04Ah, 0B1h, 0ABh, 0C2h
DB       00Eh, 056h, 0B9h, 001h, 04Dh, 00Eh, 0C8h, 00Dh
DB       04Ch, 06Ch, 055h, 039h, 04Fh, 056h, 0B8h, 054h
DB       0CFh, 00Ch, 00Bh, 04Ch, 0C8h, 007h, 0E3h, 05Eh
DB       0E9h, 053h, 0F2h, 0CAh, 054h, 094h, 019h, 04Fh
DB       0C5h, 053h, 084h, 04Ch, 00Eh, 0A6h, 0F7h, 03Ah
DB       024h, 052h, 016h, 05Bh, 094h, 06Eh, 02Eh, 049h
DB       0DDh, 04Ch, 04Eh, 056h, 0ADh, 040h, 032h, 074h
DB       04Bh, 02Bh, 0B5h, 0E3h, 0C5h, 049h, 0F2h, 00Eh
DB       054h, 0B9h, 056h, 055h, 007h, 093h, 04Ah, 001h
DB       06Ah, 0B8h, 08Ah, 0C5h, 049h, 0CAh, 0DFh, 0E2h
DB       0F7h, 045h, 0A1h, 0A4h, 034h, 061h, 09Dh, 09Ch
DB       04Eh, 032h, 0E9h, 0F2h, 05Dh, 099h, 025h, 04Ah
DB       04Dh, 026h, 044h, 0BFh, 08Dh, 0A1h, 0C6h, 03Ah
DB       0E6h, 012h, 0A5h, 039h, 0AAh, 010h, 056h, 05Ch
DB       033h, 029h, 049h, 059h, 0EBh, 062h, 0E7h, 0B8h
DB       0B4h, 00Fh, 0A6h, 08Dh, 0A9h, 001h, 05Bh, 049h
DB       0CAh, 0A0h, 012h, 056h, 05Bh, 028h, 0A1h, 04Ch
DB       058h, 04Dh, 023h, 00Ah, 0F6h, 0FFh, 007h, 036h
DB       074h, 0A0h, 0F3h, 052h, 053h, 0BAh, 08Ah, 0DCh
DB       052h, 0B0h, 04Ch, 00Fh, 0EFh, 0F6h, 087h, 04Dh
DB       046h, 022h, 0A1h, 0A9h, 022h, 04Fh, 084h, 00Fh
DB       056h, 06Dh, 092h, 075h, 04Bh, 02Bh, 050h, 0D2h
DB       03Bh, 09Fh, 048h, 0DBh, 028h, 053h, 093h, 01Ch
DB       04Eh, 056h, 008h, 068h, 092h, 0A3h, 001h, 0B4h
DB       024h, 0D4h, 03Eh, 0C2h, 0F2h, 00Dh, 042h, 00Ch
DB       0F3h, 0F2h, 0F2h, 046h, 0A0h, 049h, 007h, 006h
DB       075h, 0EDh, 023h, 049h, 04Ch, 039h, 08Fh, 0A6h
DB       0E9h, 05Bh, 014h, 068h, 0D2h, 078h, 02Ch, 0A0h
DB       0A6h, 0A3h, 025h, 034h, 02Ch, 054h, 0A5h, 0E5h
DB       07Eh, 021h, 034h, 0A4h, 0C4h, 0B2h, 052h, 0A9h
DB       083h, 03Ah, 0E9h, 04Bh, 081h, 0ACh, 037h, 0FAh
DB       010h, 049h, 00Ah, 0A1h, 058h, 02Bh, 033h, 029h
DB       059h, 0B7h, 086h, 01Bh, 0EAh, 052h, 087h, 0B4h
DB       04Ch, 0E1h, 00Fh, 0AFh, 007h, 019h, 05Eh, 001h
DB       022h, 007h, 0A4h, 0CFh, 051h, 05Eh, 063h, 020h
DB       02Bh, 0A4h, 093h, 0A1h, 0B7h, 002h, 08Fh, 09Eh
DB       052h, 057h, 0EBh, 05Bh, 030h, 03Ah, 08Dh, 02Dh
DB       02Bh, 049h, 00Dh, 022h, 045h, 01Bh, 053h, 04Fh
DB       053h, 08Eh, 04Dh, 0F0h, 0EFh, 086h, 0AEh, 024h
DB       0F7h, 0F7h, 075h, 003h, 092h, 017h, 048h, 052h
DB       0BDh, 04Fh, 034h, 048h, 09Ah, 050h, 094h, 09Bh
DB       088h, 04Dh, 012h, 05Fh, 014h, 0E1h, 05Bh, 0A5h
DB       009h, 05Ch, 054h, 01Ah, 050h, 054h, 008h, 07Fh
DB       028h, 04Fh, 0D2h, 0A0h, 04Ah, 0A0h, 056h, 0B7h
DB       0B9h, 055h, 001h, 0DEh, 013h, 0EEh, 0A4h, 026h
DB       056h, 00Fh, 04Bh, 08Ah, 053h, 052h, 051h, 0DCh
DB       094h, 0ABh, 045h, 04Eh, 012h, 0B6h, 02Dh, 0A1h
DB       0CAh, 049h, 0A0h, 0AFh, 092h, 01Eh, 053h, 074h
DB       0A1h, 08Dh, 07Bh, 027h, 0A0h, 052h, 025h, 06Dh
DB       0A4h, 04Ah, 029h, 04Eh, 014h, 00Eh, 05Fh, 0B8h
DB       02Eh, 09Bh, 0E3h, 0ACh, 00Fh, 0E4h, 00Ah, 09Ch
DB       0E9h, 05Bh, 099h, 0C0h, 024h, 091h, 0E6h, 00Dh
DB       021h, 0A2h, 0D4h, 0ADh, 010h, 022h, 0FEh, 0BBh
DB       059h, 05Fh, 087h, 035h, 052h, 053h, 0B4h, 054h
DB       0E6h, 001h, 0B2h, 0FFh, 036h, 0FEh, 008h, 091h
DB       09Fh, 024h, 06Eh, 0A4h, 02Bh, 0B4h, 072h, 084h
DB       056h, 099h, 0A1h, 0FAh, 03Bh, 056h, 040h, 036h
DB       095h, 00Bh, 069h, 0E0h, 00Ch, 0A1h, 0E4h, 056h
DB       0E2h, 05Dh, 0E3h, 0D2h, 04Ch, 0A1h, 0E5h, 05Eh
DB       05Ah, 06Ch, 016h, 096h, 05Bh, 092h, 0A1h, 099h
DB       08Dh, 0A4h, 09Fh, 0D6h, 0A6h, 09Bh, 06Ah, 09Fh
DB       068h, 05Bh, 058h, 008h, 0A4h, 0A4h, 0CCh, 098h
DB       05Ch, 049h, 053h, 0A1h, 049h, 0A0h, 0AEh, 021h
DB       054h, 02Bh, 0DCh, 049h, 0A9h, 03Ah, 03Fh, 0A0h
DB       0A5h, 0E4h, 0B4h, 094h, 06Ah, 04Bh, 089h, 031h
DB       009h, 00Ah, 024h, 06Bh, 04Fh, 0CDh, 0DAh, 028h
DB       0BBh, 031h, 0EFh, 01Fh, 052h, 04Eh, 0C6h, 0E5h
DB       08Ah, 0A5h, 01Ah, 08Fh, 062h, 0EAh, 0A6h, 025h
DB       056h, 0A7h, 0E3h, 022h, 0C6h, 02Ah, 05Fh, 0B3h
DB       0A2h, 0EAh, 09Bh, 0B3h, 071h, 0C8h, 054h, 04Ah
DB       049h, 008h, 091h, 081h, 014h, 04Fh, 0C6h, 0DCh
DB       054h, 04Bh, 010h, 09Eh, 0E6h, 0D0h, 0A8h, 010h
DB       0D5h, 066h, 059h, 0DBh, 041h, 038h, 022h, 05Bh
DB       0A4h, 05Ch, 0A0h, 065h, 0FFh, 03Eh, 001h, 055h
DB       0C2h, 026h, 09Fh, 048h, 0A0h, 094h, 039h, 03Eh
DB       04Dh, 055h, 0CFh, 0C5h, 05Ch, 022h, 07Bh, 048h
DB       0A1h, 053h, 034h, 0E3h, 0A4h, 063h, 0C3h, 068h
DB       05Eh, 09Dh, 08Fh, 039h, 012h, 0A1h, 04Dh, 011h
DB       039h, 048h, 0F6h, 0B6h, 048h, 04Dh, 055h, 057h
DB       02Eh, 053h, 05Ah, 076h, 091h, 0A0h, 0D2h, 065h
DB       0F0h, 010h, 054h, 0AEh, 048h, 0A0h, 0BBh, 053h
DB       08Ch, 04Ah, 012h, 07Eh, 02Dh, 0A0h, 0CAh, 035h
DB       0ACh, 00Bh, 065h, 056h, 022h, 0D8h, 05Bh, 0CCh
DB       01Dh, 0B0h, 0D9h, 092h, 047h, 0A2h, 00Fh, 04Ch
DB       0A1h, 091h, 07Bh, 029h, 025h, 008h, 00Eh, 0EFh
DB       0C9h, 0B2h, 0C6h, 049h, 0C6h, 05Fh, 0A6h, 0C7h
DB       0D6h, 02Dh, 02Bh, 0D6h, 013h, 00Fh, 0CAh, 04Ah
DB       045h, 0E9h, 03Dh, 049h, 0A1h, 09Ch, 054h, 04Bh
DB       010h, 0D7h, 054h, 071h, 087h, 09Ah, 066h, 0BAh
DB       059h, 063h, 009h, 034h, 087h, 05Ch, 003h, 09Fh
DB       0A0h, 023h, 0F6h, 04Bh, 02Eh, 00Dh, 02Bh, 09Eh
DB       0B2h, 0ACh, 0EAh, 06Bh, 0A2h, 039h, 04Dh, 00Eh
DB       029h, 009h, 0A0h, 015h, 0A1h, 02Ch, 078h, 0D3h
DB       052h, 06Ah, 0A4h, 048h, 0A0h, 089h, 05Dh, 036h
DB       0A1h, 0CEh, 030h, 0AFh, 03Fh, 069h, 001h, 0BDh
DB       032h, 0A6h, 03Ah, 00Eh, 0EAh, 0AAh, 04Dh, 0A0h
DB       0F4h, 0C5h, 0A3h, 04Eh, 057h, 061h, 04Ah, 0A6h
DB       05Fh, 045h, 001h, 009h, 0C6h, 04Eh, 0EFh, 070h
DB       049h, 032h, 09Fh, 064h, 0D8h, 090h, 0A0h, 091h
DB       0A1h, 0E9h, 02Ah, 00Eh, 0D6h, 024h, 048h, 0C9h
DB       06Ah, 02Bh, 0CCh, 01Dh, 099h, 0FDh, 0A9h, 025h
DB       091h, 04Fh, 06Bh, 04Ch, 009h, 039h, 02Eh, 0A0h
DB       032h, 08Dh, 0CDh, 057h, 026h, 024h, 04Bh, 08Ah
DB       0E9h, 010h, 052h, 04Eh, 0DCh, 094h, 04Ch, 010h
DB       0D2h, 065h, 0A1h, 039h, 059h, 0BFh, 041h, 01Ch
DB       05Ch, 09Ch, 052h, 05Dh, 06Dh, 0A0h, 077h, 0E0h
DB       0DAh, 054h, 046h, 09Fh, 0E3h, 04Ch, 092h, 05Fh
DB       08Ch, 0DAh, 0D9h, 072h, 045h, 0A1h, 04Ah, 038h
DB       0D2h, 0A5h, 093h, 053h, 0C9h, 0E1h, 025h, 0A1h
DB       0DAh, 047h, 063h, 024h, 09Fh, 017h, 0A6h, 09Bh
DB       069h, 05Eh, 06Fh, 02Ah, 048h, 018h, 089h, 04Bh
DB       0E0h, 088h, 057h, 09Fh, 0A4h, 001h, 048h, 0EFh
DB       0A0h, 0AFh, 0CAh, 056h, 08Ch, 053h, 0CCh, 075h
DB       0E7h, 0EAh, 0B2h, 049h, 092h, 03Ah, 089h, 08Ah
DB       01Ah, 0A0h, 06Eh, 079h, 0E7h, 0D2h, 04Ch, 047h
DB       0A0h, 00Fh, 052h, 00Eh, 091h, 07Bh, 04Eh, 077h
DB       035h, 0F6h, 064h, 025h, 0DDh, 0D4h, 049h, 0FCh
DB       022h, 035h, 0DAh, 04Dh, 046h, 090h, 091h, 081h
DB       0EAh, 092h, 0A9h, 010h, 0A4h, 0A1h, 03Fh, 0D6h
DB       059h, 092h, 0D4h, 084h, 084h, 066h, 09Eh, 0A0h
DB       00Ah, 0F6h, 0AFh, 09Fh, 001h, 0E4h, 05Fh, 023h
DB       05Eh, 08Dh, 099h, 0D1h, 065h, 0D2h, 0E7h, 0FDh
DB       037h, 039h, 0B8h, 049h, 01Ah, 07Bh, 0C2h, 01Bh
DB       047h, 0C8h, 033h, 05Bh, 0A7h, 0BDh, 08Fh, 041h
DB       05Ch, 0E1h, 0CEh, 0A5h, 05Dh, 024h, 0A0h, 079h
DB       0F7h, 0FAh, 04Ah, 0B5h, 056h, 0CCh, 0E7h, 001h
DB       019h, 071h, 0BAh, 054h, 094h, 0D2h, 049h, 039h
DB       047h, 09Fh, 023h, 0A0h, 0C8h, 04Dh, 055h, 0E4h
DB       0F7h, 012h, 0B6h, 0F1h, 059h, 03Eh, 057h, 039h
DB       0B6h, 075h, 092h, 057h, 09Bh, 079h, 0ADh, 02Fh
DB       024h, 092h, 076h, 034h, 08Ch, 093h, 0A1h, 024h
DB       068h, 0BCh, 079h, 091h, 07Ch, 02Bh, 016h, 0A4h
DB       0A1h, 04Eh, 032h, 074h, 0A0h, 09Dh, 035h, 025h
DB       07Eh, 070h, 0ADh, 054h, 0F1h, 022h, 0E9h, 0D2h
DB       0D4h, 003h, 085h, 048h, 095h, 0D2h, 033h, 010h
DB       053h, 0FDh, 06Dh, 059h, 044h, 09Dh, 0CDh, 0E3h
DB       023h, 0A0h, 0D3h, 025h, 056h, 06Dh, 001h, 031h
DB       0E5h, 0C4h, 04Dh, 04Ch, 099h, 01Ch, 0B5h, 0D8h
DB       064h, 039h, 0F0h, 025h, 05Dh, 091h, 07Bh, 0A4h
DB       0A0h, 071h, 0F7h, 0C7h, 0E1h, 05Fh, 057h, 0FFh
DB       095h, 064h, 010h, 0B0h, 082h, 04Dh, 091h, 0A0h
DB       053h, 013h, 0BAh, 0F7h, 05Dh, 036h, 07Ch, 002h
DB       09Dh, 027h, 0B4h, 001h, 019h, 0D1h, 0AAh, 054h
DB       09Ch, 073h, 0A5h, 0E9h, 0DBh, 056h, 004h, 08Ah
DB       0A0h, 0FCh, 04Dh, 08Eh, 096h, 078h, 0C9h, 0D9h
DB       031h, 028h, 086h, 091h, 0A0h, 05Ch, 090h, 07Bh
DB       029h, 04Dh, 056h, 0D9h, 047h, 05Bh, 0AAh, 0DAh
DB       0A4h, 034h, 0E9h, 032h, 0A1h, 06Ah, 0F9h, 042h
DB       07Ah, 072h, 0CAh, 099h, 0FDh, 024h, 0A1h, 07Ah
DB       094h, 0FCh, 091h, 035h, 06Bh, 009h, 00Eh, 094h
DB       022h, 093h, 081h, 034h, 047h, 0E1h, 012h, 058h
DB       023h, 054h, 0FFh, 05Bh, 059h, 04Eh, 037h, 0C4h
DB       049h, 01Eh, 0A0h, 0ABh, 0B6h, 074h, 01Eh, 09Dh
DB       01Eh, 0EAh, 096h, 0FFh, 024h, 09Fh, 0A6h, 01Ch
DB       04Ah, 06Ch, 06Bh, 046h, 09Dh, 049h, 05Eh, 0A0h
DB       0B1h, 0F6h, 008h, 009h, 021h, 0A1h, 0C7h, 0A5h
DB       0CEh, 0E1h, 024h, 055h, 0A0h, 05Ch, 042h, 0A4h
DB       04Fh, 0D9h, 0E7h, 025h, 016h, 03Fh, 02Ah, 0EAh
DB       096h, 0A5h, 05Eh, 06Ch, 02Bh, 069h, 003h, 01Dh
DB       0A0h, 071h, 0A4h, 009h, 06Ah, 065h, 071h, 08Eh
DB       079h, 0F5h, 0B2h, 09Dh, 04Ch, 088h, 052h, 0FBh
DB       0D2h, 0C9h, 05Dh, 054h, 0D6h, 087h, 07Ah, 019h
DB       01Ch, 0A0h, 0D2h, 02Dh, 055h, 0A1h, 026h, 021h
DB       09Fh, 06Eh, 03Ah, 084h, 042h, 010h, 0EBh, 0AEh
DB       0BAh, 057h, 0B2h, 013h, 0CBh, 032h, 06Eh, 046h
DB       048h, 095h, 033h, 0CAh, 054h, 059h, 0DBh, 08Dh
DB       0A6h, 064h, 069h, 0ADh, 09Ch, 056h, 0FDh, 06Ah
DB       07Dh, 02Ah, 078h, 086h, 0D3h, 012h, 041h, 016h
DB       0A0h, 09Dh, 09Dh, 022h, 0A0h, 0E5h, 01Ch, 0B6h
DB       064h, 0A0h, 01Ch, 09Fh, 06Ch, 042h, 027h, 01Ch
DB       0C8h, 091h, 0A0h, 079h, 054h, 00Dh, 06Fh, 022h
DB       0B7h, 00Ah, 0D4h, 020h, 05Dh, 0ADh, 064h, 0B7h
DB       048h, 05Dh, 0A0h, 0BBh, 09Ch, 063h, 0C5h, 05Ch
DB       0BDh, 0B2h, 04Fh, 03Eh, 059h, 097h, 082h, 0E2h
DB       09Bh, 041h, 047h, 09Eh, 0FAh, 014h, 0BAh, 02Ah
DB       093h, 0A0h, 03Ch, 072h, 0E9h, 00Eh, 06Fh, 02Dh
DB       0D5h, 026h, 02Dh, 09Fh, 09Ch, 0D2h, 091h, 010h
DB       0ACh, 030h, 0ABh, 013h, 099h, 05Bh, 047h, 05Eh
DB       04Bh, 010h, 057h, 059h, 089h, 052h, 024h, 0B0h
DB       0A6h, 09Bh, 0A0h, 021h, 0A4h, 016h, 05Dh, 0F3h
DB       06Bh, 0D7h, 0A6h, 078h, 051h, 0DAh, 022h, 023h
DB       0D2h, 06Eh, 0A0h, 023h, 09Eh, 0F1h, 0F7h, 00Bh
DB       04Fh, 012h, 0EDh, 02Eh, 05Fh, 0D7h, 0B5h, 062h
DB       06Ch, 062h, 048h, 0A0h, 0EBh, 0C8h, 0F7h, 0CCh
DB       093h, 04Ah, 0B4h, 0F9h, 07Dh, 0B4h, 074h, 09Bh
DB       0A0h, 075h, 043h, 0F6h, 0A5h, 012h, 026h, 069h
DB       0A0h, 063h, 00Eh, 069h, 084h, 034h, 0A0h, 0D2h
DB       026h, 067h, 0E9h, 015h, 056h, 06Ah, 059h, 024h
DB       05Bh, 0A0h, 07Eh, 071h, 05Ch, 0BFh, 01Eh, 0A3h
DB       0AAh, 0A1h, 04Dh, 0A0h, 088h, 0F7h, 0A4h, 0CEh
DB       031h, 0EBh, 020h, 052h, 042h, 049h, 0EDh, 0A4h
DB       04Ch, 0A0h, 008h, 05Bh, 09Ch, 07Fh, 0C4h, 049h
DB       06Ah, 0DCh, 063h, 06Dh, 020h, 025h, 0A0h, 0C6h
DB       015h, 04Ch, 020h, 05Bh, 090h, 089h, 048h, 05Eh
DB       034h, 03Bh, 09Dh, 049h, 090h, 0F6h, 048h, 053h
DB       05Fh, 059h, 0F5h, 089h, 060h, 026h, 0A0h, 0C8h
DB       0F7h, 0E9h, 0E2h, 08Dh, 08Ah, 0B9h, 001h, 05Ah
DB       045h, 0A0h, 05Bh, 048h, 0D9h, 0A0h, 0EFh, 092h
DB       009h, 01Fh, 09Bh, 017h, 0A0h, 0F1h, 057h, 00Ah
DB       0A8h, 007h, 085h, 0D9h, 007h, 01Ch, 0A7h, 087h
DB       010h, 04Eh, 023h, 0A6h, 0D1h, 007h, 00Fh, 088h
DB       0A5h, 07Ch, 042h, 052h, 0ADh, 0CAh, 015h, 008h
DB       0A7h, 09Fh, 077h, 06Eh, 02Eh, 05Ch, 030h, 0FAh
DB       0C8h, 053h, 05Dh, 044h, 09Dh, 02Bh, 088h, 056h
DB       06Eh, 090h, 0ABh, 088h, 05Ch, 090h, 052h, 0EFh
DB       0D2h, 064h, 014h, 08Fh, 0A0h, 0A4h, 0EDh, 083h
DB       048h, 0A0h, 0FBh, 088h, 052h, 05Dh, 04Eh, 036h
DB       02Fh, 040h, 0DDh, 021h, 057h, 010h, 054h, 048h
DB       096h, 0D6h, 0E3h, 095h, 049h, 0A1h, 092h, 07Ah
DB       0A0h, 0DDh, 061h, 0D9h, 049h, 0C7h, 084h, 02Ah
DB       0A9h, 0EEh, 01Fh, 0DCh, 09Ah, 0E2h, 09Dh, 0C5h
DB       0C6h, 0A4h, 0A0h, 0F4h, 0F1h, 01Eh, 021h, 09Eh
DB       07Ch, 0D2h, 0B9h, 03Eh, 0A0h, 0C8h, 054h, 07Fh
DB       044h, 04Ah, 03Eh, 0A9h, 032h, 0E2h, 0DCh, 0A4h
DB       0A2h, 07Ah, 045h, 0A0h, 0D0h, 057h, 09Fh, 087h
DB       052h, 0DEh, 01Dh, 075h, 02Dh, 045h, 028h, 024h
DB       0A0h, 077h, 0CAh, 048h, 055h, 0A4h, 0A0h, 05Dh
DB       051h, 04Dh, 037h, 0E2h, 0D2h, 03Eh, 0A0h, 088h
DB       09Eh, 075h, 034h, 0B9h, 08Ah, 0A0h, 0BAh, 07Dh
DB       087h, 0F7h, 02Eh, 081h, 0ADh, 04Dh, 0C1h, 0A4h
DB       0A0h, 0FDh, 0EAh, 07Dh, 0FAh, 045h, 0A0h, 057h
DB       06Eh, 010h, 0BAh, 0FFh, 0B2h, 09Fh, 01Fh, 03Ch
DB       043h, 0FBh, 0F2h, 054h, 03Eh, 021h, 05Fh, 0A7h
DB       07Bh, 09Ch, 02Bh, 021h, 09Fh, 0D5h, 0EEh, 090h
DB       0BCh, 04Ah, 087h, 0D5h, 027h, 07Ah, 025h, 093h
DB       0A0h, 071h, 055h, 06Fh, 031h, 060h, 0A5h, 09Dh
DB       0DFh, 0C4h, 06Ch, 05Fh, 091h, 0A0h, 0FDh, 04Dh
DB       0BFh, 026h, 0A0h, 0BEh, 088h, 056h, 0D4h, 043h
DB       0A7h, 0EFh, 09Ch, 063h, 05Fh, 044h, 008h, 032h
DB       055h, 01Fh, 0DEh, 0F1h, 07Eh, 079h, 0A0h, 06Ah
DB       052h, 07Eh, 03Bh, 0A0h, 0F8h, 05Bh, 08Dh, 0CDh
DB       01Eh, 075h, 0E0h, 0F2h, 04Dh, 0A0h, 0D5h, 016h
DB       04Ah, 03Eh, 040h, 0E8h, 0F6h, 097h, 0C5h, 0C1h
DB       027h, 05Ah, 04Bh, 090h, 047h, 071h, 0F6h, 0A4h
DB       049h, 0FEh, 04Eh, 09Fh, 049h, 0AFh, 09Ch, 0E3h
DB       09Fh, 059h, 036h, 0A0h, 0FFh, 00Fh, 0EEh, 072h
DB       071h, 04Ah, 043h, 00Ah, 0BBh, 0D9h, 071h, 055h
DB       023h, 0A0h, 09Dh, 0D0h, 007h, 06Fh, 003h, 0FDh
DB       0FCh, 0DDh, 0DFh, 0C2h, 09Ch, 00Fh, 04Eh, 02Dh
DB       002h, 026h, 0A0h, 09Dh, 090h, 008h, 09Ch, 060h
DB       038h, 09Fh, 0F6h, 0C3h, 0BAh, 0C8h, 007h, 0CCh
DB       003h, 04Bh, 048h, 00Ah, 0A0h, 0EEh, 0E2h, 04Ah
DB       00Bh, 07Ch, 04Fh, 042h, 05Fh, 0F6h, 04Eh, 06Bh
DB       0F1h, 03Fh, 0D0h, 0CBh, 09Fh, 0F7h, 008h, 0FFh
DB       077h, 0DFh, 010h, 056h, 00Eh, 09Ch, 06Dh, 059h
DB       091h, 024h, 011h, 02Dh, 0FBh, 059h, 085h, 007h
DB       09Dh, 057h, 013h, 001h, 0FCh, 0F3h, 048h, 0A0h
DB       0EEh, 0F4h, 0FEh, 065h, 0E0h, 0EEh, 024h, 0EFh
DB       08Eh, 0A0h, 0BBh, 049h, 09Fh, 09Ch, 062h, 0B0h
DB       030h, 090h, 091h, 0B7h, 045h, 0D4h, 09Ah, 0F7h
DB       01Dh, 0F1h, 05Eh, 04Bh, 05Eh, 068h, 04Bh, 07Ch
DB       072h, 04Eh, 02Ah, 09Eh, 025h, 059h, 0A4h, 0A8h
DB       002h, 027h, 097h, 065h, 020h, 0F6h, 091h, 0A0h
DB       0F7h, 0BBh, 021h, 008h, 03Fh, 0DAh, 0B2h, 094h
DB       0ADh, 022h, 0A0h, 0BEh, 08Bh, 04Ah, 076h, 0E7h
DB       06Ah, 0DDh, 024h, 06Bh, 0ADh, 0D1h, 0ADh, 0EBh
DB       03Ah, 027h, 0E0h, 0DFh, 05Eh, 04Fh, 09Eh, 01Eh
DB       04Eh, 052h, 065h, 09Fh, 029h, 025h, 07Ah, 096h
DB       0FCh, 002h, 0D2h, 04Fh, 02Fh, 0A0h, 0F8h, 09Eh
DB       089h, 0A7h, 01Dh, 065h, 0F4h, 06Ah, 089h, 0DBh
DB       02Ah, 0B1h, 074h, 022h, 0A1h, 0FDh, 022h, 0A0h
DB       0AAh, 09Ah, 06Eh, 047h, 09Fh, 04Ah, 001h, 058h
DB       008h, 0A6h, 048h, 057h, 09Fh, 09Ch, 061h, 05Ah
DB       0B6h, 001h, 091h, 0A0h, 077h, 06Ah, 090h, 037h
DB       024h, 03Eh, 0B4h, 080h, 025h, 008h, 03Bh, 094h
DB       0CEh, 04Fh, 0E3h, 02Ah, 0A2h, 083h, 049h, 0A1h
DB       04Ah, 0FCh, 009h, 0AFh, 049h, 0A0h, 0FFh, 089h
DB       049h, 01Ch, 09Fh, 093h, 079h, 052h, 0D0h, 0CDh
DB       05Eh, 056h, 0F2h, 029h, 089h, 0A7h, 035h, 09Eh
DB       024h, 0A0h, 05Dh, 079h, 007h, 009h, 022h, 09Eh
DB       06Bh, 0FEh, 034h, 0F4h, 0F9h, 02Ah, 0A3h, 084h
DB       024h, 053h, 0A1h, 05Fh, 0A4h, 0A0h, 0FFh, 06Ah
DB       07Ch, 065h, 055h, 0FAh, 02Ah, 0C9h, 07Eh, 0FFh
DB       026h, 078h, 0CAh, 04Eh, 0FAh, 06Bh, 0CAh, 04Bh
DB       0B6h, 026h, 0E5h, 022h, 0A0h, 0FEh, 0C8h, 05Dh
DB       0ADh, 08Eh, 061h, 07Eh, 0A6h, 07Ch, 0D2h, 055h
DB       04Eh, 0BEh, 023h, 053h, 00Eh, 012h, 049h, 02Fh
DB       0A0h, 0B9h, 07Eh, 0CEh, 0B3h, 049h, 09Fh, 0F3h
DB       008h, 08Dh, 029h, 00Ch, 042h, 0E8h, 09Bh, 064h
DB       089h, 0E3h, 022h, 09Fh, 0E6h, 04Ch, 091h, 0A0h
DB       0D5h, 069h, 019h, 09Fh, 008h, 02Ah, 0B2h, 012h
DB       0A4h, 088h, 0A2h, 054h, 095h, 05Bh, 074h, 013h
DB       049h, 0CBh, 020h, 0FBh, 05Bh, 0B0h, 0E1h, 04Ch
DB       0BDh, 0CCh, 0C3h, 048h, 057h, 079h, 0B1h, 007h
DB       04Fh, 0C6h, 0F5h, 094h, 08Ah, 0B7h, 06Ah, 026h
DB       04Ah, 00Eh, 04Ah, 076h, 091h, 001h, 0EFh, 05Ch
DB       026h, 0AEh, 050h, 05Fh, 001h, 0AFh, 095h, 097h
DB       0A0h, 07Ch, 097h, 093h, 0E0h, 08Fh, 0F5h, 0AFh
DB       08Eh, 0F4h, 0DAh, 03Ch, 0DEh, 06Bh, 05Fh, 025h
DB       045h, 000h, 055h, 0A4h, 0A0h, 0B8h, 0DEh, 0E2h
DB       0C3h, 071h, 091h, 0A0h, 06Bh, 0D6h, 08Bh, 0C9h
DB       01Eh, 079h, 0CEh, 03Ah, 05Dh, 074h, 001h, 097h
DB       0ACh, 0EAh, 0E3h, 0A6h, 072h, 04Dh, 0E8h, 0A7h
DB       091h, 0A0h, 07Fh, 062h, 0A7h, 0EFh, 08Bh, 001h
DB       065h, 098h, 09Ah, 0EEh, 026h, 0FDh, 09Ah, 0D9h
DB       082h, 0CAh, 055h, 04Dh, 059h, 082h, 02Ch, 040h
DB       05Fh, 0FAh, 0DFh, 089h, 082h, 029h, 0A1h, 050h
DB       0B4h, 09Fh, 016h, 080h, 0BDh, 0E4h, 02Bh, 04Fh
DB       09Fh, 08Bh, 080h, 010h, 0A4h, 09Bh, 0DBh, 042h
DB       0AAh, 05Eh, 074h, 0E0h, 073h, 04Eh, 04Ch, 08Bh
DB       0E0h, 0FBh, 05Ch, 0E0h, 0CFh, 056h, 0F5h, 001h
DB       05Eh, 02Ch, 060h, 0A6h, 095h, 051h, 0BEh, 0C9h
DB       077h, 0A9h, 0E7h, 079h, 040h, 0D5h, 0CBh, 0D6h
DB       022h, 025h, 0E2h, 0F1h, 0D6h, 0C0h, 0DCh, 0BDh
DB       04Ch, 0A0h, 0BFh, 0C3h, 0C9h, 094h, 0F8h, 080h
DB       0EEh, 0E4h, 08Dh, 0A0h, 028h, 096h, 092h, 0A3h
DB       000h, 092h, 0AAh, 074h, 0C0h, 0EAh, 08Eh, 077h
DB       0A4h, 08Ah, 0A0h, 0BAh, 06Bh, 06Fh, 0DBh, 000h
DB       0D2h, 0F7h, 03Ah, 040h, 042h, 011h, 047h, 0A0h
DB       0D5h, 036h, 04Ah, 003h, 09Dh, 01Eh, 0E0h, 021h
DB       0F7h, 09Dh, 049h, 0D7h, 097h, 0B7h, 0CBh, 051h
DB       020h, 057h, 0EBh, 0F3h, 0A0h, 0D9h, 04Dh, 00Eh
DB       0D6h, 0B3h, 0C0h, 0EAh, 0D2h, 0AAh, 02Dh, 0C0h
DB       03Bh, 0E2h, 0F7h, 0FDh, 02Ah, 08Eh, 040h, 0BBh
DB       049h, 0A0h, 0BAh, 0A4h, 0FAh, 089h, 0E6h, 025h
DB       09Eh, 026h, 0A0h, 0FFh, 092h, 0A8h, 040h, 0FFh
DB       0A5h, 0ECh, 000h, 049h, 0A0h, 0AFh, 0E3h, 09Dh
DB       08Ch, 0ABh, 03Fh, 0E0h, 0EEh, 022h, 053h, 049h
DB       04Eh, 0A0h, 0BBh, 0ECh, 09Fh, 085h, 0D9h, 09Fh
DB       00Fh, 0FAh, 09Fh, 021h, 0F2h, 07Dh, 09Fh, 040h
DB       05Eh, 095h, 051h, 0C0h, 0DAh, 047h, 0A0h, 07Fh
DB       0ADh, 051h, 080h, 074h, 0E6h, 05Dh, 093h, 0A0h
DB       05Dh, 064h, 049h, 06Eh, 0E9h, 06Bh, 08Fh, 020h
DB       0BBh, 04Fh, 0B6h, 040h, 0AEh, 092h, 07Bh, 0A0h
DB       0FCh, 049h, 08Dh, 05Dh, 0EBh, 0DCh, 040h, 077h
DB       0FDh, 0C4h, 04Eh, 08Eh, 0A0h, 0AFh, 088h, 053h
DB       0F7h, 0D1h, 09Fh, 00Fh, 0BBh, 04Bh, 0E8h, 020h
DB       0FBh, 088h, 049h, 057h, 0DBh, 0E2h, 0A7h, 045h
DB       0A0h, 05Fh, 039h, 042h, 0ABh, 089h, 04Eh, 07Dh
DB       095h, 0C0h, 074h, 048h, 09Fh, 0A0h, 0BBh, 0A7h
DB       018h, 07Dh, 01Ch, 05Bh, 061h, 0DFh, 027h, 05Ch
DB       0A0h, 0F7h, 092h, 05Fh, 0AAh, 06Eh, 0C0h, 0C8h
DB       09Eh, 039h, 043h, 089h, 007h, 0D7h, 032h, 034h
DB       047h, 0A0h, 0DEh, 04Bh, 04Fh, 0FDh, 060h, 0BBh
DB       048h, 0A0h, 0FFh, 021h, 05Ch, 0F7h, 0B8h, 0C2h
DB       0EDh, 02Ah, 0A2h, 0C0h, 0E8h, 09Ch, 085h, 05Ah
DB       04Ch, 0A0h, 047h, 05Fh, 0B7h, 0E8h, 057h, 0E4h
DB       0A5h, 02Bh, 04Ch, 055h, 04Eh, 0FCh, 080h, 0BBh
DB       04Eh, 0E8h, 040h, 0ABh, 0E4h, 0EFh, 08Dh, 0CAh
DB       075h, 0E1h, 07Eh, 02Bh, 0A0h, 0F3h, 09Ch, 0A2h
DB       055h, 03Dh, 092h, 056h, 067h, 0A0h, 068h, 056h
DB       0F5h, 00Eh, 0E9h, 0A4h, 0D7h, 0A0h, 079h, 007h
DB       03Bh, 0F6h, 080h, 0E7h, 089h, 0FDh, 03Fh, 060h
DB       064h, 09Bh, 022h, 056h, 047h, 0A0h, 0D6h, 0E2h
DB       04Ah, 042h, 00Ah, 0AAh, 021h, 055h, 0FCh, 0EFh
DB       026h, 090h, 08Eh, 09Fh, 05Fh, 0F9h, 0CFh, 0E1h
DB       062h, 026h, 0A0h, 09Eh, 03Fh, 0C7h, 0FEh, 013h
DB       05Ch, 05Bh, 0FFh, 06Ah, 0A0h, 0CBh, 056h, 055h
DB       09Dh, 040h, 07Ah, 04Ah, 0A0h, 0D5h, 0C5h, 0E0h
DB       0F2h, 057h, 097h, 080h, 049h, 017h, 0A0h, 04Eh
DB       030h, 0E5h, 0FBh, 028h, 0C9h, 0A6h, 0F3h, 06Fh
DB       0DDh, 04Ch, 0A4h, 021h, 0AFh, 05Ah, 047h, 0A0h
DB       07Ch, 0E3h, 0EAh, 015h, 0EBh, 0F7h, 09Ah, 008h
DB       045h, 0A0h, 0DAh, 0D5h, 0CAh, 0E0h, 042h, 09Fh
DB       04Ah, 0A0h, 0D7h, 047h, 080h, 05Eh, 09Dh, 046h
DB       0ECh, 0B5h, 0F1h, 020h, 05Ch, 091h, 0A0h, 071h
DB       09Fh, 017h, 0ABh, 034h, 040h, 091h, 0A0h, 025h
DB       05Bh, 0E0h, 0D9h, 09Bh, 023h, 0A0h, 03Ah, 05Eh
DB       0C5h, 03Fh, 0DCh, 0E6h, 0A4h, 0C5h, 01Bh, 05Fh
DB       0A6h, 0EEh, 054h, 064h, 010h, 0B2h, 0EEh, 0C7h
DB       040h, 010h, 05Ch, 05Bh, 0B3h, 0BBh, 069h, 066h
DB       03Fh, 0A0h, 010h, 053h, 0C8h, 05Fh, 054h, 05Ah
DB       057h, 0ADh, 040h, 0E7h, 025h, 057h, 0BEh, 065h
DB       0ECh, 0FBh, 07Fh, 080h, 078h, 071h, 04Bh, 0BFh
DB       059h, 09Fh, 07Ch, 0B5h, 0F3h, 020h, 010h, 056h
DB       0BFh, 0DDh, 051h, 008h, 05Ah, 0FCh, 00Ah, 093h
DB       0E8h, 02Ah, 024h, 00Bh, 0A0h, 057h, 038h, 0CAh
DB       0A8h, 0C0h, 0E2h, 0F7h, 032h, 0F7h, 009h, 01Ch
DB       01Ch, 0A0h, 0E7h, 00Bh, 09Fh, 0A1h, 091h, 09Fh
DB       0E7h, 02Ch, 073h, 0AEh, 091h, 090h, 04Bh, 0F4h
DB       003h, 06Eh, 03Dh, 0AFh, 0D1h, 013h, 069h, 005h
DB       0C0h, 0A5h, 0FAh, 03Dh, 013h, 023h, 043h, 05Fh
DB       094h, 0F7h, 0CAh, 0F8h, 027h, 007h, 065h, 096h
DB       0C9h, 0EEh, 0C2h, 02Bh, 04Dh, 00Eh, 025h, 0A4h
DB       0A0h, 056h, 0B1h, 0ACh, 05Ah, 04Dh, 0A0h, 0EBh
DB       0F6h, 081h, 0C9h, 0A9h, 0B6h, 017h, 0A0h, 04Bh
DB       075h, 09Bh, 060h, 08Fh, 028h, 024h, 00Fh, 04Bh
DB       077h, 097h, 000h, 072h, 0DFh, 047h, 0A0h, 052h
DB       055h, 047h, 0C0h, 0C4h, 0A7h, 064h, 0AEh, 0CEh
DB       0A0h, 072h, 087h, 0A5h, 054h, 0C0h, 051h, 0EFh
DB       01Ch, 007h, 091h, 0A0h, 0A6h, 0C2h, 0BAh, 0AFh
DB       0A6h, 0D9h, 0C9h, 052h, 0F5h, 01Ch, 01Fh, 0BFh
DB       047h, 013h, 029h, 059h, 027h, 0FEh, 0F9h, 024h
DB       0A0h, 024h, 0A1h, 05Ah, 044h, 0A0h, 025h, 00Dh
DB       04Ch, 06Fh, 042h, 02Bh, 0A3h, 005h, 04Ch, 04Dh
DB       00Dh, 094h, 067h, 08Eh, 0A0h, 026h, 09Dh, 00Ch
DB       024h, 0A0h, 07Ah, 0C5h, 0ACh, 04Ah, 05Dh, 02Fh
DB       0DBh, 080h, 05Ah, 0FDh, 093h, 081h, 08Ch, 08Ah
DB       0A0h, 0F5h, 0BEh, 08Eh, 0A0h, 04Fh, 012h, 0E6h
DB       02Bh, 0A0h, 0B2h, 057h, 038h, 008h, 0A6h, 0BFh
DB       053h, 0EFh, 037h, 0C4h, 029h, 0A9h, 02Ch, 03Dh
DB       0A0h, 0A4h, 09Fh, 04Ah, 0C6h, 025h, 054h, 0C0h
DB       05Ah, 058h, 047h, 057h, 0AEh, 0EAh, 07Eh, 0FBh
DB       00Dh, 021h, 0A0h, 02Ah, 0E7h, 060h, 09Bh, 030h
DB       0FCh, 0ABh, 08Eh, 086h, 05Ch, 061h, 0DFh, 03Eh
DB       0C9h, 09Fh, 09Eh, 0E4h, 091h, 07Ah, 0F7h, 04Dh
DB       090h, 0A9h, 010h, 0CAh, 059h, 010h, 04Eh, 0D3h
DB       087h, 025h, 079h, 03Bh, 0A1h, 0A4h, 082h, 0A0h
DB       00Eh, 004h, 04Bh, 079h, 059h, 0A4h, 06Bh, 085h
DB       0C7h, 072h, 025h, 054h, 044h, 0D8h, 0BDh, 0E4h
DB       0BBh, 0F9h, 00Ah, 059h, 0ACh, 0E5h, 075h, 0B6h
DB       0FBh, 062h, 080h, 09Fh, 096h, 0B4h, 05Bh, 05Dh
DB       0E8h, 0F6h, 0B5h, 0FBh, 0CAh, 040h, 0E4h, 08Dh
DB       09Fh, 061h, 03Dh, 048h, 001h, 0AFh, 091h, 0A0h
DB       07Fh, 02Bh, 0B2h, 0AFh, 0D0h, 06Eh, 098h, 092h
DB       0BFh, 053h, 050h, 072h, 055h, 045h, 0C0h, 0B9h
DB       043h, 0D7h, 0F8h, 0FAh, 0E4h, 0AEh, 0C8h, 0A0h
DB       056h, 0E3h, 014h, 0ABh, 09Dh, 060h, 058h, 025h
DB       0EEh, 067h, 05Fh, 002h, 09Eh, 054h, 008h, 08Eh
DB       011h, 05Bh, 0B2h, 096h, 02Eh, 0A6h, 0C0h, 06Ah
DB       001h, 055h, 012h, 0F6h, 0BAh, 065h, 059h, 0ABh
DB       095h, 0CDh, 014h, 081h, 05Bh, 02Ah, 05Fh, 06Eh
DB       092h, 0A0h, 025h, 00Ch, 04Bh, 05Dh, 03Ch, 0A1h
DB       0BDh, 071h, 023h, 0B8h, 0DEh, 0FDh, 0F5h, 0CBh
DB       0F7h, 012h, 007h, 0C2h, 019h, 0F7h, 0BEh, 0BBh
DB       0FBh, 04Ah, 07Bh, 06Dh, 046h, 0BCh, 062h, 064h
DB       071h, 083h, 071h, 068h, 052h, 0AFh, 0CCh, 085h
DB       008h, 0A5h, 0FBh, 0CAh, 0A4h, 049h, 0A2h, 05Ah
DB       0A7h, 082h, 0A3h, 049h, 04Bh, 0E9h, 025h, 0F5h
DB       0FAh, 0C4h, 0A0h, 09Ah, 0F9h, 05Eh, 0E8h, 0C0h
DB       0BAh, 0D2h, 035h, 068h, 0FAh, 0C8h, 0A0h, 04Eh
DB       0BDh, 06Dh, 029h, 044h, 049h, 0AAh, 08Fh, 0C0h
DB       05Eh, 0FDh, 020h, 0A7h, 0D9h, 01Ch, 047h, 05Ah
DB       09Dh, 0E3h, 01Fh, 05Fh, 0F2h, 022h, 029h, 0A7h
DB       025h, 04Dh, 0BDh, 0C7h, 09Ch, 0CEh, 0BFh, 04Ah
DB       0A8h, 0E9h, 059h, 03Eh, 0F4h, 09Fh, 0A0h, 088h
DB       007h, 008h, 056h, 00Eh, 028h, 0B3h, 05Ah, 05Bh
DB       0E5h, 0A0h, 0A6h, 0BAh, 0E7h, 0C9h, 019h, 0A0h
DB       00Bh, 002h, 049h, 036h, 093h, 0A1h, 088h, 054h
DB       056h, 0C4h, 007h, 089h, 0A0h, 02Fh, 017h, 0A8h
DB       0BCh, 0BBh, 06Ah, 0DBh, 0B5h, 05Ch, 0A3h, 05Dh
DB       08Ah, 056h, 046h, 0A0h, 0C5h, 04Dh, 04Fh, 0A6h
DB       0FBh, 07Dh, 080h, 032h, 0B6h, 017h, 04Ch, 00Fh
DB       0EDh, 082h, 0E9h, 07Eh, 0E2h, 0EFh, 097h, 015h
DB       0D8h, 0E7h, 09Ah, 086h, 047h, 0A0h, 056h, 09Ch
DB       0DEh, 052h, 09Fh, 050h, 0A9h, 086h, 034h, 06Ah
DB       08Ah, 09Fh, 048h, 046h, 0E9h, 077h, 029h, 058h
DB       03Fh, 048h, 09Fh, 0A4h, 08Fh, 06Dh, 092h, 023h
DB       0ACh, 057h, 02Ch, 003h, 0AEh, 03Dh, 05Fh, 026h
DB       0EEh, 0C4h, 09Dh, 0BCh, 0E1h, 0D7h, 0D4h, 08Dh
DB       087h, 0A1h, 0AFh, 070h, 0C4h, 007h, 04Dh, 099h
DB       037h, 02Bh, 0BCh, 045h, 0ADh, 089h, 02Ah, 053h
DB       055h, 033h, 0A1h, 092h, 09Dh, 07Ah, 0FBh, 0F2h
DB       05Eh, 092h, 09Fh, 0ADh, 08Eh, 042h, 0F7h, 0A5h
DB       0F5h, 049h, 07Fh, 09Eh, 022h, 09Fh, 075h, 09Bh
DB       079h, 0C7h, 008h, 01Dh, 0F7h, 025h, 0A2h, 026h
DB       0A1h, 071h, 087h, 0CBh, 0F5h, 035h, 000h, 07Ah
DB       0F1h, 068h, 06Ah, 050h, 07Ch, 0B1h, 03Eh, 0E4h
DB       007h, 08Fh, 079h, 0D7h, 0EBh, 024h, 01Eh, 0E7h
DB       068h, 071h, 05Dh, 0A7h, 0AEh, 0B9h, 0C5h, 09Fh
DB       0AFh, 08Ah, 078h, 0FDh, 0A5h, 001h, 0DAh, 044h
DB       0F8h, 0E3h, 07Eh, 0A1h, 021h, 02Eh, 075h, 0CCh
DB       052h, 086h, 077h, 0A1h, 05Bh, 09Bh, 078h, 04Ah
DB       024h, 0EFh, 02Bh, 0E8h, 048h, 0A0h, 069h, 04Ah
DB       066h, 0A9h, 035h, 0A6h, 00Fh, 011h, 0E1h, 04Bh
DB       026h, 0FDh, 0E1h, 0A6h, 04Fh, 023h, 09Fh, 0D6h
DB       03Ah, 0BEh, 048h, 0A2h, 05Fh, 0ECh, 097h, 0A4h
DB       08Fh, 0A0h, 0B5h, 0EBh, 0C5h, 064h, 0B8h, 004h
DB       0FEh, 049h, 0A0h, 0EDh, 03Ch, 0C9h, 02Dh, 056h
DB       05Eh, 074h, 07Eh, 095h, 051h, 0C0h, 06Eh, 029h
DB       0F6h, 035h, 078h, 097h, 007h, 016h, 0B7h, 08Ah
DB       008h, 024h, 0A7h, 070h, 0DEh, 091h, 09Fh, 0F6h
DB       0A2h, 058h, 057h, 044h, 059h, 0A2h, 098h, 0ECh
DB       0CBh, 0B6h, 043h, 0C9h, 063h, 084h, 0A2h, 00Eh
DB       0F5h, 035h, 038h, 092h, 04Ah, 0B1h, 02Bh, 023h
DB       0A1h, 01Dh, 0EFh, 00Fh, 0E4h, 0CCh, 02Bh, 05Dh
DB       071h, 05Fh, 046h, 08Eh, 052h, 0B7h, 0F2h, 0BBh
DB       0A2h, 0B4h, 0CDh, 0F1h, 04Bh, 0ABh, 059h, 0FEh
DB       023h, 0D6h, 093h, 0A0h, 05Bh, 0EAh, 008h, 014h
DB       042h, 04Ah, 0BBh, 055h, 0ACh, 026h, 0A0h, 0A5h
DB       038h, 084h, 04Fh, 056h, 0EFh, 0EAh, 0A2h, 0EFh
DB       0F8h, 0E2h, 0E2h, 056h, 0BDh, 0DBh, 0CDh, 012h
DB       05Fh, 06Bh, 012h, 069h, 04Fh, 01Fh, 09Fh, 0CEh
DB       033h, 0A1h, 0E7h, 022h, 09Fh, 048h, 01Eh, 0A4h
DB       0A1h, 067h, 04Ch, 0BDh, 04Eh, 0E5h, 027h, 0A0h
DB       0B2h, 053h, 00Eh, 032h, 0B4h, 0CEh, 0AFh, 056h
DB       00Fh, 08Dh, 0F4h, 0C2h, 0E3h, 09Fh, 0A9h, 08Eh
DB       084h, 054h, 05Dh, 0DEh, 053h, 0DAh, 04Ch, 053h
DB       0FAh, 0AFh, 0DEh, 040h, 07Dh, 0A4h, 050h, 016h
DB       09Dh, 0E3h, 004h, 0F9h, 06Dh, 012h, 0B1h, 001h
DB       00Eh, 02Ah, 0EDh, 08Dh, 0F4h, 0ADh, 0A1h, 0EDh
DB       02Ah, 0ECh, 0C6h, 0B9h, 04Bh, 001h, 05Ch, 085h
DB       04Bh, 0A8h, 00Bh, 0D5h, 027h, 08Ah, 00Fh, 05Fh
DB       0DAh, 094h, 027h, 0D5h, 018h, 047h, 0ADh, 04Ah
DB       058h, 0D3h, 014h, 0BCh, 097h, 0F2h, 049h, 0DCh
DB       045h, 0CAh, 0AEh, 0FCh, 0A5h, 025h, 0B9h, 056h
DB       06Eh, 0E4h, 0D5h, 053h, 094h, 01Ah, 0ABh, 0B0h
DB       026h, 05Fh, 0A1h, 001h, 09Fh, 00Ch, 0A7h, 0BFh
DB       05Bh, 0F8h, 04Bh, 0FEh, 023h, 044h, 00Eh, 07Fh
DB       055h, 0F5h, 04Bh, 0D7h, 092h, 0AFh, 09Bh, 0A0h
DB       0E5h, 05Ch, 051h, 066h, 07Eh, 02Fh, 01Ah, 0AFh
DB       0FFh, 0C2h, 038h, 057h, 059h, 0E0h, 074h, 0A3h
DB       033h, 095h, 04Ah, 029h, 056h, 03Ah, 0CEh, 050h
DB       0D7h, 098h, 0F9h, 055h, 092h, 047h, 0A5h, 027h
DB       0B5h, 02Ch, 069h, 060h, 059h, 010h, 0F9h, 00Ch
DB       059h, 047h, 0A9h, 027h, 04Ah, 04Ah, 001h, 0ABh
DB       010h, 06Ah, 058h, 066h, 054h, 0B3h, 095h, 03Ch
DB       087h, 090h, 07Ch, 0D5h, 0AAh, 0AEh, 0E9h, 04Bh
DB       025h, 06Ah, 0DAh, 06Ch, 07Ah, 0B6h, 0B5h, 0FBh
DB       049h, 05Dh, 02Bh, 0A9h, 040h, 0E9h, 07Fh, 0CAh
DB       023h, 0F4h, 0AEh, 0B3h, 0E0h, 094h, 06Ah, 0DDh
DB       0E5h, 075h, 0BDh, 0E0h, 0ECh, 0A5h, 00Bh, 053h
DB       055h, 001h, 04Ah, 0FAh, 075h, 05Eh, 015h, 084h
DB       085h, 0FDh, 02Bh, 0E8h, 06Ch, 04Ah, 0FAh, 029h
DB       046h, 059h, 03Bh, 04Dh, 00Ch, 03Ah, 0A5h, 02Ch
DB       04Bh, 027h, 052h, 025h, 0DFh, 069h, 035h, 0CDh
DB       04Eh, 049h, 046h, 0B5h, 024h, 090h, 02Bh, 001h
DB       0D7h, 01Ah, 023h, 0B2h, 05Ch, 028h, 054h, 0E2h
DB       04Ch, 09Ah, 0D1h, 097h, 0BFh, 0EDh, 029h, 025h
DB       029h, 0B4h, 05Ah, 0BCh, 0B5h, 0DCh, 0BBh, 066h
DB       07Ah, 059h, 04Eh, 00Bh, 04Ah, 0EFh, 07Dh, 0D5h
DB       07Eh, 0F2h, 041h, 0B9h, 0A9h, 0AAh, 05Ah, 0CBh
DB       0F7h, 029h, 0F0h, 05Fh, 0CFh, 0C1h, 0D2h, 057h
DB       0FBh, 071h, 04Bh, 0F4h, 069h, 057h, 01Bh, 00Ah
DB       003h, 028h, 04Eh, 04Bh, 0F9h, 0A7h, 03Ah, 0ABh
DB       00Ch, 012h, 053h, 0BFh, 0CBh, 0D3h, 04Ah, 0FFh
DB       03Fh, 0D1h, 07Fh, 093h, 011h, 036h, 040h, 042h
DB       0F1h, 00Eh, 056h, 001h, 0F5h, 0ADh, 043h, 0F4h
DB       0A3h, 0F2h, 072h, 0B7h, 015h, 06Eh, 06Dh, 04Bh
DB       0ABh, 0D8h, 0B4h, 0B5h, 0DAh, 03Fh, 0B5h, 069h
DB       0BBh, 09Ch, 07Ah, 048h, 04Dh, 0C4h, 0F7h, 0FAh
DB       001h, 0C9h, 02Bh, 09Dh, 0FEh, 023h, 057h, 025h
DB       0D5h, 02Ah, 060h, 0E9h, 0DBh, 0FCh, 09Fh, 09Fh
DB       0B6h, 0A5h, 057h, 053h, 001h, 067h, 0ADh, 04Ah
DB       01Bh, 051h, 0A8h, 076h, 097h, 05Ch, 0EBh, 0D2h
DB       09Ch, 001h, 0BDh, 0E2h, 00Bh, 09Ch, 027h, 04Bh
DB       053h, 0AEh, 068h, 0EDh, 04Bh, 0A5h, 027h, 0B8h
DB       0D6h, 047h, 0E5h, 02Ah, 001h, 012h, 04Ah, 049h
DB       03Ah, 07Ch, 02Dh, 00Ah, 015h, 008h, 06Dh, 077h
DB       05Fh, 0B4h, 0D5h, 05Dh, 089h, 00Ah, 09Fh, 054h
DB       025h, 0D7h, 016h, 055h, 091h, 01Ch, 05Eh, 0A2h
DB       02Fh, 047h, 01Ch, 0A4h, 00Fh, 0ABh, 001h, 0F4h
DB       047h, 053h, 021h, 052h, 016h, 04Ah, 0F2h, 0E8h
DB       0FDh, 0AAh, 052h, 0F8h, 0A7h, 03Bh, 0B5h, 015h
DB       0FBh, 09Fh, 069h, 03Eh, 00Ah, 052h, 026h, 0D2h
DB       0EEh, 0C9h, 0F5h, 05Ch, 00Dh, 049h, 097h, 033h
DB       0E7h, 048h, 026h, 09Eh, 0BBh, 06Bh, 04Eh, 0C7h
DB       0F0h, 065h, 00Ah, 0B2h, 0A9h, 0BCh, 04Ah, 0A5h
DB       0B4h, 0EAh, 0B5h, 0DBh, 04Ch, 0BBh, 07Ah, 0F8h
DB       04Bh, 097h, 076h, 041h, 05Ah, 045h, 069h, 0F2h
DB       05Dh, 0F0h, 0E0h, 0A5h, 05Bh, 034h, 0B8h, 08Ah
DB       0A0h, 0ACh, 052h, 0A7h, 001h, 0A5h, 071h, 069h
DB       0DCh, 0A7h, 001h, 04Dh, 032h, 04Ah, 026h, 0E6h
DB       04Fh, 0AFh, 020h, 04Dh, 0B1h, 04Ah, 099h, 0B5h
DB       017h, 03Eh, 0CBh, 04Ah, 0A7h, 049h, 071h, 05Fh
DB       04Ah, 05Dh, 0FEh, 093h, 0C6h, 069h, 07Dh, 045h
DB       082h, 0AEh, 0A5h, 075h, 0A9h, 0D2h, 053h, 048h
DB       0B4h, 0A0h, 0BEh, 088h, 049h, 055h, 04Dh, 030h
DB       023h, 0C6h, 0BDh, 023h, 0A0h, 0BDh, 02Fh, 0F8h
DB       0ABh, 0F9h, 04Bh, 0ABh, 0B7h, 03Ah, 08Eh, 055h
DB       0B9h, 057h, 0B4h, 0A2h, 04Ah, 05Fh, 079h, 0C0h
DB       0F4h, 09Bh, 0F0h, 074h, 091h, 0A0h, 07Ch, 071h
DB       049h, 087h, 07Bh, 048h, 002h, 046h, 0ABh, 056h
DB       025h, 094h, 00Eh, 0A4h, 0EAh, 0A6h, 001h, 092h
DB       02Fh, 09Eh, 092h, 0FEh, 0CAh, 0BEh, 0F6h, 003h
DB       093h, 0C6h, 072h, 09Fh, 06Dh, 035h, 0BAh, 09Eh
DB       0F4h, 092h, 0FFh, 09Ah, 077h, 0B6h, 087h, 09Bh
DB       0F0h, 054h, 0AFh, 050h, 0C9h, 07Fh, 067h, 0B0h
DB       0F2h, 05Fh, 0FBh, 0EBh, 0DCh, 0AAh, 028h, 0BFh
DB       020h, 025h, 0FFh, 017h, 080h, 069h, 07Ch, 056h
DB       05Fh, 029h, 08Eh, 076h, 0AFh, 0B4h, 0C9h, 03Dh
DB       050h, 049h, 017h, 0A0h, 0FBh, 084h, 07Fh, 092h
DB       03Fh, 0C6h, 092h, 02Ah, 09Eh, 0A4h, 0DFh, 089h
DB       0B4h, 0CFh, 054h, 0F4h, 08Fh, 050h, 0F9h, 04Bh
DB       001h, 0BAh, 093h, 03Eh, 020h, 0E5h, 02Ah, 001h
DB       0BEh, 0FDh, 080h, 000h
Size_Bitmap = $ - @BitMap
 
 | 56.701299 
							 | 56 
							 | 0.596445 
							 | 
					
	ec226bee9b63b5dde323e8f5021d3ce8d60dcf7d 
 | 4,825 
							 | 
	asm 
 | 
	Assembly 
 | 
	Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_7746_1333.asm 
 | 
	ljhsiun2/medusa 
 | 
	67d769b8a2fb42c538f10287abaf0e6dbb463f0c 
 | 
	[
  "MIT"
]  | 9 
							 | 
	2020-08-13T19:41:58.000Z 
 | 
	2022-03-30T12:22:51.000Z 
 | 
	Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_7746_1333.asm 
 | 
	ljhsiun2/medusa 
 | 
	67d769b8a2fb42c538f10287abaf0e6dbb463f0c 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2021-04-29T06:29:35.000Z 
 | 
	2021-05-13T21:02:30.000Z 
 | 
	Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_7746_1333.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 %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x7bb5, %rsi
lea addresses_WT_ht+0x14439, %rdi
nop
nop
inc %r10
mov $24, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $63030, %r10
lea addresses_UC_ht+0x74b5, %rsi
clflush (%rsi)
xor $41188, %rdi
movw $0x6162, (%rsi)
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x1beb5, %rsi
lea addresses_WC_ht+0xf835, %rdi
nop
nop
nop
nop
nop
dec %r10
mov $42, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r10
ret
    .global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rdx
// Store
lea addresses_WT+0xfab5, %rcx
nop
nop
xor $6664, %rbp
movw $0x5152, (%rcx)
nop
nop
nop
xor $663, %r9
// Faulty Load
lea addresses_D+0x16b5, %r9
sub $26205, %rdx
mov (%r9), %r12
lea oracles, %r9
and $0xff, %r12
shlq $12, %r12
mov (%r9,%r12,1), %r12
pop %rdx
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'36': 7746}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
 
 | 47.303922 
							 | 2,999 
							 | 0.660725 
							 | 
					
	161f351ce2ef0dd2904ca0f526ed56803b4f561c 
 | 6,118 
							 | 
	asm 
 | 
	Assembly 
 | 
	ti_simplelink_sdk/kernel/tirtos/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm 
 | 
	intrepidcs/OBD2PRO_WIFI_CC32XX 
 | 
	903d791bddcb43c269d9c258500a454fe4f9caa6 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	ti_simplelink_sdk/kernel/tirtos/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm 
 | 
	intrepidcs/OBD2PRO_WIFI_CC32XX 
 | 
	903d791bddcb43c269d9c258500a454fe4f9caa6 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	ti_simplelink_sdk/kernel/tirtos/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm 
 | 
	intrepidcs/OBD2PRO_WIFI_CC32XX 
 | 
	903d791bddcb43c269d9c258500a454fe4f9caa6 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	@
@  Copyright (c) 2014-2016, Texas Instruments Incorporated
@  All rights reserved.
@ 
@  Redistribution and use in source and binary forms, with or without
@  modification, are permitted provided that the following conditions
@  are met:
@ 
@  *  Redistributions of source code must retain the above copyright
@     notice, this list of conditions and the following disclaimer.
@ 
@  *  Redistributions in binary form must reproduce the above copyright
@     notice, this list of conditions and the following disclaimer in the
@     documentation and/or other materials provided with the distribution.
@ 
@  *  Neither the name of Texas Instruments Incorporated nor the names of
@     its contributors may be used to endorse or promote products derived
@     from this software without specific prior written permission.
@ 
@  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
@  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
@  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
@  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
@  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
@  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
@  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
@  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
@  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
@  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@
@
@ ======== TaskSupport_asm.asm ========
@
        .arm
        .global ti_sysbios_family_arm_TaskSupport_swap__E
        .global ti_sysbios_family_arm_TaskSupport_buildTaskStack
        .global ti_sysbios_family_arm_TaskSupport_glue
        .align  4
@
@  ======== Task_buildTaskStack ========
@
@  Task_buildTaskStack(stack, fxn, exit, entry, arg0, arg1)
@                                     r0,  r1,   r2,    r3,  [0],  [4]
@
@  initial stack image:
@
@               d8-d15 = 0      if vfp supported
@               r4  = -1
@               r5  = -1 
@               r6  = -1     
@               r7  = -1     
@               r8  = -1     
@               r9  = -1     
@               r10 = -1     
@               r11 = -1     
@               glue    
@               arg0    
@               arg1    
@               fxn    
@               exit    
@               enter    
@
STACK   .req     r0     @ 1st argument, return value
FXN     .req     r1     @ 2nd argument
EXIT    .req     r2     @ 3rd argument
ENTER   .req     r3     @ 4th argument
.set    ARG0,    0      @ 5th argument (stack offset)
.set    ARG1,    4      @ 6th argument (stack offset)
        .section .text.ti_sysbios_family_arm_TaskSupport_buildTaskStack
        .func ti_sysbios_family_arm_TaskSupport_buildTaskStack
ti_sysbios_family_arm_TaskSupport_buildTaskStack:
        str     ENTER, [STACK,#-4]!
        str     EXIT, [STACK,#-4]!
        str     FXN, [STACK,#-4]!
        ldr     r1, [sp, #ARG1]
        str     r1, [STACK,#-4]!
        ldr     r1, [sp, #ARG0]
        str     r1, [STACK,#-4]!
        ldr     r1, glueAddr
        str     r1, [STACK,#-4]!
        eor     r1, r1, r1          @ set r1 to 0
        sub     r1, r1, #1
        str     r1, [STACK,#-4]!    @ init r4-r11, lr with -1
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
        str     r1, [STACK,#-4]!
#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
        eor     r2, r2, r2
        eor     r3, r3, r3
        strd    r2, [STACK,#-8]!        @ make room for 8 vfp
        strd    r2, [STACK,#-8]!        @ saved by parent regs
        strd    r2, [STACK,#-8]!        @ d8-d15
        strd    r2, [STACK,#-8]!
        strd    r2, [STACK,#-8]!
        strd    r2, [STACK,#-8]!
        strd    r2, [STACK,#-8]!
        strd    r2, [STACK,#-8]!
#endif
        bx      lr
        .endfunc
        .align 2
glueAddr:
        .word   ti_sysbios_family_arm_TaskSupport_glue
@
@  ======== TaskSupport_swap ========
@
@  TaskSupport_swap(oldSP, newSP)
@
OLD     .req    r0                      @ 1st argument
NEW     .req    r1                      @ 2nd argument
        .section .text.ti_sysbios_family_arm_TaskSupport_swap__E
        .func ti_sysbios_family_arm_TaskSupport_swap__E
ti_sysbios_family_arm_TaskSupport_swap__E:
        push    {r4-r11, lr}
#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
            vstmdb      r13!, {D8-D15}          @ push vfp caller regs
#endif
        str     sp, [OLD]
.if (ti_sysbios_BIOS_smpEnabled__D == TRUE)
        clrex                           @ clear exclusive monitor status
        @  This instruction is not supported on ARM9 but since SMP is never
        @  enabled for ARM9, it is okay to make execution of clrex conditional
        @  on SMP being enabled.
.endif
        ldr     sp, [NEW]
#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
            vldmia      r13!, {D8-D15}          @ pop vfp caller regs
#endif
        pop     {r4-r11, pc}
        .endfunc
@
@  ======== TaskSupport_glue ========
@
@  This glue function is executed immediately before executing the "fxn"
@  passed to Task_start.  This function loads the parameters to "fxn" into
@  registers - necessary for the arm register passing model.
@
        .section .text.ti_sysbios_family_arm_TaskSupport_glue
        .func ti_sysbios_family_arm_TaskSupport_glue
ti_sysbios_family_arm_TaskSupport_glue:
        ldr r0, [sp, #16]       @ Task enter function
        blx     r0                  @ call Task enter function
@ return from Task enter function here
        ldr     r0, [sp, #0]    @ task arg0
        ldr     r1, [sp, #4]    @ task arg1
        ldr     r2, [sp, #8]    @ task fxn
        ldr     lr, [sp, #12]   @ Task exit function
        bx      r2              @ call task fxn,  ("returns" to exit func)
        .endfunc
 
 | 33.25 
							 | 78 
							 | 0.568813 
							 | 
					
	db9316ca3592eff2b68970bc53876d57d6aca3f8 
 | 31,845 
							 | 
	asm 
 | 
	Assembly 
 | 
	V2/src/ASH VGA/Old/ASH_VGA_BITEST.z80.asm 
 | 
	anjennings/Tom80 
 | 
	99b58b32b923068c26e8781912ad825978b10f37 
 | 
	[
  "MIT"
]  | 55 
							 | 
	2021-01-16T16:18:45.000Z 
 | 
	2022-03-28T17:58:05.000Z 
 | 
	V2/src/ASH VGA/Old/ASH_VGA_BITEST.z80.asm 
 | 
	anjennings/Z80-Computer 
 | 
	99b58b32b923068c26e8781912ad825978b10f37 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2021-03-19T13:38:28.000Z 
 | 
	2021-03-19T14:04:13.000Z 
 | 
	V2/src/ASH VGA/Old/ASH_VGA_BITEST.z80.asm 
 | 
	anjennings/Z80-Computer 
 | 
	99b58b32b923068c26e8781912ad825978b10f37 
 | 
	[
  "MIT"
]  | 8 
							 | 
	2021-02-07T18:52:32.000Z 
 | 
	2022-01-18T07:00:45.000Z 
 | 
	;ASH - Aidan's SHell (VGA Output Only Test)
STACK           equ 0xFFF0
OUTPUT_SEL      equ STACK+1     ;Indicates if output is via serial or VGA
PROP_ENABLED    equ STACK+2     ;Set to 0 if Prop is detected at boot
PROP_WRITE_FLAG equ STACK+3     
PROP_READ_FLAG  equ STACK+4
;First byte of term buf is the size of the term buf
TERM_BUF equ 0x8000
;Maximum size of the buffer
TERM_BUF_MAX  equ 256
;Baud Rate Divisor (115200)
BAUD_DIV_HIGH equ 0
BAUD_DIV_LOW equ 8
;////////////////
;UART Registers
;////////////////
UART_DHR equ        0x10 ;UART Data R/W register
UART_IER equ        0x11 ;Interrupt Enable Register
UART_IFR equ        0x12 ;Interrupt ID Reg (READ), FIFO Control Reg (WRITE)
UART_LCR equ        0x13 ;Line Control Register
UART_MCR equ        0x14 ;Modem Control
UART_LSR equ        0x15 ;Line Status Register
UART_MSR equ        0x16 ;Modem Status (Unused)
UART_SCR equ        0x17 ;Arbitrary data can be stored here
;According to the datasheet:
;8 Databits, No parity, 1 Stop
;///////////
;Charactars
;///////////
CHAR_NEWLINE equ 0xA
CHAR_RETURN equ 0xD
CHAR_EOT equ 0x3
CHAR_SPACE equ 0x20
CHAR_NULL equ 0x0
SYM_READ equ ":"
SYM_WRITE equ "<"
SYM_EXE equ "@"
SYM_HELP equ "?"
;//////////////////////////////////////
;PIO REGISTERS
;//////////////////////////////////////
PIO_BASE        equ     0x0
PIO_PORTA_DAT   equ     (PIO_BASE)
PIO_PORTB_DAT   equ     (PIO_BASE+1)
PIO_PORTA_CON   equ     (PIO_BASE+2)
PIO_PORTB_CON   equ     (PIO_BASE+3)
;Interrupt Vector
PIO_INT_HIGH    equ     0x08
PIO_INT_LOW     equ     0x00    ;LSB is disregarded by PIO
PIO_INT         equ     ((PIO_INT_HIGH*256) + (PIO_INT_LOW))
PIO_INT_VECT_A  equ     (PIO_INT_LOW & 0xFE)
PIO_INT_VECT_B  equ     (PIO_INT_LOW+2 & 0xFE)
;Mode Control Words
MODE_OUT       equ     0x0F    ;MODE 0
MODE_IN        equ     0x4F    ;MODE 1
MODE_BI        equ     0x8F    ;MODE 2
MODE_CON       equ     0xCF    ;MODE 3
;Must be sent after setting mode 3
PIO_B_CON_IO    equ     0x00    ;Set PB0, all of port B to outputs
;Interrupt Contro Words
PIO_INT_EN_A    equ     0x87    ;Enable interrupt for mode 0-2
PIO_INT_EN_B    equ     0x97    ;Enable interrupt for mode 3, mask follows
PIO_INT_DE      equ     0x07    ;Disable interrupt for all modes
PIO_MASK        equ     0xFF    ;Must follow Int enable on mode 3
OUTPUT_SERIAL   equ     'S'
OUTPUT_VGA      equ     'V'
org PIO_INT
dw (PIO_INT_HANDLER_OUT)
dw (PIO_INT_HANDLER_IN)
;/////////////////
;Code Starts HERE
;/////////////////
org 0000h
BOOT:
    ;Wait a few clocks
    DI
    NOP
    NOP
    JP INIT
    
    
    org 08h 
        CALL GETCH
        RET
    
    org 10h
        CALL GETSTR
        RET
    
    org 18h
        CALL PRINTCH
        RET
    
    org 20h
        CALL WRITE_STR
        RET
    
    org 28h 
    RET
    
    org 30h
    RET
    ;//////////////////
    ;Interrupt Routine
    ;//////////////////
    org 0038h
    RETI
INIT:
        ;Set up Stack
        LD HL, STACK
        LD SP, HL
        
        ;Set up output check
        LD HL, OUTPUT_SEL
        LD (HL), 0
        
        ;Set up UART
        CALL UART_INIT
        ;Set up PIO
        CALL PIO_INIT
        
    INIT_DETECT_PIO:
        CALL PIO_DETECT
        LD HL, PROP_ENABLED
        LD A, (HL)
        CP 0
        JP Z, INIT_OUTPUT_SET
        ;If Prop is disabled, set to serial
        LD HL, OUTPUT_SEL
        LD (HL), OUTPUT_SERIAL
        JP MAIN
        
    INIT_OUTPUT_SET:
        CALL GETCH  ;Wait until user presses a button to do anything
    
        LD HL, OUTPUT_MSG
        CALL WRITE_STR
        CALL OUTPUT_CHECK
MAIN:
    
    CALL GETCH
    
    ;Print Boot Screen
    LD HL, BOOT_MSG
    CALL WRITE_STR
    
    ;Do PIO Test Here
    CALL PIO_TEST
    CALL PRINTCH
    LD HL, PIO_TEST_STR
    CALL WRITE_STR
    
MAIN_LOOP:
    CALL MONITOR
    JP MAIN_LOOP
MONITOR:
    PUSH AF
    PUSH HL
    ;Clear Terminal Buffer
    LD HL, TERM_BUF
    LD A, 0
    LD (HL), A
    ;Print Prompt
    LD HL, PROMPT
    CALL WRITE_STR
    ;Get the user input and evaluate
    CALL GETSTR
    CALL EVALUATE_STMT
    POP HL
    POP AF
    RET
;//////////////////////
;//////Functions///////
;//////////////////////
;//////////////////////////////////////
;PIO Functions
;//////////////////////////////////////
PIO_INIT:
        PUSH AF
        DI
        
        ;Set interrupt page
        LD A, PIO_INT_HIGH
        LD I, A
        
        ;Set Interrupt Vector on port A and B to be the same (they can be different)
        LD A, PIO_INT_VECT_A
        OUT PIO_PORTA_CON, A
        LD A, PIO_INT_VECT_B
        OUT PIO_PORTB_CON, A
        
        ;Set port B as manual control
        LD A, MODE_CON
        OUT PIO_PORTB_CON, A
        LD A, PIO_B_CON_IO
        OUT PIO_PORTB_CON, A
        
        ;Set Interrupt Enable on Port B
        LD A, PIO_INT_EN_B
        OUT PIO_PORTB_CON, A
        LD A, PIO_MASK          ;No pins generate interrupts
        OUT PIO_PORTB_CON, A
        
        ;Put port B in a known state
        LD A, 0xFF
        OUT PIO_PORTB_DAT, A
        
        ;Set port A as bi-directional
        LD A, MODE_BI
        OUT PIO_PORTA_CON, A
        
        ;Set Interrupt Enable on Port A
        LD A, PIO_INT_EN_A
        OUT PIO_PORTA_CON, A
        
        ;Clear input register
        IN A, PIO_PORTA_DAT
        
        POP AF
        IM 2
        ;EI
        RET
;This is run when the PIO is written to
PIO_INT_HANDLER_OUT:
        EX AF, AF'
        EXX
        
        ;Indicate that prop is enabled
        LD HL, PROP_ENABLED
        LD (HL), 0
        
        EX AF, AF'
        EXX
        RETI
        
;Runs when PIO returns data to CPU
PIO_INT_HANDLER_IN:
        RETI
        
;Send command to PIO
;Expects A to be command
;Halt until interrupt response
PIO_SEND_CMD:
        PUSH AF
        
        ;Write to PIO (Check status beforehand?)
        OUT PIO_PORTA_DAT, A
        EI
        HALT        ;Wait for Prop to acknowledge write
        DI
        
        ;Read data from PIO
        ;IN A, PIO_PORTA_DAT
        POP AF
        RET
;Wait for interrupt to break out of loop
;Read data from register
PIO_GET_DATA:
        EI
        HALT
        DI
        IN A, PIO_PORTA_DAT
        RET
        
;Send command to PIO and wait for reply
;If nothing comes through assume prop is disabled
;Returns 0 if Prop is running
PIO_DETECT:
        PUSH AF
        PUSH BC
        PUSH HL
        
        ;Send data
        LD A, 0
        OUT PIO_PORTA_DAT, A
        EI
        
        ;Set flag
        LD HL, PROP_ENABLED
        LD A, 0xFF
        LD (HL), A
        LD A, 0
        EI
        
    DETECT_LOOP:
        INC A 
        LD B, A     ;Save A
        LD A, (HL)  
        CP 0        ;Check if flag has changed
        JP Z, DETECT_END
        LD A, B
        CP 0        ;Check if count has rolled over
        JP NZ, DETECT_LOOP
        
    DETECT_END:
        DI
        POP HL
        POP BC
        POP AF
        RET
;Get a character and set output mode based on value
OUTPUT_CHECK:
        PUSH AF
        PUSH HL
        
        LD HL, OUTPUT_SEL
    CHECK:
        CALL GETCH
        
    CHECK_SERIAL:
        CP OUTPUT_SERIAL
        JP NZ, CHECK_VIDEO
        LD (HL), OUTPUT_SERIAL
        JP OUTPUT_CHECK_END
        
    CHECK_VIDEO:
        CP OUTPUT_VGA
        JP NZ, CHECK
        LD (HL), OUTPUT_VGA
        
    OUTPUT_CHECK_END:
        POP HL
        POP AF
        RET
        
PIO_TEST:
        LD A, 0x80
        CALL PIO_SEND_CMD       ;Send command
        CALL PIO_GET_DATA       ;Get reply
        RET                     ;Return with value
;//////////////////////////////////////
;UART Functions
;//////////////////////////////////////
UART_INIT:
    PUSH AF
    CALL UART_CLEAR_DLAB
    CALL UART_DISABLE_FIFO
    CALL UART_SET_LINE_CONTROL
    CALL UART_TOGGLE_OUT1
    CALL UART_TOGGLE_OUT2
    CALL UART_CLEAR_LSR
    CALL UART_SET_DLAB
    CALL UART_SET_BAUD
    CALL UART_CLEAR_DLAB
    POP AF
    RET
UART_CLEAR_DLAB:
    PUSH AF
    IN A, (UART_LCR)
    AND 0x7F
    OUT (UART_LCR), A
    POP AF
    RET
UART_SET_DLAB:
    PUSH AF
    IN A, (UART_LCR)
    OR 0x80
    OUT (UART_LCR), A
    POP AF
    RET
UART_SET_LINE_CONTROL:
    PUSH AF
    LD A, 0x3         ;8 Bit word, 1 stop, no parity
    OUT (UART_LCR), A
    POP AF
    RET
UART_DISABLE_FIFO:
    PUSH AF
    LD A, 0x6
    OUT (UART_IFR), A
    POP AF
    RET
UART_SET_BAUD:
    PUSH AF
    ;115200
    LD A, BAUD_DIV_LOW
    OUT (UART_DHR), A
    LD A, BAUD_DIV_HIGH
    OUT (UART_IER), A
    POP AF
    RET
UART_CLEAR_LSR:
    PUSH AF
    ;Clear Line Status Reg Errors (Page 21)
    IN A, (UART_LSR)
    POP AF
    RET
UART_TOGGLE_OUT1:
    PUSH AF
    IN A, (UART_MCR)
    XOR 0x4
    OUT (UART_MCR), A
    POP AF
    RET
UART_TOGGLE_OUT2:
    PUSH AF
    IN A, (UART_MCR)
    XOR 0x8
    OUT (UART_MCR), A
    POP AF
    RET
;//////////////////////////////////////
;Get a character from the FIFO, add to write buffer and echo to screen
;Value is returned in A
;//////////////////////////////////////
GETCH:
        PUSH BC
    
        CALL UART_CLEAR_DLAB
        GETCH_LOOP:
            ;Read Line Status Reg
            IN A, (UART_LSR)
    
            ;If only bit 1 is set then FIFO has new data
            AND 0x1F
            CP 1
            JP NZ, GETCH_LOOP
    
        ;Get next char from data holding register
        IN A, (UART_DHR)
        CALL WRITE_BUFFER
        CALL UART_TOGGLE_OUT2
    
        GETCH_END:
        POP BC
        RET
;//////////////////////////////////////
;Get a line of text from the FIFO, until a return or newline is recieved
;//////////////////////////////////////
GETSTR:
    PUSH AF
    GETSTR_LOOP:
        CALL GETCH
        CP CHAR_RETURN
        JP NZ, GETSTR_LOOP
    POP AF
    RET
;///////////////////////////////////////
;Write a charactar to the terminal buffer, and echo to screen
;expects A to be the character
;//////////////////////////////////////
WRITE_BUFFER:
    PUSH AF
    PUSH BC
    PUSH DE
    ;Save character in D
    LD D, A
    ;Load address of terminal buffer
    LD BC, TERM_BUF
    ;Get size of terminal buffer
    LD A, (BC)
    ;Add 1
    INC A
    ;Write new length to start of buffer
    LD (BC), A
    ;Add A and C for new offset (C should be 0 but just in case)
    ADD A, C
    ;Put A into C
    LD C, A
    ;Put char back into A
    LD A, D
    ;Write to buffer
    LD (BC), A
    CALL PRINTCH
    POP DE
    POP BC
    POP AF
    RET
;/////////////////////////////////////////
;Assumes that A is the charactar to write
;/////////////////////////////////////////
PRINTCH:
        PUSH AF
        PUSH BC
        PUSH HL
        
        ;Save char into B
        LD B, A
        
        LD HL, OUTPUT_SEL
        LD A, (HL)
        CP OUTPUT_VGA
        JP Z, PRINTCH_VIDEO
        
    PRINTCH_SERIAL:
        CALL UART_CLEAR_DLAB
        
    PRINTCH_LOOP:
        ;Read transmit register status in line status register (LSR) See page 22
        ;Wait if not empty
        IN A, (UART_LSR)
        AND 0x60
        CP 0x60
        JP NZ, PRINTCH_LOOP
        ;Write Char to UART
        LD A, B
        OUT (UART_DHR), A
        
        LD HL, OUTPUT_SEL
        LD A, (HL)
        CP 'S'
        JP Z, PRINTCH_EXIT
        
    PRINTCH_VIDEO:
        LD A, B
        ;AND 0x7F
        ;CALL PIO_SEND_CMD
        CALL PRINTCH_VGA
        
    PRINTCH_EXIT:
        POP HL
        POP BC
        POP AF
        RET
PRINTCH_VGA:
    PUSH AF
    AND 0x7F
    CALL PIO_SEND_CMD
    POP AF
    RET
;////////////////////////////////////////
;Writes a string via IO
;Expects HL to be the address of a string
;////////////////////////////////////////
WRITE_STR:
    PUSH AF
    PUSH HL
    WRITE_START:
        LD A, (HL)
        CP CHAR_EOT
        JP Z, WRITE_CLOSE
        CALL PRINTCH
        INC HL
        JP WRITE_START
    WRITE_CLOSE:
    CALL UART_TOGGLE_OUT1
    POP HL
    POP AF
    RET
;Main function to tokenize, parse, and execute user entered expressions
;Assume AF has return values
EVALUATE_STMT:
    PUSH AF
    PUSH HL
    ;Tokenizes and checks for invalid characters
    CALL TOKENIZE_BUFFER
    JP C, EVALUATE_STMT_TOKEN_FAIL
    ;Checks syntax and prepares for execution
    CALL PARSE_BUFFER
    JP C, EVALUATE_STMT_SYNTAX_FAIL
    ;Execute the commands found in the buffer
    CALL EXECUTE_BUFFER
    JP C, EVALUATE_STMT_EXE_FAIL
    ;If all three functions return then jump to end
    JP EVALUATE_STMT_RETURN
    EVALUATE_STMT_TOKEN_FAIL:
        LD HL, TOKEN_ERROR
        CALL WRITE_STR
        JP EVALUATE_STMT_RETURN
    EVALUATE_STMT_SYNTAX_FAIL:
        LD HL, SYNTAX_ERROR
        CALL WRITE_STR
        JP EVALUATE_STMT_RETURN
    EVALUATE_STMT_EXE_FAIL:
        LD HL, EXE_ERROR
        CALL WRITE_STR
    EVALUATE_STMT_RETURN:
    POP HL
    POP AF
    RET
;////////////////////////////////////////////////////////////////
;There are 5 types of symbols - LITERAL, @, :, <, ?
;Returns status in register A
;0x00 - Good
;0xFF - Bad
;////////////////////////////////////////////////////////////////
;Buffer for tokens, first byte is size of buffer
TOKEN_BUF equ 0x8100
;Token Symbols in token buffer
TOKEN_EF equ 0   ;End of buffer size 1
TOKEN_LT equ 1   ;ABCDEF0123456789 size 2
TOKEN_EX equ 2   ;@ size 1
TOKEN_RD equ 3   ;: size 1
TOKEN_WR equ 4   ;< size 1
TOKEN_HE equ 5   ;? size 1
TOKEN_WD equ 6   ;Full Word, size 3
;////////////////////////////////////////////////////////////////
TOKENIZE_BUFFER:
    PUSH BC
    PUSH DE
    ;Clear parse buffer
    LD DE, TOKEN_BUF
    LD A, 0
    LD (DE), A
    ;Get start of terminal buffer
    LD DE, TERM_BUF
    ;For instruction tokens or newlines
    ;Load the token code into C and pass that to the tokenize function
    ;If its a hex letter or number
    ;The value is in B already and the tokenize function expects that
    ;Basically, for every byte in the buffer:
        ;is it a newline? if so then exit
        ;is it a number? if so then convert to hex and tokenize
        ;is it a a hex char? convert to hex and tokenize
        ;is it an instruction? put the propper token
        ;is it whitespace? ignore
    TOKENIZE_BUFFER_LOOP:
        ;Get next character
        INC DE
        LD A, (DE)
        ;Save character
        LD B, A
        ;/////////////////////
        ;Check if return
        ;/////////////////////
        LD C, TOKEN_EF
        CP CHAR_RETURN
        CALL Z, TOKENIZE_INSTR
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_RETURN_SUCCESS
        ;/////////////////////
        ;Check if a number
        ;/////////////////////
        SUB 0x30
        CP 0xA
        CALL C, TOKENIZE_NUMBERS
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;Return original character
        LD A, B
        ;/////////////////////
        ;Check if a hex character
        ;/////////////////////
        SUB 0x41
        CP 0x6
        CALL C, TOKENIZE_CHAR
        ;Return to start of loop if return is FF
        CP 0xF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;Return original character
        LD A, B
        ;/////////////////////
        ;Check if a ?
        ;/////////////////////
        LD C, TOKEN_HE
        CP SYM_HELP
        CALL Z, TOKENIZE_INSTR
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;Return original character
        LD A, B
        ;/////////////////////
        ;Check if a :
        ;/////////////////////
        LD C, TOKEN_RD
        CP SYM_READ
        CALL Z, TOKENIZE_INSTR
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;Return original character
        LD A, B
        ;/////////////////////
        ;Check if a <
        ;/////////////////////
        LD C, TOKEN_WR
        CP SYM_WRITE
        CALL Z, TOKENIZE_INSTR
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;Return original character
        LD A, B
        ;/////////////////////
        ;Check if a @
        ;/////////////////////
        LD C, TOKEN_EX
        CP SYM_EXE
        CALL Z, TOKENIZE_INSTR
        ;Return to start of loop if return is FF
        CP 0xFF
        JP Z, TOKENIZE_BUFFER_LOOP
        ;/////////////////////
        ;Check if whitespace (ignore) (maybe shouldn't ignore?)
        ;/////////////////////
        CP 0x20
        JP Z, TOKENIZE_BUFFER_LOOP
        ;If the program gets to this point there is an error
        SCF
        JP TOKENIZE_BUFFER_RETURN
    TOKENIZE_BUFFER_RETURN_SUCCESS:
        ;Signal that the program returned successful!
        SCF
        CCF
        
    TOKENIZE_BUFFER_RETURN:
    POP DE
    POP BC
    RET
;Expects C to be the token value
;Return 0xFF in A when complete
TOKENIZE_INSTR:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Get size of token buffer
    LD HL, TOKEN_BUF
    LD A, (HL)
    ;Save in D
    LD D, A
    ;Increment token buffer size
    INC A
    LD (HL), A
    ;Add the new size to the pointer so that it points to the next open spot
    LD A, D
    ADD A, L
    INC A
    LD L, A
    ;Put Instruction Token at the next open spot
    LD (HL), C
    INC L   ;TODO: ???
    POP HL
    POP DE
    POP BC
    LD A, 0xFF
    RET
;Expects B to hold next char value
;Write token symbol and value (if needed) to TOKEN_BUF
TOKENIZE_NUMBERS:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Get size of token buffer
    LD HL, TOKEN_BUF
    LD A, (HL)
    ;Save in C
    LD C, A
    ;Increment by 2
    ADD A, 2
    LD (HL), A
    ;Add size to the buffer pointer to get the next available spot
    LD A, C
    ADD A, L
    INC A
    LD L, A
    ;Put Number Token
    LD (HL), TOKEN_LT
    INC L
    ;Put Token Value
    LD A, B
    SUB 0x30
    LD (HL), A
    POP HL
    POP DE
    POP BC
    LD A, 0xFF
    RET
;Expects B to be the Char value
;Write token symbol and value to TOKEN_BUF
;Returns an F instead of FF because of an error with @
TOKENIZE_CHAR:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Get size of token buffer
    LD HL, TOKEN_BUF
    LD A, (HL)
    ;Save in C
    LD C, A
    ;Increment by 2
    ADD A, 2
    LD (HL), A
    ;Goto next free spot
    LD A, C
    ADD A, L
    INC A
    LD L, A
    ;Put Number Token
    LD (HL), TOKEN_LT
    INC L
    ;Put Token Value
    LD A, B
    SUB 0x37
    LD (HL), A
    POP HL
    POP DE
    POP BC
    LD A, 0xF
    RET
;TODO: Can this just write over the other buffers?
;Buffer for Parser
PARSE_RAM equ 0x8200
;Current and next token for parser
PARSE_CUR equ 0x8200
PARSE_NEXT equ 0x8201
;Location of state for FSM
PARSE_STATE equ 0x8202
;Incrementor location for parser
PARSE_INC equ 0x8203
;High and low values for literals
PARSE_LIT_H equ 0x8204
PARSE_LIT_L equ 0x8205
PARSE_BUF equ 0x8210
;This should organize each token into a fully readable form
;I'm using the term 'Parse' very loosely
;Return 0x00 on success
PARSE_BUFFER:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Get start of token buffer
    LD HL, TOKEN_BUF
    ;Get size of buffer
    LD A, (HL)
    ;Return if its empty
    CP 0
    JP Z, PARSE_BUFFER_RETUN_SUCCESS
    ;Clear literal storage
    LD HL, PARSE_LIT_L
    LD (HL), 0
    LD HL, PARSE_LIT_H
    LD (HL), 0
    ;Set state to be start
    ;LD HL, PARSE_STATE
    ;LD (HL), STATE_START
    ;Set size of buffer to be 0
    LD HL, PARSE_BUF
    LD (HL), 0
    ;Set incrementor
    LD HL, PARSE_INC
    LD (HL), 1
    PARSE_BUFFER_LOOP:
        ;Get incrementor
        LD HL, PARSE_INC
        LD A, (HL)
        ;Go to next location in token buffer
        LD HL, TOKEN_BUF
        ADD A, L
        LD L, A
        ;Get Token, save to A and B
        LD A, (HL)
        LD B, A
        ;Check if its the end of the buffer
        CP TOKEN_EF
        CALL Z, PARSE_INST
        CP 0xFF
        JP Z, PARSE_BUFFER_RETUN_SUCCESS
        ;Check if current token is a single literal value
        CP TOKEN_LT
        CALL Z, PARSE_LITERAL
        CP 0xFF
        JP Z, PARSE_BUFFER_LOOP
        ;Check if current token is an @ symbol
        CP TOKEN_EX
        CALL Z, PARSE_INST
        CP 0xFF
        JP Z, PARSE_BUFFER_LOOP
        ;Check if current token is an : symbol
        CP TOKEN_RD
        CALL Z, PARSE_INST
        CP 0xFF
        JP Z, PARSE_BUFFER_LOOP
        ;Check if current token is an < symbol
        CP TOKEN_WR
        CALL Z, PARSE_INST
        CP 0xFF
        JP Z, PARSE_BUFFER_LOOP
        ;Check if current token is an ? symbol
        CP TOKEN_HE
        CALL Z, PARSE_INST
        CP 0xFF
        JP Z, PARSE_BUFFER_LOOP
        ;If parser reaches this point there is an invalid token
        ;LD A, 0xFF
        ;Set carry flag
        SCF
        JP PARSE_BUFFER_RETURN
    PARSE_BUFFER_RETUN_SUCCESS:
        ;Clear carry flag
        SCF
        CCF
        
    PARSE_BUFFER_RETURN:
    POP HL
    POP DE
    POP BC
    RET
;HL should be location of next token
;A should be the token
PARSE_LITERAL:
    PUSH BC
    PUSH DE
    PUSH HL
    PARSE_LITERAL_LOOP:
        ;Check if this is a literal token
        ;TODO jump to an error state, not save
        CP TOKEN_LT
        JP NZ, PARSE_LITERAL_SAVE
        ;The goal of this next section is to shift the current token into two 8 bit values to create a single 16 bit value
        ;This is horrible and ugly but im too tired to make it better right now
        ;Get value
        INC L
        LD A, (HL)
        ;Save HL for later
        PUSH HL
        ;Save value into E
        LD E, A
        ;Get high literal value
        LD HL, PARSE_LIT_H
        LD A, (HL)
        ;Rotate A by 4 to the left (may have to rotate 5 times?) so now low bytes are high
        RLCA
        RLCA
        RLCA
        RLCA
        ;Zero out lower bytes
        AND 0xF0
        ;Save rotated high byte into B
        LD B, A
        ;Get Low literal value
        LD HL, PARSE_LIT_L
        LD A, (HL)
        ;Rotate A by 4 to the left (so now low and high bytes are swapped)
        RLCA
        RLCA
        RLCA
        RLCA
        ;Save into C
        LD C, A
        ;Zero out high bytes
        AND 0x0F
        ;Now A should contain the HIGH byte
        OR B
        LD HL, PARSE_LIT_H
        LD (HL), A
        ;Now get the value of the token
        LD A, C
        ;Put the new token (stored in E) into the low bytes of A
        AND 0xF0
        OR E
        ;Save
        LD HL, PARSE_LIT_L
        LD (HL), A
        ;Get TOKEN incrementor
        LD HL, PARSE_INC
        LD A, (HL)
        ADD A, 2
        LD (HL), A
        ;Increment pointer and return to start
        POP HL
        INC L
        LD A, (HL)
        JP PARSE_LITERAL_LOOP
    PARSE_LITERAL_SAVE:
        ;First, save this token and the full value
        ;Get size of parse buffer
        ;HL Holds the location of the next (non literal) token
        PUSH HL
        LD HL, PARSE_BUF
        LD A, (HL)
        ;Go to next empty spot
        ADD A, L
        INC A
        LD L, A
        ;First put word token
        LD (HL), TOKEN_WD
        INC L
        ;Next Put High Byte
        LD DE, PARSE_LIT_H
        LD A, (DE)
        LD (HL), A
        INC L
        ;Next put low byte
        LD DE, PARSE_LIT_L
        LD A, (DE)
        LD (HL), A
        INC L
        ;Clear literal storage NEWNEWNEW
        LD HL, PARSE_LIT_L
        LD (HL), 0
        LD HL, PARSE_LIT_H
        LD (HL), 0
        ;Go back to start of buffer, get size
        LD HL, PARSE_BUF
        LD A, (HL)
        ;Increment by size of token
        ADD A, 0x3
        LD (HL), A
        POP HL
    PARSE_LITERAL_RETURN_SUCCESS:
        LD A, 0xFF
    PARSE_LITERAL_RETURN:
    POP HL
    POP DE
    POP BC
    RET
;A should just be the instruciton token, no additional work needed
PARSE_INST:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Save token into B
    LD B, A
    LD HL, PARSE_BUF
    LD A, (HL)
    ;Go to next empty spot
    ADD A, L
    INC A
    LD L, A
    ;Put token
    LD (HL), B
    ;Go back to start of buffer, get size
    LD HL, PARSE_BUF
    LD A, (HL)
    ;Increment by size of token
    INC A
    LD (HL), A
    ;Update TOKEN incrementor
    LD HL, PARSE_INC
    LD A, (HL)
    INC A
    LD (HL), A
    ;Set return value
    LD A, 0xFF
    POP HL
    POP DE
    POP BC
    RET
;This is essentially a big case statement depending on which token appears
;first in the parse buffer, each case has a corresponding subroutine
;it shouldn't be hard to add extra functions later if needed
EXECUTE_BUFFER:
    PUSH BC
    PUSH DE
    PUSH HL
    ;Go to first token in parse buffer
    LD HL, PARSE_BUF
    INC HL
    ;Get token
    LD A, (HL)
    EXECUTE_BUFFER_EF:
        ;Check if its the end of the buffer (no instruction)
        CP TOKEN_EF
        JP Z, EXECUTE_BUFFER_RETURN_SUCCESS
    EXECUTE_BUFFER_WD:
        ;Check if current token is a Word Value
        CP TOKEN_WD
        JP NZ, EXECUTE_BUFFER_EXE                   ;If not, jump to the next
        CALL EVAL_LITERAL
        CP 0                                        ;Expect a return value of 0
        JP Z, EXECUTE_BUFFER_RETURN_SUCCESS
    EXECUTE_BUFFER_EXE:
        ;Check if current token is an @ symbol
        CP TOKEN_EX
        JP NZ, EXECUTE_BUFFER_HE
        CALL EVAL_EXE
        CP 0
        JP Z, EXECUTE_BUFFER_RETURN_SUCCESS
    EXECUTE_BUFFER_HE:
        ;Check if current token is an ? symbol
        CP TOKEN_HE
        CALL Z, EVAL_HELP
        CP 0
        JP Z, EXECUTE_BUFFER_RETURN_SUCCESS
    ;More actions could be added here
    EXECUTE_BUFFER_FAIL:
        ;If parser reaches this point then there is an invalid instruction
        ;LD A, 0xFF
        SCF
        JP EXECUTE_BUFFER_RETURN
    EXECUTE_BUFFER_RETURN_SUCCESS:
        ;I don't think this is needed because A should already be 0
        ;LD A, 0x00
        SCF
        CCF
    EXECUTE_BUFFER_RETURN:
    POP HL
    POP DE
    POP BC
    RET
EVAL_LITERAL:
    PUSH HL
    PUSH DE
    ;Get First Two Bytes
    LD HL, PARSE_BUF
    LD A, L
    ADD A, 2
    LD L, A
    ;Get the top byte
    LD A, (HL)
    ;Store into D
    LD D, A
    ;Get the bottom byte
    INC HL
    LD A, (HL)
    ;Store into E
    LD E, A
    ;Get the instruction token
    INC HL
    LD A, (HL)
    ;See if A is a read instruction
    EVAL_LITERAL_READ:
        CP TOKEN_RD
        JP NZ, EVAL_LITERAL_WRITE
        CALL EVAL_READ
        CP 0     ;Check for error
        JP Z, EVAL_LITERAL_SUCCESS
    EVAL_LITERAL_WRITE:
        CP TOKEN_WR
        JP NZ, EVAL_LITERAL_FAIL
        CALL EVAL_WRITE
        CP 0     ;Check for error
        JP Z, EVAL_LITERAL_SUCCESS
    ;Other instrucitons could be added here...
    EVAL_LITERAL_FAIL:
    LD A, 0xFF
    EVAL_LITERAL_SUCCESS:
    POP DE
    POP HL
    RET
EVAL_EXE:
    PUSH HL
    PUSH DE
    ;Clear DE
    LD D, 0
    LD E, 0
    ;Get look at the location of the second token in the buffer
    LD HL, PARSE_BUF
    LD A, L
    ADD A, 2
    LD L, A
    ;Get the token
    LD A, (HL)
    ;Make sure its a WORD token
    CP TOKEN_WD
    JP NZ, EVAL_EXE_FAILURE
    ;Get the literal
    INC HL
    LD A, (HL)
    ;Assume 1 Byte at first
    LD D, A
    ;Get next token
    INC HL
    LD A, (HL)
    LD E, A
    ;Set Up Return Address so that RET can be called
    LD HL, EVAL_EXE_SUCCESS
    PUSH HL
    LD H, D
    LD L, E
    ;Jump to new, arbitrary location
    JP (HL)
    EVAL_EXE_FAILURE:
    LD A, 0xFF
    JP EVAL_EXE_EXIT
    EVAL_EXE_SUCCESS:
    LD A, 0
    EVAL_EXE_EXIT:
    POP DE
    POP HL
    RET
EVAL_READ:
    ;DE is the literal value
    ;HL should be pointing to the read token
    PUSH HL
    PUSH DE
    PUSH BC
    ;get next token
    INC HL
    LD A, (HL)
    ;check that it is a word
    CP TOKEN_WD
    JP NZ, EVAL_READ_FAIL
    ;Get the 8 bit value
    INC HL
    INC HL
    LD A, (HL)
    ;Put the target address in HL
    LD H, D
    LD L, E
    ;Use B to count when a newline is needed
    LD B, 0
    ;Loop over each value at the location
    EVAL_READ_LOOP:
        ;Save the pointer, and the incrementor
        PUSH AF
        PUSH HL
        ;Is a newline needed?
        LD A, B
        AND 0x0F
        CP 0
        JP NZ, EVAL_READ_LOOP_L1
        LD A, CHAR_NEWLINE
        CALL PRINTCH
        LD A, CHAR_RETURN
        CALL PRINTCH
        EVAL_READ_LOOP_L1:
        ;Convert the hex to ascii
        LD A, (HL)
        CALL HTOA
        ;Print the first char
        LD A, H
        CALL PRINTCH
        ;Print the second char
        LD A, L
        CALL PRINTCH
        ;Print a space
        LD A, CHAR_SPACE
        CALL PRINTCH
        ;Get the pointer and the incrementor back
        POP HL
        POP AF
        ;Decrement counter and return if A is not 0
        INC HL
        INC B
        DEC A
        CP 0
        JP NZ, EVAL_READ_LOOP
        ;A is already 0, just jump to end
        JP EVAL_READ_EXIT
    EVAL_READ_FAIL:
    LD A, 0xFF
    EVAL_READ_EXIT:
    POP BC
    POP DE
    POP HL
    RET
EVAL_WRITE:
    ;DE is the literal value
    ;HL should not have been modified from before
    PUSH HL
    PUSH DE
    ;Look now for the final Literal
    INC HL
    LD A, (HL)
    ;Check that next token is a word, even though we only use the lower byte
    CP TOKEN_WD
    JP NZ, EVAL_WRITE_FAIL
    ;Get value to write
    INC HL
    INC HL
    LD A, (HL)
    ;Write the value
    LD H, D
    LD L, E
    LD (HL), A
    ;SUCCESS!
    LD A, 0
    JP EVAL_WRITE_RETURN
    EVAL_WRITE_FAIL:
    LD A, 0xFF
    EVAL_WRITE_RETURN:
    POP DE
    POP HL
    RET
;Just print out the help text
EVAL_HELP:
    PUSH HL
    LD HL, HELP_TEXT
    CALL WRITE_STR
    LD A, 0
    POP HL
    RET
;HEX to ASCII
;Convert hex value to 2 ascii characters
;Expects A to be the hex value
;Returns 2 chars in HL
HTOA:
    PUSH AF
    PUSH BC
    ;High Nibble First, save into H
    ;Copy A into B
    LD B, A
    HTOA_HIGH:
    ;Rotate right
    RR A
    RR A
    RR A
    RR A
    ;Clear high bits
    AND 0x0F
    ;Is this A-F?
    HTOA_HEX_1:
    CP 0xA
    JP C, HTOA_INT_1
    ADD A, 0x37
    LD H, A
    JP HTOA_LOW
    ;Is this 0-9?
    HTOA_INT_1:
    ADD A, 0x30
    LD H, A
    ;Next do the low nibble, save into E
    HTOA_LOW:
    ;Copy B back into A
    LD A, B
    AND 0x0F
    ;Is this A-F?
    HTOA_HEX_2:
    CP 0xA
    JP C, HTOA_INT_2
    ADD A, 0x37
    LD L, A
    JP HTOA_EXIT
    ;Is this 0-9?
    HTOA_INT_2:
    ADD A, 0x30
    LD L, A
    HTOA_EXIT:
    POP BC
    POP AF
    RET
;//////////////////////
;/////////DATA/////////
;//////////////////////
BOOT_MSG:
db CHAR_NEWLINE, CHAR_RETURN, "ASH v0.5", CHAR_NEWLINE, CHAR_RETURN, "(C) 2021 by Aidan Jennings"
db CHAR_NEWLINE, CHAR_RETURN, "ZILOG Z80 32k EEPROM, 64k SRAM",  CHAR_NEWLINE, CHAR_RETURN, CHAR_EOT
SYNTAX_ERROR:
db CHAR_NEWLINE, CHAR_RETURN, "SYNTAX ERROR", CHAR_NEWLINE, CHAR_EOT
TOKEN_ERROR:
db CHAR_NEWLINE, CHAR_RETURN, "INVALID TOKEN", CHAR_NEWLINE, CHAR_EOT
EXE_ERROR:
db CHAR_NEWLINE, CHAR_RETURN, "EXECUTION ERROR", CHAR_NEWLINE, CHAR_EOT
HELP_TEXT:
db CHAR_NEWLINE, CHAR_RETURN, "INSTRUCTIONS : ", CHAR_NEWLINE, CHAR_RETURN, "1FFF : 10 - READ 16 BYTES STARTING AT LOCATION 0x1FFF", CHAR_NEWLINE, CHAR_RETURN, "1FFF < 10 - WRITE 0x10 TO LOCAITON 0x1FFF", CHAR_NEWLINE, CHAR_RETURN, "@1FFF - BEGIN EXECUTION AT LOCATION 0x1FFF", CHAR_NEWLINE, CHAR_RETURN, "? - DISPLAY HELP MESSAGE", CHAR_NEWLINE, CHAR_EOT
PROMPT:
db CHAR_NEWLINE, CHAR_RETURN, "[Tom80]:~$ ", CHAR_EOT
OUTPUT_MSG:
db CHAR_NEWLINE, CHAR_RETURN, "(S)erial or (V)ideo?", CHAR_NEWLINE, CHAR_RETURN, CHAR_EOT
PIO_TEST_STR:
db " << I got this from the PIO", CHAR_NEWLINE, CHAR_NEWLINE, CHAR_RETURN, CHAR_EOT 
 | 20.206218 
							 | 355 
							 | 0.552708 
							 | 
					
	7bc367cc082b133601cd887d691bf86ee719c8a4 
 | 689 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/054/A054995.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/054/A054995.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/054/A054995.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A054995: A version of Josephus problem: a(n) is the surviving integer under the following elimination process. Arrange 1,2,3,...,n in a circle, increasing clockwise. Starting with i=1, delete the integer two places clockwise from i. Repeat, counting two places from the next undeleted integer, until only one integer remains.
; 1,2,2,1,4,1,4,7,1,4,7,10,13,2,5,8,11,14,17,20,2,5,8,11,14,17,20,23,26,29,1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91
mov $2,1
lpb $0
  sub $0,1
  add $1,3
  add $2,1
  mod $1,$2
lpe
mov $0,$1
add $0,1
 
 | 53 
							 | 327 
							 | 0.687954 
							 | 
					
	22d66cd6ed16302f49f71e45a134cd28860a6edc 
 | 411 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/main.asm 
 | 
	Iambian/Falldown2-CE 
 | 
	3f73a7be510b8bbc24b224ccf02757476222e3ea 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2020-05-18T14:09:57.000Z 
 | 
	2022-02-14T23:45:55.000Z 
 | 
	src/main.asm 
 | 
	Iambian/Falldown2-CE 
 | 
	3f73a7be510b8bbc24b224ccf02757476222e3ea 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	src/main.asm 
 | 
	Iambian/Falldown2-CE 
 | 
	3f73a7be510b8bbc24b224ccf02757476222e3ea 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	#include "src/ti84pce_short.inc"
.org userMem-2
.db 0EFh, 07Bh
.assume adl=1
;Note. 2bpp screen mode. screen @ $D43500, buffer @D48000.
programStart:
	di
	ld hl,gameData
	ld de,0D40000h
	call zx7_decompress
	;jr $
	call 0D40000h
	jp _boot_ClearVRAM
#include "src/dzx7.asm"
.echo "Loader stub size: ",$-programStart," bytes"
gameData:
#import "obj/game.zx7"
.echo "Total file size: ",$-programStart," bytes" 
 | 17.869565 
							 | 58 
							 | 0.720195 
							 | 
					
	59b5df71eae6101079ee59ea51347d53a41f3866 
 | 1,336 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/temp/sp1/zx/sprites/draw/SP1_DRAW_LOAD1LB.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/_DEVELOPMENT/temp/sp1/zx/sprites/draw/SP1_DRAW_LOAD1LB.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/_DEVELOPMENT/temp/sp1/zx/sprites/draw/SP1_DRAW_LOAD1LB.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	
; DRAW LOAD SPRITE 1 BYTE DEFINITION ROTATED, ON LEFT BORDER
; 01.2006 aralbrec, Sprite Pack v3.0
; sinclair spectrum version
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _SP1_DRAW_LOAD1LB
EXTERN _SP1_DRAW_LOAD1NR
EXTERN SP1RETSPRDRAW
; following data segment copied into struct sp1_cs
   ld hl,0
   nop
   ld de,0
   call _SP1_DRAW_LOAD1LB
; following draw code called by way of SP1UpdateNow
;
;  a = hor rot table
; bc = graphic disp
; hl = graphic def ptr
; de = left graphic def ptr
;
; 32 + 33*8 - 6 + 10 = 300 cycles
_SP1_DRAW_LOAD1LB:
   cp SP1V_ROTTBL/256
   jp z, _SP1_DRAW_LOAD1NR
   add hl,bc
   ld d,a
   ;  d = shift table
   ; hl = sprite def (graph only)
_SP1Load1LBRotate:
   ; 0
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+0),a
   ; 1
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+1),a
   ; 2
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+2),a
   ; 3
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+3),a
   ; 4
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+4),a
   ; 5
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+5),a
   ; 6
   ld e,(hl)
   inc hl
   ld a,(de)
   ld (SP1V_PIXELBUFFER+6),a
   ; 7
   ld e,(hl)
   ld a,(de)
   ld (SP1V_PIXELBUFFER+7),a
   jp SP1RETSPRDRAW
 
 | 13.227723 
							 | 60 
							 | 0.619012 
							 | 
					
	fcaa85ad00d71f0c7b8eb8de927e84d37dbd7f3d 
 | 506 
							 | 
	asm 
 | 
	Assembly 
 | 
	Src/SacaraVm/vm_jump_if_less_equals.asm 
 | 
	mrfearless/sacara 
 | 
	126ee1c8c18c9d01a09fac4aedd9044976cf17c4 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	Src/SacaraVm/vm_jump_if_less_equals.asm 
 | 
	mrfearless/sacara 
 | 
	126ee1c8c18c9d01a09fac4aedd9044976cf17c4 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	Src/SacaraVm/vm_jump_if_less_equals.asm 
 | 
	mrfearless/sacara 
 | 
	126ee1c8c18c9d01a09fac4aedd9044976cf17c4 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	header_VmJumpIfLessEquals
vm_jump_if_less_equals PROC
	push ebp
	mov ebp, esp	
	
	; pop the value
	push [ebp+arg0]
	call_vm_stack_pop_enc
	; test the carry flag
	mov ebx, [ebp+arg0]
	mov ebx, [ebx+vm_flags]
	test ebx, VM_CARRY_FLAG
	jnz modify_ip
	; test the zero flag
	mov ebx, [ebp+arg0]
	mov ebx, [ebx+vm_flags]
	test ebx, VM_ZERO_FLAG
	jz finish
modify_ip:
	; modify the vm IP
	mov ebx, [ebp+arg0]
	mov [ebx+vm_ip], eax
finish:	
	mov esp, ebp
	pop ebp
	ret
vm_jump_if_less_equals ENDP
header_marker 
 | 15.8125 
							 | 27 
							 | 0.735178 
							 | 
					
	d598ae9db7456e43356d6229a209b1c989a92b5c 
 | 5,124 
							 | 
	asm 
 | 
	Assembly 
 | 
	Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1236.asm 
 | 
	ljhsiun2/medusa 
 | 
	67d769b8a2fb42c538f10287abaf0e6dbb463f0c 
 | 
	[
  "MIT"
]  | 9 
							 | 
	2020-08-13T19:41:58.000Z 
 | 
	2022-03-30T12:22:51.000Z 
 | 
	Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1236.asm 
 | 
	ljhsiun2/medusa 
 | 
	67d769b8a2fb42c538f10287abaf0e6dbb463f0c 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2021-04-29T06:29:35.000Z 
 | 
	2021-05-13T21:02:30.000Z 
 | 
	Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1236.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 %rax
push %rcx
push %rdi
push %rdx
lea addresses_D_ht+0xacb6, %rdi
nop
sub %rdx, %rdx
mov (%rdi), %r10d
nop
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0x1afb6, %rdi
add $63691, %rax
movb (%rdi), %cl
nop
xor %r10, %r10
lea addresses_D_ht+0x19fc2, %rax
nop
nop
nop
nop
nop
sub $49010, %r11
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%rax)
nop
nop
sub %rdx, %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r11
pop %r10
ret
    .global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %r9
push %rbp
push %rdi
// Store
lea addresses_normal+0x12136, %rbp
nop
nop
add %r12, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm7
vmovups %ymm7, (%rbp)
nop
cmp $39931, %r9
// Store
lea addresses_normal+0x59a6, %rdi
nop
nop
nop
nop
nop
xor $19527, %r14
mov $0x5152535455565758, %rbp
movq %rbp, (%rdi)
nop
nop
nop
cmp $26639, %r11
// Faulty Load
mov $0x4f216a0000000936, %r11
nop
nop
inc %r8
movups (%r11), %xmm4
vpextrq $0, %xmm4, %r12
lea oracles, %r9
and $0xff, %r12
shlq $12, %r12
mov (%r9,%r12,1), %r12
pop %rdi
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': True, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
 
 | 44.947368 
							 | 2,999 
							 | 0.65886 
							 | 
					
	30f9b2047cd25baf78863981da6b9b91762129fe 
 | 377 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/127/A127651.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/127/A127651.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/127/A127651.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A127651: Triangle T(n,k) = n*k if k|n, 0 otherwise; 1<=k<=n.
; Submitted by Christian Krause
; 1,2,4,3,0,9,4,8,0,16,5,0,0,0,25,6,12,18,0,0,36,7,0,0,0,0,0,49,8,16,0,32,0,0,0,64,9,0,27,0,0,0,0,0,81,10,20,0,0,50,0,0,0,0,100,11,0,0,0,0,0,0,0,0,0,121,12,24,36,48,0,72,0,0,0,0,0,144
lpb $0
  add $2,1
  sub $0,$2
lpe
add $0,1
add $2,1
lpb $0
  gcd $0,$2
  mul $2,$1
lpe
mul $0,$2
 
 | 23.5625 
							 | 183 
							 | 0.572944 
							 | 
					
	52c361da1c713158436fa385f968212086014aea 
 | 484 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror.asm 
 | 
	teknoplop/z88dk 
 | 
	bb03fbfd6b2ab0f397a1358559089f9cd3706485 
 | 
	[
  "ClArtistic"
]  | 1 
							 | 
	2019-12-03T23:57:48.000Z 
 | 
	2019-12-03T23:57:48.000Z 
 | 
	
; int ferror(FILE *stream)
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC ferror
EXTERN asm_ferror
ferror:
   push hl
   pop ix
   
   jp asm_ferror
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC ferror
EXTERN ferror_unlocked
defc ferror = ferror_unlocked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 | 13.081081 
							 | 31 
							 | 0.454545 
							 | 
					
	87870b7d6351513e2eebf401f6c5e29a0f1c118c 
 | 387 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/083/A083045.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/083/A083045.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/083/A083045.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A083045: Main diagonal of table A083044.
; Submitted by Jamie Morken(s1)
; 1,6,17,35,68,122,224,383,656,1092,1841,2978,4859,7835,12776,20291,32664,51422,82485,129720,204821,319482,506060,789872,1237733,1927494,3024318,4687259,7274921,11271293,17578760,27133793,42125475,64909160
mov $1,3
mov $2,$0
lpb $2
  add $1,$2
  mul $1,3
  add $1,5
  div $1,2
  sub $2,1
lpe
mov $0,$1
sub $0,2
 
 | 24.1875 
							 | 205 
							 | 0.72093 
							 | 
					
	33d4166d0a00d96a11783ce4700ef5eecc91b8d0 
 | 153 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/input/zx/c/sccz80/in_key_pressed.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/input/zx/c/sccz80/in_key_pressed.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/input/zx/c/sccz80/in_key_pressed.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	
; int in_key_pressed(uint16_t scancode)
SECTION code_input
PUBLIC in_key_pressed
EXTERN asm_in_key_pressed
defc in_key_pressed = asm_in_key_pressed
 
 | 13.909091 
							 | 40 
							 | 0.849673 
							 | 
					
	1d2199b7fc0111cc2369cda7537cb643205cee1c 
 | 576 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/114/A114696.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/114/A114696.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/114/A114696.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A114696: Expansion of (1+4*x+x^2)/((x-1)*(x+1)*(x^2+2*x-1)); a Pellian-related sequence.
; 1,6,15,40,97,238,575,1392,3361,8118,19599,47320,114241,275806,665855,1607520,3880897,9369318,22619535,54608392,131836321,318281038,768398399,1855077840,4478554081,10812186006,26102926095,63018038200,152139002497,367296043198,886731088895,2140758220992,5168247530881,12477253282758,30122754096399,72722761475560,175568277047521,423859315570606,1023286908188735,2470433131948080,5964153172084897
add $0,1
cal $0,113224 ; a(2n) = A002315(n), a(2n+1) = A082639(n+1).
mov $1,$0
sub $1,1
 
 | 72 
							 | 395 
							 | 0.793403 
							 | 
					
	bfe035319a64a5304a9b0b36d9b58d5c228012f2 
 | 6,571 
							 | 
	asm 
 | 
	Assembly 
 | 
	sort4a.asm 
 | 
	clayne/SortingNetworks 
 | 
	fedbe780891b4fb66265eafd04212e07a30e48c9 
 | 
	[
  "MIT"
]  | 34 
							 | 
	2017-02-04T17:32:39.000Z 
 | 
	2021-05-27T09:35:57.000Z 
 | 
	sort4a.asm 
 | 
	clayne/SortingNetworks 
 | 
	fedbe780891b4fb66265eafd04212e07a30e48c9 
 | 
	[
  "MIT"
]  | 1 
							 | 
	2017-11-30T02:44:46.000Z 
 | 
	2017-11-30T03:37:19.000Z 
 | 
	sort4a.asm 
 | 
	clayne/SortingNetworks 
 | 
	fedbe780891b4fb66265eafd04212e07a30e48c9 
 | 
	[
  "MIT"
]  | 6 
							 | 
	2017-04-08T07:47:59.000Z 
 | 
	2021-05-08T14:57:39.000Z 
 | 
	;*******************************************************************
;   sort4a.asm
;   Sorting Networks
;
;	Author: Kareem Omar
;	[email protected]
;	https//github.com/komrad36
;
;	Last updated Feb 15, 2017
;*******************************************************************
;
; SUMMARY: I present novel and state-of-the-art sorting of 4 int32_t
; and sorting of 6 int8_t, as examples, using SSE4, and some thoughts
; and notes on fast sorting of small fixed-size arrays.
;
; These are the fastest known approaches on modern CPUs.
; They are completely branchless and extremely fast.
; For example, 4 int32_t can be sorted in ~18 cycles on Skylake.
;
; These examples can be modified to sort signed or unsigned data as long
; as the total size of the data is <= 128 bits (16 bytes). Note that
; trying to use AVX2 to push that to 256 bits will NOT HELP
; because of the 3 cycle interlane latency that makes shuffling
; across the 128-bit lane boundary too expensive to be useful.
;
; In that case, or in the case that you can't support SSE4,
; efficient scalar code can also be generated that isn't too much
; slower, but it's not immediately evident what the optimal approach
; is in assembly, nor how to coerce C/C++ compilers to produce that
; assembly from C/C++ code. (I discuss the approach at the end of this
; documentation.)
;
; Not all compilers correctly generate optimal assembly for either the
; SSE or scalar code, so I provide assembly versions too. In fact, this
; is not a strong enough statement; many compilers FAIL MISERABLY
; at both the SSE and scalar cases for n >= 3. CL in particular
; (Microsoft Visual C++) just dies horribly in a fire, so the assembly
; snippets may not be a bad idea. Profile and/or check your disassembly.
;
; Note that these assembly snippets use the Windows x64 calling convention,
; but then proceed to clobber a bunch of registers they shouldn't. Normally
; they'd be inlined. Feel free to callee-save registers that your
; application cannot safely clobber.
;
; These code snippets work on the principle of sorting networks.
; Conventional sorting algorithms like quicksort and mergesort
; are not great at small array sizes. One notices in profiling that
; simpler sorts like insertion and selection tend to win. However,
; even these are not NEARLY as fast as they could be for
; fixed-size, small arrays.
;
; Available sorts and their function names:
;
; >>> SSE Assembly (fast as hell. FASTEST option on modern CPUs.
;					 these are written in MASM for Win64;
;					 but it's Intel syntax and you can make the small
;					 modifications required for other assemblers.)
; Sorting 4 int32_t  |  simdsort4a()
; Sorting 4 int32_t  |  simdsort4a_noconstants()
; Sorting 4 int32_t  |  simdsort4a_nofloat()
;
; >>> SSE C++ (make sure generated assembly matches):
; Sorting 4 int32_t  |  simdsort4()
; Sorting 6 int8_t   |  simdsort6()
;
; >>> Scalar Assembly (these are written in MASM for Win64;
;						but it's Intel syntax and you can make the small
;						modifications required for other assemblers.)
; Sorting 2 int32_t  |  sort2a()
; Sorting 3 int32_t  |  sort3a()
; Sorting 4 int32_t  |  sort4a()
; Sorting 5 int32_t  |  sort5a()
; Sorting 6 int32_t  |  sort6a()
;
; >>> Scalar C++ (make sure generated assembly matches)
; Sorting 2 int32_t  |  sort2()
; Sorting 6 int32_t  |  sort6()
;
;
; Okay, if you've made it this far, let's discuss
; fast conditional swap operations. Conditional swaps
; if the lower element is greater are the heart of sorting
; networks. Given two values,
; 'a', and 'b', leave them as they are if 'a' is less
; than 'b', i.e. if they are in sorted order. However,
; swap them if 'a' is greater than or equal to 'b'.
; Thus after such a conditional swap operation 'a' and 'b' are in sorted
; order no matter what order they came in as.
;
; A series of such operations can deterministically sort
; a fixed-size array. Typically one can optimize for depth
; (minimum number of operations given infinite parallel
; processing) or for size (minimum number of operations given
; no parallel processing). For n == 4 these two optimal solutions
; are actually given by the same network, with depth 3 and
; size 5.
;
; Scalar first: how do you efficiently conditional swap? Again, note that
; lots of compilers don't produce optimal assembly no matter
; what C++ you give them. But what is the optimal assembly?
; Well, on modern processors, the answer is conditional moves:
;
;	; inputs: eax, r9d
;	; scratch register: edx
;	cmp     eax, r9d
;	mov     edx, eax
;	cmovg   eax, r9d
;	cmovg   r9d, edx
;	; eax and r9d have been swapped if necessary such that eax is now <= r9d
;
; See the function 'sort6' in 'sorts.cpp' for an attempt at some C++ code
; that has a decent chance of compiling into conditional swaps that look like that.
; Again, they OFTEN DON'T, especially the CL compiler and g++. Use the assembly
; snippets instead, or at least profile and inspect your disassembly to be sure.
;
; The SSE sorts are rather more sophisticated, but the basic principle
; is to branchlessly generate shuffle index masks at runtime and then
; use them to permute the order of the data in parallel, performing
; one complete level of the sorting network at a time.
;
; I provide 3 versions of the assembly for sorting 4 int32_t. The fastest
; should be the plain 'simdsort4a'. It performs float reinterpretation
; and relies on some constant loads, but both of these are USUALLY
; better than the alternatives. However:
;
; Older CPUs may incur too much latency from the reinterpretation to be
; worth it. For such CPUs, try 'simdsort4a_nofloat.asm'.
;
; Applications that cannot afford to have these constants occupying L1
; may wish to try 'simdsort4a_noconstants.asm', which does not eat
; up any cache space with constants - everything is done with immediates
; and some fairly nasty bit twiddling.
;
.CODE
sort4a PROC
	mov		eax, [rcx]
	mov		r10d, [rcx+4]
	mov		edx, [rcx+8]
	mov		r9d, [rcx+12]
	mov		r11d, edx
	mov		r8d, eax
	cmp		eax, r10d
	cmovg	r8d, r10d
	cmovg	r10d, eax
	cmp		edx, r9d
	cmovg	r11d, r9d
	cmovg	r9d, edx
	cmp		r8d, r11d
	mov		edx, r8d
	cmovg	edx, r11d
	cmovg	r11d, r8d
	cmp		r10d, r9d
	mov		r8d, r9d
	cmovg	r8d, r10d
	cmovg	r10d, r9d
	cmp		r11d, r10d
	mov		eax, r11d
	cmovg	r11d, r10d
	cmovg	r10d, eax
	mov		[rcx], edx
	mov		[rcx+4], r11d
	mov		[rcx+8], r10d
	mov		[rcx+12], r8d
	ret
sort4a ENDP
END 
 | 38.881657 
							 | 84 
							 | 0.698676 
							 | 
					
	25ed8ba7df3e9d7e3f3340ed0e6214f593610f51 
 | 436 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/111/A111736.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/111/A111736.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/111/A111736.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A111736: Distance between k*(n-th prime) and next prime, k=4 case.
; 3,1,3,1,3,1,3,3,5,11,3,1,3,1,3,11,3,7,1,9,1,1,5,3,1,5,7,3,3,5,1,17,9,1,3,3,3,1,5,9,3,3,5,1,9,1,9,15,3,3,5,11,3,5,3,9,11,3,1,5,19,9,1,5,7,9,3,13,11,3,11,3,3,1,7,11,3,9,3,1,17,9,9,1,3,5,5,3,3,9,3,15,1,9,1,5,3,3,7
seq $0,40 ; The prime numbers.
mul $0,4
seq $0,308046 ; a(n) = 2*nextprime(n - 1) - 2*n, where nextprime(n) is the smallest prime > n.
div $0,2
add $0,1
 
 | 48.444444 
							 | 212 
							 | 0.58945 
							 | 
					
	09cd40b810024493398949f7e389bc052e4395bb 
 | 2,218 
							 | 
	asm 
 | 
	Assembly 
 | 
	Examples/ch14/DiskSpc.asm 
 | 
	satadriver/LiunuxOS_t 
 | 
	c6222f04b6e734002cbf1aa366eb62e51f0ebbe5 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	Examples/ch14/DiskSpc.asm 
 | 
	satadriver/LiunuxOS_t 
 | 
	c6222f04b6e734002cbf1aa366eb62e51f0ebbe5 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	Examples/ch14/DiskSpc.asm 
 | 
	satadriver/LiunuxOS_t 
 | 
	c6222f04b6e734002cbf1aa366eb62e51f0ebbe5 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	TITLE Disk Free Space                             (DiskSpc.asm)
; This program calls INT 21h Function 7303h, to get free space information
; on a FAT-type drive volume. It displays both the volume size and free space.
; Runs under Windows 95/98/Me, but not under Windows NT/2000/XP.
; Last update: 12/11/01
INCLUDE Irvine16.inc
.data
buffer ExtGetDskFreSpcStruc <>
driveName BYTE "C:\",0
str1 BYTE "Volume size (KB): ",0
str2 BYTE "Free space (KB):  ",0
str3 BYTE "Function call failed.",0dh,0ah,0
.code
main PROC
	mov ax,@data
	mov ds,ax
	mov es,ax
	mov  buffer.Level,0		; must be zero
	mov  di, OFFSET buffer		; ES:DI points to buffer
	mov  cx, SIZEOF buffer		; buffer size
	mov  dx, OFFSET DriveName	; ptr to drive name
	mov  ax, 7303h			; Get disk free space
	int  21h
	jc   error			; Failed if CF = 1
	mov  dx,OFFSET str1		; volume size
	call WriteString
	call CalcVolumeSize
	call WriteDec
	call Crlf
	mov  dx,OFFSET str2		; free space
	call WriteString
	call CalcVolumeFree
	call WriteDec
	call Crlf
	jmp  quit
error:
	mov  dx,OFFSET str3
	call WriteString
quit:
	exit
main ENDP
;-------------------------------------------------------------------
CalcVolumeSize PROC
; Calculate and return the disk volume size, in kilobytes.
; Receives: buffer variable, a ExtGetDskFreSpcStruc structure
; Returns:  EAX = volume size
; Remarks:  (SectorsPerCluster * 512 * TotalClusters) / 1024
;--------------------------------------------------------------------
	mov eax,buffer.SectorsPerCluster
	shl eax,9			; mult by 512
	mul buffer.TotalClusters
	mov ebx,1024
	div ebx				; return kilobytes
	ret
CalcVolumeSize ENDP
;-------------------------------------------------------------------
CalcVolumeFree PROC
; Calculate and return the number of available kilobytes on the
;           given volume.
; Receives: buffer variable, a ExtGetDskFreSpcStruc structure
; Returns:  EAX = available space, in kilobytes
; Remarks:  (SectorsPerCluster * 512 * AvailableClusters) / 1024
;--------------------------------------------------------------------
	mov eax,buffer.SectorsPerCluster
	shl eax,9			; mult by 512
	mul buffer.AvailableClusters
	mov ebx,1024
	div ebx				; return kilobytes
	ret
CalcVolumeFree ENDP
END main 
 | 27.04878 
							 | 78 
							 | 0.63706 
							 | 
					
	2d0b11b037c683719cff5e1ce73d065439e9ec1b 
 | 260 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/226/A226276.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/226/A226276.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/226/A226276.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A226276: Period 4: repeat [8, 4, 4, 4].
; 8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4,8,4,4,4
mod $0,4
pow $1,$0
mul $1,4
add $1,4
mov $0,$1
 
 | 28.888889 
							 | 169 
							 | 0.511538 
							 | 
					
	030048f833863aeaeadeb2eb6aa474993eb83d4b 
 | 1,181 
							 | 
	asm 
 | 
	Assembly 
 | 
	asm/dos_infinite_magical_tickets.asm 
 | 
	Nauglamir-dev/DSVEdit 
 | 
	b772b175e7bb3f1e1ad340c00311cc164ee01346 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	asm/dos_infinite_magical_tickets.asm 
 | 
	Nauglamir-dev/DSVEdit 
 | 
	b772b175e7bb3f1e1ad340c00311cc164ee01346 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	asm/dos_infinite_magical_tickets.asm 
 | 
	Nauglamir-dev/DSVEdit 
 | 
	b772b175e7bb3f1e1ad340c00311cc164ee01346 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	.nds
.relativeinclude on
.erroronwarning on
@Overlay41Start equ 0x02308920
@FreeSpace equ @Overlay41Start + 0x7C
.open "ftc/overlay9_0", 0219E3E0h
; This patch should be applied after "dos_magical_ticket.asm".
; When starting a new game, give the player a Magical Ticket.
; There's not enough space so we overwrite the code where it checks if you already have a potion and skips giving you another three (for new game+).
.org 0x021F61D4
  ; Potions
  mov r2, 3h
  bl 021E78F0h ; SetOwnedItemNum
  ; Magical Ticket
  mov r0, 2h
  mov r1, 2Bh
  bl 021E7870h ; GiveItem
  b 021F61F0h
.close
.open "ftc/overlay9_41", @Overlay41Start
; Don't consume magical tickets on use.
.org @FreeSpace
  mov r0, 42h ; This is the SFX that will be played on use.
  b 0x021EF264 ; Return to the consumable code after the part where it would remove the item from your inventory.
; Change the global flags checked to not care that the game hasn't been saved once yet (bit 0x40000000). In its place we check the bit that makes soul drops have a 100% drop chance (bit 0x10000000), so that the player can't use magical tickets during the prologue.
.org @FreeSpace+0x08
  mov r1, 90000007h
.close
 
 | 31.078947 
							 | 264 
							 | 0.755292 
							 | 
					
	c4c9241ad570bc0af5c7a7e8048752527437bd7c 
 | 223 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/fopen.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/fopen.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/fopen.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	
; FILE *fopen(const char *filename, const char *mode)
SECTION code_clib
SECTION code_stdio
PUBLIC _fopen
EXTERN asm_fopen
_fopen:
   pop af
   pop hl
   pop de
   
   push de
   push hl
   push af
   
   jp asm_fopen
 
 | 10.136364 
							 | 53 
							 | 0.668161 
							 | 
					
	5965f6d6f76a0124a998dd2ea928f615ee8c9ac6 
 | 318 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/004/A004171.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/004/A004171.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/004/A004171.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A004171: a(n) = 2^(2n+1).
; 2,8,32,128,512,2048,8192,32768,131072,524288,2097152,8388608,33554432,134217728,536870912,2147483648,8589934592,34359738368,137438953472,549755813888,2199023255552,8796093022208,35184372088832,140737488355328,562949953421312,2251799813685248,9007199254740992
mov $1,4
pow $1,$0
mul $1,2
 
 | 45.428571 
							 | 260 
							 | 0.81761 
							 | 
					
	94a691667e70e3c017bf9f09b8b22f73e48efa31 
 | 499 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/327/A327672.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/327/A327672.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/327/A327672.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A327672: a(n) = Sum_{k=0..n} ceiling(sqrt(k)).
; 0,1,3,5,7,10,13,16,19,22,26,30,34,38,42,46,50,55,60,65,70,75,80,85,90,95,101,107,113,119,125,131,137,143,149,155,161,168,175,182,189,196,203,210,217,224,231,238,245,252,260,268,276,284,292,300,308,316,324,332,340,348,356,364,372,381,390,399,408,417,426,435,444,453,462,471,480,489,498,507,516,525,535,545,555,565,575,585,595,605,615,625,635,645,655,665,675,685,695,705
lpb $0
  add $1,$0
  add $2,2
  sub $0,$2
  add $0,2
  trn $0,1
lpe
mov $0,$1
 
 | 41.583333 
							 | 370 
							 | 0.669339 
							 | 
					
	e97650bde6e914cc4fb343cb9ba8a5cdbe471078 
 | 312 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/268/A268315.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/268/A268315.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/268/A268315.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A268315: Decimal expansion of 256/27.
; 9,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8,1,4,8
mul $0,2
add $0,1
sub $1,$0
mul $0,2
div $1,3
add $1,$0
mod $1,$0
add $1,9
mod $1,10
mov $0,$1
 
 | 22.285714 
							 | 175 
							 | 0.538462 
							 | 
					
	c5a9e3e7571fac909dfdfa12a1c082621c494071 
 | 104 
							 | 
	asm 
 | 
	Assembly 
 | 
	SE-2/MIL/3_tsr-div0/div0.asm 
 | 
	Adityajn/College-Codes 
 | 
	f40e1eee53b951f2101981230fc72201081fd5f7 
 | 
	[
  "Unlicense"
]  | 1 
							 | 
	2017-02-22T18:22:39.000Z 
 | 
	2017-02-22T18:22:39.000Z 
 | 
	SE-2/MIL/3_tsr-div0/div0.asm 
 | 
	Adityajn/College-Codes 
 | 
	f40e1eee53b951f2101981230fc72201081fd5f7 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	SE-2/MIL/3_tsr-div0/div0.asm 
 | 
	Adityajn/College-Codes 
 | 
	f40e1eee53b951f2101981230fc72201081fd5f7 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	.MODEL TINY
.CODE
ORG 100H
BEGIN:
	MOV AX,10H
	MOV BX,0H
	DIV BX
MOV AH,4CH
INT 21H
END BEGIN 
 | 9.454545 
							 | 12 
							 | 0.644231 
							 | 
					
	1c3f24908badb2840a5eaae01bfc96e60db37013 
 | 309 
							 | 
	asm 
 | 
	Assembly 
 | 
	test/link/group1/seg1b.asm 
 | 
	nigelperks/BasicAssembler 
 | 
	13dcc861254fa6c19f1d450682b4495bbebcf934 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	test/link/group1/seg1b.asm 
 | 
	nigelperks/BasicAssembler 
 | 
	13dcc861254fa6c19f1d450682b4495bbebcf934 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	test/link/group1/seg1b.asm 
 | 
	nigelperks/BasicAssembler 
 | 
	13dcc861254fa6c19f1d450682b4495bbebcf934 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	; Do private segments in distinct modules in groups of same name
; get relocated to beginning of one combined group?
; That is, are groups public?
	IDEAL
	ASSUME CS:SEG1, DS:SEG1, ES:SEG1, SS:SEG1
	SEGMENT SEG1 PRIVATE
sword:
	DW	0DEADh
	DW	0FACEh
	jmp	sword
	jmp	near cs:100h
	ENDS
	GROUP	MYGROUP SEG1
	END
 
 | 19.3125 
							 | 64 
							 | 0.750809 
							 | 
					
	c90e3b2b0619517107b6562fef517d265d9ec760 
 | 3,797 
							 | 
	asm 
 | 
	Assembly 
 | 
	ble_tx.asm 
 | 
	liuyichen12/BLE-Backscattering-Tag 
 | 
	a1072e9ddf13a14648ac5300ac238fb43c1866a4 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2022-03-25T15:19:53.000Z 
 | 
	2022-03-25T15:19:53.000Z 
 | 
	ble_tx.asm 
 | 
	liuyichen12/BLE-Backscattering-Tag 
 | 
	a1072e9ddf13a14648ac5300ac238fb43c1866a4 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	ble_tx.asm 
 | 
	liuyichen12/BLE-Backscattering-Tag 
 | 
	a1072e9ddf13a14648ac5300ac238fb43c1866a4 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	
; *****************************************************************************
; File:     ble_tx.asm
; Date:
;
; *****************************************************************************
    .cdecls C, LIST, "blebs_base.h"
    .include "NOPdefs.asm"
    .def sendBLEPacket
    .def TA_sendBLEPacket
R_TxDelay   .set    R9
R_bitout    .set    R10
R_prevState .set    R11
R_currBit	.set    R12
R_currByte	.set	R13
R_dataPtr 	.set	R14
R_byteCt    .set  	R15
sendBLEPacket:
    ;setup ble_tx register
    MOV	      &(ptr_blePacket), R_dataPtr
    MOV.B     &(len_blePacket), R_byteCt
    MOV.B     #BIT7,  R_bitout            ;data in P1.7, LSB
    ;turn on oscillator
    BIS       #BIT6,  &(P1OUT)
    BIS       #BIT5,  &(P1OUT)
    BIS       #BIT0,  &(P3OUT)
	MOV		  #TX_DELAY2,  R_TxDelay
	MOV.B     &(P1OUT),  R_prevState
    AND       #0x7F, R_prevState
    ;MOV      #0 , R_prevState
	;JMP       LoadByte
TxWakeupDelay:
	NOP								 ;[1]
	DEC		  R_TxDelay 			 ;[1]
	JNZ		  TxWakeupDelay			 ;[2]
TimingCompensate:
    JMP       LoadByte               ;[1.5]
LoadByte:
    MOV.B     @R_dataPtr+, R_currByte;[2]
SendByte:
    ;b0
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b1
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b2
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b3
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b4
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b5
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b6
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    RLA       R_currByte             ;[1]
    NOPx6                            ;[6]
    ;b7
    MOV.B     R_bitout,   R_currBit  ;[1]
    AND       R_currByte, R_currBit  ;[1]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    DEC       R_byteCt               ;[1]
    NOP
    NOP
    JNZ       LoadByte       ;[1.5]
TxTurnOff:
    NOPx3                            ;[3]
    MOV.B     #0,         R_currBit  ;[2]
    BIS       R_prevState,R_currBit  ;[1]
    MOV.B     R_currBit,  &(P1OUT)   ;[4]
    MOV		  #TX_DELAY,  R_TxDelay  ;
TxTurnOffDelay:
	NOP								 ;[1]
	DEC		  R_TxDelay  			 ;[1]
	JNZ		  TxTurnOffDelay		 ;[2]
	BIC       #BIT5,      &(P1OUT)   ;
	BIC       #BIT0,  &(P3OUT)
	BIC       #BIT6,      &(P1OUT)   ;
    RETA
 
 | 27.514493 
							 | 80 
							 | 0.429813 
							 | 
					
	e4e556fd4b3ced4640fba1ca77b292eb5ad49008 
 | 330 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/287/A287533.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/287/A287533.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/287/A287533.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A287533: Fibonacci numbers modulo 20.
; 0,1,1,2,3,5,8,13,1,14,15,9,4,13,17,10,7,17,4,1,5,6,11,17,8,5,13,18,11,9,0,9,9,18,7,5,12,17,9,6,15,1,16,17,13,10,3,13,16,9,5,14,19,13,12,5,17,2,19,1,0,1,1,2,3,5,8,13,1,14,15,9,4,13,17,10,7,17,4,1
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
mod $0,20
 
 | 55 
							 | 196 
							 | 0.590909 
							 | 
					
	b99ccb753bafee78b5337329be2824d30f731f86 
 | 392 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/stdio/ansi/generic/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/stdio/ansi/generic/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/stdio/ansi/generic/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	;
; 	ANSI Video handling
;	Non optimized (but generic) code
;
; 	CLS - Clear the screen
;	
;
;	Stefano Bodrato - 2014
;
;
;	$Id: f_ansi_cls.asm,v 1.4 2016-06-12 16:06:42 dom Exp $
;
        SECTION code_clib
	PUBLIC	ansi_cls
	EXTERN		ansi_del_line
	EXTERN	__console_h
.ansi_cls
	ld a,(__console_h)
	ld b,a
.clsloop
	push bc
	ld	a,b
	dec a
	call	ansi_del_line
	pop bc
	djnz clsloop
	ret
 
 | 11.529412 
							 | 57 
							 | 0.67602 
							 | 
					
	6a06522bb3e9f154b0dd8fb5ff560e685eaa5670 
 | 16,652 
							 | 
	asm 
 | 
	Assembly 
 | 
	C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/unpack32.asm 
 | 
	HeroSizy/Sizy 
 | 
	89bc29940dc7666591259730b5112efd0a626043 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/unpack32.asm 
 | 
	HeroSizy/Sizy 
 | 
	89bc29940dc7666591259730b5112efd0a626043 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/unpack32.asm 
 | 
	HeroSizy/Sizy 
 | 
	89bc29940dc7666591259730b5112efd0a626043 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	;***********************************************************
; Version 2.40.00                                           
;***********************************************************
; Function UNPACK32
; Processor:   C55xx
; Decription: Unpacks the output of a Radix-2 DIF complex FFT using bit-reversed input 
;    data and bit-reversed twiddle table (length N/2, cosine/sine format).
;
; Usage:  void unpack(DATA *xy, ushort nx);
;
; Copyright Texas instruments Inc, 2000
; History;
;	- 11/20/2003	C. Iovescu initial implementation
;
;************************************************************************************
;
;  DFT of N-point real-valued sequence
;
; Implementation of the rfft based on the equations:
;
;   
;
;  g(n) n=0:N-1 is a real valued sequence. Purpose of the code
;  is to compute the RFFT of this signal: G(k) k=0:N-1 complex sequence. 
;
;  g(n) is split in two real sequences, odd and even part
;    
;          xe(n) = g(2n)    n=0:N/2-1
;          xo(n) = g(2n+1)  n=0:N/2-1
;
;  Form the complex sequence:
;
;         x(n) = xe(n) + jxo(n)  n=0:N/2-1
;
;  Compute the CFFT of x(n):
;
;        X(k) k=0:N/2-1
;
;  Derive from X(k) the CFFT of xe(n) and xo(n) using the equations
;
;       Xe(k) =  0.5  (X(k) + X*(N/2-k))   k=0:N/2-1  (1)
;       Xo(k) = -0.5j (X(k) - X*(N/2-k))   k=0:N/2-1  (2)
;
;  Separate in Real and Imag parts: 
;
;   Define: 
;            Xe(k) =  Xer(k)+jXei(k)
;            Xo(k) =  Xor(k)+jXoi(k)
;
;   Equations (1) and (2) yield:
;
;       Xer(k) =  0.5  (Xr(k) + Xr(N/2-k))   k=0:N/2-1  (3)
;       Xei(k) =  0.5  (Xi(k) - Xi(N/2-k))   k=0:N/2-1  (4)
;       Xor(k) =  0.5  (Xi(k) + Xi(N/2-k))   k=0:N/2-1  (5)
;       Xoi(k) = -0.5  (Xr(k) - Xr(N/2-k))   k=0:N/2-1  (6)
;
;   The previous equations have special values for:
;
;   DC Offset: 
;             k=0     Xer(0)= Xr(0)
;                     Xei(0)= 0
;                     Xor(0)= Xi(0)
;                     Xoi(0)= 0
;
;
;   Nyquist Frequency:
;             k=N/4   Xer(N/4)= Xr(N/4)
;                     Xei(N/4)= 0
;                     Xor(N/4)= Xi(N/4)
;                     Xoi(N/4)= 0
;
;
;    Computing G(k)
;
;    G(k)   = Xe(k) + W(k,N)Xo(k)     k = 0:N/2-1   (7)
;    G(N/2-k) = Xe*(k) - W(-k,N)Xo*(k)  k = 0:N/2-1   (8)
;
;  Separate in Real and Imag parts: 
;
;   Define: 
;            G(k) =  Gr(k)+jGi(k)
;            G(N-k) =  Gr(N-k)+jGi(N-k)
;            W(k,N) = cos(2Pik/N)-jsin(2Pik/N) = Wr(k)-jWi(k)
;
;   Equations (7) and (8) yield:
;
;          Gr(k)     = Xer(k) + Wr(k)Xor(k)+Wi(k)Xoi(k)   (9)
;          Gi(k)     = Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)   (10)
;          Gr(N/2-k) = Xer(k) - Wr(k)Xor(k)-Wi(k)Xoi(k)   (11)
;          Gi(N/2-k) =-Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)   (12)
;
;
;  Equations (9) through (12) will be DIVIDED BY TWO in order to avoid
;  overflow.
;
;          Gr(k)     = 0.5[Xer(k) + Wr(k)Xor(k)+Wi(k)Xoi(k)]   (13)
;          Gi(k)     = 0.5[Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]   (14)
;          Gr(N/2-k) = 0.5[Xer(k) - Wr(k)Xor(k)-Wi(k)Xoi(k)]   (15)
;          Gi(N/2-k) =0.5[-Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]   (16)
;
;  Special values:
;        
;     * DC Offset  k = 0                                    (17)
;
;           Gr(0) = 0.5 (Xr(0)+Xi(0)) 
;           Gi(0) = 0
;
;     * k = N/4                                             (18)
;
;           Gr(N/4) = 0.5 Xr(N/4) 
;           Gi(N/4) =-0.5 Xi(N/4)
;
;     * Nyquist Frequency  k = N/2                          (19)
;
;           Gr(N/2) = 0.5 (Xr(0)-Xi(0)) 
;           Gi(N/2) = 0
;
;
;  Practical computation of G(k) k=0:N-1
;      
;      1) Compute G(k) k=0:N/2
;             - G(0),G(N/4), G(N/2) based on special values formulae
;             - G(k) for   (0<k<N/2)
;      2) Deduct G(k) k=N/2+1:N-1 from the values computed in 1) using
;      the complex conjugate symmetry formulae (since g(n) is a real
;      sequence) 
;                   
;              G(k) = G*(N-k)  k=0:N-1
;
;  Algorithm implementation:
;    
;
;     The algorithm computes only G(k) k=0:N/2. In order to store the
;     result in the input array, G(0) and G(N/2) which have zero imag parts are
;     packed together and Gr(N/2) is stored at the location of Gi(0).
;
;        1) Compute Xer(k), Xei(k), Xor(k), Xoi(k) for k=1:N/4-1
;               ( k=0 and k=N/4 are special values)
;
;  
;
;
;****************************************************************
                .mmregs
                .cpl_on
                .arms_off
                .ref twiddle32
;//-----------------------------------------------------------------------------
;// Program section
;//-----------------------------------------------------------------------------
                .sect ".text:unpack32"
                .global _unpack32
_unpack32:
;//-----------------------------------------------------------------------------
;// Context save / get arguments
;//-----------------------------------------------------------------------------
  
; upon entry stack aligned on 32-bit boundary
  
      PSH	mmap(ST0_55)
      PSH	mmap(ST1_55)
      PSH	mmap(ST2_55)  
      PSH	mmap(ST3_55)
      AADD        #-21,SP             ; create local frame
	  
	  
;//-----------------------------------------------------------------------------
;// Initialization code
;//-----------------------------------------------------------------------------
Initialize:
            AND         #0FF00h,mmap(ST2_55)    ; linear addr for CDP,AR2,AR3,AR0, AR1
            BSET        #6,ST1_55               ; set FRCT
            BSET        #8,ST1_55               ; set SXMD
            ; SATD = 0 required for 32-bit multiplication
            BCLR        #9,ST1_55               ; set SATD
           
            BCLR        #15,ST2_55              ; reset ARMS
            BCLR        #10,ST1_55              ; reset M40
;//-----------------------------------------------------------------------------
;// Unpack for RFFT
;//
;//  T0 = N (Rfft size) 
;//
;//
;//
;//-----------------------------------------------------------------------------
            MOV         XAR0,XAR1               ; AR0 = start ptr input data = Xr[0]
            ADD         T0,AR1                  ; AR1 = end ptr input data 
            ADD         T0,AR1                  ; 32-bit data 
            MOV         T0,T1                   ; T1 = T0 = RFFT size/2
            SFTS        T1,#-1                  ; T1 = RFFT size/2 
            SFTS        T1,#-1                  ; T1 = RFFT size/4 (req. for loop)
            SUB         #4,AR1                  ; AR1 = Xr[N/2-1] - last 32-bit elt
            SUB         #2,T1                   ; loop = N/4 - 2
            MOV         T1,BRC0                 ; and store in repeat counter
            AMOV        #twiddle32,XAR2         ; pointer to sin and cos tables
            AMOV        #(twiddle32+2),XAR3     ; 32-bit values (add 2)
            AMAR        *(AR2+T0B)              ; set to 2nd entry of bit reversed
            AMAR        *(AR3+T0B)              ; sin/cos table 
												; T0 = RFFT size for bitrev because 32-bit values
			MOV         XSP,XAR4   				; XAR4 local var ptr (stack)
			ADD	        #4, AR4
;--------------------------------------------------------------------------------
; Step1: 
;  Special values G(0) and G(N/2):
;        
;     * DC Offset  k = 0                                    
;
;           Gr(0) = 0.5 (Xr(0)+Xi(0)) 
;           Gi(0) = 0
;
;
;     * Nyquist Frequency  k = N/2                          
;
;           Gr(N/2) = 0.5 (Xr(0)-Xi(0)) 
;           Gi(N/2) = 0
;
;     In order to store G(k) in the input array, Gr(0) and Gr(N/2) 
;     are packed as real&imag values.
;
;--------------------------------------------------------------------------------
            MOV         dbl(*AR0+),AC1           ; AC1 = Xr[0]
            ADD         dbl(*AR0),AC1,AC0        ; AC0 = Xr[0] + Xi[0]          										             
            SUB         dbl(*AR0-),AC1,AC1     	 ; AC1 = Xr[0] - Xi[0]
       
            SFTS		AC0, #-1				 ; 0.5x
            SFTS		AC1, #-1				 ; 0.5x
                      
            MOV			AC0, dbl(*AR0+)          ; Gr(0)
            MOV			AC1, dbl(*AR0+)          ; Gr(N/2)
;--------------------------------------------------------------------------------
; Step 2: 
;
; General loop G(k) k=1:N/2-1  (k<>N/4)
;
;    Xer(k) =  0.5  (Xr(k) + Xr(N/2-k))  k=1:N/4-1  
;    Xei(k) =  0.5  (Xi(k) - Xi(N/2-k))  k=1:N/4-1 
;    Xor(k) =  0.5  (Xi(k) + Xi(N/2-k))  k=1:N/4-1  
;    Xoi(k) = -0.5  (Xr(k) - Xr(N/2-k))  k=1:N/4-1  
;
;--------------------------------------------------------------------------------
            RPTB        unpack_end              ; setup loopcounter (RFFT-size)/4 - 2
            MOV         dbl(*AR1+),AC1          ; AC1= Xr[N/2-k]           								 	
            ADD         dbl(*AR0),AC1,AC0       ; Xer = AC0 =   Xr[k] + Xr[N/2-k]  
    		SUB         dbl(*AR0+),AC1,AC3      ; Xoi = AC3 = -(Xr[k] - Xr[N/2-k])
    		
            MOV         dbl(*AR0-),AC2          ; AC2 = Xi[k]                 
            SUB			dbl(*AR1), AC2, AC1	    ; Xei = AC1 =  Xi[k] - Xi[N/2-k]             
            ADD         dbl(*AR1-),AC2,AC2      ; Xor = AC2 =  Xi[k] + Xi[N/2-k]
            SFTS        AC0,#-1                 ; Xer = 0.5*AC0
            SFTS        AC1,#-1                 ; Xei = 0.5*AC1 
            SFTS        AC2,#-1                 ; Xor = 0.5*AC2
            SFTS        AC3,#-1                 ; Xoi = 0.5*AC3
                                             
            MOV         AC0 ,dbl(*SP(#00h))     ; save Xer
            MOV         AC1 ,dbl(*SP(#02h))     ; save Xei            
            MOV         AC2 ,dbl(*SP(#04h))     ; save Xor
            MOV         AC3 ,dbl(*SP(#06h))     ; save Xoi
            
;-----------------------------------------------------------------------
;
;   Output N-point RFFT
;
;    Gr(k)     = 0.5[ Xer(k) + Wr(k)Xor(k)+Wi(k)Xoi(k)]   
;    Gi(k)     = 0.5[ Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]   
;    Gr(N/2-k) = 0.5[ Xer(k) - Wr(k)Xor(k)-Wi(k)Xoi(k)]   
;    Gi(N/2-k) = 0.5[-Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]  
;
;    Wr(k)     = cos(2Pik/N)
;    Wi(k)     = sin(2Pik/N)
;
;--------------------------------------------------------------------------------
             ; Wr(k)Xor(k)
			
			 ;  AR2 -> cos_H
			 ;		   cos_L
			 ; 
			 ;  AR4 -> Xor_H
			 ;	       Xor_L
			 ;
			 
             AMAR *AR2+
             MPYM uns(*AR2-), *AR4+, AC0	    ; AC0 = cos_L*Xor_H
             MACM *AR2, uns(*AR4-), AC0		    ; AC0 = AC0 + cos_H*Xor_L
             MACM *AR2+, *AR4, AC0 >> #16, AC0	; AC0 = AC0>>16 + cos_H*Xor_H 
             MOV  AC0 ,dbl(*SP(#08h))           ; save cos*Xor
             
             ; Wi(k)Xor(k)
			
			 ;  AR3 -> sin_H
			 ;	       sin_L
			 ; 
			 ;  AR4 -> Xor_H
			 ;	       Xor_L
			 ;
			 
			 AMAR *AR3+
             MPYM uns(*AR3-), *AR4+, AC0	    ; AC0 = sin_L*Xor_H
             MACM *AR3, uns(*AR4-), AC0		    ; AC0 = AC0 + sin_H*Xor_L
             MACM *AR3+, *AR4+, AC0 >> #16, AC0	; AC0 = AC0>>16 + sin_H*Xor_H 
             MOV  AC0 ,dbl(*SP(#0Ah))           ; save sin*Xor
			 AMAR *AR4+
			 
			 
             ; Wr(k)Xoi(k)
			
			 ;         cos_H
			 ;	AR2 -> cos_L
			 ; 
			 ;  AR4 -> Xoi_H
			 ;	       Xoi_L
			 ;
			 
			 
             MPYM uns(*AR2-), *AR4+, AC0	    ; AC0 = cos_L*Xoi_H
             MACM *AR2, uns(*AR4-), AC0		    ; AC0 = AC0 + cos_H*Xoi_L
             MACM *AR2, *AR4, AC0 >> #16, AC0	; AC0 = AC0>>16 + cos_H*Xoi_H 
             MOV  AC0 ,dbl(*SP(#0Ch))           ; save cos*Xoi
             
             			 			 
   
             ; Wi(k)Xoi(k)
			
			 ;         sin_H
			 ;	AR3 -> sin_L
			 ; 
			 ;  AR4 -> Xoi_H
			 ;	       Xoi_L
			 ;
			 
			 
            
             MPYM uns(*AR3-), *AR4+, AC0	    ; AC0 = sin_L*Xoi_H
             MACM *AR3, uns(*AR4-), AC0		    ; AC0 = AC0 + sin_H*Xoi_L
             MACM *AR3, *AR4, AC0 >> #16, AC0	; AC0 = AC0>>16 + sin_H*Xoi_H 
             MOV  AC0 ,dbl(*SP(#0Eh))           ; save sin*Xoi
       		             
          
          
          	; update AR4, local var pointer for next loop iteration 
          	SUB	        #2, AR4
            
            ; update the sin/cos pointers
            ; bit-reversed addressing used because twiddle table 
            ; is in bit-reversed format and normal format is needed
            ; in this algorithm.
            
         ;   !!!this requires special alignement of twiddle table ??
         	 ;  AR2 -> cos_H
			 ;	       cos_L         
         	 ;  AR3 -> sin_H
			 ;	       sin_L
         
         
            AMAR 	*(AR3+T0B)		; sin
            AMAR 	*(AR2+T0B)      ; cos
                
            
            
;    Gr(k)     = 0.5[ Xer(k) + Wr(k)Xor(k)+Wi(k)Xoi(k)]            
                                                                                                  
            MOV         dbl(*SP(#00h)),AC0       ; AC0 = Xer(k)           								 	 
            ADD         dbl(*SP(#08h)),AC0,AC1   ; AC1 = Xer(k)+Wr(k)Xor(k)          										             
            ADD         dbl(*SP(#0Eh)),AC1,AC1   ; AC1 = Xer(k)+Wr(k)Xor(k)+Wi(k)Xoi(k)
            SFTS		AC1, #-1				 ; 0.5x
            MOV 		AC1, dbl(*AR0+)          ; Gr(k)
                                                                                                                   
;    Gi(k)     = 0.5[ Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]                                                                                                                                                            
            
            MOV         dbl(*SP(#02h)),AC1       ; AC1 = Xei(k) 
            ADD         dbl(*SP(#0Ch)),AC1,AC2   ; AC2 = Xei(k)+ Wr(k)Xoi(k)  
            SUB         dbl(*SP(#0Ah)),AC2,AC2   ; AC2 = Xei(k)+ Wr(k)Xoi(k)-Wi(k)Xor(k)  
            SFTS		AC2, #-1				 ; 0.5x    
            MOV 		AC2, dbl(*AR0+)			 ; Gi(k)
                 
            
;    Gr(N/2-k) = 0.5[ Xer(k) - Wr(k)Xor(k)-Wi(k)Xoi(k)]                
             
            MOV         dbl(*SP(#00h)),AC1       ; AC1 = Xer(k) 
            SUB         dbl(*SP(#08h)),AC1,AC2   ; AC2 = Xer(k)- Wr(k)Xor(k)  
            SUB         dbl(*SP(#0Eh)),AC2,AC2   ; AC2 = Xer(k)- Wr(k)Xor(k)-Wi(k)Xoi(k)  
            SFTS		AC2, #-1				 ; 0.5x    
            MOV 		AC2, dbl(*AR1+)			 ; Gr(N/2-k)            
             
;    Gi(N/2-k) = 0.5[-Xei(k) + Wr(k)Xoi(k)-Wi(k)Xor(k)]                
             
            MOV         dbl(*SP(#0Ch)),AC1       ; AC1 = Wr(k)Xoi(k) 
            SUB         dbl(*SP(#02h)),AC1,AC2   ; AC2 = -Xei(k)+ Wr(k)Xoi(k)  
            SUB         dbl(*SP(#0Ah)),AC2,AC2   ; AC2 = -Xei(k)+ Wr(k)Xoi(k)-Wi(k)Xor(k)  
            SFTS		AC2, #-1				 ; 0.5x    
            MOV 		AC2, dbl(*AR1)			 ; Gi(N/2-k)             
 
unpack_end: SUB         #6,AR1                   ; adjust to Gr(N/2-k-1)          
                        
;--------------------------------------------------------------------------------
; Step3: 
;  Special values G(N/4):
;
;           Gr(N/4) = 0.5 Xr(N/4) 
;           Gi(N/4) =-0.5 Xi(N/4)
;
;//-----------------------------------------------------------------------------
            MOV         dbl(*AR0+),AC0		; Xr(N/4)
            MOV         dbl(*AR0-) ,AC1		; Xi(N/4)          
            NEG         AC1,AC1				;-Xi(N/4)
            SFTS        AC0,#-1,AC0 		; 0.5*Xr(N/4)           
            SFTS        AC1,#-1,AC1  		;-0.5*Xi(N/4)          
            MOV         AC0 ,dbl(*AR0+)		;Gr(N/4) = 0.5 Xr(N/4)
    		MOV         AC1 ,dbl(*AR0+)		;Gi(N/4) =-0.5 Xi(N/4)        
                      
            
;//-----------------------------------------------------------------------------
;// Context restore
;//-----------------------------------------------------------------------------
            AADD        #21,SP                  ; destroy local frame
;//-----------------------------------------------------------------------------
;// Return
;//-----------------------------------------------------------------------------
      POP	mmap(ST3_55)
      POP	mmap(ST2_55)
      POP	mmap(ST1_55)
      POP	mmap(ST0_55)
            RET
        .end
 
 | 37.08686 
							 | 212 
							 | 0.320982 
							 | 
					
	8a4a5f4eceef1c5be0985bd63d2023c75bba18de 
 | 445 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/046/A046951.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/046/A046951.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/046/A046951.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A046951: a(n) is the number of squares dividing n.
; 1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,3,1,2,1,2,1,1,1,2,2,1,2,2,1,1,1,3,1,1,1,4,1,1,1,2,1,1,1,2,2,1,1,3,2,2,1,2,1,2,1,2,1,1,1,2,1,1,2,4,1,1,1,2,1,1,1,4,1,1,2,2,1,1,1,3,3,1,1,2,1,1,1,2,1,2,1,2,1,1,1,3,1,2,2,4
seq $0,57918 ; Number of pairs of numbers (a,b) each less than n where (a,b,n) is in geometric progression.
seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
 
 | 74.166667 
							 | 201 
							 | 0.604494 
							 | 
					
	20884361edb6e545d52b82186802d15d934cabc3 
 | 8,771 
							 | 
	asm 
 | 
	Assembly 
 | 
	Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_2084_255.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_2084_255.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_2084_255.asm 
 | 
	ljhsiun2/medusa 
 | 
	67d769b8a2fb42c538f10287abaf0e6dbb463f0c 
 | 
	[
  "MIT"
]  | 3 
							 | 
	2020-07-14T17:07:07.000Z 
 | 
	2022-03-21T01:12:22.000Z 
 | 
	.global s_prepare_buffers
s_prepare_buffers:
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x2280, %rsi
lea addresses_UC_ht+0xcf82, %rdi
xor $64083, %rbp
mov $82, %rcx
rep movsw
cmp $41437, %r15
lea addresses_normal_ht+0x1cf80, %r8
nop
nop
nop
nop
inc %rdx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%r8)
sub %rdi, %rdi
lea addresses_WC_ht+0xba80, %rbp
nop
nop
and %r8, %r8
mov $0x6162636465666768, %rdi
movq %rdi, %xmm1
movups %xmm1, (%rbp)
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_A_ht+0xde80, %rsi
lea addresses_A_ht+0x530, %rdi
nop
nop
nop
nop
inc %rax
mov $70, %rcx
rep movsw
nop
nop
nop
sub %r15, %r15
lea addresses_UC_ht+0x9280, %rcx
clflush (%rcx)
dec %rax
mov $0x6162636465666768, %r15
movq %r15, (%rcx)
nop
nop
nop
cmp $27112, %rcx
lea addresses_WC_ht+0x16e12, %rsi
lea addresses_WT_ht+0x767b, %rdi
nop
add %rax, %rax
mov $116, %rcx
rep movsw
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x1e5c0, %rsi
nop
nop
nop
nop
nop
xor $13952, %rax
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
movups %xmm1, (%rsi)
nop
nop
nop
nop
nop
xor $37673, %rdi
lea addresses_UC_ht+0xc7b0, %rdi
nop
nop
nop
and $5726, %rcx
mov $0x6162636465666768, %rax
movq %rax, %xmm7
movups %xmm7, (%rdi)
nop
nop
nop
and $46086, %rdi
lea addresses_A_ht+0x155a8, %rdx
nop
nop
sub %rbp, %rbp
movw $0x6162, (%rdx)
nop
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0xa840, %rbp
cmp %rcx, %rcx
movl $0x61626364, (%rbp)
nop
nop
nop
nop
nop
inc %rdi
lea addresses_A_ht+0x14c0, %rdx
nop
nop
nop
cmp $65252, %rsi
vmovups (%rdx), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r15
nop
sub %rcx, %rcx
lea addresses_A_ht+0x109c0, %rbp
nop
sub $41607, %rax
movb (%rbp), %dl
nop
add $34841, %rsi
lea addresses_A_ht+0x1dd80, %rsi
lea addresses_WC_ht+0x12a80, %rdi
nop
nop
nop
nop
sub %r15, %r15
mov $26, %rcx
rep movsb
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_WC_ht+0x1b408, %r8
add $60612, %rdi
mov (%r8), %edx
nop
add %rbp, %rbp
lea addresses_D_ht+0x3b50, %rdi
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%rdi), %r15w
nop
nop
nop
xor %r8, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
ret
    .global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %rax
push %rbx
push %rcx
push %rdx
push %rsi
// Store
mov $0x1ed6970000000e80, %r8
cmp $25128, %rcx
mov $0x5152535455565758, %r13
movq %r13, (%r8)
nop
nop
nop
nop
add %rdx, %rdx
// Store
lea addresses_D+0xf080, %rbx
dec %rsi
movw $0x5152, (%rbx)
nop
add %r8, %r8
// Load
lea addresses_US+0x1db20, %r8
clflush (%r8)
sub $9401, %rbx
movb (%r8), %r13b
nop
nop
nop
nop
nop
dec %rsi
// Store
lea addresses_WC+0xb844, %rax
nop
nop
sub %rcx, %rcx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm7
movups %xmm7, (%rax)
nop
nop
dec %r8
// Faulty Load
lea addresses_A+0x1a280, %rdx
xor %rax, %rax
mov (%rdx), %ebx
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'00': 2084}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
 
 | 31.894545 
							 | 2,999 
							 | 0.653745 
							 | 
					
	f9a8b6ca17db12c220c65143f8836db43949b198 
 | 487 
							 | 
	asm 
 | 
	Assembly 
 | 
	workbench/cputest/cputype.asm 
 | 
	thecrazyboy/vector06cc 
 | 
	ba02192cbccaf7fa6763a20c9aa2fd4a1b291023 
 | 
	[
  "BSD-2-Clause"
]  | 21 
							 | 
	2015-04-09T21:05:18.000Z 
 | 
	2022-02-02T17:29:46.000Z 
 | 
	workbench/cputest/cputype.asm 
 | 
	thecrazyboy/vector06cc 
 | 
	ba02192cbccaf7fa6763a20c9aa2fd4a1b291023 
 | 
	[
  "BSD-2-Clause"
]  | null  | null  | null  | 
	workbench/cputest/cputype.asm 
 | 
	thecrazyboy/vector06cc 
 | 
	ba02192cbccaf7fa6763a20c9aa2fd4a1b291023 
 | 
	[
  "BSD-2-Clause"
]  | 7 
							 | 
	2016-05-24T17:47:24.000Z 
 | 
	2022-03-18T14:40:03.000Z 
 | 
			cpu 8080
		org 100h
	
		lxi 	d, hellojpg
		mvi 	c, 9
		call 	5
		call 	cpudetect
		mvi		c, 9
		call 	5
		ret
hellojpg	db	"DETECTING CPU TYPE",0dh,0ah,"THE CPU IS: $"
msg_z80		db	"Z80$"
msg_8080	db	"KP580BM80A$"
msg_vm1		db	"KP580BM1$"
cpudetect:
		lxi		d, msg_z80
		
		xra		a
		dcr		a
		rpo
		
		lxi		h, 0020h
		push	h
		pop		psw
		push	psw
		pop		h
		mvi		a, 20h
		ana		l
		jz		kr580
		lxi		d, msg_vm1
		ret
kr580:	lxi		d, msg_8080
		ret
		
		end
		 
 | 13.527778 
							 | 57 
							 | 0.550308 
							 | 
					
	f239faeee10929855075f2a5c0c295057733b876 
 | 9,748 
							 | 
	asm 
 | 
	Assembly 
 | 
	lib/avx/snow3g_uia2_avx.asm 
 | 
	edtubbs/intel-ipsec-mb 
 | 
	27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f 
 | 
	[
  "BSD-3-Clause"
]  | null  | null  | null  | 
	lib/avx/snow3g_uia2_avx.asm 
 | 
	edtubbs/intel-ipsec-mb 
 | 
	27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f 
 | 
	[
  "BSD-3-Clause"
]  | null  | null  | null  | 
	lib/avx/snow3g_uia2_avx.asm 
 | 
	edtubbs/intel-ipsec-mb 
 | 
	27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f 
 | 
	[
  "BSD-3-Clause"
]  | null  | null  | null  | 
	;;
;; Copyright (c) 2021, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;;     * Redistributions of source code must retain the above copyright notice,
;;       this list of conditions and the following disclaimer.
;;     * Redistributions in binary form must reproduce the above copyright
;;       notice, this list of conditions and the following disclaimer in the
;;       documentation and/or other materials provided with the distribution.
;;     * Neither the name of Intel Corporation nor the names of its contributors
;;       may be used to endorse or promote products derived from this software
;;       without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
%include "include/os.asm"
%include "include/reg_sizes.asm"
%include "include/cet.inc"
%include "include/memcpy.asm"
%include "include/const.inc"
%define APPEND(a,b) a %+ b
%define APPEND3(a,b,c) a %+ b %+ c
%ifdef LINUX
%define arg1 rdi
%define arg2 rsi
%define arg3 rdx
%define arg4 rcx
%else
%define arg1 rcx
%define arg2 rdx
%define arg3 r8
%define arg4 r9
%endif
%define E               rax
%define qword_len       r12
%define offset          r10
%define tmp             r10
%define tmp2            arg4
%define tmp3            r11
%define tmp4            r13
%define tmp5            r14
%define tmp6            r15
%define in_ptr          arg1
%define KS              arg2
%define bit_len         arg3
%define end_offset      tmp3
%define EV              xmm2
%define SNOW3G_CONST    xmm7
%define P1              xmm8
section .data
default rel
align 16
snow3g_constant:
dq      0x000000000000001b, 0x0000000000000000
align 16
bswap64:
dq      0x0001020304050607, 0x08090a0b0c0d0e0f
align 16
clear_hi64:
dq      0xffffffffffffffff, 0x0000000000000000
align 16
clear_low32:
dd      0x00000000, 0xffffffff, 0xffffffff, 0xffffffff
section .text
%ifidn __OUTPUT_FORMAT__, win64
        %define XMM_STORAGE     16*3
        %define GP_STORAGE      8*8
%else
        %define XMM_STORAGE     0
        %define GP_STORAGE      6*8
%endif
%define VARIABLE_OFFSET XMM_STORAGE + GP_STORAGE
%define GP_OFFSET XMM_STORAGE
%macro FUNC_SAVE 0
        mov     r11, rsp
        sub     rsp, VARIABLE_OFFSET
        and     rsp, ~15
%ifidn __OUTPUT_FORMAT__, win64
        ; xmm6:xmm15 need to be maintained for Windows
        vmovdqa [rsp + 0*16], xmm6
        vmovdqa [rsp + 1*16], xmm7
        vmovdqa [rsp + 2*16], xmm8
        mov     [rsp + GP_OFFSET + 48], rdi
        mov     [rsp + GP_OFFSET + 56], rsi
%endif
        mov     [rsp + GP_OFFSET],      r12
        mov     [rsp + GP_OFFSET + 8],  r13
        mov     [rsp + GP_OFFSET + 16], r14
        mov     [rsp + GP_OFFSET + 24], r15
        mov     [rsp + GP_OFFSET + 32], rbx
        mov     [rsp + GP_OFFSET + 40], r11 ;; rsp pointer
%endmacro
%macro FUNC_RESTORE 0
%ifidn __OUTPUT_FORMAT__, win64
        vmovdqa xmm6,  [rsp + 0*16]
        vmovdqa xmm7,  [rsp + 1*16]
        vmovdqa xmm8,  [rsp + 2*16]
        mov     rdi, [rsp + GP_OFFSET + 48]
        mov     rsi, [rsp + GP_OFFSET + 56]
%endif
        mov     r12, [rsp + GP_OFFSET]
        mov     r13, [rsp + GP_OFFSET + 8]
        mov     r14, [rsp + GP_OFFSET + 16]
        mov     r15, [rsp + GP_OFFSET + 24]
        mov     rbx, [rsp + GP_OFFSET + 32]
        mov     rsp, [rsp + GP_OFFSET + 40]
%endmacro
;; Reduce from 128 bits to 64 bits
%macro REDUCE_TO_64 2
%define %%IN_OUT        %1 ;; [in/out]
%define %%XTMP          %2 ;; [clobbered]
        vpclmulqdq      %%XTMP, %%IN_OUT, SNOW3G_CONST, 0x01
        vpxor           %%IN_OUT, %%IN_OUT, %%XTMP
        vpclmulqdq      %%XTMP, %%XTMP, SNOW3G_CONST, 0x01
        vpxor           %%IN_OUT, %%IN_OUT, %%XTMP
%endmacro
;; Multiply 64b x 64b and reduce result to 64 bits
;; Lower 64-bits of xmms are multiplied
%macro MUL_AND_REDUCE_TO_64 2-3
%define %%IN0_OUT       %1 ;; [in/out]
%define %%IN1           %2 ;; [in] Note: clobbered when only 2 args passed
%define %%XTMP          %3 ;; [clobbered]
        vpclmulqdq      %%IN0_OUT, %%IN0_OUT, %%IN1, 0x00
%if %0 == 2
        ;; clobber XTMP1 if 3 args passed, otherwise preserve
        REDUCE_TO_64    %%IN0_OUT, %%IN1
%else
        REDUCE_TO_64    %%IN0_OUT, %%XTMP
%endif
%endmacro
;; uint32_t
;; snow3g_f9_1_buffer_internal_avx(const uint64_t *pBufferIn,
;;                                 const uint32_t KS[5],
;;                                 const uint64_t lengthInBits);
align 16
MKGLOBAL(snow3g_f9_1_buffer_internal_avx,function,internal)
snow3g_f9_1_buffer_internal_avx:
        endbranch64
        FUNC_SAVE
        vmovdqa SNOW3G_CONST, [rel snow3g_constant]
        vpxor   EV, EV
        ;; P = ((uint64_t)KS[0] << 32) | ((uint64_t)KS[1])
        vmovq   P1, [KS]
        vpshufd P1, P1, 1110_0001b
        xor     offset, offset
        mov     qword_len, bit_len ;; lenInBits -> lenInQwords
        shr     qword_len, 6
        je      partial_blk
        mov     end_offset, qword_len
        and     end_offset, 0xfffffffffffffffc  ;; round down to nearest 4 blocks
        cmp     qword_len, 4                    ;; check at least 4 blocks
        jbe     start_single_blk_loop
        vmovdqa xmm1, P1
        MUL_AND_REDUCE_TO_64 xmm1, P1, xmm4     ;; xmm1 = P2
        vmovdqa xmm5, xmm1
        MUL_AND_REDUCE_TO_64 xmm5, P1, xmm4     ;; xmm5 = P3
        vpand   xmm5, xmm5, [rel clear_hi64]
        vmovdqa xmm3, xmm5
        MUL_AND_REDUCE_TO_64 xmm3, P1, xmm4     ;; xmm3 = P4
        vpunpcklqdq xmm0, P1, xmm1              ;; xmm0 = p1p2
        vpunpcklqdq xmm1, xmm5, xmm3            ;; xmm1 = p3p4
start_4_blk_loop:
        vmovdqu         xmm3, [in_ptr + offset * 8]
        vmovdqu         xmm4, [in_ptr + offset * 8 + 16]
        vpshufb         xmm3, xmm3, [rel bswap64]
        vpshufb         xmm4, xmm4, [rel bswap64]
        vpxor           xmm3, xmm3, EV                  ;; m1 XOR EV
        vpclmulqdq      xmm5, xmm4, xmm0, 0x10          ;; t1 = pclmulqdq_wrap(m2, p1p2, 0x10);
        vpclmulqdq      xmm6, xmm4, xmm0, 0x01          ;; t2 = pclmulqdq_wrap(m2, p1p2, 0x01);
        vpxor           xmm5, xmm5, xmm6
        vpclmulqdq      xmm6, xmm3, xmm1, 0x10          ;; t2 = pclmulqdq_wrap(m1, p3p4, 0x10);
        vpclmulqdq      xmm4, xmm3, xmm1, 0x01          ;; t3 = pclmulqdq_wrap(m1, p3p4, 0x01);
        vpxor           xmm6, xmm6, xmm4                ;; t2 = _mm_xor_si128(t2, t3);
        vpxor           EV, xmm6, xmm5                  ;; t1 = _mm_xor_si128(t2, t1);
        REDUCE_TO_64    EV, xmm3                        ;; EV = reduce128_to_64(t1);
        vpand           EV, EV, [rel clear_hi64]        ;; EV = _mm_and_si128(EV, clear_hi64);
        add     offset, 4                               ;; move to next 4 blocks
        cmp     end_offset, offset
        jne     start_4_blk_loop                        ;; at least 4 blocks left
        ;; less than 4 blocks left
        jmp     single_blk_chk
start_single_blk_loop:
        vmovq   xmm0, [in_ptr + offset * 8]
        vpshufb xmm0, xmm0, [rel bswap64]
        vpxor   EV, xmm0
        MUL_AND_REDUCE_TO_64 EV, P1, xmm1
        inc     offset
single_blk_chk:
        cmp     offset, qword_len
        jb      start_single_blk_loop
partial_blk:
        mov     tmp5, 0x3f      ;; len_in_bits % 64
        and     tmp5, bit_len
        jz      skip_rem_bits
        ;; load last N bytes
        mov     tmp2, tmp5      ;; (rem_bits + 7) / 8
        add     tmp2, 7
        shr     tmp2, 3
        shl     offset, 3       ;; qwords -> bytes
        add     in_ptr, offset  ;; in + offset to last block
        simd_load_avx_15_1 xmm3, in_ptr, tmp2
        vmovq   tmp3, xmm3
        bswap   tmp3
        mov     tmp, 0xffffffffffffffff
        mov     tmp6, 64
        sub     tmp6, tmp5
        SHIFT_GP tmp, tmp6, tmp, tmp5, left
        and     tmp3, tmp       ;; V &= (((uint64_t)-1) << (64 - rem_bits)); /* mask extra bits */
        vmovq   xmm0, tmp3
        vpxor   EV, xmm0
        MUL_AND_REDUCE_TO_64 EV, P1, xmm3
skip_rem_bits:
        ;; /* Multiply by Q */
        ;; E = multiply_and_reduce64(E ^ lengthInBits,
        ;;                           (((uint64_t)z[2] << 32) | ((uint64_t)z[3])));
        ;; /* Final MAC */
        ;; *(uint32_t *)pDigest =
        ;;        (uint32_t)BSWAP64(E ^ ((uint64_t)z[4] << 32));
        vmovq   xmm3, bit_len
        vpxor   EV, xmm3
        vmovq   xmm1, [KS + 8]                  ;; load z[2:3]
        vpshufd xmm1, xmm1, 1110_0001b
        mov     DWORD(tmp4), [KS + (4 * 4)]         ;; tmp4 == z[4] << 32
        shl     tmp4, 32
        MUL_AND_REDUCE_TO_64 EV, xmm1, xmm3
        vmovq   E, EV
        xor     E, tmp4
        bswap   E                               ;; return E (rax/eax)
        FUNC_RESTORE
        ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
 
 | 31.24359 
							 | 98 
							 | 0.574887 
							 | 
					
	527da589a799e0a56145fd77c74fc9966ef96fa7 
 | 310 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/021/A021496.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/021/A021496.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/021/A021496.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A021496: Decimal expansion of 1/492.
; 0,0,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0,3,2,5,2,0
add $0,1
mov $1,10
pow $1,$0
mul $1,7
div $1,3444
mod $1,10
mov $0,$1
 
 | 28.181818 
							 | 199 
							 | 0.541935 
							 | 
					
	d9681eaa0631152bda98f7b7c455183f4163a177 
 | 26,863 
							 | 
	asm 
 | 
	Assembly 
 | 
	Appl/Calc/calcDisplay.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 504 
							 | 
	2018-11-18T03:35:53.000Z 
 | 
	2022-03-29T01:02:51.000Z 
 | 
	Appl/Calc/calcDisplay.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 96 
							 | 
	2018-11-19T21:06:50.000Z 
 | 
	2022-03-06T10:26:48.000Z 
 | 
	Appl/Calc/calcDisplay.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 73 
							 | 
	2018-11-19T20:46:53.000Z 
 | 
	2022-03-29T00:59:26.000Z 
 | 
	COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT:	PC GEOS
MODULE:		Calculator Accessory -- LED Display
FILE:		calcDisplay.asm
AUTHOR:		Adam de Boor, Mar 15, 1990
ROUTINES:
	Name			Description
	----			-----------
	
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	Adam	3/15/90		Initial revision
DESCRIPTION:
	Object class to run the numeric display for the calculator. There
	is certain behaviour in the GenTextEdit class that we need to override,
	along with extra stuff (like clearing the display on the first
	keystroke) we need to handle.
		
	$Id: calcDisplay.asm,v 1.1 97/04/04 14:47:04 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
idata	segment
	CalcDisplayClass	; Declare class record
idata	ends
Main		segment	resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CDCheckClearPending
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	See if the display needs to be cleared before input is
		placed in the display, and clear it if so.
CALLED BY:	CalcDisplayCDKbdChar, CalcDisplayPaste
PASS:		ds:di	= CalcDisplayInstance
		*ds:si	= CalcDisplay object
RETURN:		ds:di	= possibly shifted CalcDisplayInstance
DESTROYED:	ax, bx
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	10/24/90	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CDCheckClearPending proc near
		class	CalcDisplayClass
		.enter
		tst	ds:[di].CD_clearPending
		jz	done
		DoPush	cx, dx, bp
		
		;
		; Notify the engine that the display is being cleared so it can
		; deal with pending recalls and stuff like that.
		;
		push	si
		mov	bx, ds:[di].CD_engine.handle
		mov	si, ds:[di].CD_engine.chunk
		mov	ax, MSG_CE_CLEARING
		mov	di, mask MF_CALL or mask MF_FIXUP_DS
		call	ObjMessage
		pop	si
		
		;
		; Now call ourselves to clear the display
		;
		mov	di, ds:[si]
		add	di, ds:[di].CalcDisplay_offset
		mov	ds:[di].CD_resetCount, CD_RESET_START
		mov	ax, MSG_CD_CLEAR
		call	ObjCallInstanceNoLock
		mov	di, ds:[si]
		add	di, ds:[di].CalcDisplay_offset
		mov	ds:[di].CD_resetCount, CD_RESET_START
		DoPopRV	cx, dx, bp
done:
		.leave
		ret
CDCheckClearPending endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayCDKbdChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Special funky KBD_CHAR for CalcDisplayClass that handles
		the clearing of the display, etc.
CALLED BY:	MSG_CD_KBD_CHAR
PASS:		cx	= character value
		dl	= CharFlags
		*ds:si	= instance
		ds:di	= CalcDisplayInstance
RETURN:		
DESTROYED:	
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	6/14/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayCDKbdChar method dynamic CalcDisplayClass, MSG_CD_KBD_CHAR
		.enter
	;
	; Clear the display if a clear is pending and the key is part of
	; a number (we only get here if the character is part of a number).
	;
		test	dl, mask CF_RELEASE
		jnz	transform		; only clear on press...
		call	CDCheckClearPending
transform:
	;
	; If trigger is for a decimal point, convert the character to the
	; current decimal point.
	;
		cmp	cx, (CS_BSW shl 8) or '.'
		jne	sendUpward
		mov	cl, es:[decimalPoint]
sendUpward:
		mov	ax, MSG_KBD_CHAR
		mov	di, offset CalcDisplayClass
		CallSuper	MSG_KBD_CHAR
		.leave
		ret
CalcDisplayCDKbdChar endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayKbdChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Perform special operations required by the calculator display
		when the user types something in it, including:
			- transforming numeric NUMPAD keystrokes into real
			  numbers to avoid shortcut processing in our superclass
			- sending ourselves a MSG_CD_CLEAR before forwarding
			  the keystroke if CD_clearPending is set.
CALLED BY:	MSG_KBD_CHAR
PASS:		*ds:si	= instance data
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		es	= dgroup
		cx	= char value
		dl	= CharFlags
				CF_RELEASE - set if release
				CF_STATE - set if shift, ctrl, etc.
				CF_TEMP_ACCENT - set if accented char pending
		dh 	= ShiftState
		bp low 	= ToggleState (unused)
		bp high = scan code (unused)
				
RETURN:		nothing
DESTROYED:	?
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/15/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayKbdChar method dynamic CalcDisplayClass, MSG_KBD_CHAR
		.enter
		call	CalcDisplayScanShortcuts
		jc	done
	
	;
	; If keystroke is funky UI mouse-button stuff, don't alter the reset
	; count, as this isn't a real keystroke.
	; 
		cmp	ch, CS_UI_FUNCS
		je	passItOn
	;
	; Signal that user has typed something and next C/CE should just CE.
	;
		mov	di, ds:[si]
		add	di, ds:[di].CalcDisplay_offset
		mov	ds:[di].CD_resetCount, CD_RESET_START
passItOn:
		mov	di, offset CalcDisplayClass
		CallSuper	MSG_KBD_CHAR
done:
		.leave
		ret
CalcDisplayKbdChar endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CDCheckMaxLength
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Make sure a keypress or transfer won't push the text past
		maxLength - 1
CALLED BY:	CalcDisplayFilterKbdChar, CalcDisplayFilterTransfer
PASS:		ds:bx	= CalcDisplayBase
		bp	= number of characters being inserted
		VTI_selectStart, VTI_selectEnd accurate
RETURN:		carry set if would go over
DESTROYED:	ax, di
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	10/25/90	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CDCheckMaxLength proc	near	uses bx, cx
		class	CalcDisplayClass
		.enter
	;
	; Figure current length of text.
	;
		add	bx, ds:[bx].Vis_offset
		mov	di, ds:[bx].VTI_text
		ChunkSizeHandle	ds, di, cx
		dec	cx	; null byte doesn't count
	;
	; Now figure the number of chars that'll get nuked by the insert
	;
EC <		tst	ds:[bx].VTI_selectEnd.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
EC <		tst	ds:[bx].VTI_selectStart.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		mov	ax, ds:[bx].VTI_selectEnd.low
		sub	ax, ds:[bx].VTI_selectStart.low
		sub	cx, ax
	;
	; Adjust the total remaining by what we'll insert, and add one so we're
	; comparing against maxLength - 1.
	; 
		add	cx, bp
		mov	di, ds:[di]
		cmp	{char}ds:[di], '-'	;already negative?
		je	checkLength		;yes -- compare against
						; maxLength, not mL-1
		inc	cx			; so we compare against
						;  maxLength-1, effectively
checkLength:
	;
	; If maxLength is below what we just calculated (carry set), it's
	; no go.
	; 
		cmp	ds:[bx].VTI_maxLength, cx
		.leave
		ret
CDCheckMaxLength endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayFilterKbdChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Additional key filtering for a calc display.
CALLED BY:	MSG_VIS_TEXT_FILTER_CHAR_FROM_KBD
PASS:		*ds:si	= CalcDisplayBase
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		cl 	= character being inserted
		es	= dgroup
RETURN:		cx	= 0 if character was handled, unchanged if it
			  should be inserted.
DESTROYED:	bp
PSEUDO CODE/STRATEGY:
		There are three things we have to watch for:
			- inserting an extra decimal point
			- inserting a minus sign
			- placing a number before a minus sign
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	6/14/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayFilterKbdChar method dynamic CalcDisplayClass,
				MSG_VIS_TEXT_FILTER_CHAR_FROM_KBD
		.enter
	;------------------------------------------------------------
	; First, never allow a minus sign to be inserted except by
	; MSG_TEXT_REPLACE.
	;
		cmp	cl, '-'
		jne	checkBeforeMinus
nukeIt:
		clr	cx		; never allow - to come in
		jmp	done
	;------------------------------------------------------------
checkControlBeforeMinus:
		cmp	cl, ' '
		LONG jb	passItOn
		cmp	cl, 0x7f
		jb	10$
		jmp	passItOn
checkBeforeMinus:
	;
	; See if we're trying to insert something before a leading minus sign
	; in the display. This is verboten.
	;
		cmp	ch, CS_CONTROL
		je	checkControlBeforeMinus
10$:
	;
	; It's a real character, so make sure we're not maxed out. The
	; maxLength defined for the object is actually one more than we allow
	; the user to type, as we have to allow room for a negative sign at the
	; front.
	;
		mov	bp, 1			; adding 1 char
		call	CDCheckMaxLength
		jc	nukeIt
		DoPush	bx, ax
		mov	di, bx
		add	bx, ds:[bx].Vis_offset
EC <		tst	ds:[bx].VTI_selectStart.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		mov	ax, ds:[bx].VTI_selectStart.low
		tst	ax
		jnz	popCheckDecimal	; Not at front, so can't go before
					;  a minus sign.
EC <		tst	ds:[bx].VTI_selectEnd.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		or	ax, ds:[bx].VTI_selectEnd.low
		jnz	popCheckDecimal	; Selection exists, so any insertion
					;  will biff the minus sign
		add	di, ds:[di].Gen_offset
		mov	di, ds:[di].GTDI_text
		mov	di, ds:[di]
		cmp	{char}ds:[di], '-'
		jne	popCheckDecimal
		DoPopRV	bx, ax
jmpToNukeIt:
		jmp	nukeIt
popCheckDecimal:
		DoPopRV	bx, ax
	;------------------------------------------------------------
	; If the thing is a decimal point, make sure there's not already one
	; in the object.
	;
		cmp	cl, es:[decimalPoint]
		jne	passItOn
		
		add	bx, ds:[bx].Gen_offset
		mov	bx, ds:[bx].GTDI_text
		DoPush	cx, ax, es
		ChunkSizeHandle	ds, bx, cx
		jcxz	ok
		mov	al, es:[decimalPoint]
		mov	di, ds:[bx]
		segmov	es, ds
		repne	scasb
		jne	ok
	;
	; See if the decimal found lies w/in the selection. If so,
	; this insertion should biff the thing, so it's ok.
	;
		stc			; di is one beyond the '.'...
		sbb	di, ds:[bx]	; di <- offset into text
		clr	cx		; assume it's in the selection
		xchg	ax, di
		mov	di, ds:[si]
		add	di, ds:[di].Vis_offset
EC <		tst	ds:[di].VTI_selectStart.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
EC <		tst	ds:[di].VTI_selectEnd.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		cmp	ax, ds:[di].VTI_selectStart.low
		jb	bad		; => before selection
		cmp	ax, ds:[di].VTI_selectEnd.low
		jb	ok		; => w/in selection, so happy
bad:
		inc	cx		; signal badness by making sure cx
					;  is non-zero
ok:
		tst	cx
		DoPopRV	cx, ax, es
		jnz	jmpToNukeIt
passItOn:
	;
	; Give our superclass a crack at it.
	;
		mov	di, offset CalcDisplayClass
		mov	ax, MSG_VIS_TEXT_FILTER_CHAR_FROM_KBD
		CallSuper	MSG_VIS_TEXT_FILTER_CHAR_FROM_KBD
done:
		.leave
		ret
CalcDisplayFilterKbdChar		endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayFilterTransfer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Make sure a pending paste conforms to our rigid standards
		for input.
CALLED BY:	MSG_VIS_TEXT_FILTER_CHARS_FROM_TRANSFER
PASS:		*ds:si	= CalcDisplay object
		ds:di	= CalcDisplayInstance
		ds:bx	= CalcDisplayBase
		cx:dx	= buffer of chars
		bp	= count
		es	= dgroup
RETURN:		bp	= 0 to filter range
DESTROYED:	ax, bx, cx, dx, di
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	10/25/90	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayFilterTransfer method dynamic CalcDisplayClass, 
			  	MSG_VIS_TEXT_FILTER_CHARS_FROM_TRANSFER
		.enter
	;
	; Setup registers for loop:
	;	ds:si	= buffer char
	;	cx	= chars left in transfer buffer
	;	ds:bx	= VisTextInstance
	;	es:di	= current text
	;	dx	= non-zero if decimal point seen in buffer
	;	ah	= localized decimal point
	;
		call	CDCheckMaxLength
		jc	error
		mov	ah, es:[decimalPoint]
		add	bx, ds:[bx].Vis_offset
		mov	si, dx
		segmov	es, ds
		mov	ds, cx
		mov	cx, bp
		mov	di, es:[bx].VTI_text
		mov	di, es:[di]
		clr	dx
		
		lodsb
	;
	; Check for leading minus. It's ok so long as we're inserting at
	; the front and there's not a minus there that'll stay there.
	;
		cmp	al, '-'
		jne	haveChar
		
EC <		tst	es:[bx].VTI_selectStart.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		cmp	es:[bx].VTI_selectStart.low, 0
		jne	error
		cmp	di, -1		; if no text
		je	nextChar	;  check the whole buffer
		cmp	{char}es:[di], al
		jne	nextChar
EC <		tst	es:[bx].VTI_selectEnd.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		cmp	es:[bx].VTI_selectEnd.low, 1
		jae	nextChar	; => '-' would be nuked by the paste, so
					;  it's ok.
error:
		clr	bp		; signal rejection of whole thing
		jmp	done		; and bail
checkLoop:
		lodsb
haveChar:
	;
	; Numeric?
	;
		cmp	al, '0'
		jb 	checkDecimal
		cmp	al, '9'
		ja	error
nextChar:
		loop	checkLoop
		jmp	done
checkDecimal:
	;
	; Check for decimal point in the pasted text.
	;
		cmp	al, ah
		jne	error		; anything other than 0-9 or . is
					;  bullshit
		xor	dx, -1		; flag presence and check for already
					;  having had one in this text. (can't
					;  use NOT b/c that doesn't affect the
					;  flags)
		jz	error		; already had one '.', thanks
		cmp	di, -1
		je	nextChar	; can't be a '.' in the existing text
					;  yet b/c there is no existing text
	;
	; Look for an already-existing decimal point in the text. If it's in
	; the current selection, it's ok.
	; 
		DoPush	di, cx
		ChunkSizePtr	es, di, cx
		
		repne	scasb
		xchg	ax, di
		DoPopRV	di, cx
		jne	nextChar
	;
	; There's a '.' in the text already. See if it'll get biffed by the
	; paste. If so, we're happy; if not, heads will roll.
	; 
		stc			; di was one beyond the '.'
		sbb	ax, di		; ax <- offset into the text
EC <		tst	es:[bx].VTI_selectStart.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		cmp	ax, es:[bx].VTI_selectStart.low
		jb	error		; => before selection, so choke
EC <		tst	es:[bx].VTI_selectEnd.high	;>
EC <		ERROR_NZ	SELECTION_TOO_LARGE	;>
		cmp	ax, es:[bx].VTI_selectEnd.low
		jae	error		; => after selection, so die
		jmp	nextChar
done:
		.leave
		ret
CalcDisplayFilterTransfer endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayScanShortcuts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	See if the keyboard event maps to one of the shortcuts
		bound into the display.
CALLED BY:	CalcDisplayKbdChar
PASS:		*ds:si	= instance data
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		cx	= char value
		dl	= CharFlags
				CF_RELEASE - set if release
				CF_STATE - set if shift, ctrl, etc.
				CF_TEMP_ACCENT - set if accented char pending
		dh 	= ShiftState
		bp low 	= ToggleState (unused)
		bp high = scan code (unused)
RETURN:		carry set if shortcut found and processed
DESTROYED:	di always, nothing else if shortcut not found, else
		ax, bx, si
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	6/ 8/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayScanShortcuts proc	near
		class	CalcDisplayClass
		.enter
	;
	; See if the character is one of the shortcuts defined for the display.
	;
		mov	di, ds:[di].CD_shortcuts
		tst	di
		jz	done		; no shortcuts defined
		;
		; Figure end of array for loop
		;
		mov	di, ds:[di]
		ChunkSizePtr	ds, di, ax
		add	ax, di
scanLoop:
		cmp	cx, ds:[di].CDS_char	; Character matches?
		je	haveShort
		add	di, size CDShortcut
		cmp	di, ax
		jb	scanLoop
		mov	ax, MSG_KBD_CHAR
		jmp	done
haveShort:
	;
	; Found a matching shortcut. We handle the thing by sending a
	; MSG_GEN_ACTIVATE to the trigger bound to the shortcut.
	;
		test	dl, mask CF_RELEASE	; Don't invoke shortcut on
		jnz	doneProcessed		;  release, thanks.
		mov	si, ds:[di].CDS_trigger.chunk
		mov	bx, ds:[di].CDS_trigger.handle
		mov	ax, MSG_GEN_ACTIVATE
		mov	di, mask MF_CALL or mask MF_FIXUP_DS
		call	ObjMessage
doneProcessed:
		stc
done:
		.leave
		ret
CalcDisplayScanShortcuts endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayClearPending
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Mark the display as needing clearing on the next input
CALLED BY:	MSG_CD_CLEAR_PENDING
PASS:		*ds:si	= instance data
RETURN:		nothing
DESTROYED:	di
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/15/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayClearPending	method dynamic CalcDisplayClass, MSG_CD_CLEAR_PENDING
		.enter
		mov	ds:[di].CD_clearPending, BB_TRUE
		mov	ds:[di].CD_resetCount, CD_RESET_START	; some operation
							;  performed, so
							;  reset the resetCount
		.leave
		ret
CalcDisplayClearPending endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayClear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Clear the display
CALLED BY:	MSG_CD_CLEAR
PASS:		*ds:si	= instance data
RETURN:		Nothing
DESTROYED:	ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/15/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
nullString	char	0
CalcDisplayClear method	dynamic CalcDisplayClass, MSG_CD_CLEAR
		.enter
		mov	ds:[di].CD_clearPending, BB_FALSE
		dec	ds:[di].CD_resetCount
		jnz	clearDisplay
	;
	; Reset counter went to zero => C/CE hit twice w/o intervening operation
	; so tell the engine to reset itself.
	;
		mov	ds:[di].CD_resetCount, CD_RESET_START
		push	si
		mov	ax, MSG_CE_RESET
		mov	si, ds:[di].CD_engine.chunk
		mov	bx, ds:[di].CD_engine.handle
		mov	di, mask MF_CALL or mask MF_FIXUP_DS
		call	ObjMessage
		pop	si
clearDisplay:
		mov	ax, MSG_VIS_TEXT_DELETE_ALL
		mov	dx, cs
		mov	bp, offset nullString
		clr	cx		; Null-terminated
		call	ObjCallInstanceNoLock
		.leave
		ret
CalcDisplayClear endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayRead
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Read the currently displayed value into a DDFixed
CALLED BY:	MSG_CD_READ
PASS:		*ds:si	= instance
		cx	= non-zero if display should clear itself on
			  next keystroke
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		es	= dgroup
RETURN:		carry clear if the number is in error, else
		ax:cx:dx:bp = number read
DESTROYED:	
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/22/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayRead	method	dynamic CalcDisplayClass, MSG_CD_READ
temp		local	DDFixed
		.enter
	;
	; Set clearPending if told to
	;
		jcxz	noClearPending
		mov	ds:[di].CD_clearPending, BB_TRUE
		mov	ds:[di].CD_resetCount, CD_RESET_START	; some operation
							;  performed, so
							;  reset the resetCount
noClearPending:
	;
	; Call ourselves to get the text into a local chunk
	;
		add	bx, ds:[bx].Gen_offset
		mov	si, ds:[bx].GTDI_text
		ChunkSizeHandle	ds, si, cx
		jcxz	error
	;
	; Now convert to DDFixed
	;
		mov	al, es:[decimalPoint]
		segmov	es, ss, di
		lea	di, ss:[temp]
		mov	si, ds:[si]	; ds:si = string
		call	CalcAToF	; convert ds:si -> es:di
		jc	error		; overflow...
	;
	; Signal our happiness with the number
	;
		stc
		mov	ax, temp.DDF_frac.low
		mov	ss:[bp], ax	; Return bp = low fraction
		mov	dx, temp.DDF_frac.high
		mov	cx, temp.DDF_int.low
		mov	ax, temp.DDF_int.high
done:
		.leave
		ret
error:
		clc
		jmp	done
CalcDisplayRead	endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Format the fixed-point number at CX:DX and display it in
		ourselves.
CALLED BY:	MSG_CD_WRITE
PASS:		*ds:si	= instance
		cx:dx	= DDFixed to be displayed
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		es	= dgroup
RETURN:		nothing
DESTROYED:	ax, cx, dx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/14/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayWrite method	dynamic CalcDisplayClass, MSG_CD_WRITE
numBuf		local	MAX_NUM_LENGTH dup(char)
		.enter
	;
	; Convert the number to ascii in our local variable.
	;
		push	ds
		mov	bx, dx			; ds:bx = number to convert
		mov	dx, ds:[di].CD_precision
		mov	ds, cx
		mov	cx, dx			; cx = max precision for
						;  conversion
		mov	al, es:[decimalPoint]
		segmov	es,ss,di		; es:di = string storage
		lea	di, ss:[numBuf]
		call	CalcFToA
		pop	ds
	;
	; Now send ourselves a SET_TEXT method to put the string up.
	;
		push	bp
		mov	dx, ss
		lea	bp, numBuf		; dx:bp = text
		clr	cx			; cx = 0 => null-terminated
		mov	ax, MSG_VIS_TEXT_REPLACE_ALL
		call	ObjCallInstanceNoLock
		pop	bp
		.leave
		ret
CalcDisplayWrite endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplaySetPrecision
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Set the maximum number of decimal places to display
CALLED BY:	MSG_CD_SET_PRECISION
PASS:		*ds:si	= display instance
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
		cx	= precision to use
RETURN:		nothing
DESTROYED:	di
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/22/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplaySetPrecision method	dynamic CalcDisplayClass,
					MSG_CD_SET_PRECISION
		.enter
		mov	ds:[di].CD_precision, cx
		mov	ds:[di].CD_resetCount, CD_RESET_START
		.leave
		ret
CalcDisplaySetPrecision endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayChangeSign
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Invert the sign of the currently-displayed number
CALLED BY:	MSG_CD_CHANGE_SIGN
PASS:		*ds:si	= display object
		ds:bx	= CalcDisplayBase
		ds:di	= CalcDisplayInstance
RETURN:		nothing
DESTROYED:	?
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	3/22/90		Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
minusSign	char	'-'		; For inserting - at beginning
CalcDisplayChangeSign method	dynamic CalcDisplayClass, MSG_CD_CHANGE_SIGN
params		local	VisTextReplaceParameters
		.enter
	;
	; Fetch the current text so we can decide whether to add or remove
	; the sign.
	;
		add	bx, ds:[bx].Gen_offset
		mov	bx, ds:[bx].GTDI_text
		ChunkSizeHandle	ds, bx, cx
		dec	cx
		jz	done			; Do nothing on empty object
		mov	bx, ds:[bx]
	;
	; Don't change sign if display contains 0 (-0 generates an error)
	; or Error (looks funny).
	; XXX: This only handles the simple case where the display contains
	; only '0'. It won't handle obnoxious cases like '0.00000', but anyone
	; putting that in deserves to get an Error...
	; 
		cmp	{char}ds:[bx], 'E'
		je	done
		cmp	{char}ds:[bx], '0'
		jne	setParams
		dec	cx
		jz	done		; => only '0' so no sign change
setParams:
	;
	; Initialize params no matter what we're doing. Always changing position
	; 0 and want always to point to the minusSign given above.
	;
		mov	ss:[params].VTRP_textReference.TR_type, TRT_POINTER
		mov	ss:[params].VTRP_textReference.TR_ref.TRU_pointer.\
					TRP_pointer.segment, cs
		mov	ss:[params].VTRP_textReference.TR_ref.TRU_pointer.\
					TRP_pointer.offset, offset minusSign
		clr	ax
		mov	ss:[params].VTRP_insCount.high, ax
		clrdw	ss:[params].VTRP_range.VTR_start, ax
		clrdw	ss:[params].VTRP_range.VTR_end, ax
		mov	dx, 1		; dx = ins count (assume adding -)
		cmp	{char}ds:[bx], '-'
		jne	doReplace
		xchg	ax, dx		; Nope. delete char instead
doReplace:
		mov	ss:[params].VTRP_range.VTR_end.low, ax
		mov	ss:[params].VTRP_insCount.low, dx
		push	bp
		add	bp, offset params
		mov	ax, MSG_VIS_TEXT_REPLACE_NEW
		call	ObjCallInstanceNoLock
		pop	bp
		
done:
		.leave
		ret
CalcDisplayChangeSign		endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		CalcDisplayPaste
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Field a MSG_PASTE so we can clear the display if necessary
CALLED BY:	MSG_PASTE
PASS:		ds:di	= CalcDisplayInstance
		*ds:si	= CalcDisplay object
RETURN:		nothing
DESTROYED:	?
PSEUDO CODE/STRATEGY:
		
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ardeb	10/24/90	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDisplayPaste method	dynamic CalcDisplayClass, MSG_PASTE
		.enter
		call	CDCheckClearPending
		
		mov	ax, MSG_PASTE
		mov	di, offset CalcDisplayClass
		CallSuper	MSG_PASTE
		.leave
		ret
CalcDisplayPaste endp
Main		ends
 
 | 25.24718 
							 | 79 
							 | 0.586457 
							 | 
					
	01dc532ed0ed195ac67b5b860ec05f3d0dae1886 
 | 387 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/119/A119690.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/119/A119690.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/119/A119690.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A119690: n! mod n*(n+1)/2.
; 0,2,0,4,0,6,0,0,0,10,0,12,0,0,0,16,0,18,0,0,0,22,0,0,0,0,0,28,0,30,0,0,0,0,0,36,0,0,0,40,0,42,0,0,0,46,0,0,0,0,0,52,0,0,0,0,0,58,0,60,0,0,0,0,0,66,0,0,0,70,0,72,0,0,0,0,0,78,0,0,0,82,0,0,0,0,0,88,0,0,0,0,0,0
lpb $0
  add $0,1
  mov $1,$0
  seq $0,66247 ; Characteristic function of composite numbers: 1 if n is composite else 0.
  mul $0,$1
lpe
mov $0,$1
 
 | 35.181818 
							 | 209 
							 | 0.581395 
							 | 
					
	8e421ca863cf4517f7b078555cdc5d558fef899b 
 | 427 
							 | 
	asm 
 | 
	Assembly 
 | 
	oeis/025/A025941.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 11 
							 | 
	2021-08-22T19:44:55.000Z 
 | 
	2022-03-20T16:47:57.000Z 
 | 
	oeis/025/A025941.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 9 
							 | 
	2021-08-29T13:15:54.000Z 
 | 
	2022-03-09T19:52:31.000Z 
 | 
	oeis/025/A025941.asm 
 | 
	neoneye/loda-programs 
 | 
	84790877f8e6c2e821b183d2e334d612045d29c0 
 | 
	[
  "Apache-2.0"
]  | 3 
							 | 
	2021-08-22T20:56:47.000Z 
 | 
	2021-09-29T06:26:12.000Z 
 | 
	; A025941: Expansion of 1/((1-2x)(1-3x)(1-6x)(1-11x)).
; Submitted by Jon Maiga
; 1,22,327,4172,49553,567714,6382699,71043064,786493125,8681598926,95678810591,1053554778276,11595631317817,127591121803258,1403737417995603,15442522109891408,169876206409453229
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
  mov $0,$3
  sub $2,1
  sub $0,$2
  seq $0,16308 ; Expansion of 1/((1-2*x)*(1-6*x)*(1-11*x)).
  mul $1,3
  add $1,$0
lpe
mov $0,$1
 
 | 25.117647 
							 | 177 
							 | 0.686183 
							 | 
					
	f76f33930a60c8f1e0bad471d2d03ded34b07da6 
 | 228 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep.asm 
 | 
	meesokim/z88dk 
 | 
	5763c7778f19a71d936b3200374059d267066bb2 
 | 
	[
  "ClArtistic"
]  | null  | null  | null  | 
	
; void bit_beep(uint16_t duration_ms, uint16_t frequency_hz)
SECTION code_sound_bit
PUBLIC _bit_beep
EXTERN asm_bit_beep
_bit_beep:
   pop af
   pop de
   pop hl
   
   push hl
   push de
   push af
   
   jp asm_bit_beep
 
 | 10.857143 
							 | 60 
							 | 0.70614 
							 | 
					
	0cee15876008113fabd4b8faf17594bd6656364d 
 | 2,114 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/110/A110451.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/110/A110451.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/110/A110451.asm 
 | 
	karttu/loda 
 | 
	9c3b0fc57b810302220c044a9d17db733c76a598 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A110451: a(n) = n*(4*n^2 + 2*n + 1).
; 0,7,42,129,292,555,942,1477,2184,3087,4210,5577,7212,9139,11382,13965,16912,20247,23994,28177,32820,37947,43582,49749,56472,63775,71682,80217,89404,99267,109830,121117,133152,145959,159562,173985,189252,205387,222414,240357,259240,279087,299922,321769,344652,368595,393622,419757,447024,475447,505050,535857,567892,601179,635742,671605,708792,747327,787234,828537,871260,915427,961062,1008189,1056832,1107015,1158762,1212097,1267044,1323627,1381870,1441797,1503432,1566799,1631922,1698825,1767532,1838067,1910454,1984717,2060880,2138967,2219002,2301009,2385012,2471035,2559102,2649237,2741464,2835807,2932290,3030937,3131772,3234819,3340102,3447645,3557472,3669607,3784074,3900897,4020100,4141707,4265742,4392229,4521192,4652655,4786642,4923177,5062284,5203987,5348310,5495277,5644912,5797239,5952282,6110065,6270612,6433947,6600094,6769077,6940920,7115647,7293282,7473849,7657372,7843875,8033382,8225917,8421504,8620167,8821930,9026817,9234852,9446059,9660462,9878085,10098952,10323087,10550514,10781257,11015340,11252787,11493622,11737869,11985552,12236695,12491322,12749457,13011124,13276347,13545150,13817557,14093592,14373279,14656642,14943705,15234492,15529027,15827334,16129437,16435360,16745127,17058762,17376289,17697732,18023115,18352462,18685797,19023144,19364527,19709970,20059497,20413132,20770899,21132822,21498925,21869232,22243767,22622554,23005617,23392980,23784667,24180702,24581109,24985912,25395135,25808802,26226937,26649564,27076707,27508390,27944637,28385472,28830919,29281002,29735745,30195172,30659307,31128174,31601797,32080200,32563407,33051442,33544329,34042092,34544755,35052342,35564877,36082384,36604887,37132410,37664977,38202612,38745339,39293182,39846165,40404312,40967647,41536194,42109977,42689020,43273347,43862982,44457949,45058272,45663975,46275082,46891617,47513604,48141067,48774030,49412517,50056552,50706159,51361362,52022185,52688652,53360787,54038614,54722157,55411440,56106487,56807322,57513969,58226452,58944795,59669022,60399157,61135224,61877247
mov $1,4
mul $1,$0
mul $0,$1
add $1,2
mul $0,$1
add $0,$1
mov $1,$0
div $1,4
 
 | 176.166667 
							 | 1,996 
							 | 0.851939 
							 | 
					
	9ce833e92bd258dd71bb03458e7801d1be4b9912 
 | 544 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/315/A315340.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/315/A315340.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/315/A315340.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A315340: Coordination sequence Gal.6.625.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,6,10,16,22,28,32,38,44,50,54,60,66,70,76,82,88,92,98,104,110,114,120,126,130,136,142,148,152,158,164,170,174,180,186,190,196,202,208,212,218,224,230,234,240,246,250,256,262,268
mov $2,$0
mov $4,$0
mul $4,2
add $4,3
add $0,$4
add $0,4
sub $4,2
mov $3,$4
lpb $0
  sub $0,11
  trn $0,1
  add $0,1
  trn $3,2
lpe
mov $1,$3
lpb $2
  add $1,4
  sub $2,1
lpe
add $1,1
 
 | 22.666667 
							 | 180 
							 | 0.669118 
							 | 
					
	5d6c84f448db61e854f8b96fc10a0b65a0e9f64d 
 | 2,324 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/016/A016965.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/016/A016965.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/016/A016965.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A016965: a(n) = (6*n + 4)^9.
; 262144,1000000000,68719476736,1207269217792,10578455953408,60716992766464,262144000000000,922190162669056,2779905883635712,7427658739644928,18014398509481984,40353607000000000,84590643846578176,167619550409708032,316478381828866048,572994802228616704,1000000000000000000,1689478959002692096,2773078757450186752,4435453859151328768,6930988311686938624,10604499373000000000,15916595351771938816,23474432367845903872,34068690316840665088,48717667557975775744,68719476736000000000,95713410696980686336,131751637663571771392,179382478698232427008,241746618002717016064,322687697779000000000,426878854210636742656,559966859614392781312,728735647959800086528,941291116759119107584,1207269217792000000000,1538069472247945355776,1947116172645480005632,2450149664319731035648,3065550233359913058304,3814697265625000000000,4722366482869645213696,5817168207073186596352,7132029752782342586368,8704725199652968436224,10578455953408000000000,12802485663117464444416,15432833226052183785472,18533027778365537970688,22174929740517389369344,26439622160671000000000,31418376777267496615936,37213699403613156884992,43940459422602502340608,51727108368644890545664,60716992766464000000000,71069766592698296736256,82962908926146261286912,96593352556072838768128,112179229525223253213184,129961739795077000000000,150207149435418497253376,173208924958501538463232,199290010639942344245248,228805255893990661179904,262144000000000000000000,299732821709746744055296,342038461501733491965952,389570924488754625683968,442886772228801716813824,502592611936843000000000,569348791846124752470016,643873311722413023427072,726945957793021755916288,819412671614557937042944,922190162669056000000000,1036270774747572283265536,1162727616453365928558592,1302719966433505169694208,1457498964228107529355264,1628413597910449000000000,1816916999978860838649856,2024573063252673153152512,2253063388819461999689728,2504194578379511247798784,2779905883635712000000000,3082277225683090878270976,3413537597661784009080832,3776073864250556052494848,4172439971894903128981504,4605366583984375000000000,5077771155518005355216896,5592768462124649550295552,6153681598636596624621568,6764053462750046908071424,7427658739644928000000000,8148516403779060372015616,8930902754417879308828672,9779365001810772358501888
mul $0,6
add $0,4
pow $0,9
 
 | 332 
							 | 2,264 
							 | 0.942771 
							 | 
					
	09ead90a270b6c040f9b7d4e498cda0dace9c379 
 | 8,380 
							 | 
	asm 
 | 
	Assembly 
 | 
	playground/Gen1/CmdSend.asm 
 | 
	marcelocaetano/XSharp 
 | 
	394f17cee63bfc9781ac8f6b1e21291caa9fc111 
 | 
	[
  "BSD-3-Clause"
]  | 168 
							 | 
	2017-08-05T18:23:29.000Z 
 | 
	2022-03-31T19:33:13.000Z 
 | 
	playground/Gen1/CmdSend.asm 
 | 
	marcelocaetano/XSharp 
 | 
	394f17cee63bfc9781ac8f6b1e21291caa9fc111 
 | 
	[
  "BSD-3-Clause"
]  | 12 
							 | 
	2017-09-19T13:24:16.000Z 
 | 
	2020-09-03T09:42:19.000Z 
 | 
	playground/Gen1/CmdSend.asm 
 | 
	marcelocaetano/XSharp 
 | 
	394f17cee63bfc9781ac8f6b1e21291caa9fc111 
 | 
	[
  "BSD-3-Clause"
]  | 47 
							 | 
	2017-08-13T04:12:40.000Z 
 | 
	2022-03-29T18:25:19.000Z 
 | 
	; Generated at 4/14/2019 1:59:47 AM
DebugStub_SendRegisters:
mov AL, DebugStub_Const_Ds2Vs_Registers
Call DebugStub_ComWriteAL
mov ESI, dword [DebugStub_PushAllPtr]
mov ECX, 0x20
Call DebugStub_ComWriteX
mov ESI, DebugStub_CallerESP
Call DebugStub_ComWrite32
mov ESI, DebugStub_CallerEIP
Call DebugStub_ComWrite32
DebugStub_SendRegisters_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendRegisters_Exit
Ret
DebugStub_SendFrame:
mov AL, DebugStub_Const_Ds2Vs_Frame
Call DebugStub_ComWriteAL
mov EAX, 0x20
Call DebugStub_ComWriteAX
mov ESI, dword [DebugStub_CallerEBP]
add ESI, 0x8
mov ECX, 0x20
Call DebugStub_ComWriteX
DebugStub_SendFrame_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendFrame_Exit
Ret
DebugStub_SendCommandOnChannel:
Pushad
Call DebugStub_ComWriteAL
Popad
mov AL, BL
Pushad
Call DebugStub_ComWriteAL
Popad
Pushad
mov EAX, ECX
Call DebugStub_ComWriteEAX
Popad
DebugStub_SendCommandOnChannel_Block1_Begin:
cmp ECX, 0x0
JE near DebugStub_SendCommandOnChannel_Block1_End
Call DebugStub_ComWrite8
dec dword ECX
Jmp DebugStub_SendCommandOnChannel_Block1_Begin
DebugStub_SendCommandOnChannel_Block1_End:
DebugStub_SendCommandOnChannel_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendCommandOnChannel_Exit
Ret
DebugStub_SendStack:
mov AL, DebugStub_Const_Ds2Vs_Stack
Call DebugStub_ComWriteAL
mov ESI, dword [DebugStub_CallerESP]
mov EAX, dword [DebugStub_CallerEBP]
sub EAX, ESI
Call DebugStub_ComWriteAX
mov ESI, dword [DebugStub_CallerESP]
DebugStub_SendStack_Block1_Begin:
cmp ESI, dword [DebugStub_CallerEBP]
JE near DebugStub_SendStack_Block1_End
Call DebugStub_ComWrite8
Jmp DebugStub_SendStack_Block1_Begin
DebugStub_SendStack_Block1_End:
DebugStub_SendStack_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendStack_Exit
Ret
DebugStub_SendMethodContext:
Pushad
mov AL, DebugStub_Const_Ds2Vs_MethodContext
Call DebugStub_ComWriteAL
mov ESI, dword [DebugStub_CallerEBP]
Call DebugStub_ComReadEAX
add ESI, EAX
Call DebugStub_ComReadEAX
mov ECX, EAX
DebugStub_SendMethodContext_Block1_Begin:
cmp ECX, 0x0
JE near DebugStub_SendMethodContext_Block1_End
Call DebugStub_ComWrite8
dec dword ECX
Jmp DebugStub_SendMethodContext_Block1_Begin
DebugStub_SendMethodContext_Block1_End:
DebugStub_SendMethodContext_Exit:
Popad
mov dword [INTs_LastKnownAddress], DebugStub_SendMethodContext_Exit
Ret
DebugStub_SendMemory:
Pushad
mov AL, DebugStub_Const_Ds2Vs_MemoryData
Call DebugStub_ComWriteAL
Call DebugStub_ComReadEAX
mov ESI, EAX
Call DebugStub_ComReadEAX
mov ECX, EAX
DebugStub_SendMemory_Block1_Begin:
cmp ECX, 0x0
JE near DebugStub_SendMemory_Block1_End
Call DebugStub_ComWrite8
dec dword ECX
Jmp DebugStub_SendMemory_Block1_Begin
DebugStub_SendMemory_Block1_End:
DebugStub_SendMemory_Exit:
Popad
mov dword [INTs_LastKnownAddress], DebugStub_SendMemory_Exit
Ret
DebugStub_SendTrace:
mov AL, DebugStub_Const_Ds2Vs_BreakPoint
cmp dword [DebugStub_DebugStatus], DebugStub_Const_Status_Run
JNE near DebugStub_SendTrace_Block1_End
mov AL, DebugStub_Const_Ds2Vs_TracePoint
DebugStub_SendTrace_Block1_End:
Call DebugStub_ComWriteAL
mov ESI, DebugStub_CallerEIP
Call DebugStub_ComWrite32
DebugStub_SendTrace_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendTrace_Exit
Ret
DebugStub_SendText:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_Message
Call DebugStub_ComWriteAL
mov ESI, EBP
add ESI, 0xC
mov ECX, dword [ESI]
Call DebugStub_ComWrite16
mov ESI, dword [EBP + 8]
DebugStub_SendText_WriteChar:
cmp ECX, 0x0
JE near DebugStub_SendText_Finalize
Call DebugStub_ComWrite8
dec dword ECX
inc dword ESI
Jmp DebugStub_SendText_WriteChar
DebugStub_SendText_Finalize:
Popad
pop dword EBP
DebugStub_SendText_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendText_Exit
Ret
DebugStub_SendSimpleNumber:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_SimpleNumber
Call DebugStub_ComWriteAL
mov EAX, dword [EBP + 8]
Call DebugStub_ComWriteEAX
Popad
pop dword EBP
DebugStub_SendSimpleNumber_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendSimpleNumber_Exit
Ret
DebugStub_SendKernelPanic:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_KernelPanic
Call DebugStub_ComWriteAL
mov EAX, dword [EBP + 8]
Call DebugStub_ComWriteEAX
Call DebugStub_SendCoreDump
Popad
pop dword EBP
DebugStub_SendKernelPanic_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendKernelPanic_Exit
Ret
DebugStub_SendSimpleLongNumber:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_SimpleLongNumber
Call DebugStub_ComWriteAL
mov EAX, dword [EBP + 8]
Call DebugStub_ComWriteEAX
mov EAX, dword [EBP + 12]
Call DebugStub_ComWriteEAX
Popad
pop dword EBP
DebugStub_SendSimpleLongNumber_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendSimpleLongNumber_Exit
Ret
DebugStub_SendComplexNumber:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_ComplexNumber
Call DebugStub_ComWriteAL
mov EAX, dword [EBP + 8]
Call DebugStub_ComWriteEAX
Popad
pop dword EBP
DebugStub_SendComplexNumber_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendComplexNumber_Exit
Ret
DebugStub_SendComplexLongNumber:
push dword EBP
mov EBP, ESP
Pushad
mov AL, DebugStub_Const_Ds2Vs_ComplexLongNumber
Call DebugStub_ComWriteAL
mov EAX, dword [EBP + 8]
Call DebugStub_ComWriteEAX
mov EAX, dword [EBP + 12]
Call DebugStub_ComWriteEAX
Popad
pop dword EBP
DebugStub_SendComplexLongNumber_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendComplexLongNumber_Exit
Ret
DebugStub_SendPtr:
mov AL, DebugStub_Const_Ds2Vs_Pointer
Call DebugStub_ComWriteAL
mov ESI, dword [EBP + 8]
Call DebugStub_ComWrite32
DebugStub_SendPtr_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendPtr_Exit
Ret
DebugStub_SendStackCorruptionOccurred:
mov AL, DebugStub_Const_Ds2Vs_StackCorruptionOccurred
Call DebugStub_ComWriteAL
mov ESI, DebugStub_CallerEIP
Call DebugStub_ComWrite32
Call DebugStub_SendCoreDump
DebugStub_SendStackCorruptionOccurred_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendStackCorruptionOccurred_Exit
Ret
DebugStub_SendStackOverflowOccurred:
mov AL, DebugStub_Const_Ds2Vs_StackOverflowOccurred
Call DebugStub_ComWriteAL
mov ESI, DebugStub_CallerEIP
Call DebugStub_ComWrite32
Call DebugStub_SendCoreDump
DebugStub_SendStackOverflowOccurred_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendStackOverflowOccurred_Exit
Ret
DebugStub_SendInterruptOccurred:
push dword EAX
mov AL, DebugStub_Const_Ds2Vs_InterruptOccurred
Call DebugStub_ComWriteAL
pop dword EAX
Call DebugStub_ComWriteEAX
DebugStub_SendInterruptOccurred_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendInterruptOccurred_Exit
Ret
DebugStub_SendNullReferenceOccurred:
mov AL, DebugStub_Const_Ds2Vs_NullReferenceOccurred
Call DebugStub_ComWriteAL
mov ESI, DebugStub_CallerEIP
Call DebugStub_ComWrite32
Call DebugStub_SendCoreDump
DebugStub_SendNullReferenceOccurred_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendNullReferenceOccurred_Exit
Ret
DebugStub_SendMessageBox:
mov AL, DebugStub_Const_Ds2Vs_MessageBox
Call DebugStub_ComWriteAL
mov ESI, EBP
add ESI, 0xC
mov ECX, dword [ESI]
Call DebugStub_ComWrite16
mov ESI, dword [EBP + 8]
DebugStub_SendMessageBox_WriteChar:
cmp ECX, 0x0
JE near DebugStub_SendMessageBox_Exit
Call DebugStub_ComWrite8
dec dword ECX
inc dword ESI
Jmp DebugStub_SendMessageBox_WriteChar
DebugStub_SendMessageBox_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendMessageBox_Exit
Ret
DebugStub_SendCoreDump:
push dword EAX
push dword EBX
push dword ECX
push dword EDX
push dword EDI
push dword ESI
mov EAX, DebugStub_CallerEBP
push dword EAX
mov EAX, DebugStub_CallerEIP
push dword EAX
mov EAX, DebugStub_CallerESP
push dword EAX
mov ECX, 0x24
mov EAX, EBP
DebugStub_SendCoreDump_Block1_Begin:
cmp EAX, 0x0
JE near DebugStub_SendCoreDump_Block1_End
mov EBX, dword [EAX + 4]
push dword EBX
add ECX, 0x4
mov EAX, dword [EAX]
Jmp DebugStub_SendCoreDump_Block1_Begin
DebugStub_SendCoreDump_Block1_End:
mov AL, DebugStub_Const_Ds2Vs_CoreDump
Call DebugStub_ComWriteAL
mov EAX, ECX
Call DebugStub_ComWriteAX
DebugStub_SendCoreDump_Block2_Begin:
cmp ECX, 0x0
JE near DebugStub_SendCoreDump_Block2_End
pop dword EAX
Call DebugStub_ComWriteEAX
dec dword ECX
Jmp DebugStub_SendCoreDump_Block2_Begin
DebugStub_SendCoreDump_Block2_End:
DebugStub_SendCoreDump_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_SendCoreDump_Exit
Ret
 
 | 21.487179 
							 | 77 
							 | 0.871838 
							 | 
					
	b624dba12b6328f4e17aa57034317dce76af2803 
 | 266 
							 | 
	asm 
 | 
	Assembly 
 | 
	symbols_eu.asm 
 | 
	Prof9/MMZX-Slot2-Patch 
 | 
	8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 
 | 
	[
  "Unlicense"
]  | 10 
							 | 
	2019-08-20T04:41:44.000Z 
 | 
	2021-12-16T15:40:59.000Z 
 | 
	symbols_eu.asm 
 | 
	Prof9/MMZX-Slot2-Patch 
 | 
	8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 
 | 
	[
  "Unlicense"
]  | null  | null  | null  | 
	symbols_eu.asm 
 | 
	Prof9/MMZX-Slot2-Patch 
 | 
	8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 
 | 
	[
  "Unlicense"
]  | 1 
							 | 
	2021-07-03T19:17:48.000Z 
 | 
	2021-07-03T19:17:48.000Z 
 | 
	.definelabel	IsZero3Inserted,	0x2010CD0
.definelabel	IsZero4Inserted,	0x2010D08
.definelabel	LoadGbaFile,		0x2010D48
.definelabel	FS_ReadFile,		0x20AF210
.definelabel	FS_CloseFile,		0x20AF300
.definelabel	FS_OpenFile,		0x20AF348
.definelabel	FS_InitFile,		0x20AF698
 
 | 33.25 
							 | 39 
							 | 0.849624 
							 | 
					
	dbbff364f372198bb1cb9443b552340d7bde97f6 
 | 3,302 
							 | 
	asm 
 | 
	Assembly 
 | 
	vpx_dsp/arm/idct8x8_1_add_neon.asm 
 | 
	golden1232004/libvpx 
 | 
	61a8b8673411110823d31ffd9d3e28d5023c5e9f 
 | 
	[
  "BSD-3-Clause"
]  | 83 
							 | 
	2015-08-04T06:19:59.000Z 
 | 
	2022-03-25T03:33:55.000Z 
 | 
	vpx_dsp/arm/idct8x8_1_add_neon.asm 
 | 
	golden1232004/libvpx 
 | 
	61a8b8673411110823d31ffd9d3e28d5023c5e9f 
 | 
	[
  "BSD-3-Clause"
]  | 32 
							 | 
	2015-07-31T22:47:16.000Z 
 | 
	2022-03-16T01:57:49.000Z 
 | 
	vpx_dsp/arm/idct8x8_1_add_neon.asm 
 | 
	golden1232004/libvpx 
 | 
	61a8b8673411110823d31ffd9d3e28d5023c5e9f 
 | 
	[
  "BSD-3-Clause"
]  | 40 
							 | 
	2015-07-25T03:01:48.000Z 
 | 
	2022-03-29T07:55:34.000Z 
 | 
	;
;  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
;
;  Use of this source code is governed by a BSD-style license and patent
;  grant that can be found in the LICENSE file in the root of the source
;  tree. All contributing project authors may be found in the AUTHORS
;  file in the root of the source tree.
;
    EXPORT  |vpx_idct8x8_1_add_neon|
    ARM
    REQUIRE8
    PRESERVE8
    AREA ||.text||, CODE, READONLY, ALIGN=2
;void vpx_idct8x8_1_add_neon(int16_t *input, uint8_t *dest,
;                                  int dest_stride)
;
; r0  int16_t input
; r1  uint8_t *dest
; r2  int dest_stride)
|vpx_idct8x8_1_add_neon| PROC
    ldrsh            r0, [r0]
    ; generate cospi_16_64 = 11585
    mov              r12, #0x2d00
    add              r12, #0x41
    ; out = dct_const_round_shift(input[0] * cospi_16_64)
    mul              r0, r0, r12               ; input[0] * cospi_16_64
    add              r0, r0, #0x2000           ; +(1 << ((DCT_CONST_BITS) - 1))
    asr              r0, r0, #14               ; >> DCT_CONST_BITS
    ; out = dct_const_round_shift(out * cospi_16_64)
    mul              r0, r0, r12               ; out * cospi_16_64
    mov              r12, r1                   ; save dest
    add              r0, r0, #0x2000           ; +(1 << ((DCT_CONST_BITS) - 1))
    asr              r0, r0, #14               ; >> DCT_CONST_BITS
    ; a1 = ROUND_POWER_OF_TWO(out, 5)
    add              r0, r0, #16               ; + (1 <<((5) - 1))
    asr              r0, r0, #5                ; >> 5
    vdup.s16         q0, r0                    ; duplicate a1
    ; load destination data
    vld1.64          {d2}, [r1], r2
    vld1.64          {d3}, [r1], r2
    vld1.64          {d4}, [r1], r2
    vld1.64          {d5}, [r1], r2
    vld1.64          {d6}, [r1], r2
    vld1.64          {d7}, [r1], r2
    vld1.64          {d16}, [r1], r2
    vld1.64          {d17}, [r1]
    vaddw.u8         q9, q0, d2                ; dest[x] + a1
    vaddw.u8         q10, q0, d3               ; dest[x] + a1
    vaddw.u8         q11, q0, d4               ; dest[x] + a1
    vaddw.u8         q12, q0, d5               ; dest[x] + a1
    vqmovun.s16      d2, q9                    ; clip_pixel
    vqmovun.s16      d3, q10                   ; clip_pixel
    vqmovun.s16      d30, q11                  ; clip_pixel
    vqmovun.s16      d31, q12                  ; clip_pixel
    vst1.64          {d2}, [r12], r2
    vst1.64          {d3}, [r12], r2
    vst1.64          {d30}, [r12], r2
    vst1.64          {d31}, [r12], r2
    vaddw.u8         q9, q0, d6                 ; dest[x] + a1
    vaddw.u8         q10, q0, d7                ; dest[x] + a1
    vaddw.u8         q11, q0, d16               ; dest[x] + a1
    vaddw.u8         q12, q0, d17               ; dest[x] + a1
    vqmovun.s16      d2, q9                     ; clip_pixel
    vqmovun.s16      d3, q10                    ; clip_pixel
    vqmovun.s16      d30, q11                   ; clip_pixel
    vqmovun.s16      d31, q12                   ; clip_pixel
    vst1.64          {d2}, [r12], r2
    vst1.64          {d3}, [r12], r2
    vst1.64          {d30}, [r12], r2
    vst1.64          {d31}, [r12], r2
    bx               lr
    ENDP             ; |vpx_idct8x8_1_add_neon|
    END
 
 | 37.101124 
							 | 79 
							 | 0.439128 
							 | 
					
	3e5d531e3cd10832cd51b041df09f433cafe58a0 
 | 679 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/270/A270257.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/270/A270257.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/270/A270257.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A270257: Number of 2X2X2 triangular 0..n arrays with some element plus some adjacent element totalling n exactly once.
; 0,12,24,48,72,108,144,192,240,300,360,432,504,588,672,768,864,972,1080,1200,1320,1452,1584,1728,1872,2028,2184,2352,2520,2700,2880,3072,3264,3468,3672,3888,4104,4332,4560,4800,5040,5292,5544,5808,6072,6348,6624,6912,7200,7500,7800,8112,8424,8748,9072,9408,9744,10092,10440,10800,11160,11532,11904,12288,12672,13068,13464,13872,14280,14700,15120,15552,15984,16428,16872,17328,17784,18252,18720,19200,19680,20172,20664,21168,21672,22188,22704,23232,23760,24300,24840,25392,25944,26508,27072,27648,28224,28812,29400,30000
add $0,1
pow $0,2
div $0,2
mul $0,6
 
 | 84.875 
							 | 520 
							 | 0.789396 
							 | 
					
	8fd5b03109d9eae8717939597fb7e2f7a93c617c 
 | 543 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/025/A025823.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-03-15T11:38:20.000Z 
 | 
	2021-03-15T11:38:20.000Z 
 | 
	programs/oeis/025/A025823.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	programs/oeis/025/A025823.asm 
 | 
	jmorken/loda 
 | 
	99c09d2641e858b074f6344a352d13bc55601571 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	; A025823: Expansion of 1/((1-x^2)(1-x^9)(1-x^10)).
; 1,0,1,0,1,0,1,0,1,1,2,1,2,1,2,1,2,1,3,2,4,2,4,2,4,2,4,3,5,4,6,4,6,4,6,4,7,5,8,6,9,6,9,6,9,7,10,8,11,9,12,9,12,9,13,10,14,11,15,12,16,12,16,13,17,14,18,15,19,16,20,16
mov $5,$0
mov $7,2
lpb $7
  clr $0,5
  mov $0,$5
  sub $7,1
  add $0,$7
  sub $0,1
  lpb $0
    mov $1,$0
    cal $1,25791 ; Expansion of 1/((1-x)(1-x^9)(1-x^10)).
    sub $0,2
    add $2,$1
  lpe
  mov $1,$2
  add $1,1
  mov $8,$7
  lpb $8
    mov $6,$1
    sub $8,1
  lpe
lpe
lpb $5
  mov $5,0
  sub $6,$1
lpe
mov $1,$6
 
 | 17.516129 
							 | 167 
							 | 0.499079 
							 | 
					
	e019b85e49f0d0868fdc82907b125a80ced2b15b 
 | 176 
							 | 
	asm 
 | 
	Assembly 
 | 
	C/Mips(Assembly)_C/Lab3/Ex3_1b.asm 
 | 
	paulolima18/ProgrammingMesh 
 | 
	2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df 
 | 
	[
  "MIT"
]  | 3 
							 | 
	2021-02-15T11:36:52.000Z 
 | 
	2021-06-27T14:21:01.000Z 
 | 
	C/Mips(Assembly)_C/Lab3/Ex3_1b.asm 
 | 
	paulolima18/ProgrammingMesh 
 | 
	2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	C/Mips(Assembly)_C/Lab3/Ex3_1b.asm 
 | 
	paulolima18/ProgrammingMesh 
 | 
	2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	#0 - 0x00111111 - 0x3f
#1 - 0x00000110 - 0x06
#2 - 0x00101011 - 
#3 - 0x00000000
#4 - 0x00000000
#5 - 0x00000000
#6 - 0x00000000
#7 - 0x00000000
#8 - 0x01111111
#9 - 0x00000000 
 | 17.6 
							 | 22 
							 | 0.670455 
							 | 
					
	16f11c3054916d8e4224539a21b20612ff56d0af 
 | 2,944 
							 | 
	asm 
 | 
	Assembly 
 | 
	rustnes-dev/test_roms/test_apu_m/test_11.asm 
 | 
	w1n5t0n99/rustnes 
 | 
	2d03cc0c5dcc33d6f4ca35a009b2aee9c0d096d4 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2021-04-29T10:43:44.000Z 
 | 
	2021-05-06T04:45:20.000Z 
 | 
	rustnes-dev/test_roms/test_apu_m/test_11.asm 
 | 
	w1n5t0n99/rustnes 
 | 
	2d03cc0c5dcc33d6f4ca35a009b2aee9c0d096d4 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	rustnes-dev/test_roms/test_apu_m/test_11.asm 
 | 
	w1n5t0n99/rustnes 
 | 
	2d03cc0c5dcc33d6f4ca35a009b2aee9c0d096d4 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	; TEST 01
; 2012 (c) JrezCorp Team
;
; ASM6502
;
	.list
	.inesprg 1 ; 1 PRG
	.ineschr 1 ; 1 CHR
	.inesmir 0 ; V-mirroring
	.inesmap 0 ; 0-map (NMAP)
; MEMORY MAP
;
; 0x0000 - 0x04FF - arrays (0x0000-0x00FF - zero page, 0x0100-0x01FF - stack, 0x0200-0x02FF - sprite memmory)
; 0x0500 - 0x07FF - variables
; 0x0800 - 0x1FFF - mirrors of 0x0000 - 0x07FF
; 0x2000 - 0x2007 - PPU registers
; 0x2008 - 0x3FFF - mirrors of 0x2000 - 0x2007
; 0x4000 - 0x401F - 2A03 (APU) registers
; 0x4020 - 0x5FFF - mapper registers (not used)
; 0x6000 - 0x7FFF - SRAM
; 0x8000 - 0xFFFF - PRG ROM
; VARIABLES AND ARRAYS
stack = $0100 ; (size = 256)
sprite_mem = $0200 ; (size = 256)
nmi_hit = $0500 ; (size = 1)
first_run = $0501 ; (size = 1)
last_res = $0502 ; (size = 1)
	.bank 0
	.org $8000
; PRG ROM
main:
; PPU is turned off
; setup palette
	lda #$3f
	sta $2006
	lda #0
	sta $2006
	lda #13
	sta $2007
	lda #32
	sta $2007
	lda #14
	sta $2007
	lda #14
	sta $2007
; clear attributes
	lda #$23
	sta $2006
	lda #$c0
	sta $2006
	ldx #64
	lda #0
main_loop0:
	sta $2007
	dex
	bne main_loop0
	lda #$21
	sta $2006
	lda #$2a
	sta $2006
; TEST
	lda #0
	sta first_run
	sta last_res
	jmp test
	.org $8100
test:
	lda #$40
	sta $4017
	lda #0
	sta $4017
	ldx #$39
	ldy #$18
loop:
	dex
	bne loop
	dey
	bne loop
	nop
	nop
	lda $4015
	bne wait_1
wait_1:
	lda #$40
	sta $4017
	lda #0
	sta $4002
	sta $4003
	lda #1
	sta $4015
	lda #0
	sta $4003
	lda #$80
	ldx #7
clear_lc_loop:
	sta $4017
	dex
	bne clear_lc_loop
	stx $4017
	ldx #$38
	ldy #$18
clear_loop:
	dex
	bne clear_loop
	dey
	bne clear_loop
	nop
	nop
	nop
	nop
	sta $4017
	nop
	ldx #$ff
	lda $4015
	and #1
	ldy first_run
	bne test_check
	sta last_res
	lda #1
	sta first_run
	jmp test
test_check:
	eor last_res
	beq fail_loop
pass_loop:
	inx
	lda test_success, x
	sta $2007
	bne pass_loop
	beq test_end
fail_loop:
	inx
	lda test_error, x
	sta $2007
	bne fail_loop
test_end:
	jsr vwait
	lda #%00001010
	sta $2001
	clv
eloop:
	bvc eloop
; clear scroll
clear_scroll:
	lda #0
	sta $2006
	sta $2006
	rts
; wait for vblank starts
vwait_start:
	bit $2002
vwait_start_loop0:
	bit $2002
	bpl vwait_start_loop0
	rts
; wait for vblank ends and clear scroll
vwait_end:
	jsr vwait_end_wc
	jmp clear_scroll
; wait for vblank ends
vwait_end_wc:
	lda $2002
	bmi vwait_end_wc
	rts
; wait for a vblank
vwait:
	jsr vwait_wc
	jmp clear_scroll
; wait for a vblank (scroll not cleared)
vwait_wc:
	jsr vwait_start
	jmp vwait_end_wc
; entry point
start:
; turn off PPU
	lda #0
	sta $2000
	sta $2001
; disable interrupts
	sei
; reset stack pointer
	ldx $ff
	txs
; wait for two vblanks
	jsr vwait_wc
	jsr vwait_wc
; goto main
	jmp main
; non-maskable interrupt
nmi:
; save state
	php
	pha
	lda #1
	sta nmi_hit
	pla
	plp
	rti
; ignore any irq
irq:
	rti
; DATA
test_error:
	.db "TEST FAILED",0
test_success:
	.db "TEST PASSED",0
; POINTERS
	.bank 1
	.org $FFFA
	.dw nmi, start, irq
; CHR ROM
	.bank 2
	.org $0000
	.incbin "rom.chr"
 
 | 12.317992 
							 | 109 
							 | 0.67731 
							 | 
					
	c487194b4e3cc8a5169f56374beb008883e8204a 
 | 18,767 
							 | 
	asm 
 | 
	Assembly 
 | 
	Appl/FileMgrs/CommonDesktop/CMain/cmainProcess.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 504 
							 | 
	2018-11-18T03:35:53.000Z 
 | 
	2022-03-29T01:02:51.000Z 
 | 
	Appl/FileMgrs/CommonDesktop/CMain/cmainProcess.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 96 
							 | 
	2018-11-19T21:06:50.000Z 
 | 
	2022-03-06T10:26:48.000Z 
 | 
	Appl/FileMgrs/CommonDesktop/CMain/cmainProcess.asm 
 | 
	steakknife/pcgeos 
 | 
	95edd7fad36df400aba9bab1d56e154fc126044a 
 | 
	[
  "Apache-2.0"
]  | 73 
							 | 
	2018-11-19T20:46:53.000Z 
 | 
	2022-03-29T00:59:26.000Z 
 | 
	COMMENT @----------------------------------------------------------------------
	Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT:	PC GEOS
MODULE:		Desktop/Main
FILE:		mainProcess.asm
ROUTINES:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	brianc	7/89		Initial version
DESCRIPTION:
	Misc routines
	$Id: cmainProcess.asm,v 1.2 98/06/03 13:44:56 joon Exp $
------------------------------------------------------------------------------@
UtilCode	segment resource
if _NEWDESK and not GPC_FOLDER_WINDOW_MENUS
COMMENT @----------------------------------------------------------------------
MESSAGE:	DesktopCancelOptions -- MSG_DESKTOP_CANCEL_OPTIONS
							for DesktopClass
DESCRIPTION:	Rset the options
PASS:
	*ds:si - instance data
	es - segment of DesktopClass
	ax - The message
RETURN:
DESTROYED:
	bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	Tony	3/28/93		Initial version
------------------------------------------------------------------------------@
DesktopCancelOptions	method dynamic	DesktopClass, MSG_DESKTOP_CANCEL_OPTIONS
	; see if there are any options saved
	segmov	ds, cs
	lea	si, newdeskbaString			;dssi = category
	mov	cx, cs
	lea	dx, warningsString
	call	InitFileReadInteger
	jc	noOptionsSaved
	; options are saved
	mov	ax, MSG_META_LOAD_OPTIONS
	mov	bx, handle OptionsMenu
	mov	si, offset OptionsMenu
	clr	di
	GOTO	ObjMessage
noOptionsSaved:
	FALL_THRU	DesktopResetOptions
DesktopCancelOptions	endm
COMMENT @----------------------------------------------------------------------
MESSAGE:	DesktopResetOptions -- MSG_DESKTOP_RESET_OPTIONS
							for DesktopClass
DESCRIPTION:	Rset the options
PASS:
	*ds:si - instance data
	es - segment of DesktopClass
	ax - The message
RETURN:
DESTROYED:
	bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	Tony	3/28/93		Initial version
------------------------------------------------------------------------------@
DesktopResetOptions	method DesktopClass, MSG_DESKTOP_RESET_OPTIONS
if 0
	; delete the category
	segmov	ds, cs
	lea	si, newdeskbaString			;dssi = category
	call	InitFileDeleteCategory
endif
	; and reset stuff
	; stuff default values
	mov	bx, handle FileDeleteOptionsGroup
	mov	si, offset FileDeleteOptionsGroup
	mov	ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
	mov	cx, OCDL_FULL
	clr	dx
	call	sendMessage
	mov	cx, 1					;mark modified
	mov	ax, MSG_GEN_ITEM_GROUP_SET_MODIFIED_STATE
	call	sendMessage
	mov	ax, MSG_GEN_ITEM_GROUP_SEND_STATUS_MSG
	call	sendMessage
	mov	ax, MSG_GEN_APPLY
	call	sendMessage
	mov	bx, handle OptionsList
	mov	si, offset OptionsList
	mov	cx, mask OMI_CONFIRM_EMPTY_WB or mask OMI_CONFIRM_READ_ONLY or \
		    mask OMI_CONFIRM_REPLACE or mask OMI_CONFIRM_EXECUTABLE or \
		    mask OMI_ASK_BEFORE_RETURNING
	clr	dx
	mov	ax, MSG_GEN_BOOLEAN_GROUP_SET_GROUP_STATE
	call	sendMessage
	mov	cx, mask OptionsMenuItems
	clr	dx
	mov	ax, MSG_GEN_BOOLEAN_GROUP_SET_GROUP_MODIFIED_STATE
	call	sendMessage
	mov	ax, MSG_GEN_BOOLEAN_GROUP_SEND_STATUS_MSG
	call	sendMessage
	mov	ax, MSG_GEN_APPLY
	call	sendMessage
	ret
;---
sendMessage:
	clr	di
	call	ObjMessage
	retn
DesktopResetOptions	endm
warningsString	char	"warnings", 0
newdeskbaString	char	"fileManager", 0
endif
if _NEWDESKBA
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopRunIclasBatchFileIfNeeded
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Way of forcing thing on the queue.  See called
		routine for details.
CALLED BY:	MSG_DESKTOP_RUN_ICLAS_BATCH_FILE_IF_NEEDED
PASS:		*ds:si	= BAApplicationClass object
		ds:di	= BAApplicationClass instance data
		ds:bx	= BAApplicationClass object (same as *ds:si)
		es 	= segment of BAApplicationClass
		ax	= message #
RETURN:		
DESTROYED:	
SIDE EFFECTS:	
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	RB	2/ 6/93   	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BAAppRunIclasBatchFileIfNeeded	method dynamic DesktopClass,
				MSG_BA_APP_RUN_ICLAS_BATCH_FILE_IF_NEEDED
	uses	ax, cx, dx, bp
	.enter
		call	IclasRunSpecialBatchFileIfNeeded
	.leave
	ret
BAAppRunIclasBatchFileIfNeeded	endm
endif		; _NEWDESKBA
if _DOS_LAUNCHERS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopHandleCreateOrEditLauncher
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	DOS:Create Launcher or DOS:Edit Launcher was selected
CALLED BY:	MSG_CREATE_DOS_LAUNCHER, MSG_EDIT_DOS_LAUNCHER
PASS:		es - segment of DesktopClass
RETURN:		none
DESTROYED:	???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		none
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	dlitwn	06/22/92	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopHandleCreateOrEditLauncher	method DesktopClass,
					MSG_CREATE_DOS_LAUNCHER, 
					MSG_EDIT_DOS_LAUNCHER
	.enter
NOFXIP<	segmov	es, dgroup, bx		; es = dgroup			>
FXIP  <	GetResourceSegmentNS dgroup, es, TRASH_BX			>
	mov	es:[creatingLauncher], 1
	cmp	ax, MSG_CREATE_DOS_LAUNCHER
	je	gotCreateEdit
	mov	es:[creatingLauncher], 0
gotCreateEdit:
	mov	bx, ss:[targetFolder]		; bx:si = target folder object
	mov	si, FOLDER_OBJECT_OFFSET	; common offset
	tst	bx				; check if any target
	jz	noFolder
	call	ObjMessageCall			; send to folder object
	jmp	done
	; don't check tree, because tree window can't select files.
noFolder:
	cmp	ax, MSG_CREATE_DOS_LAUNCHER
	mov	ax, MSG_GEN_INTERACTION_INITIATE
	mov	bx, handle GetCreateLauncherFileBoxSelectTrigger
	mov	si, offset GetCreateLauncherFileBoxSelectTrigger
	mov	cx, handle GetCreateLauncherFileBox
	mov	dx, offset GetCreateLauncherFileBox	; default to create
	je	sendIt
	mov	bx, handle GetEditLauncherFileBoxSelectTrigger
	mov	si, offset GetEditLauncherFileBoxSelectTrigger
	mov	cx, handle GetEditLauncherFileBox	; ...else edit
	mov	dx, offset GetEditLauncherFileBox
sendIt:
	push	cx, dx
	mov	dl, VUM_NOW
	mov	ax, MSG_GEN_SET_NOT_ENABLED
	call	ObjMessageCall
	pop	bx, si
	mov	ax, MSG_GEN_INTERACTION_INITIATE
	call	ObjMessageForce
done:
	.leave
	ret
DesktopHandleCreateOrEditLauncher	endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopCreateEditFileSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	The user hit OK on either the Create File Selector or Edit
		File Selector.
CALLED BY:	MSG_DOS_LAUNCHER_FILE_SELECTED
PASS:		none
RETURN:		none
DESTROYED:	???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		none
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	dlitwn	06/22/92	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopCreateEditFileSelected	method DesktopClass,
						MSG_DOS_LAUNCHER_FILE_SELECTED
	.enter
NOFXIP<	segmov	es, dgroup, bx		; es = dgroup			>
FXIP  <	GetResourceSegmentNS dgroup, es, TRASH_BX			>
	sub	sp, PATH_BUFFER_SIZE + FILE_LONGNAME_BUFFER_SIZE
	mov	cx, ss
	mov	dx, sp				; copy into stack buffer
	mov	bx, handle CreateLauncherFileSelector
	mov	si, offset CreateLauncherFileSelector
	cmp	es:[creatingLauncher], 0
	jne	gotObject
	mov	bx, handle EditLauncherFileSelector
	mov	si, offset EditLauncherFileSelector
gotObject:
	mov	ax, MSG_GEN_FILE_SELECTOR_GET_FULL_SELECTION_PATH
	call	ObjMessageCall
	mov	di, dx
	mov	bx, ax				; put diskhandle in bx
	clr	ax
	mov	cx, -1
	LocalFindChar				; go to end of string
	not	cx				; get length to cx
	LocalPrevChar esdi			; point es:di to null
	mov	si, di				; si points to null at end
	std					; reverse direction flag
	LocalLoadChar ax, C_BACKSLASH		; find last '\\'
	LocalFindChar
	cld					; clear direction flag
	mov	ax, bx				; restore diskhandle to ax
	mov	bx, si				; point path to null at end
	jne	gotFileNameStart
	LocalNextChar esdi
SBCS <	mov	{byte} es:[di], 0		; replace '\\' with null >
DBCS <	mov	{wchar} es:[di], 0		; replace '\\' with null >
	mov	bx, sp				; sp points to path start
gotFileNameStart:
	LocalNextChar esdi
	mov	si, di
	mov	bp, di				; save this in bp
	segmov	ds, es, di			; ds:si = name, es:di = idata
	mov	di, offset launcherGeosName
	mov	cx, FILE_LONGNAME_BUFFER_SIZE/2
	rep	movsw				; copy into idata
	mov	si, bp				; reset
	mov	di, offset launchFileName
	mov	cx, FILE_LONGNAME_BUFFER_SIZE/2
	rep	movsw				; copy into idata
	call	DOSLauncherFileSelected		; pass ax, ds:bx as path
	add	sp, PATH_BUFFER_SIZE + FILE_LONGNAME_BUFFER_SIZE
	.leave
	ret
DesktopCreateEditFileSelected	endm
endif			; _DOS_LAUNCHERS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopRemoteErrorBox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	put up error box for UI thread.
CALLED BY:	MSG_REMOTE_ERROR_BOX
PASS:		cx - error code
RETURN:		nothing
DESTROYED:	
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		none
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	brianc	05/17/90	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopRemoteErrorBox	method	DesktopClass, MSG_REMOTE_ERROR_BOX
	mov	ax, cx				; pass error code in ax
	call	DesktopOKError			; do regular error box
	ret
DesktopRemoteErrorBox	endp
UtilCode	ends
if _ICON_AREA
ToolCode	segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopShowDrives
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Puts the drive buttons on the Toolbar at the bottom of
		Desktop's primary
CALLED BY:	DesktopSetDriveLocation
PASS:		none
RETURN:		none
DESTROYED:	???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		none
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	dlitwin	06/09/92	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopShowDrives	proc	near
	.enter
	call	ShowHourglass
	mov	cl, DRIVES_SHOWING
	mov	ax, MSG_TA_SET_DRIVE_LOCATION
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog
	call	ObjMessageCall
	mov	ax, MSG_GEN_GUP_INTERACTION_COMMAND
	mov	cx, IC_DISMISS
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog
	call	ObjMessageCall				; dismiss dialog
	mov	ax, MSG_TA_MOVE_DRIVE_TOOLS
	mov	cx, handle IconArea
	mov	dx, offset IconArea			; destination
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog		; source
	call	ObjMessageCall
	call	HideHourglass
	.leave
	ret
DesktopShowDrives	endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopFloatHideDrives
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	If cx = DRIVES_FLOATING
			Puts the drive buttons into a floating dialog and
			initiates it
		If cx = DRIVES_HIDDEN
			Hides the drive buttons from view by putting them
			into a floating dialog and NOT initating it.
		if cx = DRIVES_SHOWING
			call DesktopShowDrives to put the drives back in the
			ToolArea.
CALLED BY:	MSG_SET_DRIVES_LOCATION
PASS:		none
RETURN:		none
DESTROYED:	???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		none
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	dlitwin	06/09/92	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopSetDrivesLocation	method DesktopClass, MSG_SET_DRIVES_LOCATION
	.enter
	call	ShowHourglass
	cmp	cx, DRIVES_SHOWING
	jne	notDrivesShowing
	call	DesktopShowDrives
	jmp	exit
notDrivesShowing:
	push	cx				; new location
	mov	ax, MSG_TA_GET_DRIVE_LOCATION
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog
	call	ObjMessageCall
	cmp	cl, DRIVES_SHOWING
	jne	alreadyDialog
	mov	ax, MSG_TA_MOVE_DRIVE_TOOLS
	mov	cx, handle FloatingDrivesDialog
	mov	dx, offset FloatingDrivesDialog		; destination
	mov	bx, handle IconArea
	mov	si, offset IconArea			; source
	call	ObjMessageCall
alreadyDialog:
	pop	cx					; pop new location
	cmp	cx, DRIVES_FLOATING
	mov	ax, MSG_GEN_INTERACTION_INITIATE
	je	gotMessage
	mov	ax, MSG_GEN_GUP_INTERACTION_COMMAND
gotMessage:
	push	cx					; save location
	mov	cx, IC_DISMISS				; if it was floating...
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog
	call	ObjMessageCall
	pop	cx					; restore location
	mov	ax, MSG_TA_SET_DRIVE_LOCATION
	mov	bx, handle FloatingDrivesDialog
	mov	si, offset FloatingDrivesDialog
	call	ObjMessageCall
exit:
	call	HideHourglass
	mov	ax, MSG_GEN_APPLICATION_OPTIONS_CHANGED
	call	UserCallApplication
	.leave
	ret
DesktopSetDrivesLocation	endm
if _PREFERENCES_LAUNCH
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopLaunchPreferences
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Launch PrefMgr
PASS:		
		ds - dgroup of class
		es - segment of DesktopClass
RETURN:		
		nothing
	
DESTROYED:	
		ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
		none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		This method should be optimized for SMALL SIZE over SPEED
		Common cases:
			unknown
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	srs	9/28/93   	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
prefFileName char "Preferences",0
prefToken GeodeToken <<"PMGR">,MANUFACTURER_ID_GEOWORKS>
DesktopLaunchPreferences	method dynamic DesktopClass, 
						MSG_DESKTOP_LAUNCH_PREFERENCES
	.enter
	mov	dx,MSG_GEN_PROCESS_OPEN_APPLICATION
	call	IACPCreateDefaultLaunchBlock
	jc	done
	;    Create LoadAppData block
	;
	mov	cx, mask HAF_LOCK shl 8
	mov	ax,size LoadAppData
	call	MemAlloc
	jc	destroyAppLaunchBlock
	;   Copy file name and token to LoadAppData block
	;
	mov	es,ax
	segmov	ds,cs
	mov	di,offset LAD_file
	mov	si,offset prefFileName
	mov	cx,size prefFileName
	rep	movsb
	mov	di,offset LAD_token
	mov	si,offset prefToken
	mov	cx,size prefToken
	rep	movsb
	call	MemUnlock			;LoadAppData block
	mov	cx,bx				;LoadAppData block
	;    Use MF_FORCE_QUEUE so that this code segment isn't locked
	;    when the application launches.
	;
	mov	bx,handle 0
	mov	di,mask MF_FORCE_QUEUE
	mov	ax,MSG_DESKTOP_LOAD_APPLICATION
	call	ObjMessage
done:
	.leave
	ret
destroyAppLaunchBlock:
	mov	bx,dx
	call	MemFree
	jmp	done
DesktopLaunchPreferences		endm
endif
ToolCode	ends	
endif		; _ICON_AREA
if _PEN_BASED
PseudoResident	segment	resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopAbortQuickTransfer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Easy way to abort quick-transfer on process thread.
CALLED BY:	MSG_DESKTOP_ABORT_QUICK_TRANSFER
PASS:		ds	= dgroup
		es 	= segment of DesktopClass
		ax	= MSG_DESKTOP_ABORT_QUICK_TRANSFER
RETURN:		nothing
ALLOWED TO DESTROY:	
		ax, cx, dx, bp
		bx, si, di, ds, es
SIDE EFFECTS:	
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	brianc	6/24/93  	Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DesktopAbortQuickTransfer	method	dynamic	DesktopClass,
					MSG_DESKTOP_ABORT_QUICK_TRANSFER
EC <	ECCheckDGroup	ds						>
	mov	ds:[fileDragging], 0
	mov	ds:[delayedFileDraggingEnd], BB_FALSE
	xor	bx, bx				; return END_OTHER
						; (carry clear - don't check
						;	quick-transfer status)
	call	ClipboardHandleEndMoveCopy
	ret
DesktopAbortQuickTransfer	endm
PseudoResident	ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		DesktopLaunchFromToken
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:	Launch app from token
PASS:		
		ds - dgroup of class
		es - segment of DesktopClass
		cxdx - token chars
		bp - manuf ID
RETURN:		
		nothing
	
DESTROYED:	
		ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
		none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
		This method should be optimized for SMALL SIZE over SPEED
		Common cases:
			unknown
REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	srs	9/28/93   	Initial version
	brianc	1/22/98		adapted for general launching
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _DOCMGR or GPC_SIGN_UP_ICON
UtilCode	segment	resource
launchFromTokenProgram	TCHAR	"Program",0
DesktopLaunchFromToken	method dynamic DesktopClass, 
						MSG_DESKTOP_LAUNCH_FROM_TOKEN
tokenHigh	local	word	push	cx
tokenLow	local	word	push	dx
	.enter
	mov	dx,MSG_GEN_PROCESS_OPEN_APPLICATION
	call	IACPCreateDefaultLaunchBlock
	jc	done
	;    Create LoadAppData block
	;
	mov	cx, mask HAF_LOCK shl 8 or mask HF_SWAPABLE
	mov	ax,size LoadAppData
	call	MemAlloc
	jc	destroyAppLaunchBlock
	;   Copy file name and token to LoadAppData block
	;
	mov	es,ax
	segmov	ds,SEGMENT_CS
	mov	di,offset LAD_file
	mov	si,offset launchFromTokenProgram
	mov	cx,size launchFromTokenProgram
	rep	movsb
	mov	ax, tokenHigh
	mov	{word}es:[LAD_token].GT_chars[0], ax
	mov	ax, tokenLow
	mov	{word}es:[LAD_token].GT_chars[2], ax
	mov	ax, ss:[bp]			; passed BP
	mov	{word}es:[LAD_token].GT_manufID, ax
	call	MemUnlock			;LoadAppData block
	mov	cx,bx				;LoadAppData block
	;    Use MF_FORCE_QUEUE so that this code segment isn't locked
	;    when the application launches.
	;
	mov	bx,handle 0
	mov	di,mask MF_FORCE_QUEUE
	mov	ax,MSG_DESKTOP_LOAD_APPLICATION
	call	ObjMessage
done:
	.leave
	ret
destroyAppLaunchBlock:
	mov	bx,dx
	call	MemFree
	jmp	done
DesktopLaunchFromToken		endm
UtilCode	ends
endif  ; _DOCMGR or GPC_SIGN_UP_ICON
 
 | 23.313043 
							 | 80 
							 | 0.628124 
							 | 
					
	5b2456b3f5ee0e93e26f74eb47bf19a160674f8a 
 | 1,365 
							 | 
	asm 
 | 
	Assembly 
 | 
	src/gcd.asm 
 | 
	SebastianPilarski/MIPS_Pipelined_Processor 
 | 
	fbf3084678e2e4708f5d44a52f625a972c878a12 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	src/gcd.asm 
 | 
	SebastianPilarski/MIPS_Pipelined_Processor 
 | 
	fbf3084678e2e4708f5d44a52f625a972c878a12 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	src/gcd.asm 
 | 
	SebastianPilarski/MIPS_Pipelined_Processor 
 | 
	fbf3084678e2e4708f5d44a52f625a972c878a12 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	# Pseudo-code:
# int gcd(int x, int y) {
# if (x > y)
# swap(x, y);
# return x == 0 ? y : gcd(y % x, x);
# }
        addi $11, $0, 2000  	# initializing the beginning of Data Section address in memory
        addi $29, $0, 32764
test:   addi $4, $0, 22866             # x 103*222
        addi $5, $0, 9991              # y 103*97
        sw   $4, 0($11)
        sw   $5, 4($11)
        addi $4, $0, 99                 #memory tests
        addi $5, $0, 151
        lw   $4, 0($11)
        lw   $5, 4($11)
        
        jal gcd
        sw   $2, 8($11)
EoP:	beq	 $11, $11, EoP 	#end of program (infinite loop)
gcd:    slt $8, $5, $4              # swap condition
        bne $8, $0, swap
        addi $29, $29, -12
        sw $5, 8($29)
        sw $4, 4($29)
        sw $31, 0($29)
        or $2, $0, $5               # y into output
        beq $4, $0, gcd_rt          # return if x == 0
        or $8, $0, $5
        or $5, $0, $4
        div $8, $4                  # divide y by x
        mfhi $4                     # take remainder as x
        jal gcd
        lw $5, 8($29)
        lw $4, 4($29)
        j gcd_rt
swap:   or $8, $0, $4               # put x into temp
        or $4, $0, $5               # put y into x
        or $5, $0, $8               # put temp into y
        j gcd
gcd_rt: lw $31, 0($29)
        addi $29, $29, 12
        jr $31 
 | 26.764706 
							 | 91 
							 | 0.376557 
							 | 
					
	1a960df224aa8d86dffdaeaee0331c086c77fb6e 
 | 11,519 
							 | 
	asm 
 | 
	Assembly 
 | 
	Firmware.asm 
 | 
	andrew-jacobs/annoy-a-tron 
 | 
	fc80008fd4908a8e7078b478a1afa3a6383ca084 
 | 
	[
  "CC0-1.0"
]  | null  | null  | null  | 
	Firmware.asm 
 | 
	andrew-jacobs/annoy-a-tron 
 | 
	fc80008fd4908a8e7078b478a1afa3a6383ca084 
 | 
	[
  "CC0-1.0"
]  | null  | null  | null  | 
	Firmware.asm 
 | 
	andrew-jacobs/annoy-a-tron 
 | 
	fc80008fd4908a8e7078b478a1afa3a6383ca084 
 | 
	[
  "CC0-1.0"
]  | 1 
							 | 
	2021-10-31T13:17:24.000Z 
 | 
	2021-10-31T13:17:24.000Z 
 | 
	;===============================================================================
;     _                                            _____                
;    / \   _ __  _ __   ___  _   _        __ _    |_   _| __ ___  _ __  
;   / _ \ | '_ \| '_ \ / _ \| | | |_____ / _` |_____| || '__/ _ \| '_ \ 
;  / ___ \| | | | | | | (_) | |_| |_____| (_| |_____| || | | (_) | | | |
; /_/   \_\_| |_|_| |_|\___/ \__, |      \__,_|     |_||_|  \___/|_| |_|
;                            |___/                                      
; An Annoy-a-tron
;-------------------------------------------------------------------------------
; Copyright (C)2012-2019 Andrew John Jacobs
; All rights reserved.
;
; This work is made available under the terms of the Creative Commons
; Zero Universal (1.0) license. Open the following URL to see the
; details.
;
; http://creativecommons.org/publicdomain/zero/1.0/
;===============================================================================
; Revision History:
;
; 2012-06-03 Initial version
;-------------------------------------------------------------------------------
                errorlevel -302
                errorlevel -312
;===============================================================================
; Fuse Configuration
;-------------------------------------------------------------------------------
                ifdef   __12F683
                include P12F683.inc
CONFIG_STD      equ     _FCMEN_OFF & _IESO_OFF & _BOREN_OFF & _MCLRE_ON & _INTOSCIO & _WDT_OFF
                ifdef   __DEBUG
CONFIG_BUILD    equ     _CPD_OFF & _CP_OFF & _PWRTE_OFF
                else
CONFIG_BUILD    equ     _CPD_ON & _CP_ON & _PWRTE_ON
                endif
                endif
                __config CONFIG_STD & CONFIG_BUILD
;===============================================================================
; Hardware Configuration
;-------------------------------------------------------------------------------
OSC             equ     .4000000
TMR0_HZ         equ     .100
TMR0_PRESCALE   equ     .64
TMR0_INCREMENT  equ     OSC / (.4 * TMR0_PRESCALE * TMR0_HZ)
                if      TMR0_INCREMENT > .255
                error   "TMR0 increment is bigger than 8-bits"
                endif
;===============================================================================
; Data Areas
;-------------------------------------------------------------------------------
                udata_shr
TICKS           res     .1                      ; 100Hz tick counter
VERSION         res     .1                      ; Data version number
OFFSET          res     .1                      ; Next write offset
LFSR            res     .2                      ; Current LFSR value
BEEPS           res     .1                      ; Number of beeps
SLEEPS          res     .1                      ; Number of sleep periods
SCRATCH         res     .1
;===============================================================================
; Power On Reset
;-------------------------------------------------------------------------------
.ResetVector    code    h'000'
PowerOnReset:
                banksel GPIO
                clrf    GPIO                    ; Set all pins low
                movlw   b'00000111'
;                         -----111              ; Disable comparators
                movwf   CMCON0
                banksel TRISIO
                clrf    ANSEL                   ; Disable analog features
                clrf    TRISIO                  ; Make all pins outputs
;-------------------------------------------------------------------------------
                clrf    VERSION                 ; Initialise randomise values
                clrf    LFSR+.0
                clrf    LFSR+.1
                clrw
FindLast:
                movwf   OFFSET 
                call    EepromSetAddr           ; Set offset of next data block
                call    EepromRead              ; Read the version bytes
                movwf   SCRATCH
                call    EepromRead
                xorlw   h'ff'
                xorwf   SCRATCH,W               ; And see if they are valid              
                btfss   STATUS,Z
                goto    NoMoreData              
                movf    OFFSET,W                ; Is this the first entry?
                btfsc   STATUS,Z
                goto    SaveData                ; Yes, save as best so far
                incf    VERSION,W               ; Matches expected version?
                xorwf   SCRATCH,W
                btfss   STATUS,Z
                goto    NoMoreData              ; No, last entry was the last
                
SaveData:
                movf    SCRATCH,W               ; Save the version number
                movwf   VERSION
                call    EepromRead              ; And read the LFSR state
                movwf   LFSR+.0
                call    EepromRead
                movwf   LFSR+.1
                movf    OFFSET,W                ; Try the next block
                addlw   .4
                goto    FindLast
NoMoreData:
                movf    LFSR+.0,W               ; Is the initial LFSR value
                iorwf   LFSR+.1,W               ; .. zero?
                btfsc   STATUS,Z
                incf    LFSR+.0,F               ; Yes, force a one bit
                call    Shift                   ; Generate the next value
                movf    OFFSET,W                ; Set offset to next block
                call    EepromSetAddr
                incf    VERSION,W               ; Write version header
                movwf   VERSION
                call    EepromWrite
                comf    VERSION,W
                call    EepromWrite
                movf    LFSR+.0,W               ; Followed by LFSR value
                call    EepromWrite
                movf    LFSR+.1,W
                call    EepromWrite
;===============================================================================
; Main Task
;-------------------------------------------------------------------------------
MainTask:
                banksel OPTION_REG              ; Set prescaler for TMR0
                movlw   b'10000101'
;                         1-------              ; Pullups not enabled
;                         -x------              ; Interrupt edge select
;                         --0-----              ; TMR0 source internal
;                         ---x----              ; TMR0 source edge
;                         ----0---              ; Prescaler assigned to TMR0
;                         -----101              ; Prescaler /64
                movwf   OPTION_REG
                call    Random                  ; Generate next random number
                movf    LFSR+.0,W               ; Extract the beep count
                andlw   h'03'
                movwf   BEEPS
                incf    BEEPS,F
                movf    LFSR+.1,W               ; Extract the sleep count
                andlw   h'1f'
                movwf   SLEEPS
                incf    SLEEPS,F
Beep:
                banksel GPIO                    ; Generate 1-4 short beeps
                bsf     GPIO,.2
                call    Delay
                bcf     GPIO,.2
                call    Delay
                decfsz  BEEPS,F
                goto    Beep
;-------------------------------------------------------------------------------
                clrwdt
                banksel OPTION_REG              ; Set prescaler for WDT
                movlw   b'10001111'
;                         1-------              ; Pullups not enabled
;                         -x------              ; Interrupt edge select
;                         --0-----              ; TMR0 source internal
;                         ---x----              ; TMR0 source edge
;                         ----1---              ; Prescaler assigned to WDT
;                         -----111              ; Prescaler /128
                movwf   OPTION_REG
                banksel WDTCON                  ; Configure and start watchdog
                movlw   b'00010001'
;                         ---1000-              ; /8192
                movwf   WDTCON
                clrwdt
                bsf     WDTCON,SWDTEN
Snore:
                sleep                           ; Sleep for 1-32 WDT periods
                nop
                nop
                clrwdt
                decfsz  SLEEPS,F
                goto    Snore
                bcf     WDTCON,SWDTEN           ; Disable watchdog
                goto    MainTask                ; Then do it all again
;-------------------------------------------------------------------------------
Delay:
                movlw   .25                     ; Set tick count for 25 periods
                movwf   TICKS
                banksel TMR0
DelayReset:
                movlw   low -TMR0_INCREMENT     ; Reset TMR0 for 1/100sec
                movwf   TMR0
DelayWait:
                movf    TMR0,W                  ; Wait for period to elapse
                btfss   STATUS,Z
                goto    DelayWait
                decfsz  TICKS,F                 ; Repeat for each tick
                goto    DelayReset
                return                          ; Done
;-------------------------------------------------------------------------------
Random:
                call    $+.1                    ; Shift the LFSR by 8 bits
                call    $+.1
                call    $+.1
Shift:
                bcf     STATUS,C                ; Shift the LFSR one bit
                rrf     LFSR+.1,F
                rrf     LFSR+.0,F
                btfss   STATUS,C
                return
                movlw   h'b4'                   ; And XOR back it dropped bits
                xorwf   LFSR+.1,F
                return
;===============================================================================
; EEPROM Access Routines
;-------------------------------------------------------------------------------
; Set the EEPROM memory address in WREG as the address for the next EEPROM read
; or write operation.
EepromSetAddr:
                banksel EEADR
                movwf   EEADR                   ; Set target EEPROM address
                return
; Trigger a read from the EEPROM memory and returns the value in WREG. The
; address is moved on by one ready to read the following byte.
EepromRead:
                banksel EECON1
                bsf     EECON1,RD               ; Trigger an EEPROM read
                incf    EEADR,F                 ; Bump address by one
                movf    EEDATA,W                ; And fetch the recovered data
                return
; Write the value in WREG to the current target address and then bump the
; address by one.
EepromWrite:
                banksel EEDAT                   ; Save the data byte to write
                movwf   EEDAT
                BSF     EECON1,WREN             ; Enable writing to EEPROM
                MOVLW   h'55'                   ; Perform unlock sequence
                MOVWF   EECON2
                MOVLW   h'AA'
                MOVWF   EECON2
                BSF     EECON1,WR               ; Start a data write
                BCF     EECON1,WREN
WriteWait:
                btfsc   EECON1,WR               ; Wait for write to complete
                goto    WriteWait
                incf    EEADR,F                 ; Bump address by one
                return
                end 
 | 39.047458 
							 | 94 
							 | 0.347773 
							 | 
					
	c5dfad82c709455dff82ee7ed35d668a2296934c 
 | 1,457 
							 | 
	asm 
 | 
	Assembly 
 | 
	programs/oeis/123/A123194.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 22 
							 | 
	2018-02-06T19:19:31.000Z 
 | 
	2022-01-17T21:53:31.000Z 
 | 
	programs/oeis/123/A123194.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 41 
							 | 
	2021-02-22T19:00:34.000Z 
 | 
	2021-08-28T10:47:47.000Z 
 | 
	programs/oeis/123/A123194.asm 
 | 
	neoneye/loda 
 | 
	afe9559fb53ee12e3040da54bd6aa47283e0d9ec 
 | 
	[
  "Apache-2.0"
]  | 5 
							 | 
	2021-02-24T21:14:16.000Z 
 | 
	2021-08-09T19:48:05.000Z 
 | 
	; A123194: a(n) = (n+1)*Fibonacci(n+2) + 3.
; 4,7,12,23,43,81,150,275,498,893,1587,2799,4904,8543,14808,25555,43931,75261,128538,218923,371934,630457,1066467,1800603,3034828,5106871,8580900,14398415,24129163,40388073,67527582,112786499,188195274,313733813,522562323,869681415,1446262256,2403347471,3991032048,6623205643,10984486139,18206766357,30160575522,49935739483,82634035638,136675893361,225953767875,373379618355,616727182228,1018250553703,1680515285052,2772447140999,4572181277419,7537528572033,12421828854438,20464376585075,33703343603106,55489877510381,91332516599283,150283846917663,247217111810744,406563159830207,668443221036552,1098731531364163,1805562852293723,2966407634048301,4872471836625450,8001494071347595,13137081858930318,21564306481909033,35390234843427747,58069118379556299,95262776779791964,156249895770375703,256234096718003028,420123417267241535,688718362931942731,1128842053924745241,1849921539528947118,3031124989851512483,4965769048450538874,8133977953769950757,13321553436758468307,21814421740534297143,35716671961836622208,58470680836920654191,95707636717850868000,156638188608414848635,256325980299002634683,419404194933797727813,686150356231917525042,1122414758191212659899,1835845502447744754534,3002400855689069391073,4909667341211540691843,8027629775025448605795,13124279677436554366756,21454453591786406564551,35068259969746929592428,57314784401381708410103
add $0,1
seq $0,23607 ; a(n) = n * Fibonacci(n+1).
add $0,3
 
 | 208.142857 
							 | 1,351 
							 | 0.896362 
							 | 
					
	682d50e4e8e0a22ea84cd666421dfb3816ed4eb6 
 | 875 
							 | 
	asm 
 | 
	Assembly 
 | 
	examples/fib.asm 
 | 
	Benderx2/FVM 
 | 
	520ba257509069d0afeb8771b1b254681e4becfb 
 | 
	[
  "BSD-2-Clause"
]  | 2 
							 | 
	2017-07-20T00:37:43.000Z 
 | 
	2017-09-24T14:33:12.000Z 
 | 
	examples/fib.asm 
 | 
	Benderx2/FVM 
 | 
	520ba257509069d0afeb8771b1b254681e4becfb 
 | 
	[
  "BSD-2-Clause"
]  | null  | null  | null  | 
	examples/fib.asm 
 | 
	Benderx2/FVM 
 | 
	520ba257509069d0afeb8771b1b254681e4becfb 
 | 
	[
  "BSD-2-Clause"
]  | null  | null  | null  | 
	include 'a32.inc'
_start:
LOAD_R0 string
CALLF print
LOAD_R1 5
XOR R1, R1
VM_DEBUG
LOAD_R0 15
LOAD_R1 25
ADDR R0, R1
VM_DEBUG
LOAD_R0 R1
CMPR R0, R1
JMPF_E .equal
;; this line wont be printed
LOAD_R0 not_equal_string
CALLF print
.equal:
LOAD_R0 fib_test
CALLF print
CALLF do_fib_test
VM_EXIT
print:
PUSH R0
PUSH R1
.ploop:
LOAD_BYTE
CMPR R1, 0
JMPF_E .done
VM_CALL 0
JMPF .ploop
.done:
POP R1
POP R0
RETF
do_fib_test:
LOAD_R0 1	
LOAD_R2 0
LOAD_R3 1
.ploop:
; R3 = 1
; R0 = 1
; R0 + R3 = R0 = 2
; R3 = 1
; R0 = 2
; R3 = 1
; R0 + R3 = R0 = 3
; R3 = 2
; ???
LOAD_R3 R4
LOAD_R4 R0
ADDR R0, R3
LOAD_R1 R0
VM_CALL 3
LOAD_R1 ' '
VM_CALL 0
INCR R2
CMPR R2, 12
JMPF_E .done
JMPF .ploop
.done:
RETF
_end_start:
_data:
string: db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 0
not_equal_string: db 'R0 and R1 aren"t equal FAIL', 0
fib_test: db 'Fibonacci Test....', 0x0A, 0
_end_data:
_bss:
_end_bss:
 
 | 12.323944 
							 | 53 
							 | 0.716571 
							 | 
					
	a0e69a88712613ceec38265ab297178a45b9e22a 
 | 491 
							 | 
	asm 
 | 
	Assembly 
 | 
	Tests/Core/Macros/Macros.asm 
 | 
	fengjixuchui/armips 
 | 
	781edcc0c41cc1b1dd81be8bc3d7e389b4ce1ab5 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2016-09-30T22:19:33.000Z 
 | 
	2017-02-12T13:22:45.000Z 
 | 
	Tests/Core/Macros/Macros.asm 
 | 
	fengjixuchui/armips 
 | 
	781edcc0c41cc1b1dd81be8bc3d7e389b4ce1ab5 
 | 
	[
  "MIT"
]  | 2 
							 | 
	2016-09-30T22:03:19.000Z 
 | 
	2017-02-03T16:44:08.000Z 
 | 
	Tests/Core/Macros/Macros.asm 
 | 
	fengjixuchui/armips 
 | 
	781edcc0c41cc1b1dd81be8bc3d7e389b4ce1ab5 
 | 
	[
  "MIT"
]  | null  | null  | null  | 
	.gba
.create "output.bin",0
; check token replacement
.macro pushWrapper, registers
  push registers
.endmacro
.macro ldrWrapper, target, source
  ldr target,source
.endmacro
pushWrapper {r5,r7}
ldrWrapper r2,[r4, r5]
; check parameters containing function calls
.macro cat, a, b
  .byte "" + a + b
  .align
.endmacro
cat toHex(255, 4), toHex(256, 3)
; check equ usage in macros
.macro print, a
  value equ "<" + a + ">"
  .notice value
.endmacro
print "test1"
print "test2"
.close
 
 | 14.441176 
							 | 44 
							 | 0.692464 
							 | 
					
	d63fef3905dff90e531adaf5885031ac7151cc9b 
 | 200 
							 | 
	asm 
 | 
	Assembly 
 | 
	libsrc/stdio/ansi/px8/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 640 
							 | 
	2017-01-14T23:33:45.000Z 
 | 
	2022-03-30T11:28:42.000Z 
 | 
	libsrc/stdio/ansi/px8/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 1,600 
							 | 
	2017-01-15T16:12:02.000Z 
 | 
	2022-03-31T12:11:12.000Z 
 | 
	libsrc/stdio/ansi/px8/f_ansi_cls.asm 
 | 
	jpoikela/z88dk 
 | 
	7108b2d7e3a98a77de99b30c9a7c9199da9c75cb 
 | 
	[
  "ClArtistic"
]  | 215 
							 | 
	2017-01-17T10:43:03.000Z 
 | 
	2022-03-23T17:25:02.000Z 
 | 
	;
; 	ANSI Video handling for the Epson PX8
;	By Stefano Bodrato - 2019
;
; 	CLS - Clear the screen
;	
;
;	$Id: f_ansi_cls.asm $
;
	SECTION code_clib
	PUBLIC	ansi_cls
	
	EXTERN	clg
.ansi_cls
	jp	clg
 
 | 11.111111 
							 | 40 
							 | 0.675 
							 | 
					
	b900c8532d7172aa7572f4b07ec93b0eb18760a9 
 | 1,133 
							 | 
	asm 
 | 
	Assembly 
 | 
	_build/dispatcher/jmp_ippsECCPSetStd128r2_07ee26b6.asm 
 | 
	zyktrcn/ippcp 
 | 
	b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 
 | 
	[
  "Apache-2.0"
]  | 1 
							 | 
	2021-10-04T10:21:54.000Z 
 | 
	2021-10-04T10:21:54.000Z 
 | 
	_build/dispatcher/jmp_ippsECCPSetStd128r2_07ee26b6.asm 
 | 
	zyktrcn/ippcp 
 | 
	b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	_build/dispatcher/jmp_ippsECCPSetStd128r2_07ee26b6.asm 
 | 
	zyktrcn/ippcp 
 | 
	b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 
 | 
	[
  "Apache-2.0"
]  | null  | null  | null  | 
	extern m7_ippsECCPSetStd128r2:function
extern n8_ippsECCPSetStd128r2:function
extern y8_ippsECCPSetStd128r2:function
extern e9_ippsECCPSetStd128r2:function
extern l9_ippsECCPSetStd128r2:function
extern n0_ippsECCPSetStd128r2:function
extern k0_ippsECCPSetStd128r2:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq  .Lin_ippsECCPSetStd128r2
.Larraddr_ippsECCPSetStd128r2:
    dq m7_ippsECCPSetStd128r2
    dq n8_ippsECCPSetStd128r2
    dq y8_ippsECCPSetStd128r2
    dq e9_ippsECCPSetStd128r2
    dq l9_ippsECCPSetStd128r2
    dq n0_ippsECCPSetStd128r2
    dq k0_ippsECCPSetStd128r2
segment .text
global ippsECCPSetStd128r2:function (ippsECCPSetStd128r2.LEndippsECCPSetStd128r2 - ippsECCPSetStd128r2)
.Lin_ippsECCPSetStd128r2:
    db 0xf3, 0x0f, 0x1e, 0xfa
    call ippcpSafeInit wrt ..plt
    align 16
ippsECCPSetStd128r2:
    db 0xf3, 0x0f, 0x1e, 0xfa
    mov     rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
    movsxd  rax, dword [rax]
    lea     r11, [rel .Larraddr_ippsECCPSetStd128r2]
    mov     r11, qword [r11+rax*8]
    jmp     r11
.LEndippsECCPSetStd128r2:
 
 | 29.051282 
							 | 103 
							 | 0.805825 
							 | 
					
			Subsets and Splits
				
	
				
			
				
No community queries yet
The top public SQL queries from the community will appear here once available.