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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b0e605d100751e58e2f1778fb9f05feee5fbff28 | 3,848 | asm | Assembly | Driver/Printer/DotMatrix/Gemini9/gemini9ControlCodes.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/DotMatrix/Gemini9/gemini9ControlCodes.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/DotMatrix/Gemini9/gemini9ControlCodes.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z |
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Star Gemini 9-pin Print Driver
FILE: gemini9ControlCodes.asm
AUTHOR: Dave Durran, 1 April 1990
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 4/1/90 Initial revision
DC_ESCRIPTION:
This file contains all the Printer Control Codes for the gemini 9-pin
driver.
$Id: gemini9ControlCodes.asm,v 1.1 97/04/18 11:54:33 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;*****************************************************************************
;
;CONTROL CODES FOR THE Star Gemini 9-PIN PRINTERS.....
;
; the first byte is the byte count for the control code.
;
;*****************************************************************************
;__________Job Control______________________________________
pr_codes_ResetPrinter label byte
byte NULL ;2,C_ESC,"@"
pr_codes_InitPrinter label byte
byte 6,0 ;send a null to wait till after any reset garb
byte C_ESC,"O" ;cancel any perforation skipping.
byte C_ESC,"U",1 ;set uni-directional
pr_codes_InitTextMode label byte
byte 3 ;count
byte C_ESC,"U",0 ;set bi-directional
pr_codes_DefeatPaperOut label byte
byte 2,C_ESC,"8"
;__________ASF Control______________________________________
pr_codes_InitPaperLength label byte
byte 4,C_ESC,"C",0,22 ;set page length to max (22")
pr_codes_FormFeed label byte
byte 5
byte C_ESC,"3",2 ;set 2/144" line spacing.
byte C_ESC,"C" ;set the page length.
;__________Cursor Control______________________________________
pr_codes_SetTab label byte
byte 2
byte C_ESC,"D" ;set the tab...
pr_codes_DoTab label byte
byte 2,0,C_HT
pr_codes_DoLineFeed label byte
byte 2,C_ESC,"J"
pr_codes_DoMaxLineFeed label byte
byte 3,C_ESC,"J",PR_MAX_LINE_FEED
pr_codes_Do1ScanlineFeed label byte
byte 3,C_ESC,"J",1
;__________Graphics Control______________________________________
pr_codes_SetLoGraphics label byte
byte 3,C_CR,C_ESC,"K"
pr_codes_SetMedGraphics label byte
pr_codes_SetHiGraphics label byte ;used for hi also....
byte 3,C_CR,C_ESC,"L"
;__________Pitch Control______________________________________
pr_codes_Set10PitchRoman label byte
byte 3,C_ESC,"B",1
pr_codes_Set12PitchRoman label byte
byte 3,C_ESC,"B",2
pr_codes_Set17PitchRoman label byte
byte 3,C_ESC,"B",3
pr_codes_SetProportionalRoman label byte
byte 3,C_ESC,"Z",1
pr_codes_SetCondensed label byte
byte 1,C_SI
pr_codes_SetSubscript label byte
byte 3,C_ESC,"S",1
pr_codes_SetSuperscript label byte
byte 3,C_ESC,"S",0
pr_codes_SetNLQ label byte
pr_codes_SetBold label byte
byte 4,C_ESC,"E",C_ESC,"G"
pr_codes_SetItalic label byte
byte 2,C_ESC,"4"
pr_codes_SetDblWidth label byte
byte 3,C_ESC,"W",1
pr_codes_SetUnderline label byte
pr_codes_SetDblHeight label byte
byte 1,C_NULL
pr_codes_ResetCondensed label byte
byte 1,C_DC2
pr_codes_ResetScript label byte
byte 2,C_ESC,"T"
pr_codes_ResetNLQ label byte
pr_codes_ResetBold label byte
byte 4,C_ESC,"F",C_ESC,"H"
pr_codes_ResetItalic label byte
byte 2,C_ESC,"5"
pr_codes_ResetDblWidth label byte
byte 3,C_ESC,"W",0
pr_codes_ResetUnderline label byte
pr_codes_ResetDblHeight label byte
byte 1,C_NULL
| 31.032258 | 79 | 0.618243 |
832679b8a526dd0a34d1615ade4914bfa12f7ff3 | 264 | asm | Assembly | programs/oeis/190/A190540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/190/A190540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/190/A190540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A190540: 7^n - 2^n.
; 0,5,45,335,2385,16775,117585,823415,5764545,40353095,282474225,1977324695,13841283105,96889002215,678223056465,4747561477175,33232930504065,232630513856135,1628413597648305,11398895184848855
mov $1,7
pow $1,$0
mov $2,2
pow $2,$0
sub $1,$2
| 29.333333 | 192 | 0.784091 |
5fc98666714dc62128103721ef040fc5dce9bc62 | 279 | asm | Assembly | tests/devices/longptr/Issue144_disp_longptr.asm | fengjixuchui/sjasmplus | df0fabd2411bf89e23637fce46d273f52dafbe16 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/devices/longptr/Issue144_disp_longptr.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/devices/longptr/Issue144_disp_longptr.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ; same as Issue144 main test, but in --longptr mode, where the arguments outside of the $0000..$FFFF range are legal
org #4000
disp #10000-this+zac
zac
nop
this
ENT
org #4000+this-zac
disp #0000
nop
ENT
; valid in --longptr mode
ORG -1
long1
DISP -2
long2
nop
ENT
| 13.285714 | 116 | 0.698925 |
65717ef325befd37bb1217461025994bb8b72a1a | 4,824 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_550.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %rdi
push %rsi
lea addresses_WT_ht+0x4743, %rdi
nop
nop
nop
nop
add %rsi, %rsi
mov (%rdi), %r13
add %rsi, %rsi
pop %rsi
pop %rdi
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rbp
push %rdi
push %rsi
// Store
lea addresses_WC+0x14ab6, %rdi
nop
nop
add %r10, %r10
movb $0x51, (%rdi)
cmp %rdi, %rdi
// Store
lea addresses_RW+0x6ed2, %r15
nop
nop
nop
nop
nop
sub %r12, %r12
mov $0x5152535455565758, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%r15)
// Exception!!!
nop
nop
nop
nop
mov (0), %rsi
cmp %r13, %r13
// Load
lea addresses_A+0x1d1d6, %rbp
xor %r15, %r15
mov (%rbp), %esi
add %r10, %r10
// Faulty Load
lea addresses_WT+0xdab6, %r12
clflush (%r12)
nop
nop
nop
add $65354, %r15
vmovups (%r12), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rsi
lea oracles, %r13
and $0xff, %rsi
shlq $12, %rsi
mov (%r13,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 9, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 48.24 | 2,999 | 0.655265 |
ee74163ef9a4cf507d7d27479c41679a03e72f96 | 408 | asm | Assembly | programs/oeis/005/A005451.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/005/A005451.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/005/A005451.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A005451: Define b(n) = ( (n-1)*(n^2-3*n+1)*b(n-1) - (n-2)^3*b(n-2) )/(n*(n-3)); b(2) = b(3) = 1; sequence gives denominators of b(n).
; 1,1,4,1,6,1,8,9,10,1,12,1,14,15,16,1,18,1,20,21,22,1,24,25,26,27,28,1,30,1,32,33,34,35,36,1,38,39,40,1,42,1,44,45,46,1,48,49,50,51,52,1,54,55,56,57,58,1,60
mov $1,$0
add $0,1
add $1,2
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
gcd $1,$0
| 45.333333 | 157 | 0.588235 |
11746cbdb4ad0f167616d919d8b70fa14e97d2a5 | 360 | asm | Assembly | src/x86/memcpy.asm | CrackerCat/vcrtl | 56cc303a9fc1f76764d76f226a72ea2745395326 | [
"MIT"
] | 124 | 2019-11-27T07:37:45.000Z | 2022-03-27T10:22:21.000Z | src/x86/memcpy.asm | CrackerCat/vcrtl | 56cc303a9fc1f76764d76f226a72ea2745395326 | [
"MIT"
] | 4 | 2020-03-30T15:19:54.000Z | 2021-06-29T21:43:02.000Z | src/x86/memcpy.asm | CrackerCat/vcrtl | 56cc303a9fc1f76764d76f226a72ea2745395326 | [
"MIT"
] | 31 | 2019-11-27T08:46:39.000Z | 2022-03-23T04:12:21.000Z | .model flat
public _memcpy
.code
memcpy_fr struct
ret_addr dword ?
dest dword ?
src dword ?
sz dword ?
memcpy_fr ends
_memcpy proc
mov eax, esi
mov edx, edi
mov edi, [esp + memcpy_fr.dest]
mov esi, [esp + memcpy_fr.src]
mov ecx, [esp + memcpy_fr.sz]
rep movsb
mov edi, edx
mov esi, eax
mov eax, [esp + memcpy_fr.dest]
ret
_memcpy endp
end
| 12 | 32 | 0.688889 |
0bbe4f4a2f1d6471cb9c6aaac768aeca05d29f49 | 1,044 | asm | Assembly | programs/oeis/188/A188123.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/188/A188123.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/188/A188123.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A188123: Number of strictly increasing arrangements of 4 nonzero numbers in -(n+2)..(n+2) with sum zero.
; 1,3,8,16,31,51,80,118,167,227,302,390,495,617,758,918,1101,1305,1534,1788,2069,2377,2716,3084,3485,3919,4388,4892,5435,6015,6636,7298,8003,8751,9546,10386,11275,12213,13202,14242,15337,16485,17690,18952,20273,21653
mov $12,$0
mov $14,$0
add $14,1
lpb $14
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
add $11,1
lpb $11
mov $0,$9
sub $11,1
sub $0,$11
add $0,7
mul $0,2
mov $1,$0
mov $5,4
mod $7,8
div $7,5
gcd $7,$0
mov $0,1
add $0,$7
mul $1,5
mov $2,$7
lpb $0
mod $0,$5
add $0,5
add $1,$5
add $2,12
sub $1,$2
sub $1,6
mov $4,$0
div $0,$1
mul $4,2
div $4,8
add $5,5
trn $3,$5
add $3,6
lpe
mul $3,2
add $0,$3
div $1,$0
add $1,$4
sub $1,5
mul $1,2
add $1,1
mov $3,7
mov $7,$0
add $10,$1
lpe
add $13,$10
lpe
mov $1,$13
| 17.694915 | 216 | 0.509579 |
af4f02e10977596b8c3df5fa1c0edbcaa35a95c4 | 446 | asm | Assembly | oeis/094/A094632.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/094/A094632.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/094/A094632.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A094632: A trace sequence for a Napoleon graph.
; Submitted by Jon Maiga
; 1,0,3,4,21,55,198,609,2021,6460,21033,67859,219926,711165,2302233,7448804,24107061,78008495,252446598,816924969,2643639901,8554973900,27684516753,89588913979,289915919446,938187455205,3036038652273
mov $2,1
mov $5,-1
lpb $0
sub $0,1
add $1,$3
sub $4,$5
add $4,$2
mov $5,$4
mov $4,$2
mov $2,$3
add $4,$1
add $5,$4
mov $3,$5
mul $4,4
lpe
mov $0,$2
| 21.238095 | 199 | 0.683857 |
747aa66173a1bff67e8f23de490b9af5af4369b9 | 2,268 | asm | Assembly | lib/target/multi8/classic/bootstrap.asm | w5Mike/z88dk | f5090488e1d74ead8c865afe6df48231cd5c70ba | [
"ClArtistic"
] | 4 | 2021-11-20T19:35:01.000Z | 2022-01-01T16:08:42.000Z | lib/target/multi8/classic/bootstrap.asm | w5Mike/z88dk | f5090488e1d74ead8c865afe6df48231cd5c70ba | [
"ClArtistic"
] | null | null | null | lib/target/multi8/classic/bootstrap.asm | w5Mike/z88dk | f5090488e1d74ead8c865afe6df48231cd5c70ba | [
"ClArtistic"
] | 1 | 2021-11-27T15:58:02.000Z | 2021-11-27T15:58:02.000Z | ; Bootstrap for loading allram multi8 tapes
SECTION BOOTSTRAP
PUBLIC __multi8_bootstrap_built
defc __multi8_bootstrap_built = 1
org $c000
ld hl,intro_string
call print_string
call setup_memory_map
call asm_tape_load
jp nc,$0000
ld hl,failed_string
call reset_memory_map
call print_string
loop:
jp loop
intro_string:
defm "z88dk Multi8 bootstrap starting\n"
defb 0
failed_string:
defm "Loading failed\n"
defb 0
setup_memory_map:
; Here we need to switch to 64k RAM mode
; We have no access to the display (unless we page it in)
di
ld a,@00100000 ;bit 5 set = RAM
;bit 4 reset = RAM
out ($2a),a
ret
reset_memory_map:
; Here we need to switch to 64k RAM mode
; We have no access to the display (unless we page it in)
ld a,@00010000 ;bit 5 set = RAM
;bit 4 reset = RAM
out ($2a),a
ei
ret
; Write string: hl = string
print_string:
ld a,(hl)
and a
ret z
push hl
rst $18
pop hl
inc hl
jr print_string
;
; Load a block to the address specified in the file header
;
; Exit: nc = success
; c = failure
;
asm_tape_load:
call initialise_hw
ld a,$4e
out ($21),a
ld a,$14
out ($21),a
in a,($20)
wait_for_ready:
in a,($21)
bit 1,a
jr z,wait_for_ready
in a,($21)
and $30
jr nz,asm_tape_load
in a,($20) ;ac4
cp $3a
jr nz,asm_tape_load
call read_byte
ld c,a
ld h,a
call read_byte
ld l,a
add c
ld c,a
call read_byte
add c
jr nz,failure ;@0b07
next_block:
call read_byte
cp $3a
jr nz,failure
call read_byte
ld c,a
ld b,a
or a
ret z ;end of file
read_block_loop:
call read_byte
IF VERIFY
push af
ld a,(some_var) ;some_var = f97b
or a
jr z,skip_verify
pop af
cp (hl)
jr nz,failure
jr rejoin
skip_verify:
pop af
ENDIF
ld (hl),a
rejoin:
add c
ld c,a
inc hl
dec b
jr nz,read_block_loop
call read_byte
add c
jr z,next_block
failure:
scf
ret
failure_pop:
pop af ;return address from read_byte
jr failure
read_byte:
in a,($21)
bit 1,a
jr z,read_byte
in a,($21)
and $30
jr nz,failure_pop
in a,($20)
ret
initialise_hw:
ld a,$ce
out ($21),a
ld a,$27
out ($21),a
ld a,$77
out ($21),a
ret
| 14.727273 | 65 | 0.637566 |
96406ea2d210ff0b4c95f522ba110424120140a2 | 289 | asm | Assembly | programs/oeis/040/A040209.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040209.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040209.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A040209: Continued fraction for sqrt(224).
; 14,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28
mov $1,14
lpb $0
mod $0,2
mul $1,2
lpe
gcd $1,$0
| 28.9 | 189 | 0.605536 |
ca275735c2509f06f574a0919a1181aac400e2f3 | 4,379 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %rbp
push %rbx
push %rdi
lea addresses_UC_ht+0x1d909, %rdi
nop
nop
nop
xor %r10, %r10
mov $0x6162636465666768, %r13
movq %r13, %xmm6
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm6, (%rdi)
nop
nop
nop
nop
nop
dec %r11
lea addresses_UC_ht+0x142d1, %rbx
nop
nop
nop
nop
inc %rbp
mov (%rbx), %r12
nop
nop
nop
add %rbx, %rbx
pop %rdi
pop %rbx
pop %rbp
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %rbx
push %rcx
push %rdi
push %rsi
// Faulty Load
lea addresses_A+0x197a1, %rsi
nop
nop
nop
nop
nop
add $45978, %r12
mov (%rsi), %edi
lea oracles, %r13
and $0xff, %rdi
shlq $12, %rdi
mov (%r13,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'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
*/
| 50.333333 | 2,999 | 0.66385 |
66ebecb58154687fecbe3ea827366b6e177c48e7 | 2,494 | asm | Assembly | libsrc/_DEVELOPMENT/arch/ts2068/misc/z80/asm_tshc_scroll_up.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/z80/asm_tshc_scroll_up.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/z80/asm_tshc_scroll_up.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; ===============================================================
; 2017
; ===============================================================
;
; void tshc_scroll_up(uchar prows, uchar attr)
;
; Scroll screen upward by rows pixels and clear vacated area
; using attribute.
;
; ===============================================================
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_arch
PUBLIC asm_tshc_scroll_up
PUBLIC asm0_tshc_scroll_up
EXTERN asm_tshc_cls, asm_tshc_py2saddr
EXTERN asm_tshc_saddrpdown
asm_tshc_scroll_up:
; enter : de = number of pixel rows to scroll upward by
; l = attr byte
;
; uses : af, bc, de, hl
inc d
dec d
jp nz, asm_tshc_cls
asm0_tshc_scroll_up:
inc e
dec e
ret z
ld a,191
sub e
jp c, asm_tshc_cls
inc a
; e = number of pixel rows to scroll upward
; l = attr byte
; a = loop count
ld b,a ; b = loop count
push hl ; save attr byte
push de ; save scroll amount
;; copy upward
ex de,hl
call asm_tshc_py2saddr ; hl = screen address corresponding to first scroll row L
IF __USE_SPECTRUM_128_SECOND_DFILE
ld de,$c000
ELSE
ld de,$4000 ; de = destination address of first scroll row
ENDIF
copy_up_loop_1:
push bc
IF __CLIB_OPT_UNROLL & __CLIB_OPT_UNROLL_LDIR
EXTERN l_ldi
call l_ldi - (31*2)
ELSE
ld bc,31
ldir
ENDIF
ld a,(hl)
ld (de),a
set 5,d
set 5,h
IF __CLIB_OPT_UNROLL & __CLIB_OPT_UNROLL_LDIR
EXTERN l_ldd
call l_ldd - (31*2)
ELSE
ld bc,31
lddr
ENDIF
ld a,(hl)
ld (de),a
res 5,d
res 5,h
ex de,hl
call asm_tshc_saddrpdown
ex de,hl
call asm_tshc_saddrpdown
pop bc
djnz copy_up_loop_1
;; clear vacated area
pop bc
ld b,c ; b = scroll amount = number of vacated rows
ex de,hl
pop de
ld a,e ; a = attr byte
vacate_loop_0:
push bc
ld (hl),0
ld e,l
ld d,h
inc e
IF __CLIB_OPT_UNROLL & __CLIB_OPT_UNROLL_LDIR
EXTERN l_ldi
call l_ldi - (31*2)
ELSE
ld bc,31
ldir
ENDIF
set 5,d
set 5,h
ld (hl),a
dec de
dec e
IF __CLIB_OPT_UNROLL & __CLIB_OPT_UNROLL_LDIR
EXTERN l_ldd
call l_ldd - (31*2)
ELSE
ld bc,31
lddr
ENDIF
ld c,a
call asm_tshc_saddrpdown
ld a,c
pop bc
djnz vacate_loop_0
ret
| 14.333333 | 88 | 0.554531 |
c4e6834b615713ffb543d28ce3d1fdfdf7807334 | 2,791 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/alpha/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | libtool/src/gmp-6.1.2/mpn/alpha/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | libtool/src/gmp-6.1.2/mpn/alpha/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl Alpha mpn_addmul_1 -- Multiply a limb vector with a limb and add the
dnl result to a second limb vector.
dnl Copyright 1992, 1994, 1995, 2000, 2002 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C EV4: 42
C EV5: 18
C EV6: 7
C INPUT PARAMETERS
C rp r16
C up r17
C n r18
C vl r19
ASM_START()
PROLOGUE(mpn_addmul_1)
ldq r2,0(r17) C r2 = s1_limb
addq r17,8,r17 C s1_ptr++
subq r18,1,r18 C size--
mulq r2,r19,r3 C r3 = prod_low
ldq r5,0(r16) C r5 = *res_ptr
umulh r2,r19,r0 C r0 = prod_high
beq r18,$Lend1 C jump if size was == 1
ldq r2,0(r17) C r2 = s1_limb
addq r17,8,r17 C s1_ptr++
subq r18,1,r18 C size--
addq r5,r3,r3
cmpult r3,r5,r4
stq r3,0(r16)
addq r16,8,r16 C res_ptr++
beq r18,$Lend2 C jump if size was == 2
ALIGN(8)
$Loop: mulq r2,r19,r3 C r3 = prod_low
ldq r5,0(r16) C r5 = *res_ptr
addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
subq r18,1,r18 C size--
umulh r2,r19,r4 C r4 = cy_limb
ldq r2,0(r17) C r2 = s1_limb
addq r17,8,r17 C s1_ptr++
addq r3,r0,r3 C r3 = cy_limb + prod_low
cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
addq r5,r3,r3
cmpult r3,r5,r5
stq r3,0(r16)
addq r16,8,r16 C res_ptr++
addq r5,r0,r0 C combine carries
bne r18,$Loop
$Lend2: mulq r2,r19,r3 C r3 = prod_low
ldq r5,0(r16) C r5 = *res_ptr
addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
umulh r2,r19,r4 C r4 = cy_limb
addq r3,r0,r3 C r3 = cy_limb + prod_low
cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
addq r5,r3,r3
cmpult r3,r5,r5
stq r3,0(r16)
addq r5,r0,r0 C combine carries
addq r4,r0,r0 C cy_limb = prod_high + cy
ret r31,(r26),1
$Lend1: addq r5,r3,r3
cmpult r3,r5,r5
stq r3,0(r16)
addq r0,r5,r0
ret r31,(r26),1
EPILOGUE(mpn_addmul_1)
ASM_END()
| 27.91 | 79 | 0.704765 |
f742d4e15045b01f70486490ea4ace83aeb2ccfe | 190 | asm | Assembly | gfx/pokemon/venonat/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/venonat/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/venonat/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | frame 2, 10
frame 0, 10
frame 2, 10
frame 0, 06
frame 1, 06
frame 0, 06
setrepeat 3
frame 1, 04
frame 0, 04
dorepeat 7
setrepeat 2
frame 1, 02
frame 0, 02
dorepeat 11
endanim
| 11.875 | 12 | 0.663158 |
5ba5334751f1c2712230396595f52ed3cc77d702 | 215 | asm | Assembly | libsrc/graphics/generic_console/respixl6.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/generic_console/respixl6.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/generic_console/respixl6.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z | ;
; Generic pseudo graphics routines for text-only platforms
;
; Reset pixel at (x,y) coordinate.
SECTION code_clib
PUBLIC respixel
.respixel
defc NEEDunplot = 1
INCLUDE "pixel6.asm"
| 13.4375 | 64 | 0.660465 |
2f2a1aebfda2e603dbf5cfc920e9aee7901534ab | 1,489 | asm | Assembly | statsRoutines.asm | RevolutionSoftware/Juego | 31c1706e41713e9bcf631f369b89ce1f94bef0d5 | [
"Unlicense"
] | 1 | 2021-09-18T21:02:45.000Z | 2021-09-18T21:02:45.000Z | statsRoutines.asm | RevolutionSoftware/Juego | 31c1706e41713e9bcf631f369b89ce1f94bef0d5 | [
"Unlicense"
] | null | null | null | statsRoutines.asm | RevolutionSoftware/Juego | 31c1706e41713e9bcf631f369b89ce1f94bef0d5 | [
"Unlicense"
] | null | null | null | startMenu:
call drawMap ; erase the screen [drawMap.asm]
call drawPlayer ; player was erased in the call above
xor a ; default option selected
ld hl,startMenuTxt
call drawMenu
call menuGetkey
jp main ;if they cancel out of the menu with [Alpha], go back to the main loop
dispStats:
call clearGbuf
ld bc,$4060 ;dimensions
ld de,$0000 ;coords
ld hl,statsMenuTxt ;txt
call drawTextBox
call drawGbuf
call pause
jr startMenu
dispItems:
ld hl,playerInventory
ld a,(hl)
or a
jr z,noItems
exx
ld hl,itemMenuTxt
ld (hl),a ;# of items
inc hl
exx
ld b,a
ld ix,subMenu1Txt
createItemListLoop:
inc hl ;points to first item ID
ld e,(hl)
inc hl ;item amount
ld d,(hl)
push de
exx
pop de
ld (hl),MN
inc hl
ld (hl),ITEM
inc hl
ld (hl),e
inc hl
ld (hl),NEWX
inc hl
ld (hl),82
inc hl
ld (hl),NUM8
inc hl
ld (hl),d
inc hl
ld (hl),NEWL
inc hl ;.db MN,ITEM,[ID],NEWX,70,NUM8,[#],NEWL
exx
ld (ix),ITEMD
inc ix
ld (ix),e
inc ix
ld (ix),0
inc ix ;.db ITEMD,[ID],0
djnz createItemListLoop
;zero terminate the string
xor a
exx
dec hl
ld (hl),a ;this overwrites the last NEWL with a 0
;just ignore shadows
ld hl,itemMenuTxt
ld de,$0000 ;y,x
ld bc,$2E60 ;width,height
ld a,5 ;how many items to be drawn at a time
call drawMenuScroll
ld de,$002C ;e=y,d=x
ld bc,$1460 ;width,height
call installSub1
call menuGetkey
jp startMenu
noItems:
ld hl,noItemsTxt
call drawDialog
jp startMenu
| 17.313953 | 82 | 0.672263 |
570b7236acaf182d2ad78bc9c73a49fa654fa1e7 | 5,198 | asm | Assembly | core.asm | Sweetnow/mips-pipeline-cpu | b42ad2cdf66361c7285a7e4ae34350d935bf3b0f | [
"MIT"
] | 2 | 2020-08-04T09:33:48.000Z | 2020-08-09T14:05:11.000Z | core.asm | Sweetnow/mips-pipeline-cpu | b42ad2cdf66361c7285a7e4ae34350d935bf3b0f | [
"MIT"
] | 1 | 2020-08-09T14:06:34.000Z | 2020-08-14T04:48:16.000Z | core.asm | Sweetnow/mips-pipeline-cpu | b42ad2cdf66361c7285a7e4ae34350d935bf3b0f | [
"MIT"
] | null | null | null | .text
j __main
j __interrupt
j __exception
__main:
# reset sp
addi $sp, $zero, 0x800
# reset digits
addi $27, $zero, 1
addi $28, $zero, 0x0000
# reset timer
lui $t8, 0x4000 # $t8: timer base addr
sw $zero, 0x0008($t8)
lui $t9, 0xffff # TH -50000
addi $t9, $t9, 0xb3f8
sw $t9, 0($t8)
ori $t9, $t9, 0xffff
sw $t9, 0x0004($t8)
addi $t9, $zero, 3
sw $t9, 0x0008($t8)
la $t9, main
andi $t9, $t9, 0x07ff
jr $t9
__interrupt:
# close timer
addi $sp, $sp, -24
sw $1, 20($sp)
sw $t7, 16($sp)
sw $t8, 12($sp)
sw $t9, 8($sp)
sw $t0, 4($sp)
sw $t1, 0($sp)
lui $t8, 0x4000 # $t8: timer base addr
lw $t9, 0x0008($t8) # TCON
andi $t9, $t9, 0xfff9
sw $t9, 0x0008($t8)
# Interrupt Program START
# $27 - WHICH ONE IS SHOWED BEFORE
# $28 - SHOW NUMBER
srl $t1, $28, 0
beq $27, 1, __show
srl $t1, $28, 4
beq $27, 2, __show
srl $t1, $28, 8
beq $27, 4, __show
srl $t1, $28, 12
beq $27, 8, __show
__show:
andi $t1, $t1, 0x000f
addi $t0, $zero, 0x00C0
beq $t1, 0, __digit_out
addi $t0, $zero, 0x00F9
beq $t1, 1, __digit_out
addi $t0, $zero, 0x00A4
beq $t1, 2, __digit_out
addi $t0, $zero, 0x00B0
beq $t1, 3, __digit_out
addi $t0, $zero, 0x0099
beq $t1, 4, __digit_out
addi $t0, $zero, 0x0092
beq $t1, 5, __digit_out
addi $t0, $zero, 0x0082
beq $t1, 6, __digit_out
addi $t0, $zero, 0x00F8
beq $t1, 7, __digit_out
addi $t0, $zero, 0x0080
beq $t1, 8, __digit_out
addi $t0, $zero, 0x0090
beq $t1, 9, __digit_out
addi $t0, $zero, 0x0088
beq $t1, 10, __digit_out
addi $t0, $zero, 0x0083
beq $t1, 11, __digit_out
addi $t0, $zero, 0x00C6
beq $t1, 12, __digit_out
addi $t0, $zero, 0x00A1
beq $t1, 13, __digit_out
addi $t0, $zero, 0x0086
beq $t1, 14, __digit_out
addi $t0, $zero, 0x008E
beq $t1, 15, __digit_out
addi $t0, $zero, 0x00FF
__digit_out:
nor $t1, $27, $zero
sll $t1, $t1, 8
andi $t1, $t1, 0x0f00
add $t1, $t0, $t1
sw $t1, 0x10($t8)
beq $27, 8, __reset
sll $27, $27, 1
j __out
__reset:
addi $27, $zero, 1
__out:
# Interrupt Program END
addi $t7, $zero, 0x0002
or $t9, $t9, $t7
sw $t9, 0x0008($t8)
lw $t1, 0($sp)
lw $t0, 4($sp)
lw $t9, 8($sp)
lw $t8, 12($sp)
lw $t7, 16($sp)
lw $1, 20($sp)
addi $sp, $sp, 24
jr $k0
__exception:
# Exception Program START
addi $sp, $sp, -12
sw $1, 8($sp)
sw $t8, 4($sp)
sw $t9, 0($sp)
lui $t8, 0x4000
lw $t9, 0xC($t8)
ori $t9, $t9, 0x0080
sw $t9, 0xC($t8)
lw $t9, 0($sp)
lw $t8, 4($sp)
lw $1, 8($sp)
addi $sp, $sp, 12
# Exception Program END
addi $k0, $k0, 4
jr $k0
main:
lw $a2, 0($zero)
# copy data
li $t2, 0 # cnt
li $t0, 4
addi $t1, $a2, 1
sll $t1, $t1, 2 # new base addr
move $a0, $t1
move $s2, $a0
move $s4, $a2
in_copy:
beq $t2, $a2, out_copy
sll $t3, $t2, 2
add $t4, $t3, $t0
lw $t7, 0($t4)
add $t4, $t3, $t1
sw $t7, 0($t4)
addi $t2, $t2, 1
j in_copy
out_copy:
# call quicksort
lui $t0, 0x4000
lw $s0, 0x14($t0) # $s0 - START CLK
li $a1, 0
addi $a2, $a2, -1
jal quicksort
lui $t0, 0x4000
lw $s1, 0x14($t0) # $s1 - END CLK
sub $28, $s1, $s0
srl $28, $28, 16
jal delay
sub $28, $s1, $s0
lw $t1, 0xC($t0)
ori $t1, $t1, 0x0001
sw $t1, 0xC($t0)
jal exit
quicksort:
addi $sp, $sp, -20 # save s0,1,2,ra,i
sw $ra, 16($sp)
sw $s3, 12($sp)
sw $s2, 8($sp)
sw $s1, 4($sp)
sw $s0, 0($sp)
move $s0, $a0 # arr
move $s1, $a1 # left
move $s2, $a2 # right
move $t0, $s1 # $t0 = i = left
move $t1, $s2 # $t1 = j = right
add $t2, $s1, $s2 # $t2 = i + j
srl $t2, $t2, 1 # $t2 /= 2
sll $t2, $t2, 2 # for lw
add $t2, $s0, $t2 # $t2 = arr + (i + j)/2
lw $t2, ($t2) # $t2 = mid
loop1: bgt $t0, $t1, exit1 # if i>j, break
loop2: sll $t3, $t0, 2
add $t4, $s0, $t3 # $t4 = arr + i
lw $t5, ($t4) # $t5 = arr[i]
bge $t5, $t2, loop3 # if arr[i] >= mid, break
addi $t0, $t0, 1 # i++
j loop2
loop3: sll $t3, $t1, 2
add $t6, $s0, $t3 # $t6 = arr + j
lw $t7, ($t6) # $t7 = arr[j]
ble $t7, $t2, exit3 # if arr[j] <= mid, break
addi $t1, $t1, -1 # j--
j loop3
exit3: bgt $t0, $t1, loop1 # if i > j, break
move $t3, $t5
move $t5, $t7
move $t7, $t3 # swap(arr[i],arr[j])
sw $t5, ($t4)
sw $t7, ($t6)
addi $t0, $t0, 1 # i++
addi $t1, $t1, -1 # j--
move $s3, $t0
exit1: bge $s1, $t1, skip1 # if left >= j, skip
move $a1, $s1
move $a2, $t1
jal quicksort
skip1: bge $s3, $s2, skip2 # if i >= right, skip
move $a1, $s3
move $a2, $s2
jal quicksort
skip2: lw $s0, 0($sp) # reload s0,1,2
lw $s1, 4($sp)
lw $s2, 8($sp)
lw $s3, 12($sp)
lw $ra, 16($sp)
addi $sp, $sp, 20
jr $ra
exit:
li $s3, 0
show:
jal delay
sll $t0, $s3, 2
add $t0, $s2, $t0
lw $28, 0($t0)
#move $28, $t0
addi $s3, $s3, 1
blt $s3, $s4, show
lui $t0, 0x4000
lw $t1, 0xC($t0)
ori $t1, $t1, 0x2
sw $t1, 0xC($t0)
death_loop:
nop
nop
nop
j death_loop
# function delay some cycle
delay:
lui $t0, 0x4000
lw $t6, 0x14($t0) # $t6: SYSCLK START
li $t1, 0x0510FF40 # 85MHz 1s
in_delay:
lw $t7, 0x14($t0) # $t7: SYSCLK END
sub $t7, $t7, $t6
bgt $t7, $t1, out_delay
j in_delay
out_delay:
jr $ra
| 20.959677 | 52 | 0.542901 |
529fde836d4be958b4892d3f71317a2e68188f6c | 5,677 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_640.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_640.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_640.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x14d44, %r13
nop
nop
nop
nop
nop
cmp %r11, %r11
movw $0x6162, (%r13)
nop
sub $17308, %r12
lea addresses_D_ht+0x13724, %rsi
lea addresses_D_ht+0x3724, %rdi
sub %rbx, %rbx
mov $79, %rcx
rep movsl
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_UC_ht+0x9724, %r11
nop
add %rcx, %rcx
movups (%r11), %xmm7
vpextrq $0, %xmm7, %r9
nop
nop
xor $65275, %r11
lea addresses_UC_ht+0x15888, %rsi
lea addresses_D_ht+0x1e4c4, %rdi
nop
dec %rbx
mov $41, %rcx
rep movsq
add $15451, %r12
lea addresses_WT_ht+0x12604, %rdi
nop
nop
nop
add $39849, %r12
mov $0x6162636465666768, %r9
movq %r9, (%rdi)
sub %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r9
push %rax
push %rcx
push %rdx
// Store
lea addresses_PSE+0xfb24, %rcx
nop
nop
nop
nop
dec %r9
mov $0x5152535455565758, %rdx
movq %rdx, (%rcx)
sub %rax, %rax
// Store
lea addresses_A+0xa724, %rdx
nop
nop
nop
nop
cmp %rcx, %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm0
movups %xmm0, (%rdx)
nop
nop
and %r9, %r9
// Faulty Load
lea addresses_PSE+0xfb24, %r14
clflush (%r14)
nop
dec %r11
mov (%r14), %dx
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 9}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 1}, 'dst': {'same': True, 'type': 'addresses_D_ht', 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 42.051852 | 2,999 | 0.657918 |
b2c74839ce57669fb9748fb03accf9786506a099 | 6,646 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_951.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_951.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_951.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x11094, %r14
nop
nop
xor $47520, %r15
mov $0x6162636465666768, %rsi
movq %rsi, %xmm2
and $0xffffffffffffffc0, %r14
movaps %xmm2, (%r14)
nop
nop
inc %rcx
lea addresses_WC_ht+0xb896, %rdx
nop
nop
nop
cmp $8476, %rsi
movb $0x61, (%rdx)
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WC_ht+0x8dde, %r14
nop
nop
nop
nop
add %rsi, %rsi
mov (%r14), %rcx
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x7896, %rsi
lea addresses_WT_ht+0x2296, %rdi
nop
sub %r13, %r13
mov $99, %rcx
rep movsl
xor $10991, %r15
lea addresses_normal_ht+0x18cb6, %rsi
add $30507, %rdx
mov $0x6162636465666768, %r14
movq %r14, (%rsi)
nop
add %r15, %r15
lea addresses_WT_ht+0x15956, %rdi
nop
nop
xor $1480, %r13
mov (%rdi), %dx
nop
cmp $12224, %r13
lea addresses_UC_ht+0x9096, %rcx
nop
nop
nop
nop
nop
and %rdx, %rdx
and $0xffffffffffffffc0, %rcx
movntdqa (%rcx), %xmm4
vpextrq $0, %xmm4, %rdi
nop
nop
nop
dec %r14
lea addresses_normal_ht+0xd5ed, %rdi
nop
nop
sub $11580, %r15
mov $0x6162636465666768, %r14
movq %r14, %xmm4
movups %xmm4, (%rdi)
nop
nop
nop
nop
nop
xor $8719, %rdx
lea addresses_WT_ht+0x12ce2, %r15
nop
nop
nop
xor %rcx, %rcx
movb $0x61, (%r15)
nop
nop
mfence
lea addresses_D_ht+0x12696, %rdx
nop
nop
nop
nop
sub $20093, %rdi
mov (%rdx), %r13d
nop
nop
cmp %rdx, %rdx
lea addresses_normal_ht+0x5456, %r15
nop
dec %rcx
movl $0x61626364, (%r15)
nop
nop
nop
nop
nop
dec %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rax
push %rcx
push %rdi
push %rdx
// Faulty Load
lea addresses_A+0x16896, %rdi
nop
nop
nop
nop
xor %rcx, %rcx
movups (%rdi), %xmm7
vpextrq $1, %xmm7, %r9
lea oracles, %rdx
and $0xff, %r9
shlq $12, %r9
mov (%rdx,%r9,1), %r9
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 36.718232 | 2,999 | 0.658592 |
83baf98bc10834c8036f2eaff448f8b0d45de7d2 | 408 | asm | Assembly | libsrc/enterprise/exos_write_block.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/enterprise/exos_write_block.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/enterprise/exos_write_block.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; Enterprise 64/128 specific routines
; by Stefano Bodrato, 2011
;
; exos_write_block(unsigned char channel, unsigned int byte_count, unsigned char *address);
;
;
; $Id: exos_write_block.asm,v 1.2 2015/01/19 01:32:43 pauloscustodio Exp $
;
PUBLIC exos_write_block
exos_write_block:
pop af
pop de
pop bc
pop hl
push hl
push bc
push de
push af
ld a,l
rst 30h
defb 8
ld h,0
ld l,a
ret
| 13.16129 | 91 | 0.708333 |
fd69e771a8f20d689e59c35f95ba9b4b647ea550 | 1,676 | asm | Assembly | writer.asm | JacobLaney/x86-Assembly-Practice | dcf949cf912eae7136949e03d44effb958fb75ec | [
"MIT"
] | null | null | null | writer.asm | JacobLaney/x86-Assembly-Practice | dcf949cf912eae7136949e03d44effb958fb75ec | [
"MIT"
] | null | null | null | writer.asm | JacobLaney/x86-Assembly-Practice | dcf949cf912eae7136949e03d44effb958fb75ec | [
"MIT"
] | null | null | null | ; Jacob Laney
; January 2016
;
; NASM x86 for Mac OSX
; build: nasm -f macho64 writer.asm && ld writer.o -o writer
; run: ./writer
;
; Obective is to produce an assortment of procedures for printing data
; to stdout
global start
section .data
; SYSTEM CALL CODES
%define exit 0x2000001
%define read 0x2000003
%define write 0x2000004
msg: db "Hello World!", 10, 0
.len: equ $ - msg
section .text
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
start:
default rel ; use relative addressing
mov rsi, msg
call WriteStr
mov rax, exit
mov rdi, 0
syscall
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WriteStr(char * message)
; input:
; rsi - address of 0 terminated string max 100 chars
; output:
; prints string to stdout
WriteStr:
push rax
push rdx
push rdi
push rsi
push rcx
mov ecx, 100 ; max 100 rep
mov rdx, 0 ; count length of string
StrLenCountLoop: ; check for termination of string
cmp byte [rsi], 0
pushf
inc rsi ; move to next address in string
inc rdx ; increment size of string
popf
loopne StrLenCountLoop
pop rcx
pop rsi
mov rax, write
mov rdi, 1 ; stdout
syscall ; write the string
Return:
pop rdi
pop rdx
pop rax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 23.942857 | 70 | 0.459427 |
7010c2844779b5eb51a0a6a99b866d01a2475504 | 440 | asm | Assembly | oeis/123/A123160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/123/A123160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/123/A123160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A123160: Triangle read by rows: T(0,0)=1; T(n,k) = n!(n+k-1)!/((n-k)!(n-1)!(k!)^2) for 0 <= k <= n.
; Submitted by Christian Krause
; 1,1,1,1,4,3,1,9,18,10,1,16,60,80,35,1,25,150,350,350,126,1,36,315,1120,1890,1512,462,1,49,588,2940,7350,9702,6468,1716,1,64,1008,6720,23100,44352,48048,27456,6435,1,81,1620,13860,62370,162162,252252,231660
lpb $0
mov $1,$0
add $2,1
sub $0,$2
sub $1,1
lpe
bin $1,$0
bin $2,$0
mul $1,$2
mov $0,$1
| 29.333333 | 207 | 0.622727 |
f3f6bbcce39993b3dbdcc2a2795af762a2228b3c | 7,225 | asm | Assembly | examples/sprite.asm | feilipu/TMS9918A | c839cde61e2e70fadfec52a430f238852bb1c81b | [
"Unlicense"
] | 1 | 2021-03-13T19:07:48.000Z | 2021-03-13T19:07:48.000Z | examples/sprite.asm | feilipu/TMS9918A | c839cde61e2e70fadfec52a430f238852bb1c81b | [
"Unlicense"
] | null | null | null | examples/sprite.asm | feilipu/TMS9918A | c839cde61e2e70fadfec52a430f238852bb1c81b | [
"Unlicense"
] | null | null | null | ; TMS9918A sprite example
; by J.B. Langston
ramtop: equ $ffff
im1vect: equ $38 ; location of interrupt mode 1 vector
nmivect: equ $66
frameticks: equ 6 ; number of interrupts per animation frame
framecount: equ 8 ; number of frames in animation
org $100
jp start
tmsfont:
include "tms.asm"
start:
ld sp, ramtop
call tmsbitmap
ld bc, spritelen
ld de, $1800
ld hl, sprite
call tmswrite
ld a, frameticks ; initialize interrupt counter to frame length
ld (tickcounter), a
ld hl, inthandler ; install the interrupt handler
call nmisetup
call tmsintenable ; enable interrupts on TMS
mainloop:
jr mainloop ; busy wait and let interrupts do their thing
; set up interrupt mode 1 vector
; HL = interrupt handler
im1setup:
di
ld a, $C3 ; prefix with jump instruction
ld (im1vect), a
ld (im1vect+1), hl ; load interrupt vector
im 1 ; enable interrupt mode 1
ei
ret
; set up NMI vector
; HL = interrupt handler
nmisetup:
ld a, $C3 ; prefix with jump instruction
ld (nmivect), a
ld (nmivect+1), hl ; load interrupt vector
ret
; interrupt handler: rotate animation frames
inthandler:
in a, (tmsreg) ; clear interrupt flag
call drawframe ; draw next frame, if it's time
ei
reti
tickcounter:
defb 0 ; interrupt down counter
currframe:
defb 0 ; current frame of animation
xdelta:
defb 1 ; direction of x axis motion
ydelta:
defb 1 ; directino of y axis motion
; Sprite Attributes
sprite1y:
defb 88
sprite1x:
defb 0
sprite1name:
defb 0
sprite1color:
defb tmsdarkblue
sprite2y:
defb 88
sprite2x:
defb 0
sprite2name:
defb 4
sprite2color:
defb tmslightgreen
; change direction of motion
; HL = pointer to direction variable
changedir:
push af
ld a, (hl)
neg
ld (hl), a
pop af
ret
; draw a single animation frame
; HL = animation data base address
; A = current animation frame number
drawframe:
ld hl, xdelta ; move x position
ld a, (sprite1x)
add a, (hl)
ld (sprite1x), a
ld (sprite2x), a
cp 240 ; bounce off the edge
call z, changedir
cp 0
call z, changedir
ld hl, ydelta ; move y position
ld a, (sprite1y)
add a, (hl)
ld (sprite1y), a
ld (sprite2y), a
cp 176 ; bounce off the edge
call z, changedir
cp 0
call z, changedir
ld a, (tickcounter) ; check if we've been called frameticks times
or a
jr nz, framewait ; if not, wait to draw next animation frame
ld a, (currframe) ; next animation frame
add a, a ; multiply current frame x 8
add a, a
add a, a
ld (sprite1name), a ; set name for first sprite
add a, 4 ; add 4
ld (sprite2name), a ; set name for second sprite
ld a, (currframe) ; next animation frame
inc a
cp framecount ; have we displayed all frames yet?
jr nz, skipreset ; if not, display the next frame
ld a, 0 ; if so, start over at the first frame
skipreset:
ld (currframe), a ; save next frame in memory
ld a, frameticks ; reset interrupt down counter
ld (tickcounter), a
ret
framewait:
ld bc, 8 ; send updated sprite attribute table
ld de, $3b00
ld hl, sprite1y
call tmswrite
ld hl, tickcounter ; not time to switch animation frames yet
dec (hl) ; decrement down counter
ret
; planet sprites from TI VDP Programmer's guide
sprite:
; Sprite world0 pattern 1
defb $07,$1C,$38,$70,$78,$5C,$0E,$0F
defb $0F,$1F,$7F,$63,$73,$3D,$1F,$07
defb $E0,$F8,$7C,$66,$F2,$BE,$DC,$FC
defb $F8,$A0,$C0,$C0,$E2,$F4,$F8,$E0
; Sprite world0 pattern 2
defb $00,$03,$07,$0F,$07,$A3,$F1,$F0
defb $F0,$E0,$80,$1C,$0C,$02,$00,$00
defb $00,$00,$80,$98,$0C,$41,$23,$03
defb $07,$5F,$3F,$3E,$1C,$08,$00,$00
; Sprite world1 pattern 1
defb $03,$1F,$3E,$7C,$7E,$97,$03,$03
defb $03,$07,$1F,$78,$7C,$3F,$1F,$07
defb $E0,$38,$1C,$18,$3C,$2F,$B7,$FF
defb $FE,$E8,$F0,$F0,$F8,$7C,$F8,$E0
; Sprite world1 pattern 2
defb $00,$00,$01,$03,$01,$68,$FC,$FC
defb $FC,$F8,$E0,$07,$03,$00,$00,$00
defb $00,$C0,$E0,$E6,$C2,$D0,$48,$00
defb $01,$17,$0F,$0E,$06,$80,$00,$00
; Sprite world2 pattern 1
defb $07,$1F,$3F,$7F,$3F,$E5,$C0,$C0
defb $80,$01,$07,$1E,$3F,$3F,$1F,$07
defb $E0,$C8,$84,$06,$8E,$CB,$ED,$FF
defb $FF,$FA,$FC,$3C,$3E,$DC,$F8,$E0
; Sprite world2 pattern 2
defb $00,$00,$00,$00,$40,$1A,$3F,$3F
defb $7F,$FE,$F8,$61,$40,$00,$00,$00
defb $00,$30,$78,$F8,$70,$34,$12,$00
defb $00,$05,$03,$C2,$C0,$20,$00,$00
; Sprite world3 pattern 1
defb $07,$1F,$3F,$1F,$4F,$F9,$70,$F0
defb $E0,$80,$01,$07,$0F,$1F,$1F,$07
defb $E0,$F0,$E0,$C2,$E2,$72,$3B,$3F
defb $3F,$7E,$FF,$8E,$CE,$F4,$F8,$E0
; Sprite world3 pattern 2
defb $00,$00,$00,$60,$30,$06,$8F,$0F
defb $1F,$7F,$FE,$78,$70,$20,$00,$00
defb $00,$08,$1C,$3C,$1C,$8D,$C4,$C0
defb $C0,$81,$00,$70,$30,$08,$00,$00
; Sprite world4 pattern 1
defb $07,$1F,$3F,$67,$73,$BE,$DC,$FC
defb $F8,$A0,$C0,$41,$63,$37,$1F,$07
defb $E0,$F8,$F8,$F0,$F8,$5C,$0E,$0F
defb $0F,$1F,$7F,$E2,$F2,$FC,$F8,$E0
; Sprite world4 pattern 2
defb $00,$00,$00,$18,$0C,$41,$23,$03
defb $07,$5F,$3F,$3E,$1C,$08,$00,$00
defb $00,$00,$04,$0E,$06,$A3,$F1,$F0
defb $F0,$E0,$80,$1C,$0C,$00,$00,$00
; Sprite world5 pattern 1
defb $07,$1F,$1F,$19,$3C,$2F,$B7,$FF
defb $FE,$E8,$F0,$70,$78,$3D,$1F,$07
defb $E0,$F8,$FC,$FC,$FE,$97,$03,$03
defb $03,$07,$1F,$78,$FC,$FC,$F8,$E0
; Sprite world5 pattern 2
defb $00,$00,$20,$66,$43,$D0,$48,$00
defb $01,$17,$0F,$0F,$07,$02,$00,$00
defb $00,$00,$00,$02,$00,$68,$FC,$FC
defb $FC,$F8,$E0,$86,$02,$00,$00,$00
; Sprite world6 pattern 1
defb $07,$0F,$07,$06,$0F,$CB,$ED,$FF
defb $FF,$FA,$FC,$3C,$3E,$1F,$1F,$07
defb $E0,$F8,$FC,$7E,$3E,$E5,$C0,$C0
defb $80,$01,$07,$1E,$3E,$7C,$F8,$E0
; Sprite world6 pattern 2
defb $00,$10,$38,$79,$70,$34,$12,$00
defb $00,$05,$03,$43,$41,$20,$00,$00
defb $00,$00,$00,$80,$C0,$1A,$3F,$3F
defb $7F,$FE,$F8,$E0,$C0,$80,$00,$00
; Sprite world7 pattern 1
defb $07,$13,$21,$41,$63,$72,$3B,$3F
defb $3F,$7E,$FF,$0F,$4F,$37,$1F,$07
defb $E0,$F8,$FC,$9E,$CE,$F9,$70,$F0
defb $E0,$80,$01,$06,$8E,$DC,$F8,$E0
; Sprite world7 pattern 2
defb $00,$0C,$1E,$3E,$1C,$8D,$C4,$C0
defb $C0,$81,$00,$70,$30,$08,$00,$00
defb $00,$00,$00,$60,$30,$06,$8F,$0F
defb $1F,$7F,$FE,$F8,$70,$20,$00,$00
spritelen: equ $-sprite | 31.413043 | 83 | 0.537301 |
98b6f3bb3e3fe1a63d39aaff8194bd57e163cff9 | 465 | asm | Assembly | programs/oeis/177/A177228.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/177/A177228.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/177/A177228.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A177228: A combinatorial differential triangle sequence:q=3;t=1/q;f(t,n)=d^n/dt^n*(t/(1+t); c(t.n,m)=(1/(1+t)*f(n,t)/(f(t,m)*f(t,(n-m))
; 3,3,3,3,-2,3,3,-3,-3,3,3,-4,-6,-4,3,3,-5,-10,-10,-5,3,3,-6,-15,-20,-15,-6,3,3,-7,-21,-35,-35,-21,-7,3,3,-8,-28,-56,-70,-56,-28,-8,3,3,-9,-36,-84,-126,-126,-84,-36,-9,3,3,-10,-45,-120,-210,-252,-210,-120,-45,-10
cal $0,141540 ; Duplicate of A132046.
mov $1,4
trn $1,$0
mul $1,3
sub $1,$0
mul $1,2
sub $1,13
div $1,4
add $1,3
| 35.769231 | 212 | 0.541935 |
5878e0ae7997fcffe57b5e129fd84a1512aad45b | 242 | asm | Assembly | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadBGPalette.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadBGPalette.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadBGPalette.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void SMS_loadBGPalette(void *palette)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_loadBGPalette
EXTERN asm_SMSlib_loadBGPalette
_SMS_loadBGPalette:
pop af
pop hl
push hl
push af
jp asm_SMSlib_loadBGPalette
| 12.736842 | 39 | 0.768595 |
d2ac94c46eed3e97bc537a8f91ee2f1210cc0f60 | 685 | asm | Assembly | oeis/192/A192847.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/192/A192847.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/192/A192847.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A192847: Molecular topological indices of the tetrahedral graphs.
; Submitted by Jon Maiga
; 0,0,0,72,1080,7020,30240,100800,281232,687960,1520640,3100680,5920200,10702692,18476640,30663360,49180320,76561200,116093952,171978120,249502680,355245660,497296800,685504512,931748400,1250238600,1657843200,2174445000,2823328872,3631600980,4630641120,5856589440,7350868800,9160744032,11339919360,13949175240,17057045880,20740538700,25085896992,30189407040,36158250960,43111406520,51180595200,60511279752,71263712520,83614035780,97755435360,113899348800,132276729312,153139366800,176761267200
mov $1,$0
add $1,1
mov $3,-2
add $3,$0
bin $0,3
mov $2,$1
add $3,$0
mul $2,$3
mul $0,$2
mul $0,9
| 45.666667 | 493 | 0.826277 |
1670f808fa095d9465a4f5d0108fdb8de8c741d3 | 650 | asm | Assembly | oeis/328/A328352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/328/A328352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/328/A328352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A328352: Similar to A328350, but for 5 digits rather then 3.
; 0,1,56,2831,141706,7086081,354307956,17715417331,885770964206,44288548698581,2214427437370456,110721371880729831,5536068594097526706,276803429705181511081,13840171485260601432956,692008574263037701042331,34600428713151923199089206,1730021435657596350689323581,86501071782879818488140495456,4325053589143990929175396354831,216252679457199546482611675651706,10812633972859977324249793072136081,540631698642998866213085700054557956,27031584932149943310657265234966667331
lpb $0
mov $2,$0
sub $0,1
seq $2,86578 ; a(n) = 7*(10^n - 1).
add $3,$2
mul $3,5
lpe
mov $0,$3
div $0,315
| 50 | 469 | 0.84 |
495a412f7ff18d6cecb0bd72bd4b34f0836fe41b | 9,465 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i3-7100_9_0x84_notsx.log_21829_3090.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i3-7100_9_0x84_notsx.log_21829_3090.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i3-7100_9_0x84_notsx.log_21829_3090.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x7c6, %rdx
nop
nop
cmp %r13, %r13
vmovups (%rdx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r8
nop
nop
nop
nop
dec %rdi
lea addresses_A_ht+0x14ac6, %rsi
lea addresses_WC_ht+0x18bee, %rdi
nop
and $40640, %rax
mov $108, %rcx
rep movsl
sub $53218, %r13
lea addresses_normal_ht+0x1dc36, %rsi
clflush (%rsi)
nop
nop
nop
nop
xor %rdx, %rdx
movl $0x61626364, (%rsi)
nop
inc %rax
lea addresses_D_ht+0x14466, %rsi
lea addresses_UC_ht+0x16f86, %rdi
clflush (%rdi)
nop
nop
cmp $28813, %r12
mov $106, %rcx
rep movsb
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_UC_ht+0x13b17, %rsi
lea addresses_A_ht+0x148bc, %rdi
clflush (%rdi)
nop
nop
cmp %r8, %r8
mov $19, %rcx
rep movsl
nop
nop
and $22310, %rax
lea addresses_A_ht+0x8f42, %rsi
lea addresses_WC_ht+0x1dc56, %rdi
nop
nop
xor %r13, %r13
mov $5, %rcx
rep movsq
nop
nop
nop
nop
and %r8, %r8
lea addresses_D_ht+0x846, %rax
nop
nop
add $38829, %rdx
mov (%rax), %r8d
cmp $63775, %rdi
lea addresses_WC_ht+0x1a46, %rdi
nop
nop
nop
cmp $57176, %r12
movb (%rdi), %cl
nop
nop
nop
sub $7410, %rax
lea addresses_D_ht+0x76c6, %rsi
lea addresses_normal_ht+0x110f6, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp %rdx, %rdx
mov $3, %rcx
rep movsl
nop
cmp %r12, %r12
lea addresses_WT_ht+0x18246, %rsi
lea addresses_D_ht+0x5d05, %rdi
nop
nop
nop
nop
nop
cmp $43423, %r8
mov $58, %rcx
rep movsl
nop
nop
cmp $39970, %r13
lea addresses_normal_ht+0x1103f, %rdi
nop
nop
nop
nop
cmp $10797, %rsi
mov (%rdi), %cx
nop
nop
sub %r8, %r8
lea addresses_normal_ht+0x19946, %rsi
lea addresses_normal_ht+0xc946, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r8, %r8
mov $70, %rcx
rep movsb
nop
nop
nop
add $16538, %r8
lea addresses_WT_ht+0x3c6f, %rsi
lea addresses_UC_ht+0x16886, %rdi
nop
cmp %r13, %r13
mov $47, %rcx
rep movsl
nop
cmp %rsi, %rsi
lea addresses_D_ht+0xf346, %r12
clflush (%r12)
nop
nop
sub $421, %rdx
movw $0x6162, (%r12)
nop
nop
nop
inc %r13
lea addresses_D_ht+0x654e, %rsi
lea addresses_UC_ht+0x11096, %rdi
nop
nop
nop
dec %r8
mov $87, %rcx
rep movsw
sub %r8, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_normal+0x7946, %rsi
lea addresses_WT+0x168c6, %rdi
nop
nop
add $39556, %rbx
mov $120, %rcx
rep movsl
nop
nop
nop
nop
xor $16654, %rsi
// Store
lea addresses_WC+0x13146, %r12
nop
nop
nop
nop
cmp $64583, %rbx
movw $0x5152, (%r12)
nop
add $8350, %rbx
// Store
lea addresses_A+0x1ecc, %r12
sub $47437, %rbx
movb $0x51, (%r12)
nop
nop
nop
nop
nop
sub $30208, %r12
// Store
lea addresses_WT+0xf6e6, %r12
nop
nop
nop
sub $17194, %rdx
mov $0x5152535455565758, %r14
movq %r14, %xmm1
movups %xmm1, (%r12)
nop
nop
sub $16961, %rsi
// Store
lea addresses_RW+0x1e3de, %r12
nop
nop
nop
nop
add $14638, %rsi
mov $0x5152535455565758, %rbx
movq %rbx, %xmm5
movups %xmm5, (%r12)
nop
nop
nop
nop
dec %rsi
// Faulty Load
lea addresses_normal+0x1f946, %rdi
nop
and $12171, %rcx
vmovntdqa (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbx
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC', 'same': True, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'00': 39, '49': 222, '46': 10118, '45': 2426, '44': 3241, '34': 5783}
45 44 46 34 46 45 34 44 45 34 44 45 34 46 34 46 46 34 46 46 34 46 45 34 46 44 34 46 45 46 46 34 46 45 46 34 44 44 34 44 46 34 46 45 46 34 46 46 46 34 44 46 46 44 45 34 46 46 44 46 34 44 46 46 46 46 34 46 46 46 46 46 34 46 34 44 44 46 46 49 45 46 34 49 46 46 34 46 45 34 34 44 34 46 45 34 46 45 46 46 46 46 46 46 34 44 46 46 49 46 45 34 46 45 46 34 44 45 46 34 46 46 46 34 44 46 34 46 34 45 46 34 44 45 46 46 45 34 46 34 34 45 46 34 46 46 34 44 34 46 46 34 46 46 46 46 46 34 46 45 34 46 46 34 44 45 34 45 46 34 44 45 34 44 45 34 46 46 46 34 46 45 46 46 34 46 45 46 34 46 46 34 44 45 46 34 34 44 46 34 46 44 46 34 49 44 46 34 46 45 46 46 46 46 34 44 45 46 44 46 34 44 46 46 46 46 34 44 45 34 44 46 34 46 46 34 44 45 34 44 46 46 46 34 46 46 34 44 34 46 46 34 44 46 34 46 34 46 45 34 46 46 34 46 45 46 34 46 46 34 44 46 34 44 46 46 34 44 34 46 45 34 46 44 34 46 46 34 46 45 34 46 45 46 34 46 44 46 34 44 46 46 46 46 46 46 46 34 46 45 46 34 44 46 34 46 44 34 46 46 46 46 34 44 34 46 45 46 34 46 45 34 44 44 46 46 44 46 49 44 46 46 44 46 34 44 46 46 34 46 45 34 46 45 46 34 44 44 46 49 46 34 46 46 34 46 46 34 46 46 46 46 46 46 34 49 46 46 46 45 46 46 34 45 46 34 46 34 46 46 46 44 46 46 44 45 46 46 46 44 45 34 44 45 34 46 00 34 46 46 46 46 34 46 46 34 44 46 34 46 45 46 44 45 46 34 44 44 46 34 46 44 34 46 46 34 46 45 46 34 34 46 44 45 46 34 46 46 46 44 46 34 46 45 34 44 45 34 49 46 46 46 44 46 34 46 45 34 46 45 46 34 46 44 34 44 46 46 46 34 46 46 34 44 44 46 46 46 46 34 34 46 46 46 46 45 34 46 46 49 44 46 34 44 34 46 45 34 34 44 46 46 46 46 46 46 46 34 44 45 34 44 46 46 49 46 46 34 46 46 44 46 46 46 34 46 45 46 34 46 46 34 34 46 45 34 46 46 34 44 45 34 44 46 46 34 46 46 34 46 46 34 44 46 34 46 46 34 46 45 46 46 34 46 46 34 34 46 45 46 46 46 46 45 34 46 45 46 34 46 46 34 46 44 46 44 46 34 44 46 34 46 46 46 34 46 45 46 49 46 34 46 46 34 46 44 34 46 46 46 34 44 46 34 46 45 34 44 46 34 44 45 34 46 45 46 34 44 46 34 46 46 34 44 45 46 46 49 44 46 34 34 44 46 34 34 46 46 34 46 45 46 34 44 45 34 46 46 46 46 46 34 49 46 46 34 46 46 34 44 46 34 46 46 46 34 44 45 34 44 46 34 46 34 46 45 46 46 44 45 34 44 46 34 46 34 44 46 46 34 44 46 34 46 46 34 46 45 46 34 46 45 46 34 46 46 34 44 46 34 44 45 46 34 44 46 34 44 45 46 34 46 46 34 46 46 46 34 46 46 34 34 44 46 34 44 46 34 44 46 46 45 34 46 46 34 46 45 34 46 45 46 34 49 46 46 34 44 46 46 34 44 46 46 46 46 49 46 46 46 34 44 45 46 34 46 46 46 34 44 46 46 34 44 46 34 44 46 34 44 45 34 44 45 34 46 44 46 34 46 45 46 34 44 46 34 44 44 34 44 34 44 44 34 44 34 46 45 46 34 44 34 46 45 46 34 44 34 46 45 46 34 44 46 34 46 45 34 44 34 46 46 46 46 34 44 45 34 44 45 46 34 44 46 34 46 46 34 44 45 46 46 46 34 46 46 46 44 46 34 44 45 46 34 44 46 49 46 45 46 46 44 46 34 44 45 45 46 34 44 46 34 46 46 34 34 46 46 46 34 46 44 34 49 46 46 34 44 34 46 46 34 44 46 34 46 46 34 46 34 46 44 34 44 34 44 46 34 46 46 44 46 46 34 46 45 46 34 44 45 34 44 45 34 44 46 34 46 46 34 46 45 46 34 46 46 46 34 46 45 46 46 46 34 46 46 34 34 46 46 34 44 46 44 46 34 44 46 49 44
*/
| 31.134868 | 2,999 | 0.657052 |
d35fc2f3bc35c1bca150e74f4e94e3e7101a0940 | 116 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/acosh.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/acosh.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/acosh.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_fp_math48
PUBLIC _acosh
EXTERN cm48_sdccix_acosh
defc _acosh = cm48_sdccix_acosh
| 11.6 | 31 | 0.853448 |
aa35490699c2abcfff9a523b8cf7dacd0d186aab | 519 | asm | Assembly | spectranet/socklib/listen_callee.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 40 | 2021-07-23T21:33:59.000Z | 2022-02-07T19:07:46.000Z | spectranet/socklib/listen_callee.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | null | null | null | spectranet/socklib/listen_callee.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 2 | 2021-08-02T17:49:03.000Z | 2021-10-09T21:53:41.000Z | ; process
; int listen_callee(int sockfd, int backlog);
; The Spectranet listen() implementation currently does not take a
; backlog parameter, but it must be provided for compatibility.
PUBLIC listen_callee
PUBLIC ASMDISP_LISTEN_CALLEE
include "spectranet.asm"
.listen_callee
pop hl ; return addr
pop de ; int backlog
ex (sp), hl ; swap socket/return address
ld a, l ; socket in A
.asmentry
HLCALL LISTEN
jr c, err
ld hl, 0
ret
.err
ld hl, -1
ret
defc ASMDISP_LISTEN_CALLEE = asmentry - listen_callee
| 20.76 | 66 | 0.749518 |
3bc2dff808ae22ba6f5b0d71ad49d94893e17a9a | 1,479 | asm | Assembly | libsrc/_DEVELOPMENT/string/z80/asm_strtok.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/string/z80/asm_strtok.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/string/z80/asm_strtok.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; ===============================================================
; Dec 2013
; ===============================================================
;
; char *strtok(char * restrict s1, const char * restrict s2)
;
; Return the next token from the string being traversed.
; s2 is a string of delimiters used to identify where the next
; token ends.
;
; (1) If s1 != NULL, make s1 the new string to traverse. Else
; use the internally stored string position.
; (2) Skip over any delimiting chars at the head of the current
; string. This position becomes the start of the next token.
; (3) Find the end of the next token by searching for the first
; delimiter char.
; (4) Terminate the next token by overwriting the delimiter char
; with 0.
; (5) Update internal variable to search the string beginning
; after this terminating 0 on next call to strtok().
; (6) Return pointer to the found token.
;
; ===============================================================
SECTION code_clib
SECTION code_string
PUBLIC asm_strtok
EXTERN __string_strtok_p
EXTERN asm_strtok_r
asm_strtok:
; enter : de = char *s2 = delimiters
; hl = char *s1 = string to tokenize
;
; exit : de = char *s2 = delimiters
;
; found
;
; carry set
; hl = ptr to token
;
; not found
;
; carry reset
; hl = 0
;
; uses : af, bc, hl
ld bc,__string_strtok_p
jp asm_strtok_r
| 26.410714 | 65 | 0.553753 |
be4d98434a4d2dfd53cfeaf942a60ed5760d10da | 5,938 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x18d2e, %r13
nop
nop
nop
and $32374, %r11
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%r13)
nop
cmp $20622, %r8
lea addresses_D_ht+0x9712, %r14
nop
cmp $37282, %r15
and $0xffffffffffffffc0, %r14
vmovaps (%r14), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdx
nop
nop
nop
xor %r11, %r11
lea addresses_WC_ht+0x13892, %rsi
and $51611, %r11
movw $0x6162, (%rsi)
nop
dec %r14
lea addresses_WC_ht+0x1b52, %r14
and $43329, %r15
vmovups (%r14), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r11
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x1bf12, %rsi
sub %r13, %r13
movb $0x61, (%rsi)
nop
nop
nop
nop
dec %r13
lea addresses_UC_ht+0x60ec, %r15
nop
and $23175, %r13
mov (%r15), %esi
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0x1c112, %rsi
lea addresses_UC_ht+0x16642, %rdi
nop
nop
inc %rdx
mov $28, %rcx
rep movsq
nop
cmp $15870, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rbp
push %rbx
push %rdx
// Store
lea addresses_A+0x3b9b, %r11
nop
sub $6129, %r13
mov $0x5152535455565758, %r9
movq %r9, (%r11)
nop
nop
nop
xor %r9, %r9
// Faulty Load
lea addresses_RW+0x7b12, %rbp
nop
nop
nop
nop
sub $59771, %rdx
mov (%rbp), %r11w
lea oracles, %rbp
and $0xff, %r11
shlq $12, %r11
mov (%rbp,%r11,1), %r11
pop %rdx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 40.951724 | 2,999 | 0.657292 |
6018955e5a6b3c7e9ecebdb99b7d052aafec4f24 | 698 | asm | Assembly | oeis/076/A076409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/076/A076409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/076/A076409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A076409: Sum of the quadratic residues of prime(n).
; Submitted by Jon Maiga
; 1,1,5,7,22,39,68,76,92,203,186,333,410,430,423,689,767,915,1072,994,1314,1343,1577,1958,2328,2525,2369,2675,2943,3164,3683,3930,4658,4587,5513,5134,6123,6520,6012,7439,7518,8145,7831,9264,9653,8955,10761,11596,12258,13053,13514,12428,14460,14809,16448,15517,18023,16802,19113,19670,19527,21389,23025,21148,24414,25043,26811,28308,29148,30363,31064,28720,31929,34689,35247,33321,37733,39303,40100,41718,41900,44205,41807,46764,44778,47844,50288,52098,53015,51856,52771,51253,57466,57938,61377,57845
seq $0,40 ; The prime numbers.
sub $0,1
seq $0,228587 ; Sum of the squares (modulo n) of the odd numbers less than n.
| 87.25 | 499 | 0.777937 |
8b3108e9e32659ff1649203bd9f648b802860ad2 | 20,174 | asm | Assembly | averybreakout.asm | pkali/Avery_Breakout | ebca02f968c8d84310b1cbff054df9646f4f75ca | [
"MIT"
] | 1 | 2020-05-13T07:27:15.000Z | 2020-05-13T07:27:15.000Z | averybreakout.asm | pkali/Avery_Breakout | ebca02f968c8d84310b1cbff054df9646f4f75ca | [
"MIT"
] | null | null | null | averybreakout.asm | pkali/Avery_Breakout | ebca02f968c8d84310b1cbff054df9646f4f75ca | [
"MIT"
] | null | null | null | ;Acid Breakout - a break from the daily acid
;build 006, 2010-05-12
;CLEAR!
;あめでと
;---------------------------------------------------
icl '../lib/atari.hea'
icl '../lib/macro.hea'
display=$a000
screenWidth = 80 ;in pixels
maxLines = 57 ; number of lines on the screen (must be odd)
spawnProbability = (256*1/5)
margin = 2 ; top and bottom screen safety margin
racquetPosMin = $2 ; min position of the paddle moved by the user
racquetPosMax = screenWidth-8 ; max position of the paddle moved by the user
racquetSize = 10
maxSpeed = 2; maximum speed of a ball. must be power of 2 ('and #' used)
maxBalls = 100 ; maximum number of moving balls, <$80 (bpl used!)
maxMemory = 7 ; number of saved pixel positions
;Beware! For easier calc somewhere it uses "modulo maxMemory"
;calculations and therefore this value must be a power of 2!
maxBrickLines = 14 ; maximum number of lines of bricks to be eradicated
.zpvar xpos ypos .word = $80 ; position of the ball
.zpvar colour .byte ; colour of the pixel to plot
.zpvar deXpos deYpos .byte ;position for deletion
.zpvar dX dY .word ;main loop shortcuts to the table values
;.zpvar dx dy .word ;delta
;xpos, dx - "static point precision" - [dx+1].[dx] (big endian!)
;this static point precision is emulated with .word calcs, just a result is the high byte
.zpvar currBall collisionCheck racquetPos MyClok eXistenZstackPtr .byte
.zpvar xMemAddr yMemAddr .word ; address where to store memories of the current ball
.zpvar temp .word
.zpvar clearCount clearBallNr .byte
.zpvar DLI_A DLI_X dliCount .byte
org $2000
;---------------------------------------------------
dl
.by $80+$20
dta $4f+$20,a(display) ;VSCROLL
:((maxlines-1)/2) dta a($2f8f)
;----
.by $42+$10 ;Hscroll
DLracquetAddr0
.wo racquetDisp
.by $41
.wo dl
;---------------------------------------------------
racquetDisp
:42 .byte $0
.byte $80, $80, $80, $80, $80
:36 .byte $0
;--------------------------------------------------
vint
;------------JOY-------------
;happy happy joy joy
;check for joystick now
/*
inc MyClok
lda MyClok
and #$07
bne jNotRight
*/
ldy PORTA
/*
tya
and #$01 ;up
bne jNotUp
ldx joystickConversion ;up
lda #1
sta keyboardGrid,x
jNotUp
tya
and #$02 ;down
bne jNotDown
ldx joystickConversion+1 ;up
lda #1
sta keyboardGrid,x
jNotDown
*/
tya
and #$04 ;left
bne jNotLeft
ldx racquetPos
cpx #racquetPosMin+1
bcc jNotLeft
dex
stx racquetPos
jNotLeft
tya
and #$08 ;right
bne jNotRight
ldx racquetPos
cpx #racquetPosMax
bcs jNotRight
inx
stx racquetPos
jNotRight
/*
;fire
lda TRIG0
bne JNotFire
...
JNotFire
*/
lda racquetPos
sec
lda #screenWidth-1
sbc racquetPos
lsr
clc
adc #<racquetDisp
sta dlracquetAddr0
lda #>racquetDisp
adc #0
sta dlracquetAddr0+1
lda racquetPos
lsr
and #$01
;sta HSCROL
;pos print
lda racquetPos
:4 lsr
clc
adc #'0'
sta hexDump
lda racquetPos
and #$0F
clc
adc #'0'
sta hexDump+1
mva #0 dliCount
mva #13 VSCROL
jmp XITVBV
;--------------------------------------------------
DLI
sta DLI_A
stx DLI_X
ldx dliCount
sta WSYNC
lda #13
sta VSCROL
lda #3
sta VSCROL
txa
asl
asl
;lda brickColourTab,x
sta COLBAK
inx
stx dliCount
ldx DLI_X
lda DLI_A
rti
;--------------------------------------------------
main
jsr initialize
loop
mva #maxBalls-1 currBall
jsr cycleColours
flight
ldx currBall
lda BalleXistenZ,x
jeq ballDoesNotexist
lda xposTableL,x
sta xpos
lda xposTableH,x
sta xpos+1
lda yposTableL,x
sta ypos
lda yposTableH,x
sta ypos+1
lda dxTableL,x
sta dX
lda dxTableH,x
sta dX+1
lda dyTableL,x
sta dY
lda dYTableH,x
sta dY+1
; now, delete the oldest pixel
;
lda memCycleTable,x
clc
adc #1 ;next position in the table
cmp #maxMemory
bne notMaxMem
lda #0
notMaxMem
sta memCycleTable,x ; memCycleTable saved
tax
lda xposMemTableAdrL,x
sta xMemAddr
lda xposMemTableAdrH,x
sta xMemAddr+1
lda yposMemTableAdrL,x
sta yMemAddr
lda yposMemTableAdrH,x
sta yMemAddr+1
;now on zero page I've got the addressess to store the old xPos and yPos
ldy currBall
lda (yMemAddr),y
tax
lda (xMemAddr),y
sta dexpos
; and erase the last point in the "snake"
;jsr deplot
;--------------------------------------------------
;deplot
; moved here for the speeeeeed
; deyxpos, deypos (.byte) - pixel position
;--------------------------------------------------
; let's calculate coordinates from xpos and ypos
;lda dexpos
lsr
tay
;---
;ldx deypos
lda lineAdrL,x
sta temp
lda lineAdrH,x
sta temp+1
lda dexpos
and #$01
tax
lda (temp),y
and debittable,x
sta (temp),y
;move the ball!!!
adw xpos dX xpos
adw ypos dY ypos
;top bounce
; if ypos<margin then bounce
lda ypos+1
cmp #margin
bcs noTop
; assuming that here a plot can get only from below, so it is enough to switch dy sign
; sbw #$ffff dy dy ;this does not compile :(
negw dY
mva #margin+1 ypos+1
noTop
;bottom bounce
; if ypos>maxLines+margin then bounce
lda ypos+1
cmp #maxLines+margin
bcc noBottom
; check if the ball hits the racquette
lda CONSOL
and #%00000100 ; OPTION
bne bounceNormally
jmp bottomBounce ; turns off the ball kill
bounceNormally
lda ypos+1
cmp #maxLines+margin*2+maxSpeed*2 ; that makes the ball below the racquet
bcs flyDown2 ;kinda lame optimisation as A carries ypos+1
lda racquetPos
sec
sbc #racquetPosMin+1
bpl racquettePlus
lda #0
racquettePlus
cmp xpos+1
jcs flyDown
clc
adc #racquetSize-1
cmp xpos+1
jcs bottomBounce
flyDown
lda ypos+1
flyDown2
cmp #maxLines+margin*6+maxSpeed*2 ;maximum depth
bcc noBottom
ballOut
lda currBall
eXistenZdEstroy
;destroys ball number A
;pushes one free slot to the eXistenZstack
;ends with !number of balls in X (maxBalls == end of the game)
;txa
ldy eXistenZstackPtr
iny
sta eXistenZstack,y
sty eXistenZstackPtr
;ldx currBall
tax
lda #0
sta balleXistenZ,x
jmp flightLoopEnd
bottomBounce
; assuming that here a plot can get only from below,
; so it is enough to switch dy sign
; sbw #$ffff dy dy ;this does not compile :(
negw dY
mva #maxLines+margin-2 ypos+1
noBottom
;left bounce
lda xpos+1
cmp #margin
bcs noLeft
negw dX
mva #margin+1 xpos+1
noLeft
;right border bounce
lda xpos+1
cmp #screenWidth-margin
bcc noRight
negw dX
mva #screenWidth-margin-1 xpos+1
noRight
;jsr plot
; the full plot copied here to get few cycles and collision
; high byte is the integer position
; low byte is the "fractional" part
; let's calculate coordinates from xpos and ypos
lda xpos+1
lsr
tay
;---
ldx ypos+1
lda lineAdrL,x
sta temp
lda lineAdrH,x
sta temp+1
ldx colour
lda xpos+1
and #$01
bne pRightNibble
pLeftNibble
lda (temp),y
sta collisionCheck
and #$0F
ora LNColtable,x
sta (temp),y
lda collisionCheck
and #$F0
cmp #%10000000
jne noCollision
jmp plotEnd ;unconditional branch
pRightNibble
lda (temp),y
sta collisionCheck
and #$F0
ora RNColtable,x
sta (temp),y
lda collisionCheck
and #$0F
cmp #%00001000
jne noCollision
plotEnd
lda ypos+1
cmp #maxLines+margin-2-1
jcs noCollision ;ball is outside the screen!
;switch direction, Charles
; an idea for assuming which direction to switch - dX or dY?
; on a diagram below in the middle there is an approached brick
/*
\ /
\-dY /
\ /
-dX [] -dX
/ \
/-dY \
/ \
*/
; it means:
; if |dX|>|dY| then dX == -dX
; else dY == -dY
; get absolute values
lda dX+1
bpl dXpositive
;dX is negative here
lda dY+1
bpl dXneg_dYpos
;dX and dY are negative here
cmp dX+1
bcc dX_gr_dY__dX_dYneg
; |dY| >= |dX| ; hour 5
negw dY
jmp bounceDone
dX_gr_dY__dX_dYneg
; hour 4
negw dX
jmp bounceDone
dXneg_dYpos
; dY in A
clc
adc dX+1
bpl dY_gr_dX__dXneg_dYpos
; |dX| > |dy|; hour 2
negw dX
jmp bounceDone
dY_gr_dX__dXneg_dYpos
; hour 1
negw dY
jmp bounceDone
dXpositive
lda dY+1
bpl dX_dYpositive
;dX positive, dY negative
clc
adc dX+1
bpl dX_gr_dY__dXpos_dYneg
; hour 7
negw dY
jmp bounceDone
dX_gr_dY__dXpos_dYneg
; hour 8
negw dX
jmp bounceDone
dX_dYpositive
;(dY+1)* is in A
cmp dX+1
bcc dX_gr_dY__dX_dYpos
; dY > dX ; hour 11
negw dY
jmp bounceDone
dX_gr_dY__dX_dYpos
; dY < dX ; hour 10
negw dX
bounceDone
;spawn the new bally
; if there is still an empty slot for a new ball somewhere...
;lda RANDOM
;cmp #spawnProbability
;bcs noCollision
lda colour
cmp #1
bne noCollision
eXistenZcReate
;creates a new ball
;removes one free slot from the eXistenZstack
;ends with ball number in X
;ends with zero when there is no free slot for a ball
ldy eXistenZstackPtr
beq noMoreSlots
lda eXistenZstack,Y
dey
sty eXistenZstackPtr
tax
;OK, in X there is an empty slot for a ball
;spawn it
lda #1
sta balleXistenZ,x
lda xPos
sta xPosTableL,x
lda xPos+1
sta xPosTableH,x
lda yPos
sta yPosTableL,x
lda yPos+1
sta yPosTableH,x
; random initial speed and direction
lda random
bpl dXplus
lda #-1
sta dxTableH,x
bne dXlower
dXplus
lda #1
sta dxTableH,x
dXlower
lda random
sta dxTableL,x
;randomize 1 maxSpeed-1 ;dy can not be too small or the game would take forever
lda #1
sta dyTableH,x
lda random
sta dyTableL,x
; sound
;lda random
;and #%00001000
;lda #%00000000
;sta consol
noCollision
noMoreSlots
flightLoopEnd
;end of the cycle for one ball
;save the changes now
ldx currBall
; let's save the position for the future erase
; old position of ball(currBall) is saved here
; in table nr memCycleTable(currBall)
ldy currBall
lda xpos+1 ;high byte is the integer position
sta (xMemAddr),y
lda ypos+1
sta (yMemAddr),y
; saved
lda xpos
sta xposTableL,x
lda xpos+1
sta xposTableH,x
lda ypos
sta yposTableL,x
lda ypos+1
sta yposTableH,x
lda dX
sta dxTableL,x
lda dX+1
sta dxTableH,x
lda dY
sta dyTableL,x
lda dY+1
sta dYTableH,x
endOfBallzLoop
;pause
dec currBall
jpl flight
pause 0;all balls
lda eXistenZstackPtr
cmp #maxBalls
jne loop
;game over
gameOver
lda RANDOM
and #$07
sta COLPM0
jmp gameOver
;-------------------
ballDoesNotexist
;a delay loop for a ball that does not really exist (yet)
ldx #70
delayLoop
dex
bne delayLoop
jmp endOfBallzLoop
;--------------------------------------------------
fatplot
; xpos, ypos (.byte) - pixel position
; xpos<80
; pixel colour in "colour"
;--------------------------------------------------
; let's calculate coordinates from xpos and ypos
lda xpos
lsr
tay
;---
ldx ypos
lda lineAdrL,x
sta temp
lda lineAdrH,x
sta temp+1
ldx colour
lda xpos
and #$01
bne fpRightNibble
fpLeftNibble
lda (temp),y
and #$0F
ora LNColtable,x
sta (temp),y
rts
fpRightNibble
lda (temp),y
and #$F0
ora RNColtable,x
sta (temp),y
rts
;--------------------------------------------------
fatdeplot
; deyxpos, deypos (.byte) - pixel position
;--------------------------------------------------
; let's calculate coordinates from xpos and ypos
lda dexpos
lsr
tay
;---
ldx deypos
lda lineAdrL,x
sta temp
lda lineAdrH,x
sta temp+1
lda dexpos
and #$01
tax
lda (temp),y
and debittable,x
sta (temp),y
rts
;--------------------------------------------------
clearDeadBall
;--------------------------------------------------
;dead ball in clearBallNr
ldx #maxMemory-1
stx clearCount
clearDeadLoop
ldx clearCount
lda xposMemTableAdrL,x
sta xMemAddr
lda xposMemTableAdrH,x
sta xMemAddr+1
lda yposMemTableAdrL,x
sta yMemAddr
lda yposMemTableAdrH,x
sta yMemAddr+1
;now on zero page I've got the addressess to store the old xPos and yPos
ldy clearBallNr
lda (xMemAddr),y
sta dexpos
lda (yMemAddr),y
sta deypos
jsr fatdeplot
dec clearCount
bpl clearDeadLoop
rts
;--------------------------------------------------
clearScreen
;--------------------------------------------------
lda #0
tax
Loopi1
:(maxLines*40/256+1) sta display+$100*#,x
inx
bne Loopi1
rts
;--------------------------------------------------
cycleColoursReset
ldy #6
cycleRloop
lda colourCycleTabReset,y
sta colourCycleTab,y
dey
bpl cycleRloop
mva #0 colour
;--------------------------------------------------
cycleColours
;--------------------------------------------------
inc colour
lda colour
cmp #8
bne noColourReset
mva #1 colour
noColourReset
ldy #6
cycleCloop
lda colourCycleTab,y
;sta COLPM1,y
sta COLPM1S,y
dey
bpl cycleCloop
;shift colours
/*
2
2 4
2 4 6
2 4 6 8
2 4 6 8 10
2 4 6 8 10 12
2 4 6 8 10 12 14
4 6 8 10 12 14 2
6 8 10 12 14 2 4
8 10 12 14 2 4 6
10 12 14 2 4 6 8
12 14 2 4 6 8 10
14 2 4 6 8 10 12
2 4 6 8 10 12 14
4 6 8 10 12 14
6 8 10 12 14
8 10 12 14
10 12 14
12 14
14
261 262 263 264 265 266 267
*/
cct = colourCycleTab
ldx cct+6
mva cct+5 cct+6
mva cct+4 cct+5
mva cct+3 cct+4
mva cct+2 cct+3
mva cct+1 cct+2
mva cct+0 cct+1
stx cct+0
rts
colourCycleTab
.by 14,2,4,6,8,10,12
colourCycleTabReset
.by 14,2,4,6,8,10,12
brickColourTab
.by 0
;--------------------------------------------------
initialize
;--------------------------------------------------
mva #$00 COLPM0S ; = $02C0 ;- - rejestr-cień COLPM0
jsr cycleColoursReset
mva #$7C COLBAKS
mva #0 dliCount
jsr clearscreen
jsr drawBricks
lda dmactls
and #$fc
ora #$02 ; normal screen width
;ora #$01 ; narrow screen width
sta dmactls
mwa #dl dlptrs
vdli DLI
; prepare mem address tables (for "snake" routine)
;first address initialized
mva #<xposMemTable xposMemTableAdrL
mva #>xposMemTable xposMemTableAdrH
mva #<yposMemTable yposMemTableAdrL
mva #>yposMemTable yposMemTableAdrH
;now add maxBalls to the following addresses
;just take the previous one and add "maxBalls"
ldx #0
initLoop1
clc
lda xposMemTableAdrL,x
adc #<maxBalls ; maxBalls <$80
sta xposMemTableAdrL+1,x
lda xposMemTableAdrH,x
adc #>maxBalls ; maxBalls <$80, so it is == 0
sta xposMemTableAdrH+1,x
clc
lda yposMemTableAdrL,x
adc #<maxBalls ; maxBalls <$80
sta yposMemTableAdrL+1,x
lda yposMemTableAdrH,x
adc #>maxBalls ; maxBalls <$80, so it is == 0
sta yposMemTableAdrH+1,x
inx
cpx #maxMemory-1
bne initLoop1
;snake memory addressess initialized!
;clear the balleXistenZ (nothing is bouncing!)
;and other tables
ldx #0
txa
eXistenZclearLoop
sta balleXistenZ,x
sta dxTableL,x
sta dxTableH,x
sta dyTableL,x
sta dyTableH,x
sta xposTableL,x
sta xposTableH,x
sta yposTableL,x
sta yposTableH,x
sta memCycleTable,x
inx
cpx #maxBalls
bne eXistenZclearLoop
sta balleXistenZcatch
dex
; X == maxBalls-1
txa
eXistenZstackFill
sta eXistenZstack+1,x
dex
txa
bne eXistenZstackFill
ldy #maxBalls
sty eXistenZstackPtr
;sty clearPtr
;OK, one ball starts!
;ldy eXistenZstackPtr
lda eXistenZstack,Y
dey
sty eXistenZstackPtr
tax
jsr randomStart ;just one random pixxxel
;previously the whole band of ballz
;VBI
mva #screenWidth/2 racquetPos
vmain vint,7
lda #$80 ;+GTIACTLBITS
sta GTIACTL
sta GTICTLS
mva #1 colour
rts
;--------------------------------------------------
drawBricks
;--------------------------------------------------
; solid maxBrickLines field
; for x=margin to screenWidth-margin:
; for y=margin to maxBrickLines+margin:
; fatplot(x,y)
mva #8 colour
mva #margin*2 ypos
drawBricksLoopY
mva #margin*3 xpos
drawBricksLoop
jsr fatplot
inc xpos
lda xpos
cmp #screenWidth-margin*3
bne drawBricksLoop
inc ypos
lda ypos
cmp #maxBrickLines+margin*2
bne drawBricksLoopY
rts
;--------------------------------------------------
randomStart
; X - ball number
;--------------------------------------------------
lda #1
sta balleXistenZ,x
;randomize margin $ff-margin
lda #40
sta xposTableH,x
;randomize margin*2+maxBrickLines maxLines-margin*4
lda #30
sta yposTableH,x
; random initial speed and direction
;randomize 0 maxSpeed-1
lda #1 ;easy start
sta dxTableH,x
lda random
sta dxTableL,x
;randomize 1 maxSpeed-1 ;dy can not be too small or the game would take forever
lda #-1 ;easy start
sta dyTableH,x
lda #1
sta dyTableL,x
rts
;--------------------------------------------------
lineAdrL
:margin .byte <marginLine ;8 lines of margin space
:maxLines .byte <(display+40*#)
;:margin .byte <marginLine ;8 lines of margin space
:256-maxLines-1*margin .by <marginLine; (display+40*#) ;just to let the plot smear on full .byte ypos
lineAdrH
:margin .byte >marginLine
:maxLines .byte >(display+40*#)
;:margin .byte >marginLine
:256-maxLines-1*margin .by >marginLine; (display+40*#) ;just to let the plot smear on full .byte ypos
; $E000 is an address in ROM - the trick to avoid spawning new balls!
bittable
.byte %11110000
.byte %00001111
RNColtable ; Right Nibble Colour Table
.byte %00000000
.byte %00000001
.byte %00000010
.byte %00000011
.byte %00000100
.byte %00000101
.byte %00000110
.byte %00000111
.byte %00001000
LNColtable ; Left Nibble Colour Table
.byte %00000000
.byte %00010000
.byte %00100000
.byte %00110000
.byte %01000000
.byte %01010000
.byte %01100000
.byte %01110000
.byte %10000000
debittable
.byte %00001111
.byte %11110000
dxTableL :maxBalls .byte 0
dxTableH :maxBalls .byte 0
dyTableL :maxBalls .byte 0
dyTableH :maxBalls .byte 0
; xpos and ydaw are "decimal" parts of static point precision .word
xposTableL :maxBalls .byte 0 ; "fractional" part
xposTableH :maxBalls .byte 0 ; "fractional" part
yposTableL :maxBalls .byte 0 ;
yposTableH :maxBalls .byte 0 ;
;ball position memory tables - the ball trace works like a "snake"
; (one set, one erased)
; there are "maxMemory" number of tables, "maxballs" length each
; too bad their addressess are not known in advance,
; so a short subrourine must calculate them and place to XposMemTableAdrL, etc.
balleXistenZ :maxBalls .byte 0 ; 0-dead, 1-alive!
balleXistenZcatch
.byte 0 ; catch last ball byte
eXistenZstack ; goes from index [1..maxBalls]. maxBalls[0] is unused
; keeps the list of free slots for balls
; goes from down to top. ptr==0 means stack is empty (all balls playing)
:maxBalls+1 .byte 0
xposMemTable
:maxBalls*maxMemory .byte 0
yposMemTable
:maxBalls*maxMemory .byte 0
;addressess of the tables with
xposMemTableAdrL
:maxMemory .byte 0
xposMemTableAdrH
:maxMemory .byte 0
yposMemTableAdrL
:maxMemory .byte 0
yposMemTableAdrH
:maxMemory .byte 0
;table for keeping the count on the last position to be deleted from the "snake"
memCycleTable
:maxBalls .byte 0
statusBar
dta d"rc$"
hexDump
dta d" dx$"
dxDisp
dta d" dy$"
dyDisp
dta d" balls$"
ballDisp
dta d" "
marginLine :40 .byte 0
RUN main
| 19.231649 | 105 | 0.611431 |
0762dbd51ece7da17f66eb763d30a7e71e1b7d04 | 442 | asm | Assembly | oeis/172/A172265.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/172/A172265.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/172/A172265.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A172265: Partial sums of A024810(n) = floor(2^(n+1)/Pi).
; Submitted by Jon Maiga
; 1,3,8,18,38,78,159,321,646,1297,2600,5207,10422,20852,41712,83433,166876,333762,667534,1335078,2670166,5340342,10680695,21361402,42722816,85445645,170891304,341782622,683565259,1367130534,2734261085,5468522187,10937044391
lpb $0
mov $2,$0
sub $0,1
seq $2,24810 ; a(n) = floor( tan(m*Pi/2) ), where m = 1 - 2^(-n).
add $1,$2
lpe
mov $0,$1
add $0,1
| 34 | 223 | 0.701357 |
6dbe96ccd6a80357750e886dd2d918a73e899a30 | 16,995 | asm | Assembly | 45/runtime/rt/dkstmt.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/dkstmt.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/dkstmt.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | TITLE DKSTMT - Disk I/O Interfaces
page 56,132
;***
;DKSTMT - Disk I/O Interfaces
;
; Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
; This module contains disk I/O interfaces for BASIC statements.
;
; This module came from iodisk.asm, which had been split into three
; modules, -- diskio.asm, dkopen.asm and fileio.asm. Diskio.asm
; contains all drivers for disk I/O except disk open and close.
; Disk open is in dkopen.asm. This module contains interfaces for
; file I/O statements.
;
;BASIC Syntax mapping to included runtime entry points:
;
;- FILES Statement:
;
; FILES Statement:
;
; FILES [filespec]
; |
; B$FILS
;
;- KILL Statement:
;
; KILL filespec
; |
; B$KILL
;
;- LOCK Statement:
;
; LOCK [#]filenum [{, record} | [start] TO end]
; |
; B$LOCK
;
;- NAME Statement:
;
; NAME oldname AS newname
; |
; B$NAME
;
;- RESET Statement:
;
; RESET
; |
; B$REST
;
;- UNLOCK Statement:
;
; UNLOCK [#]filenum [{, record} | [start] TO end]
; |
; B$LOCK
;
;******************************************************************************
INCLUDE switch.inc
INCLUDE rmacros.inc ;Runtime Macro Defintions
;Code segmetns
useSeg DK_TEXT
useSeg ER_TEXT
useSeg NH_TEXT
useSeg RT_TEXT
;Data segments
useSeg CONST
useSeg _DATA
useSeg _BSS
INCLUDE seg.inc
INCLUDE ascii.inc
INCLUDE baslibma.inc
INCLUDE devdef.inc
INCLUDE files.inc
INCLUDE idmac.inc
INCLUDE messages.inc
INCLUDE rtps.inc
INCLUDE string.inc
SUBTTL local constant definitions
page
sBegin CONST
externB b$EightSpaces ; buffer of 8 spaces
staticB DirStr,"<DIR> "
sEnd CONST
sBegin _DATA
sEnd _DATA
sBegin _BSS
externB b$PATHNAM ; defined in GWINI.ASM
externB b$Buf2 ; defined in GWINI.ASM
b$PATHNAM2 EQU b$Buf2
externW b$PN_NAME
sEnd _BSS
SUBTTL code externals
page
sBegin DK_TEXT
externNP B$GET_PATHNAME
externNP B$GET_CUR_DIR
externFP B$PSI4
externNP B$PUTS
externNP B$OUTCNT
externNP B$$WCHT
externNP B$$TCR
externNP B$TTY_GPOS
externNP B$TTY_GWID
externNP B$CLOSF
externNP B$CHKFOPEN
externNP B$DOS3CHECK ;check for >= DOS 3.00
externNP B$MUL32
sEnd DK_TEXT
sBegin NH_TEXT
externNP B$STDALCTMP
externNP B$LHFDBLOC
sEnd NH_TEXT
sBegin ER_TEXT
externNP B$PUTNUM ; output message
externNP B$ERR_FC
externNP B$ERR_BFN
externNP B$ERR_BRN
externNP B$ERR_FAE
externNP B$ERR_FNF
externNP B$ERR_IFN
externNP B$ERR_ACD
externNP B$ERR_FWP
externNP B$ERR_AFE
externNP B$ERR_PNF
externNP B$ERR_RAD
sEnd ER_TEXT
sBegin RT_TEXT
sEnd RT_TEXT
PAGE
assumes CS,DK_TEXT
sBegin DK_TEXT
;***
;B$KILL - KILL filename
;
;Purpose:
;
;Entry:
; fname = filename sdesc
;
;Exit:
;
;Uses:
; Per convention
;
;Exceptions:
; B$ERR_FNF -- for file not found
; B$ERR_ACD -- for access denied
; B$ERR_FAO -- for file already open
;
;******************************************************************************
cProc B$KILL,<FAR,PUBLIC>,<SI,DI,ES>
parmSD fname
cbegin
PUSH DS ; set ES=DS for string operations
POP ES
MOV BX,fname ; get *sd of filename
MOV DI,OFFSET DGROUP:b$PATHNAM ; Where to put the pathname
CALL B$GET_PATHNAME ; generate pathname, checking for errors
; sets ES = DS
CALL B$STDALCTMP ;delete temporaries
CALL SearchNoDir ; find first file, or give "file not found"
KILL_NEXT:
; DI --> pointer to processed filename
PUSH DI ; save pathname buffer address
MOV DI,b$PN_NAME ; DI = address past last "\" in pathname
; (filename.ext field of pathname)
mov si,offset dgroup:b$PATHNAM2+30 ; Where dos put the filename
; store name into the name field of pathname
dkk22:
lodsb ;get a byte from the filename
stosb ;store it into the pathname
or al,al ;end ?
jnz dkk22 ;no
pop di ;--> pathname
CALL B$CHKFOPEN ; Check for conflict with open files
; (doesn't return if error)
; delete the link
mov dx,di ; DX = address of pathname to delete
CALLOS unlink,,,,dx
JB KILL_ERR ; give proper error message
CALLOS FINDN ;find next
JNB KILL_NEXT ; found next, continue
cEnd
KILL_ERR:
CMP AX,ERRACD ;test if access error
JNE ERFNF ; if not, then KILL defaults to file not
; found error
JMP B$ERR_ACD ;treat as access error
ERFNF:
JMP B$ERR_FNF ; File not found
;***
; B$NAME - Name statement
;
;Purpose:
; Rename a file
;
;Entry:
; oldname = Name of existing file
; newname = name to change to
;
;Exit:
;
;Uses:
; Per convention
;
;Exceptions:
; B$ERR_FAE if newname already exists.
;
;******************************************************************************
cProc B$NAME,<FAR,PUBLIC>,<ES,SI,DI>
parmSD oldname
parmSD newname
cBegin
PUSH DS ; set ES=DS
POP ES
GetpSD BX,newname
MOV DI,OFFSET DGROUP:b$PATHNAM2
CALL NAME_COMMON ; do common processing for second name
GetpSD BX,oldname ; source pathname sdesc
MOV DI,OFFSET DGROUP:b$PATHNAM
CALL NAME_COMMON ; do common processing for first name
MOV DX,OFFSET DGROUP:b$PATHNAM ;source
MOV DI,OFFSET DGROUP:b$PATHNAM2 ;destination
CALLOS RENAME
JC NAME_ERR
cEnd
NAME_ERR:
CMP AL,ERRFNF ; file not found?
JE ERFNF ; brif so
CMP AL,ERRPNF ; path not found?
JE ERPNF ; brif so
CMP AL,ERRACD ; access denied?
JE ERFAE ; brif so -- File already exists
CMP AL,ERRNSD ; not same device?
JE ERRAD ; brif so -- Rename across disks
; default to Illegal function call error
; for NAME if not one of the above.
ERFC:
JMP B$ERR_FC ; Illegal function call
ERFAE:
JMP B$ERR_FAE ; File already exists
ERPNF:
JMP B$ERR_PNF ; Path not found
ERRAD:
JMP B$ERR_RAD ; Rename across disks
ERBFN:
JMP B$ERR_BFN ; Bad file name
ERCFNF2:
JMP SHORT ERFNF ; give "file not found" error
;***
; NAME_COMMON - common processing. Added as part of [14].
;
;Purpose:
; Common processing for each filename of B$NAME.
;
; Algorithm:
; call B$GET_PATHNAME
; if (wildcards in filename) then error
; deallocate the string temp
; if (file already open) then error
;
;Entry:
; DI = *space for pathname
; BX = pointer to user-specified filename string descriptor
;
;Exit:
; DI = *processed pathname
; CX = length of pathname (including null byte)
;
;Uses:
; per convention
;
;Preserves:
;
;Exceptions:
; B$ERR_BFN -- for bad file name
; B$ERR_FAO -- for file already open
;
;******************************************************************************
NAME_COMMON:
CALL B$GET_PATHNAME ; Scan file name
; sets ES = DS
cCall B$STDALCTMP ; deallocate string temp
TEST AL,FN_WILD ; wildcards in filename?
JNZ ERBFN ; brif so -- error
; [DI] = processed pathname
; [CX] = number of bytes in pathname
JMP B$CHKFOPEN ; check for file already open and return
; (doesn't return if error)
;***
; Search/SearchNoDir - search for file
;
;Purpose:
; Search for files
;Entry:
; b$PATHNAM has pathname to search for
;Exit:
; Conditions after DOS search function:
; b$PATHNAM2 has directory entry for first matching file
; DX -> b$PATHNAM
; ZF ==> file found, NZ ==> error
;
;Uses:
; AX,CX,DX
;
;Preserves:
;
;Exceptions:
;
;******************************************************************************
Search:
mov cx,ATTR_SUBDIR ; Search attributes
SKIP 2 ; eat the XOR and fall into common code
cProc SearchNoDir,<NEAR> ; no directory
cBegin
xor cx,cx ;no search attributes (files only)
MOV DX,OFFSET DGROUP:b$PATHNAM2
CALLOS BUFF ;Set buffer address
MOV DX,OFFSET DGROUP:b$PATHNAM ; Address of pathname to search
CALLOS FINDF ; Use new one
JC ERCFNF2 ; brif error -- file not found
cEnd
SUBTTL B$REST - Reset statement
PAGE
;***
; B$REST - Reset statement
;
;Purpose:
; Runtime entry. Close all open files.
;
;******************************************************************************
cProc B$REST,<FAR,PUBLIC,FORCEFRAME>
cBegin
CALL B$CLOSF ;Close all files
CALLOS GDRV ;Get drive number
PUSH AX
CALLOS REST ;Restore
POP AX
MOV DL,AL
CALLOS SDRV ;Set drive number
cEnd
SUBTTL FILE interface
page
newlin: ;moved here from below
CALL B$TTY_GPOS
XCHG AL,AH
ADD AL,18 ;Position after next file name
CALL B$TTY_GWID
CMP AL,AH
RET
;***
;B$FILS - FILES Statement
;
;Purpose:
; Print a listing of all files in the current directory, which match the given
; string pattern
;
;Input:
; fname = filename sd
;
;Output:
; None
;
;Modifies:
; Per convention
;
;Exceptions:
; Control could be transfered to error code, such as B$ERR_FNF
;
;******************************************************************************
cProc B$FILS,<FAR,PUBLIC>,<ES,DI,SI>
parmW fname
cBegin
PUSH DS ; set ES=DS for string operations
POP ES
MOV BX,fname
MOV DI,OFFSET DGROUP:b$PATHNAM
call B$GET_PATHNAME ; convert to standard pathname format
CALL B$STDALCTMP ;delete string if temp
PUSH DI ; save pathname buffer address
MOV AX,[DI] ; load drive letter and colon into AX
MOV DI,OFFSET DGROUP:b$PATHNAM2 ; buffer for current directory
PUSH DI ; save buffer address (for printing)
STOSW ; store drive letter and ":" into buffer
SUB AX,':' SHL 8 + 'A' - 1 ; convert AX to drive number (1-26)
XCHG AX,DX ; DX = drive number
CALL B$GET_CUR_DIR ; store current directory path for this
; drive into buffer, after the drive letter
; print the current directory for specified drive
POP AX ; AX = buffer offset
PUSH DX ; save drive number
MOV DX,DS ; DX = buffer segment
CALL B$PUTS ; print the null-terminated buffer
CALL B$$TCR ; print a CR
; add "*.*" to the pathname if necessary
; CX and DX preserved from above
POP DX ; restore drive number
POP DI ; restore pathname buffer address
PUSH DX ; save drive number for free space check
ADD DI,CX ; one past null byte
DEC DI ; DI = address of null byte
CMP DI,b$PN_NAME ; does pathname end with a "\"?
JNZ NO_ADD_EXT ; brif not -- don't add the extention
MOV AX,".*" ; add "*." to the pathname
STOSW
MOV AX,"*" ; add "*0" to the pathname
STOSW
NO_ADD_EXT:
CALL Search ; search for first file with this name
; or give "file not found"
d2off:
mov si,offset dgroup:b$PATHNAM2+30 ; name
mov cx,8
mov dx,"."
call outnam
mov cx,4
xor dx,dx
call outnam
mov si,offset dgroup:b$EightSpaces
cmp byte ptr b$PATHNAM2+21,ATTR_SUBDIR ; check for directory attr
jne d2space
mov si,offset dgroup:DirStr
d2space:
mov cx,6 ; print 6 chars
CALL B$OUTCNT ; print CX bytes
call newlin
jl findn
call B$$TCR
findn:
callos findn
jnb d2off
CALL B$$TCR ; list of files done -- output a CR
POP DX ; get back drive number
CALLOS FREES ;get disk free space
mul cx ;[ax]=bytes/sect*sect/alloc
mul bx ;[dxax]=[ax]*free alloc units
PUSH DX ; pass the I4
PUSH AX
call B$PSI4 ; and output that
MOV AX,MS_BYTESFREE ;output "Bytes free"
cCall B$PUTNUM ;output the message
cEnd
outnam:
mov al," "
cmp byte ptr[si],dh ;end of string?
je atend
cmp byte ptr[si],dl ;possible end of name
je atend
lodsb
atend:
call B$$WCHT ;write char
loop outnam
ret
page
SUBTTL LOCK/UNLOCK interfaces
page
ERCFNF: JMP B$ERR_FNF ;file not found
ERCAFE: JMP B$ERR_AFE ;advanced feature
;***
;B$LOCK -- LOCK/UNLOCK statement interface
;void B$LOCK (I2 channel, I4 first_rec, I4 last_rec, U2 mode)
;
;Purpose:
; Lock or unlock an opened file according to the value of mode. The
; file must be opened using the new OPEN syntax with the lock clause,
; and DOS version must be 3.0 or above;otherwise a runtime error will
; occur. Between 2.0 and 3.0, the range of record number is slightly
; different. In 2.0, a 24-bit record number is supported, whereas a
; 31-bit record number is supported.
;
; Note: BASICA 3.2 supports 32-bit record number.
;
; BASCOM 2.0 uses two separate interfaces, $ULK & $LK0, for UNLOCK and
; LOCK statement respectively. In BASCOM 3.0, a single interface is
; used with mode containing valuable information. The beauty of the mode
; is that the first bit tells whether it is a lock or an unlock, and the
; second bit tells whether it is to lock/unlock the whole file or not.
;
; The syntax for LOCK/UNLOCK is as follows:
; LOCK/UNLOCK [#]channel [,[first-rec] [TO last-rec]]
;
; B$CHAN WILL NOT be called prior to B$LOCK, this routine has to
; check the file is opened or not.
;
; The 'first-rec' is the 'from' record # and 'last-rec' is the 'to'
; record #. The default 'first-rec' is 1 and the default 'last-rec'
; is the same record number as the 'first-rec.' For example,
; "LOCK #1, TO 3" will generate first=1, last=3 & mode=2, and
; "UNLOCK #1, 5" will generate first=5, last=5 & mode=3.
;
; NOTE: Currently, record number is only meaningful to the random file.
; Sequential file is always lock/unlocked the whole file, and
; there is no range check of 'first-rec' or 'last-rec' for a
; sequential file. (the compiler or the interpreter parser
; does check whether the parameter is a numerical type.)
;
; The low order byte of mode may contain the following values according
; to different situations (the high order word should wlays be IGNORED,
; as the interpeter uses it):
;
; mode = 0 -- lock entire file
; mode = 2 -- lock from first to last
;
; mode = 1 -- unlock entire file
; mode = 3 -- unlock from first to last
;
; The reason is illustrated as the following bit map.
; mode:
; _________________________________
; | 0 | 0 | 0 | 0 | 0 | 0 | X | Y |
; ---------------------------------
; MSB LSB
; where:
; X is used to represent whether to lock/unlock the whole file, and
; Y is used to decide whether it is a lock or is an unlock.
;
; The runtime may then use one AND, instead of one AND & one SHR, before
; call DOS lock/unlock function. (The value needed in AL is 0 for lock
; and 1 for unlock. Refer to the next paragraph.)
;
; The DOS function call for lock/unlock a file needs:
; [AH] = 5CH
; [AL] = 0 -- lock
; 1 -- unlock
; [BX] = file handle
; [CX] = offset high
; [DX] = offset low
; [SI] = length high
; [DI] = length low
;Entry:
; Parameters are pushed in stack
; int channel
; long int first_rec
; long int last_rec
; ushort mode
;Exit:
; none
;Uses:
; none
;Exceptions:
;
;*******************************************************************************
cProc B$LOCK,<PUBLIC,FAR>,<SI,DI> ;push di,si
ParmW Channel ;I2 file number
ParmD First ;I4 first record number
ParmD Last ;I4 last record number
ParmW Mode ;U2 mode
cBegin ;set up stack frame
cCall B$DOS3CHECK ;must be DOS 3.0 or above
JB ERCAFE ;Brif not, give "advanced feature"
MOV BX,Channel ;get file number
CALL B$LHFDBLOC ;NZ then SI has the pointer to FDB
JZ ERCIFN ; Brif not, give "bad file number"
FDB_PTR ES,SI,SI ;(ES:)[SI] = *FDB
MOV BX,FileDB.FD_HANDLE ; get file handle in BX
PUSH BX ;save file handle
TEST Mode,LOCK_1stToLast ; test the "entire file" bit
JZ LockEntire ; jump if we want to lock it all
TEST FileDB.FD_MODE,MD_RND+MD_BIN
; is opened for random or binary ?
JNZ LockOffset ; Brif yes, record number is meaningful
LockEntire:
XOR CX,CX ;starting record
MOV DX,CX ;(0-relative)
MOV SI,CX ;offset
DEC SI ;SI=0FFFFh
MOV DI,SI ;lock the whole file
JMP SHORT LockFile ;go lock it
ERCIFN: JMP B$ERR_IFN ; bad file number
LockOffset:
MOV CX,Off_First ; get first record number low
MOV DX,Seg_First ; get first record number high
OR DX,DX ; negative number?
JS ERCBRN ; Brif yes, give "bad record number"
SUB CX,1 ;decrement one, set carry if not big enough
SBB DX,0 ;if CY ([DX|CX] = 0), then give error
PUSH CX ;save 0-relative first rec# low
PUSH DX ;save 0-relative first rec# high
JB ERCBRN ;give "bad record number"
MOV AX,CX ;get a copy of rec# low
OR AX,DX ;is 0 ?
MOV AX,FileDB.FD_VRECL ; [AX] = multiplicant (also used below)
JZ LockLen ;Brif yes, no translate needed, to get length
PUSH AX ;save multiplicand
cCall B$MUL32 ;[DX|CX]=[DX|CX]*[AX], if CY then overflow
; generates Bad record number on overflow
POP AX
LockLen:
POP SI ;get first 0-relative first rec# high
POP DI ;get first 0-relative first rec# low
PUSH CX ;push low offset
PUSH DX ;push high offset
MOV CX,Off_Last ; get Second record number low
MOV DX,Seg_Last ; get Second record number high
MOV BX,CX
OR BX,DX ; Make sure non-zero
JZ ERCBRN
OR DX,DX ; negative number?
JS ERCBRN ; Brif yes, give "bad record number"
SUB CX,DI ;calculate how many records
SBB DX,SI ;[DX|CX]= second# - (first# - 1)
JB ERCBRN ; Brif second > first, give bad record num
; [AX] = multiplicant, set up above...
cCall B$MUL32 ;[DX|CX]=[DX|CX]*[AX], if CY then overflow
; generates Bad record number on overflow
MOV DI,CX ;DI=length low
MOV SI,DX ;SI=length high
POP CX ;CX=offset high
POP DX ;DX=offset low
LockFile:
POP BX ;get back file handle
MOV AX,Mode ;get mode
AND AL,1 ;lock or unlock
CALLOS LOCKING,ULKERR ;go lock it
cEnd ;pop si,di and exit to caller
ULKERR:
CMP AX,ERRIVH ;invalid handle ?
JZ ERCIFN ;bad file number
JMP B$ERR_FWP ;now "Permission Denied"
ERCBRN: JMP B$ERR_BRN ; bad record number
cEnd
sEnd DK_TEXT
END
| 23.869382 | 80 | 0.67308 |
df2184ba8f59cb147b34e115fd2313ae7f506a11 | 4,050 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_346.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_346.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_346.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x18623, %rsi
lea addresses_WT_ht+0x18923, %rdi
nop
nop
nop
cmp $19897, %r15
mov $88, %rcx
rep movsw
nop
nop
add $62897, %r13
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rax
push %rbp
push %rdx
// Faulty Load
lea addresses_RW+0xf523, %r10
nop
dec %rbp
movb (%r10), %al
lea oracles, %rdx
and $0xff, %rax
shlq $12, %rax
mov (%rdx,%rax,1), %rax
pop %rdx
pop %rbp
pop %rax
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': True, 'type': 'addresses_WT_ht'}}
{'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
*/
| 66.393443 | 2,999 | 0.664198 |
9e41d31996217c2ceecda1d523c37abfead7050e | 7,116 | asm | Assembly | asm/x86/aplib_x86_fast.asm | uniabis/apultra | 85e019447213805881fbcee97d2597971247ef46 | [
"Zlib",
"CC0-1.0"
] | 79 | 2019-11-04T07:04:13.000Z | 2022-03-24T17:48:15.000Z | asm/x86/aplib_x86_fast.asm | uniabis/apultra | 85e019447213805881fbcee97d2597971247ef46 | [
"Zlib",
"CC0-1.0"
] | 9 | 2019-12-22T20:51:50.000Z | 2021-09-14T17:28:05.000Z | asm/x86/aplib_x86_fast.asm | uniabis/apultra | 85e019447213805881fbcee97d2597971247ef46 | [
"Zlib",
"CC0-1.0"
] | 13 | 2019-12-08T23:41:33.000Z | 2021-06-08T05:12:26.000Z | ; aplib_x86_fast.asm - speed-optimized aPLib decompressor for x86 - 188 bytes
;
; Copyright (C) 2019 Emmanuel Marty
;
; This software is provided 'as-is', without any express or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not be
; misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source distribution.
segment .text
bits 32
; ---------------------------------------------------------------------------
; Decompress aPLib data
; inputs:
; * esi: compressed aPLib data
; * edi: output buffer
; output:
; * eax: decompressed size
; ---------------------------------------------------------------------------
%ifndef BIN
global apl_decompress
global _apl_decompress
%endif
; uint32_t apl_decompress(const void *Source, void *Destination);
%macro apl_get_bit 0 ; read bit into carry
add al,al ; shift bit queue, and high bit into carry
jnz %%gotbit ; queue not empty, bits remain
lodsb ; read 8 new bits
adc al,al ; shift bit queue, and high bit into carry
%%gotbit:
%endmacro
apl_decompress:
_apl_decompress:
pushad
%ifdef CDECL
mov esi, [esp+32+4] ; esi = aPLib compressed data
mov edi, [esp+32+8] ; edi = output
%endif
; === register map ===
; al: bit queue
; ah: unused, but value is trashed
; bx: follows_literal
; cx: scratch register for reading gamma2 codes and storing copy length
; dx: match offset (and rep-offset)
; si: input (compressed data) pointer
; di: output (decompressed data) pointer
; bp: temporary value, trashed
mov al,080H ; clear bit queue(al) and set high bit to move into carry
xor edx, edx ; invalidate rep offset
.literal:
movsb ; read and write literal byte
.next_command_after_literal:
mov ebx,03H ; set follows_literal(bx) to 3
.next_command:
apl_get_bit ; read 'literal or match' bit
jnc .literal ; if 0: literal
; 1x: match
apl_get_bit ; read '8+n bits or other type' bit
jc .other ; 11x: other type of match
; 10: 8+n bits match
call .get_gamma2 ; read gamma2-coded high offset bits
sub ecx,ebx ; high offset bits == 2 when follows_literal == 3 ?
; (a gamma2 value is always >= 2, so substracting follows_literal when it
; is == 2 will never result in zero)
jae .not_repmatch ; if not, not a rep-match
call .get_gamma2 ; read match length
jmp .got_len ; go copy
.not_repmatch:
mov edx,ecx ; transfer high offset bits to dh
shl edx, 8
mov dl,[esi] ; read low offset byte in dl
inc esi
call .get_gamma2 ; read match length
cmp edx,07D00H ; offset >= 32000 ?
jae .increase_len_by2 ; if so, increase match len by 2
cmp edx,0500H ; offset >= 1280 ?
jae .increase_len_by1 ; if so, increase match len by 1
cmp edx,0080H ; offset < 128 ?
jae .got_len ; if so, increase match len by 2, otherwise it would be a 7+1 copy
.increase_len_by2:
inc ecx ; increase length
.increase_len_by1:
inc ecx ; increase length
; copy cx bytes from match offset dx
.got_len:
push esi
mov esi,edi ; point to destination in es:di - offset in dx
sub esi,edx
rep movsb ; copy matched bytes
pop esi
mov bl,02H ; set follows_literal to 2 (bx is unmodified by match commands)
jmp .next_command
; read gamma2-coded value into cx
.get_gamma2:
xor ecx,ecx ; initialize to 1 so that value will start at 2
inc ecx ; when shifted left in the adc below
.gamma2_loop:
apl_get_bit ; read data bit
adc ecx,ecx ; shift into cx
apl_get_bit ; read continuation bit
jc .gamma2_loop ; loop until a zero continuation bit is read
ret
; handle 7 bits offset + 1 bit len or 4 bits offset / 1 byte copy
.other:
xor ecx,ecx
apl_get_bit ; read '7+1 match or short literal' bit
jc .short_literal ; 111: 4 bit offset for 1-byte copy
; 110: 7 bits offset + 1 bit length
movzx edx,byte[esi] ; read offset + length in dl
inc esi
inc ecx ; prepare cx for length below
shr dl,1 ; shift len bit into carry, and offset in place
je .done ; if zero offset: EOD
adc ecx,ecx ; len in cx: 1*2 + carry bit = 2 or 3
jmp .got_len
; 4 bits offset / 1 byte copy
.short_literal:
apl_get_bit ; read 4 offset bits
adc ecx,ecx
apl_get_bit
adc ecx,ecx
apl_get_bit
adc ecx,ecx
apl_get_bit
adc ecx,ecx
xchg eax,ecx ; preserve bit queue in cx, put offset in ax
jz .write_zero ; if offset is 0, write a zero byte
; short offset 1-15
mov ebx,edi ; point to destination in es:di - offset in ax
sub ebx,eax ; we trash bx, it will be reset to 3 when we loop
mov al,[ebx] ; read byte from short offset
.write_zero:
stosb ; copy matched byte
mov eax,ecx ; restore bit queue in al
jmp .next_command_after_literal
.done:
sub edi, [esp+32+8] ; compute decompressed size
mov [esp+28], edi
popad
ret
| 39.314917 | 106 | 0.517707 |
a9e89d7814c97aa9b1c747edc2de7d248ed917c4 | 1,380 | asm | Assembly | Test/Z80/print.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 43 | 2019-12-06T23:46:40.000Z | 2022-03-31T15:34:44.000Z | Test/Z80/print.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 21 | 2019-12-27T01:49:08.000Z | 2022-03-31T15:38:42.000Z | Test/Z80/print.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 13 | 2019-12-27T00:38:46.000Z | 2022-03-15T08:34:51.000Z | #target bin
#code ram,65268, $10000 - 65268
start:
ld a, 65
ld de, 0
call print_char
ret
;******************************************************************
; PRINT STRING
;******************************************************************
;print_str:
; ld hl, (cursor) ;loads hl with start of string
; ld bc, string
; add hl, bc
;str_l:
; ld a, (hl)
; cp 0 ;null termination check
; jp z, break_l
; ld de, (cursor) ;position = ascii (for now!)
; call print_char ;prints character
; ld hl, (cursor) ;increase cursor
; inc hl
; ld (cursor), hl
; ld bc, string ;add cursor to start of string
; add hl, bc
; jp str_l ;loops
;break_l:
; ret
;
;******************************************************************
; PRINT CHARACTER IN A (ASCII) AT DE
;******************************************************************
print_char:
ld b, 0 ;load bc with a for *8
ld c, a
sla c
rl b
sla c
rl b
sla c
rl b
;ld hl, 16384 ;sets position in screen file
;add hl, de
;ld d, h
;ld e, l
;ld hl, (23606)
;add hl, bc ;address of char in charmap
ld hl, (23606)
inc h
inc l
ld de, 16384
ld b, 8
ld c, 0
char_l:
ld a, (hl)
ld (de), a
inc hl
inc d
djnz char_l
ret
string: defm 'hello world'+0
cursor: defb 0, 0
#end | 17.922078 | 68 | 0.442754 |
cabe842c5b52478bf9191f0877c9b0279bc25782 | 5,911 | asm | Assembly | src/isr.asm | ignaciolebrero/Orga2TP3 | 746aa2db4a248301e88dca3d73cd72137cfe27c8 | [
"MIT"
] | null | null | null | src/isr.asm | ignaciolebrero/Orga2TP3 | 746aa2db4a248301e88dca3d73cd72137cfe27c8 | [
"MIT"
] | null | null | null | src/isr.asm | ignaciolebrero/Orga2TP3 | 746aa2db4a248301e88dca3d73cd72137cfe27c8 | [
"MIT"
] | null | null | null | ; ** por compatibilidad se omiten tildes **
; ==============================================================================
; TRABAJO PRACTICO 3 - System Programming - ORGANIZACION DE COMPUTADOR II - FCEN
; ==============================================================================
; definicion de rutinas de atencion de interrupciones
%include "imprimir.mac"
extern inicializar_dir_pirata
extern game_reprintar_pantalla
extern game_syscall_manejar
extern game_debuggear_tarea
extern game_atender_teclado
extern game_pirata_exploto
extern mmu_mapear_pagina
extern habilitar_pic
extern resetear_pic
extern game_tick
extern print
BITS 32
;; Excepciones
global _isr0
global _isr1
global _isr2
global _isr3
global _isr4
global _isr5
global _isr6
global _isr7
global _isr8
global _isr10
global _isr11
global _isr12
global _isr13
global _isr14
global _isr16
global _isr17
global _isr18
global _isr19
global _isr20
global _isr32
global _isr33
global _isr70
;; scheduler
sched_tarea_offset: dd 0x00
sched_tarea_selector: dw 0x00
;; PIC
extern fin_intr_pic1
;; Sched
extern sched_tick
extern sched_tarea_actual
;; Screen
extern print
;; Msjs de excepciones
cero_mr_msg dw 'diviste por 0 ',0
;cero_mr_len equ $ - cero_mr_msg
uno_mr_msg dw 'Debug Exception ',0
dos_mr_msg dw 'NMI Interrupt ',0
tres_mr_msg dw 'Breakpoint',0
cuatro_mr_msg dw 'Overflow ',0
cinco_mr_msg dw 'BOUND Range Exceeded ',0
seis_mr_msg dw 'Invalid Opcode ',0
siete_mr_msg dw 'Device not Available ',0
ocho_mr_msg dw 'Double fault ',0
diez_mr_msg dw 'Invalid TSS ',0
once_mr_msg dw 'Segment Not Present ',0
doce_mr_msg dw 'Stack-Segment Fault ',0
trece_mr_msg dw 'General Protection ',0
catorce_mr_msg dw 'Page Fault ',0
diezseis_mr_msg dw 'x87 FPU floating-Point Error ',0
diezsiete_mr_msg dw 'Alignment Check',0
diezocho_mr_msg dw 'Machine Check ',0
dieznueve_mr_msg dw 'SIMD floating-Point Exception ',0
veinte_mr_msg dw 'Virtualization Exception ',0
;; Debug
debug_habilitado db 0x0
pantalla_debug_activa db 0x0
;;
;; Definición de MACROS
;; -------------------------------------------------------------------------- ;;
%macro ISR 1
global _isr%1
_isr%1:
mov eax, %1
jmp $
%endmacro
;;
;; Datos
;; -------------------------------------------------------------------------- ;;
; Scheduler
;;
;; Rutina de atención de las EXCEPCIONES
;; -------------------------------------------------------------------------- ;;
;TODO: preguntar si es mas comodo pasarlo a un archivo en C hacer call a las funciones de ahi apra las interrupciones (suena mas facil de programar)
;TODO:revisar si compila, funciona, eclosiona(?)
_isr0:
pushad
jmp matar_pirata
popad
iret
_isr1:
pushad
jmp matar_pirata
popad
iret
_isr2:
pushad
jmp matar_pirata
popad
iret
_isr3:
pushad
jmp matar_pirata
popad
iret
_isr4:
pushad
jmp matar_pirata
popad
iret
_isr5:
pushad
jmp matar_pirata
popad
iret
_isr6:
pushad
jmp matar_pirata
popad
iret
_isr7:
pushad
jmp matar_pirata
popad
iret
_isr8:
pushad
jmp matar_pirata
popad
iret
_isr10:
pushad
jmp matar_pirata
popad
iret
_isr11:
pushad
jmp matar_pirata
popad
iret
_isr12:
pushad
jmp matar_pirata
popad
iret
_isr13:
pushad
jmp matar_pirata
popad
iret
_isr14:
pushad
jmp matar_pirata
popad
iret
_isr16:
pushad
jmp matar_pirata
popad
iret
_isr17:
pushad
jmp matar_pirata
popad
iret
_isr18:
pushad
jmp matar_pirata
popad
iret
_isr19:
pushad
jmp matar_pirata
popad
iret
_isr20:
pushad
jmp matar_pirata
popad
iret
;;
;; Rutina de atención del RELOJ
;; -------------------------------------------------------------------------- ;;
_isr32:
pushad
call fin_intr_pic1
mov ax, [pantalla_debug_activa]
cmp ax, 0x1
je .fin
call sched_tick
xor ecx, ecx
str cx
cmp ax, cx
je .fin
mov [sched_tarea_selector], ax
jmp far [sched_tarea_offset]
.fin:
popad
iret
;;
;; Rutina de atención del TECLADO
;; -------------------------------------------------------------------------- ;;
;Está parcialmente la implementacion de la activacion del debugger
_isr33:
pushad
call fin_intr_pic1
in al, 0x60
cmp byte al, 0x15 ; codigo de la Y
je .rutina_debuger
cmp byte [pantalla_debug_activa], 0x1
je pop
cmp byte al, 0x2A
je .rutinals
cmp byte al, 0x36
je .rutinars
jmp pop
_isr33.rutinals:
xor eax, eax
push eax;jugadorA
call game_atender_teclado
add esp, 4
jmp pop
_isr33.rutinars:
xor eax, eax
mov eax, 1
push eax;jugadorB
call game_atender_teclado
add esp, 4
jmp pop
_isr33.rutina_debuger:
mov ax, [debug_habilitado]
cmp ax, 0x1
je _isr33.deshabilitar_debugger
mov ax, 0x1
mov [debug_habilitado], ax
jmp pop
_isr33.deshabilitar_debugger:
mov ax,[pantalla_debug_activa]
cmp ax, 0x1
je _isr33.desactivar_pantalla_debug
jne _isr33.apagar_debugger
_isr33.desactivar_pantalla_debug:
call game_reprintar_pantalla
mov ax, 0x0
mov [pantalla_debug_activa], ax
mov [debug_habilitado], ax
jmp pop
_isr33.apagar_debugger:
mov ax, 0x0
mov [debug_habilitado], ax
jmp pop
pop:
popad
iret
;;
;; Rutinas de atención de las SYSCALLS
;; -------------------------------------------------------------------------- ;;
_isr70:
pushad
push ecx
push eax
call game_syscall_manejar
add esp, 8
mov [esp+28], eax
mov ax, 0x70
mov [sched_tarea_selector], ax ;idle
jmp far [sched_tarea_offset]
popad
iret
;;
;; rutina de muerte de pirata
;; -------------------------------------------------------------------------- ;;
matar_pirata:
mov ax, [debug_habilitado]
cmp ax, 0x0
je .matar
mov ax, 0x1
mov [pantalla_debug_activa], ax
popad
pushad
call game_debuggear_tarea
jmp .matar
.matar:
call game_pirata_exploto
jmp .fin
.fin:
str cx
cmp cx, 0x70
je .finb
mov ax, 0x70
mov [sched_tarea_selector], ax ;idle
jmp far [sched_tarea_offset]
.finb:
popad
iret
| 16.283747 | 148 | 0.657926 |
77448795a0fcdddfe9582feb8ca79e02e62b56ca | 382 | asm | Assembly | programs/oeis/001/A001091.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001091.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001091.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A001091: a(n) = 8*a(n-1) - a(n-2); a(0) = 1, a(1) = 4.
; 1,4,31,244,1921,15124,119071,937444,7380481,58106404,457470751,3601659604,28355806081,223244789044,1757602506271,13837575261124,108942999582721,857706421400644,6752708371622431,53163960551578804
mov $1,1
lpb $0,1
sub $0,1
sub $1,1
add $1,$2
add $1,$2
mov $3,$2
add $3,4
add $1,$3
add $2,$1
add $2,$1
lpe
| 23.875 | 196 | 0.667539 |
0ebce5357e6f80eb777175a76658b55c57344de1 | 796 | asm | Assembly | oeis/173/A173985.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/173/A173985.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/173/A173985.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A173985: a(n) = numerator of (Zeta(0,2,2/3) - Zeta(0,2,n+2/3)), where Zeta is the Hurwitz Zeta function.
; Submitted by Jamie Morken(w4)
; 0,9,261,4401,546921,27234729,7956214281,8017899597,4266143013213,724241322449397,611292843754229277,9809672294036025657,9833902887524676921,3557459561652307818081,5990804897343048247416561,6000108897363439317446961,13272253098315314563819191249,332204224555714913490256674921,934156409521583315481073234093089,935047427496559580428401274903089,3257694327485049466346085573917812809,3133075929432712161731400982021752349449,3135288327228230286431493808921398839049
mul $0,2
add $0,1
mov $1,1
lpb $0
mov $2,$0
sub $0,2
div $2,2
add $2,$0
pow $2,2
mul $3,$2
add $3,$1
mul $1,$2
lpe
mov $0,$3
gcd $3,$1
mov $1,$0
div $1,$3
mov $0,$1
mul $0,9
| 33.166667 | 465 | 0.787688 |
72a75995748f49fc6bee315080aff22667e46f6c | 533 | asm | Assembly | programs/oeis/165/A165827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/165/A165827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/165/A165827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A165827: Totally multiplicative sequence with a(p) = 6.
; 1,6,6,36,6,36,6,216,36,36,6,216,6,36,36,1296,6,216,6,216,36,36,6,1296,36,36,216,216,6,216,6,7776,36,36,36,1296,6,36,36,1296,6,216,6,216,216,36,6,7776,36,216,36,216,6,1296,36,1296,36,36,6,1296,6,36,216,46656,36,216,6,216,36,216,6,7776,6,36,216,216,36,216,6,7776,1296,36,6,1296,36,36,36,1296,6,1296,36,216,36,36,36,46656,6,216,216,1296
seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)).
mov $1,6
pow $1,$0
mov $0,$1
| 66.625 | 335 | 0.701689 |
bb0babb251de0ea572dd4cfa15dca1c6f009833d | 721 | asm | Assembly | oeis/014/A014166.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/014/A014166.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/014/A014166.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A014166: Apply partial sum operator 4 times to Fibonacci numbers.
; Submitted by Christian Krause
; 0,1,5,16,41,92,189,365,674,1204,2098,3588,6050,10093,16703,27476,44995,73440,119575,194345,315460,511576,829060,1342936,2174596,3520457,5698329,9222440,14924829,24151764,39081553,63238773,102326310,165571628,267905078,433484476,701397990,1134891605,1836299475,2971201740,4807512695,7778726776,12586252715,20364993681,32951261576,53316271472,86267550344,139583840240,225851410184,365435271249,591286703533,956721998208,1548008726545,2504730750988,4052739505253,6557470285501,10610209821610
lpb $0
mov $2,$0
sub $0,1
seq $2,14162 ; Apply partial sum operator thrice to Fibonacci numbers.
add $1,$2
lpe
mov $0,$1
| 60.083333 | 490 | 0.825243 |
87dee8fa3a6c4eeec82c9733fe8fdf9a78a93db4 | 1,892 | asm | Assembly | programs/oeis/010/A010023.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/010/A010023.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010023.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010023: a(0) = 1, a(n) = 42*n^2 + 2 for n>0.
; 1,44,170,380,674,1052,1514,2060,2690,3404,4202,5084,6050,7100,8234,9452,10754,12140,13610,15164,16802,18524,20330,22220,24194,26252,28394,30620,32930,35324,37802,40364,43010,45740,48554,51452,54434,57500,60650,63884,67202,70604,74090,77660,81314,85052,88874,92780,96770,100844,105002,109244,113570,117980,122474,127052,131714,136460,141290,146204,151202,156284,161450,166700,172034,177452,182954,188540,194210,199964,205802,211724,217730,223820,229994,236252,242594,249020,255530,262124,268802,275564,282410,289340,296354,303452,310634,317900,325250,332684,340202,347804,355490,363260,371114,379052,387074,395180,403370,411644,420002,428444,436970,445580,454274,463052,471914,480860,489890,499004,508202,517484,526850,536300,545834,555452,565154,574940,584810,594764,604802,614924,625130,635420,645794,656252,666794,677420,688130,698924,709802,720764,731810,742940,754154,765452,776834,788300,799850,811484,823202,835004,846890,858860,870914,883052,895274,907580,919970,932444,945002,957644,970370,983180,996074,1009052,1022114,1035260,1048490,1061804,1075202,1088684,1102250,1115900,1129634,1143452,1157354,1171340,1185410,1199564,1213802,1228124,1242530,1257020,1271594,1286252,1300994,1315820,1330730,1345724,1360802,1375964,1391210,1406540,1421954,1437452,1453034,1468700,1484450,1500284,1516202,1532204,1548290,1564460,1580714,1597052,1613474,1629980,1646570,1663244,1680002,1696844,1713770,1730780,1747874,1765052,1782314,1799660,1817090,1834604,1852202,1869884,1887650,1905500,1923434,1941452,1959554,1977740,1996010,2014364,2032802,2051324,2069930,2088620,2107394,2126252,2145194,2164220,2183330,2202524,2221802,2241164,2260610,2280140,2299754,2319452,2339234,2359100,2379050,2399084,2419202,2439404,2459690,2480060,2500514,2521052,2541674,2562380,2583170,2604044
pow $1,$0
gcd $1,2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,42
add $1,$2
| 172 | 1,773 | 0.835095 |
cf722c3f1df5f16464b54925e8d13ac1b04923ad | 1,820 | nasm | Assembly | slae32/assignment/6/part/2/polymorphic_shellcode.nasm | rbctee/SlaeExam | f21ae27ac2a0edbd49869d08469b4b9105b20b6a | [
"MIT"
] | null | null | null | slae32/assignment/6/part/2/polymorphic_shellcode.nasm | rbctee/SlaeExam | f21ae27ac2a0edbd49869d08469b4b9105b20b6a | [
"MIT"
] | null | null | null | slae32/assignment/6/part/2/polymorphic_shellcode.nasm | rbctee/SlaeExam | f21ae27ac2a0edbd49869d08469b4b9105b20b6a | [
"MIT"
] | null | null | null | ; Author: Robert C. Raducioiu (rbct)
; Reference: http://shell-storm.org/shellcode/files/shellcode-561.php
; Shellcode: "\xeb\x48\x5f\x89\xfe\x31\xc9\xf7\xe1\xb1\x0b\x81\x37\x71\x63\x63\x75\x83\xc7\x04\xe2\xf5\x89\xf7\x89\xfb\x83\xc3\x0c\x53\x5e\x57\x5b\xb0\x06\x48\xb2\x69\xc1\xc2\x02\x66\xb9\x43\x04\x49\xcd\x80\x93\x31\xc0\x50\x5a\x6a\x20\x5a\x4a\x6a\x03\x58\x40\x56\x59\xcd\x80\x31\xc0\xb0\x06\xcd\x80\x40\xcd\x80\xe8\xb3\xff\xff\xff\x5e\x06\x17\x16\x5e\x13\x02\x06\x02\x14\x07\x75\x05\x0c\x0c\x07\x4b\x59\x53\x4f\x41\x59\x17\x45\x41\x11\x59\x5a\x03\x0c\x0c\x01\x4b\x4c\x01\x1c\x1f\x4c\x01\x14\x02\x0b\x69\x75"
; Length: 123 bytes
global _start
section .text
_start:
jmp short CallRunShellcode
RunShellcode:
pop edi
mov esi, edi
xor ecx, ecx
mul ecx
mov cl, 11
DecodeStringBytes:
xor DWORD [edi], 0x75636371
add edi, 0x4
loop DecodeStringBytes
OpenFile:
mov edi, esi
mov ebx, edi
add ebx, 0xc
push ebx
pop esi
push edi
pop ebx
mov al,0x6
dec eax
mov dl, 0x69
rol edx, 2
mov cx,0x443
dec ecx
; call syscall 0x5: open()
int 0x80
AddMaliciousUser:
xchg ebx,eax
xor eax, eax
push eax
pop edx
push 0x20
pop edx
dec edx
push 0x3
pop eax
inc eax
push esi
pop ecx
; call syscall write()
int 0x80
CloseFileHandle:
xor eax, eax
; call syscall close()
mov al,0x6
int 0x80
Exit:
; call syscall exit()
inc eax
int 0x80
CallRunShellcode:
call RunShellcode
EncodedStringBytes: db 0x5e,0x06,0x17,0x16,0x5e,0x13,0x02,0x06,0x02,0x14,0x07,0x75,0x05,0x0c,0x0c,0x07,0x4b,0x59,0x53,0x4f,0x41,0x59,0x17,0x45,0x41,0x11,0x59,0x5a,0x03,0x0c,0x0c,0x01,0x4b,0x4c,0x01,0x1c,0x1f,0x4c,0x01,0x14,0x02,0x0b,0x69,0x75
| 18.958333 | 507 | 0.666484 |
a866003f47c58123fc607be11c5cd722aa56d1f4 | 95 | asm | Assembly | data/maps/headers/SafariZoneCenterRestHouse.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/SafariZoneCenterRestHouse.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/SafariZoneCenterRestHouse.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header SafariZoneCenterRestHouse, SAFARI_ZONE_CENTER_REST_HOUSE, GATE, 0
end_map_header
| 23.75 | 77 | 0.873684 |
34b6742d678ddc08fa9d24c169820b1fc2800aaf | 22,676 | asm | Assembly | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/init.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2019-11-04T07:11:25.000Z | 2019-11-04T07:11:25.000Z | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/init.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 13 | 2018-10-12T21:29:09.000Z | 2018-10-25T20:06:51.000Z | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/init.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | ;
; Copyright (c) 2006-2008 Advanced Micro Devices,Inc. ("AMD").
;
; This library is free software; you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation; either version 2.1 of the
; License, or (at your option) any later version.
;
; This code is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General
; Public License along with this library; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place, Suite 330,
; Boston, MA 02111-1307 USA
;
;*******************************************************************************
;* This file contains the installation code for VSA II.
;*
;* BIOS Usage:
;* CALL far ptr [VSA_Entry]
;* where VSA_Entry: dw 0020h, <segment>
;*
;*******************************************************************************
include vsa2.inc
include sysmgr.inc
include init.inc
include smimac.mac
include chipset.inc
;include vpci.inc
DESCRIPTOR struc
DescrType BYTE ? ; Type of MSR
Flag BYTE ? ; See definitions below
Link BYTE ? ; Link to next MSR
Split BYTE ? ; Index of descriptor that was split
Owner WORD ? ; PCI Address this descriptor belongs to
Mbiu BYTE ? ; MBUI on which this descriptor is located
Port BYTE ? ; Port this descriptor routes to
MsrAddr DWORD ? ; Routing address of MSR (descriptor/LBAR/RCONF)
MsrData0 DWORD ? ; MSR data low
MsrData1 DWORD ? ; MSR data high
Physical DWORD ? ; Physical memory assigned (00000000 if none)
Range DWORD ? ; Actual I/O range for IOD_SC
Address WORD ? ; Address of I/O Trap or Timeout
DESCRIPTOR ENDS
.model small,c
.586
.CODE
VERIFY_VSM_COPY equ 1 ; 0=skip verify
SW_SMI equ 0D0h
; VSA loader debug codes:
VSA_ENTERED equ 10h ; VSA installation has been entered
VSA_INIT1 equ 11h ; Returned from Setup
VSA_SYSMGR equ 12h ; Image of SysMgr was found
VSA_VSM_FOUND equ 13h ; A VSM has been found (followed by VSM type)
VSA_COPY_START equ 14h ; Start of module copy
VSA_COPY_END equ 15h ; End of module copy
VSA_VRFY_START equ 1Ch ; Start of verifying module copy
VSA_VRFY_END equ 1Dh ; End of verifying module copy
VSA_FILL_START equ 1Eh ; Start of filling BSS
VSA_FILL_END equ 1Fh ; End of filling BSS
VSA_INIT2 equ 16h ; Returned from copying VSA image
VSA_INIT3 equ 17h ; Performing VSA initialization SMI
VSA_INIT4 equ 18h ; Returned from s/w SMI
VSA_INIT5 equ 19h ; Returned from initializing statistics
VSA_INIT6 equ 1Ah ; Returning to BIOS
VSA_ERROR equ 0EEh ; Installation error. EBX contains error mask
; NOTES:
; 1) A VSM's CS segment must be writeable since the message queue is
; stored there and the VSM must be able to update the pointers.
; 2) The nested flag must be set so when the System Manager RSMs
; to a VSM, the processor remains in SMM.
VSM_FLAGS equ SMI_FLAGS_CS_WRITABLE + SMI_FLAGS_NESTED + SMI_FLAGS_CS_READABLE
POST macro Code
mov al, Code
out 80h, al
endm
public Device_ID
public Chipset_Base
public Errors
public BIOS_ECX
public BIOS_EDX
externdef Software_SMI: proc
externdef Get_Sbridge_Info: proc
externdef Get_IRQ_Base: proc
externdef Get_SMI_Base: proc
externdef Get_CPU_Info: proc
externdef Clear_SMIs: proc
externdef Get_SMM_Region: proc
externdef Init_SMM_Region: proc
externdef Enable_SMIs: proc
externdef Enable_SMM_Instr: proc
externdef Disable_A20: proc
externdef Get_Memory_Size: proc
externdef Set_CPU_Fields: proc
externdef VSA_Image: byte
ORG 0000h
;***********************************************************************
; Entry Point for DOS installer
;***********************************************************************
VSA_Installation:
mov dx, offset Msg_Not_DOS_BUILD
push cs ; DS <= CS
pop ds
mov ah, 9 ; Call DOS PrintString
int 21h
ReturnToDOS:
sti
mov ah, 4Ch ; Return to DOS
int 21h
org 001Eh ; Used by INFO to skip over init code
dw offset VSA_Image
;***********************************************************************
; Entry point for BIOS installer
;***********************************************************************
org 0020h
VSA_Install proc far
POST VSA_ENTERED
pushf
push cs ; DS <- CS
pop ds
ASSUME DS:_TEXT
mov [BIOS_ECX], ecx ; MSR address of SMM memory descriptor (P2D_BMO)
mov [BIOS_EDX], edx ; MSR address of system memory descriptor (P2D_R)
;
; Make sure VSM's SmiHeader is DWORD aligned
;
mov si, VSM_Header.SysStuff.State
test si, 3
jz AlignmentOK
mov bx, [Errors]
or bx, ERR_INTERNAL
jmp DisplayErrors
AlignmentOK:
; Set up for SMM
call Setup
jc DisplayErrors
; Load System Manager and VSMs into memory
POST VSA_INIT1
call ProcessModules
POST VSA_INIT2
push cs
pop ds
mov bx, [Errors] ; Any errors detected ?
test bx, bx
jz Init_VSA
DisplayErrors:
POST VSA_ERROR
jmp Exit
Init_VSA:
cli
; Set SMM MSRs
mov ebx, [SysMgrEntry]
call Init_SMM_Region
; Generate s/w SMI to initialize VSA
POST VSA_INIT3 ; POST 17h
call Enable_SMIs ; Enable SMIs
movzx eax, [SysCall_Code]
mov ebx, [InitParam1]
mov ecx, [InitParam2]
call Software_SMI
POST VSA_INIT4 ; POST 18h
call InitStatistics ; Initialize VSA statistics
POST VSA_INIT5 ; POST 19h
Exit:
POST VSA_INIT6 ; POST 1Ah
popf
ret
VSA_Install endp
ASSUME DS:NOTHING
;***********************************************************************
;***********************************************************************
;***********************************************************************
;***********************************************************************
;***********************************************************************
;
; Some of the time in SMM cannot be recorded by VSA.
; This unaccounted time consists of:
; 1) the cycles used to write the SMM header.
; 2) the cycles for the SMM entry code before RDTSC is executed.
; 3) the cycles between the exit RDTSC through the RSM instruction.
;
; The following code calculates how many clocks this time consists
; of and stores it in a VSA structure. It is used as an adjustment
; to the statistics calculations.
;
;***********************************************************************
InitStatistics proc
in al, 92h ; Save A20 mask
push ax
mov si, 0 ; Don't toggle A20 (no SMI)
call DeltaSMI
mov edi, eax ; EDI = overhead of DeltaSMI()
mov ebx, [SysMgrEntry] ; Get ptr to SysMgr's header
add ebx, VSM_Header.SysStuff
mov es:(System PTR [ebx]).Clocks, 0
mov si, 2 ; Generate an SMI by toggling A20
call DeltaSMI
mov ecx, es:(System PTR [ebx]).Clocks
sub eax, ecx ; Subtract clocks VSA determined
sub eax, edi ; Subtract DeltaSMI() overhead
mov es:(System PTR [ebx]).Adjustment, eax
pop ax ; Restore A20 mask
out 92h, al
; Initialize statistics structure
RDTSC ; Record VSA start time
mov es:(System PTR [ebx+0]).StartClocks, eax
mov es:(System PTR [ebx+4]).StartClocks, edx
xor eax, eax
mov es:(System PTR [ebx+0]).Clocks, eax
mov es:(System PTR [ebx+4]).Clocks, eax
mov es:(System PTR [ebx+0]).NumSMIs, eax
mov es:(System PTR [ebx+4]).NumSMIs, eax
ret
InitStatistics endp
;***********************************************************************
; Helper routine for InitStatistics()
; Input: SI = XOR mask for port 92h
;***********************************************************************
DeltaSMI proc
RDTSC ; Record VSA start time
mov ecx, eax
in al, 92h ; Generate an SMI by toggling A20 mask
xor ax, si
out 92h, al
RDTSC ; Compute actual delta clocks
sub eax, ecx
jnc Exit
neg eax ; TSC rolled over
Exit: ret
DeltaSMI endp
;***********************************************************************
; Setup for VSA installation:
; - Gets information about the system: CPU, Southbridge, memory, PCI
; - Sets ES to be 4 GB descriptor
; - Clears pending SMIs
;***********************************************************************
Setup proc near
ASSUME DS:_TEXT
cli
call Get_CPU_Info ; Get information about the CPU
mov [Cpu_Revision], ax
mov [Cpu_ID], si
mov [PCI_MHz], bx
mov [CPU_MHz], cx
mov [DRAM_MHz], dx
call Get_Sbridge_Info ; Get information about the Southbridge
jc short SetupExit
mov [Chipset_Base], ebx
mov [Device_ID], dx
mov [Chipset_Rev], cl
call Get_SMM_Region ; Get SMM entry point
mov [ModuleBase], eax
mov [SysMgr_Location], eax
mov [VSA_Size], bx
movzx ebx, bx ; Get end of VSA memory
shl ebx, 10
add eax, ebx
mov [VSA_End], eax
call Enable_SMM_Instr ; Enable SMM instructions
rsdc es, [Flat_Descriptor] ; Setup ES as a 4 GB flat descriptor
call Disable_A20 ; Turn off A20 masking
call Get_Memory_Size ; Get physical memory size
mov [TotalMemory], eax
call Clear_SMIs ; Clear all pending SMIs
SetupExit:
mov [SetupComplete], 0FFh
clc
ret
ASSUME DS: NOTHING
Setup endp
;*****************************************************************************
;
; Loads the VSA II image into memory
; NOTE: The System Manager must be the first module of the VSA image.
;
;*****************************************************************************
ProcessModules proc
; Point DS:ESI to loaded VSA image
lea bx, [VSA_Image] ; Point DS to start of file image
movzx esi, bx
and si, 000Fh
shr bx, 4
mov ax, cs
add ax, bx
mov ds, ax
; Point EDI to where System Manager will be loaded
mov edi, cs:[ModuleBase] ; Get last ptr value
call AlignVSM
mov cs:[SysMgrEntry], edi ; Record entry point of System Manager
; Ensure the System Manager is the first module unless loading from DOS
mov ax, ERR_NO_SYS_MGR
cmp (VSM_Header PTR [si]).Signature, VSM_SIGNATURE
jne ErrExit
cmp (VSM_Header PTR [si]).VSM_Type, VSM_SYS_MGR
je LoadSysMgr
LoadSysMgr:
POST VSA_SYSMGR
call PatchSysMgr ; Apply patches to the System Manager
; EDI = flat ptr of System Manager base
; DS:SI = near ptr to System Manager image
call CopyModule ; Install System Manager
jc ErrExit
; Sequence through each VSM and install it.
VSM_Loop:
mov eax, VSM_SIGNATURE ; Check for a VSM signature
cmp eax, (VSM_Header PTR [si]).Signature
jne short Return
call Load_VSM ; Load the VSM
jnc VSM_Loop
ErrExit:or cs:[Errors], ax
Return: ret
ProcessModules endp
;*****************************************************************************
; Copies INT vector table to VSA. If installing VSA from DOS, copies the
; INT_Vector[] from current System Manager to the VSA image being installed.
;*****************************************************************************
SnagInterruptVectors proc
Exit: ret
SnagInterruptVectors endp
;*******************************************************************
;
; Aligns a VSM ptr according to requirements flag
; Input:
; EDI = ptr to be aligned
; Output:
; EDI = aligned ptr
;
;*******************************************************************
AlignVSM proc uses eax
mov cx, cs:[Requirments] ; Compute alignment
and cl, MASK Alignment@@tag_i0 ; Compute mask from 2^(n+4)
add cl, 4
xor eax, eax
mov al, 1
shl eax, cl
dec eax
add edi, eax ; Align the next VSM load address
not eax ; to requested boundary
and edi, eax
ret
AlignVSM endp
;*******************************************************************
; Patches various fields within System Manager
; INPUT:
; SI = ptr to System Manager
; EDI = ptr to where System Manager will reside
;*******************************************************************
PatchSysMgr proc
pushad
;
; Patch "jmp <EntryPoint>" over System Manager's VSM signature
;
mov ax, (VSM_Header PTR [si]).EntryPoint
sub ax, 3
shl eax, 8
mov al, 0E9h ; JMP opcode
mov (VSM_Header PTR [si]).Signature, eax
;
; Patch SysMgr's Hardware structure
;
lea bx, [si+SPECIAL_LOC]
mov bx, (InfoStuff PTR [bx]).HardwareInfo
ASSUME BX: PTR Hardware
mov ax, cs:[Device_ID]
mov [bx].Chipset_ID, ax
mov ax, cs:[PCI_MHz]
mov [bx].PCI_MHz, ax
movzx ax, cs:[Chipset_Rev]
mov [bx].Chipset_Rev, ax
mov eax, cs:[Chipset_Base]
mov [bx].Chipset_Base, eax
mov ax, cs:[Cpu_ID]
mov [bx].CPU_ID, ax
mov ax, cs:[Cpu_Revision]
mov [bx].CPU_Revision, ax
mov ax, cs:[CPU_MHz]
mov [bx].CPU_MHz, ax
mov ax, cs:[DRAM_MHz]
mov [bx].DRAM_MHz, ax
mov eax, cs:[TotalMemory]
mov [bx].SystemMemory, eax
mov eax, cs:[SysMgr_Location]
mov [bx].VSA_Location, eax
mov [si].SysStuff.SysMgr_Ptr, eax
mov ax, cs:[VSA_Size]
mov [bx].VSA_Size, ax
ASSUME BX:NOTHING
;
; Patch SysMgr's descriptors
;
mov eax, (VSM_Header PTR [si]).DS_Limit
mov [SysMgrSize], ax
lea bx, (VSM_Header PTR [si])._DS
call Init_Descr
mov eax, SYSMGRS_STACK + VSM_STACK_FRAME
lea bx, (VSM_Header PTR [si])._SS
call Init_Descr
;
; Initialize the SysMgr's message queue
;
call Init_Msg_Q
;
; Patch variables in SysMgr
;
mov eax, cs:[Chipset_Base]
mov [si].SysStuff.Southbridge, eax
mov bx, si
add si, SPECIAL_LOC
ASSUME SI: PTR InfoStuff
movzx eax, [si].SysMgr_Stack
mov (VSM_Header PTR [bx]).SysStuff.SavedESP, eax
mov [si].SysMgr_VSM, edi
lea eax, (VSM_Header PTR [edi]).SysStuff.State + sizeof(SmiHeader)
add bx, [si].Header_Addr
mov [bx], eax
call Get_SMI_Base
mov [si].SMI_Base, eax
call Get_IRQ_Base
mov [si].IRQ_Base, eax
Exit:
call SnagInterruptVectors ; Snapshot INT vectors from current VSA
popad
ret
PatchSysMgr endp
;*******************************************************************
;
; Loads a VSM into memory
; Input:
; DS:SI = ptr to VSM to load
;
;*******************************************************************
Load_VSM proc
POST VSA_VSM_FOUND
; Initialize the VSM's Header
ASSUME si:PTR VSM_Header
mov ax, [si].Flag
mov cs:[Requirments], ax
test ax, MASK SkipMe@@tag_i0
jz LoadIt
Skip_VSM:
add esi, [si].VSM_Length ; Point to end of this VSM
call Flat_ESI
jmp Next_VSM
LoadIt:
; Initialize CPU dependent fields in the VSM's SMM header
call Set_CPU_Fields
; Initialize EIP to VSM's entry point
movzx ecx, [si].EntryPoint
mov [si].SysStuff.State.Next_EIP, ecx
or [si].SysStuff.State.SMI_Flags, VSM_FLAGS
; Store ptrs to certain System Manager structures for fast access
mov eax, cs:[SysMgrEntry]
add eax, SPECIAL_LOC
mov [si].SysStuff.SysMgr_Ptr, eax
mov eax, cs:[Chipset_Base]
mov al, SW_SMI
mov [si].SysStuff.Southbridge, eax
; Initialize the VSM's resume header
; Get size of DS segment
mov eax, [si].DS_Limit ; _DS.limit_15_0
inc eax ; Round to WORD boundary
and al, NOT 1
mov ecx, eax
; Initialize the CS descriptor fields
; NOTE: CS descriptor fields in SMM header are in "linear" format.
mov [si].SysStuff.State._CS.limit, ecx
mov [si].SysStuff.State._CS.attr, CODE_ATTR
mov [si].SysStuff.State.EFLAGS, VSM_EFLAGS
mov ecx, CR0 ; Preserve the CD & NW bit
and ecx, 60000000h
or ecx, VSM_CR0
mov [si].SysStuff.State.r_CR0, ecx
mov [si].SysStuff.State.r_DR7, VSM_DR7
; Determine size of VSM's stack
movzx ecx, [si]._SS.limit_15_0 ; Get SS limit
or cx, cx ; Did VSM specify a stack size ?
jnz CheckMemSize
mov cx, VSM_STACK_SIZE ; No, use default stack size
;*******************************************************************
; SI = ptr to VSM image to be loaded
; EAX = DS limit
; ECX = stack size
;*******************************************************************
CheckMemSize:
add eax, ecx ; Compute descriptor limits
add ax, 15 ; Round up to next paragraph
and al, NOT 15
mov [si].DS_Limit,eax ; Update for use by BIOS scan
lea ebx, [edi+eax] ; If not enough memory, skip this VSM
cmp ebx, [VSA_End]
jae Skip_VSM
call AlignVSM
mov cs:[ModuleBase], edi ; Save the VSM module pointer in EDI
;*******************************************************************
;
; Initialize VSM's descriptors
;
; SI = ptr to VSM image to be loaded
; EAX = DS limit
; EDI = Runtime address for this VSM
;
;*******************************************************************
; Set VSM's CS selector to <load address> & 0xFFFFF
mov ecx, edi
and ecx, 000FFFFFh
shr ecx, 4
mov [si].SysStuff.State._CS.selector, cx
mov [si].SysStuff.State._CS.base, edi
; Initialize the VSM's stack ptr
mov ebx, eax
and bl, 0FCh ; Round DOWN to nearest DWORD
sub bx, VSM_STACK_FRAME
mov [si].SysStuff.SavedESP, ebx
lea bx, [si]._DS ; Init DS
call Init_Descr
lea bx, [si]._ES ; Init ES
call Init_Descr
lea bx, [si]._SS ; Init SS
call Init_Descr
; Initialize the VSM's message queue
call Init_Msg_Q
; Update the doubly linked list of VSMs
mov ebx, edi
xchg ebx, cs:[Blink]
or ebx, ebx ; 1st VSM other than System Manager ?
jnz SetFlink
; Store ptr to 1st VSM in the System Manager
mov eax, cs:[SysMgrEntry]
mov es:(VSM_Header PTR [eax]).SysStuff.Flink, edi
jmp Setlinks
; EBX points to previous VSM
SetFlink:
mov (VSM_Header PTR es:[ebx]).SysStuff.Flink, edi
Setlinks:
mov [si].SysStuff.Blink, ebx
mov eax, cs:[Flink]
mov [si].SysStuff.Flink, eax
call CopyModule
ret
Load_VSM endp
END_MSG_QUEUE equ (MAX_MSG_CNT)*sizeof(Message)
Init_Msg_Q proc
mov bx, offset VSM_Header.SysStuff.MsgQueue
mov [si].SysStuff.Qhead, bx ; Store queue head ptr
mov [si].SysStuff.Qtail, bx ; Store queue tail ptr
add bx, END_MSG_QUEUE ; End of queue
mov [si].SysStuff.EndMsgQ, bx
ret
Init_Msg_Q endp
;*******************************************************************
;
; Initializes a descriptor
; On entry:
; BX = ptr to descriptor
; EAX = limit
; EDI = base
;
;*******************************************************************
Init_Descr proc
ASSUME bx: PTR Descriptor
push eax
push edi
mov [bx].limit_15_0, ax ; limit
shr eax, 16
mov [bx].limit_19_16, al
mov [bx].base_15_0, di ; base[15:00]
shr edi, 16
mov ax, di
mov [bx].base_23_16, al ; base[31:16]
mov [bx].base_31_24, ah
mov [bx].attr, DATA_ATTR ; attribute
pop edi
pop eax
ret
ASSUME bx: NOTHING
Init_Descr endp
;*******************************************************************
;
; Copies a module to its runtime location.
; On Entry:
; DS:SI - ptr to source
; ES:EDI - ptr to destination
; On Exit:
; CF - set if error. AX = error code
;*******************************************************************
CopyModule proc
; Get length of segment & compute size of BSS
mov ecx, [si].VSM_Length
movzx edx, [si]._DS.limit_15_0
sub edx, ecx
call Flat_ESI
;
; Copy the VSM image to its runtime location
;
if VERIFY_VSM_COPY
push ecx ; Save byte count & ptrs
push esi
push edi
endif
POST VSA_COPY_START ; 14h
mov ah, cl
shr ecx, 2 ; Convert BYTE count to DWORD count
cld
rep movsd [edi], es:[esi]
and ah, 3 ; Copy remaining bytes
mov cl, ah
rep movsb [edi], es:[esi]
POST VSA_COPY_END ; 15h
if VERIFY_VSM_COPY
pop edi ; Restore original ptrs and byte count
pop esi
pop ecx
;
; Verify the VSM image copy
;
mov ebx, edi ; Save ptr to start of VSM
shr ecx, 2 ; Convert byte count to dword count
POST VSA_VRFY_START ; 1Ch
repe cmpsd es:[esi], [edi]
jne VerifyError
mov cl, ah ; Compare leftover byte(s)
repe cmpsb es:[esi], [edi]
je Verify_Passed
VerifyError:
mov ax, ERR_VERIFY
stc
jmp Exit
Verify_Passed:
POST VSA_VRFY_END ; 1Dh
endif ; VERIFY_VSM_COPY
POST VSA_FILL_START
;
; Clear the uninitialized data space
;
mov ecx, edx ; Fill BSS with zeros
shr ecx, 2
xor eax, eax
rep stosd [edi]
mov cl, dl
and cl, 3
je BSS_Cleared
rep stosb [edi]
BSS_Cleared:
POST VSA_FILL_END
; Search the image for the next VSM.
; Some VSMs lie about their size. Search a byte at a time
; for 'VSM ', first backward, then forward.
Next_VSM::
mov edx, -1 ; Start search backwards
MAX_SEARCH equ 16
Search:
mov cx, MAX_SEARCH ; Range in bytes to scan for VSM
SearchNext:
cmp dword ptr es:[esi], VSM_SIGNATURE
je NextVSMfound
add esi, edx
loop SearchNext
add esi, MAX_SEARCH
neg edx ; Look the other direction
cmp dl, 1 ; Have we already looked in that direction ?
je Search
jmp OK_Exit ; No more VSMs found
NextVSMfound:
; Convert ESI into DS:SI format
mov edx, esi
shr edx, 4
mov ds, dx
and esi, 0000000Fh
OK_Exit:
clc
Exit: ret
CopyModule endp
;*******************************************************************
; Converts DS:SI to a flat ptr in ESI.
;*******************************************************************
Flat_ESI proc
push eax
mov ax, ds ; Convert DS:SI to a flat ptr
movzx eax, ax
shl eax, 4
movzx esi, si
add esi, eax
pop eax
ret
Flat_ESI endp
BIOS_ECX dd 0
BIOS_EDX dd 0
TotalMemory dd 0
SysMgr_Location dd 0
VSA_End dd 0
Chipset_Base dd 0
SysMgrEntry dd 00000000h
ModuleBase dd 00000000h
Blink dd 00000000h
Flink dd 00000000h
InitParam1 dd 0
InitParam2 dd 0
SysMgrSize dw 0
VSA_Size dw 0
Errors dw 0
Device_ID dw 0
Cpu_ID dw 0
Cpu_Revision dw 0
SysCall_Code dw SYS_BIOS_INIT
Requirments dw 0
CPU_MHz dw 0
PCI_MHz dw 0
DRAM_MHz dw 0
Chipset_Rev db 0
SetupComplete db 0
LoadFlag db 0
Flat_Descriptor Descriptor {0FFFFh, 0000h, 00h, DATA_ATTR, 8Fh, 00h, 0}
Msg_CompareError db "...compare error at 0x$"
Msg_Not_DOS_BUILD db CR,LF, "This version of INIT doesn't support DOS install.$"
END VSA_Installation
| 22.275049 | 81 | 0.594902 |
6300ea741f924211df41bd5dd0ad6a5140d368ee | 3,879 | asm | Assembly | native/standalone/sandbox/seccomp_filter.asm | minad/crts | 0986b9f8b9375bd12bbf11de80fc52fdba80f5d4 | [
"Apache-2.0"
] | 1 | 2019-04-15T22:45:48.000Z | 2019-04-15T22:45:48.000Z | native/standalone/sandbox/seccomp_filter.asm | minad/crts | 0986b9f8b9375bd12bbf11de80fc52fdba80f5d4 | [
"Apache-2.0"
] | null | null | null | native/standalone/sandbox/seccomp_filter.asm | minad/crts | 0986b9f8b9375bd12bbf11de80fc52fdba80f5d4 | [
"Apache-2.0"
] | null | null | null | #define KILL #0
#define ALLOW #0x7fff0000
/* struct seccomp_data */
#define nr [0]
#define arch [4]
#define arg0_lo [16]
#define arg0_hi [20]
#define arg1_lo [24]
#define arg1_hi [28]
#define arg2_lo [32]
#define arg2_hi [36]
#define arg3_lo [40]
#define arg3_hi [44]
#define arg4_lo [48]
#define arg4_hi [52]
#define arg5_lo [56]
#define arg5_hi [60]
/* pread64, pwrite64 and fallocate offsets/sizes */
#define block1_lo arg2_lo
#define block1_hi arg2_hi
#define block2_lo arg3_lo
#define block2_hi arg3_hi
#define BLOCK_JMP(i) jeq $BPF_BLOCK_FD(i), block_fd_##i
#define BLOCK_SIZE(i) \
block_fd_##i: \
ld $BPF_BLOCK_LO(i) \
st M[2] \
ld $BPF_BLOCK_HI(i) \
st M[3] \
jmp block_check_range
#define BLOCK_FOREACH(f) \
f(0) f(1) f(2) f(3) \
f(4) f(5) f(6) f(7)
start:
ld arch
jne $AUDIT_ARCH, kill
ld nr
jeq $SYS_pread64, block_call
jeq $SYS_pwrite64, block_call
jeq $SYS_clock_gettime, clock_gettime
jeq $SYS_write, write
jeq $SYS_read, read
jeq $SYS_fallocate, fallocate
jeq $SYS_fdatasync, fdatasync
jeq $SYS_ppoll, ppoll
jeq $SYS_exit_group, allow
jmp kill
clock_gettime:
ld arg0_hi
jne #0, kill
ld arg0_lo
jeq $CLOCK_MONOTONIC, allow
jeq $CLOCK_REALTIME, allow, kill
ppoll:
ld arg3_hi
jne #0, kill /* no signals */
ld arg3_lo
jne #0, kill /* no signals */
ld arg4_hi
jne #0, kill /* no signals */
ld arg4_lo
jne #0, kill /* no signals */
ld arg1_hi
jne #0, kill /* nfd */
ld arg1_lo
jeq $BPF_PPOLL_COUNT, allow, kill /* nfd */
write:
ld arg0_hi
jne #0, kill
ld arg0_lo
jge #32, kill
tax
ld $write_fd_mask
rsh %x
jset #1, allow, kill
read:
ld arg0_hi
jne #0, kill
ld arg0_lo
jge #32, kill
tax
ld $read_fd_mask
rsh %x
jset #1, allow, kill
fdatasync:
ld arg0_hi
jne #0, kill
ld arg0_lo
jlt $BPF_BLOCK_MIN, kill
jge $BPF_BLOCK_MAX, kill, allow
fallocate:
ld arg0_hi
jne #0, kill
ld arg1_lo
jne $FALLOC_MODE, kill
jmp block_call
block_call:
/* check block fd */
ld arg0_hi
jne #0, kill
ld arg0_lo
jlt $BPF_BLOCK_MIN, kill
jge $BPF_BLOCK_MAX, kill
/* check nonnegative, the kernel would also catch that, but we do it earlier */
ld block1_hi
and #0x80000000
jne #0, kill
ld block2_hi
and #0x80000000
jne #0, kill
/* check alignment */
ld block1_lo
and $BPF_BLOCK_MASK
jne #0, kill
ld block2_lo
and $BPF_BLOCK_MASK
jne #0, kill
/* M[0] = size_lo + off_lo */
ld block1_lo
tax
ld block2_lo
add %x
st M[0]
/* M[1] = size_hi + off_hi */
ld block1_hi
tax
ld block2_hi
add %x
st M[1]
/* check if low addition overflowed */
ld block2_lo
tax
ld M[0]
jlt %x, block_ovf
jmp block_no_ovf
/* add carry to M[1] */
block_ovf:
ld M[1]
add #1
st M[1]
block_no_ovf:
/* load sizes to M[2] and M[3] */
ld arg0_lo
BLOCK_FOREACH(BLOCK_JMP)
jmp kill
BLOCK_FOREACH(BLOCK_SIZE)
block_check_range:
/* check size_hi + off_hi <= BLOCK_SIZE_HI */
ld M[1]
ldx M[3]
jlt %x, allow
jgt %x, kill
/* check size_lo + off_lo <= BLOCK_SIZE_LO */
ld M[0]
ldx M[2]
jgt %x, kill, allow
kill:
ret KILL
allow:
ret ALLOW
| 20.967568 | 87 | 0.535189 |
0c6023b65974816dc4ae1cabfcc92ce796100770 | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_char.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_char.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_char.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_char.asm
Type: file
Size: 178340
Last-Modified: '2016-05-13T04:36:32Z'
SHA-1: 61A784601DB2AAAAEC66114E658A326E64B79B30
Description: null
| 21 | 47 | 0.816327 |
e00a00c1a752bbb995ab7b5000023930c6232e29 | 314 | asm | Assembly | vic-20/basic-loader.asm | SvenMichaelKlose/bender | 7f0ad22ac8464b9f3cdbf72493305aecbf4b8c8a | [
"BSD-2-Clause"
] | 2 | 2016-04-03T06:47:31.000Z | 2018-03-02T15:22:35.000Z | vic-20/basic-loader.asm | SvenMichaelKlose/bender | 7f0ad22ac8464b9f3cdbf72493305aecbf4b8c8a | [
"BSD-2-Clause"
] | null | null | null | vic-20/basic-loader.asm | SvenMichaelKlose/bender | 7f0ad22ac8464b9f3cdbf72493305aecbf4b8c8a | [
"BSD-2-Clause"
] | null | null | null | org @(- (basic-start-address *model*) 2)
load_address:
@(low (basic-start-address *model*))
@(high (basic-start-address *model*))
@(unless (first-pass?) (low basic_end))
@(unless (first-pass?) (high basic_end))
$01 $00 $9e @(unless (first-pass?) (princ main nil)) 0
basic_end:
$00 $00
| 28.545455 | 58 | 0.60828 |
0236e7794b108b49274f8464311dcec4a4e8b8c7 | 9,723 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_355.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_21829_355.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_21829_355.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x20fb, %rsi
lea addresses_WT_ht+0x18ffb, %rdi
nop
nop
nop
nop
inc %rbp
mov $89, %rcx
rep movsq
nop
add %rbx, %rbx
lea addresses_D_ht+0x879b, %r15
nop
nop
nop
nop
nop
sub $25863, %r13
and $0xffffffffffffffc0, %r15
movaps (%r15), %xmm5
vpextrq $0, %xmm5, %rbp
nop
nop
cmp $15728, %rbx
lea addresses_WT_ht+0xeb7f, %rsi
lea addresses_UC_ht+0xd0fb, %rdi
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $30, %rcx
rep movsb
nop
nop
cmp %rbp, %rbp
lea addresses_A_ht+0x79fb, %rsi
lea addresses_D_ht+0x1b72b, %rdi
nop
nop
nop
nop
nop
xor %rbx, %rbx
mov $37, %rcx
rep movsq
nop
nop
nop
nop
add $16131, %rdi
lea addresses_UC_ht+0xee3e, %r14
nop
sub $55247, %rbp
movw $0x6162, (%r14)
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_D_ht+0x135fb, %r15
nop
and $9869, %rcx
movups (%r15), %xmm4
vpextrq $0, %xmm4, %rsi
nop
nop
and $59796, %rsi
lea addresses_normal_ht+0xabcf, %rsi
lea addresses_UC_ht+0x81fb, %rdi
sub %rbx, %rbx
mov $70, %rcx
rep movsl
nop
nop
nop
nop
nop
add $46041, %r13
lea addresses_D_ht+0xcf9b, %rbp
nop
nop
nop
nop
nop
cmp %rcx, %rcx
movw $0x6162, (%rbp)
nop
nop
nop
xor %rbx, %rbx
lea addresses_D_ht+0x3423, %rdi
add %rcx, %rcx
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
dec %rbx
lea addresses_WT_ht+0x1847b, %rbp
add $29028, %rsi
mov $0x6162636465666768, %r13
movq %r13, (%rbp)
nop
nop
nop
nop
xor $17839, %r13
lea addresses_normal_ht+0x1dbfb, %rsi
lea addresses_WC_ht+0x1b57b, %rdi
nop
nop
nop
nop
and %r14, %r14
mov $125, %rcx
rep movsq
nop
nop
nop
nop
cmp %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_D+0x1666f, %rsi
lea addresses_WC+0x148e3, %rdi
inc %r8
mov $11, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rcx, %rcx
// Store
lea addresses_D+0x105fb, %rdi
nop
nop
nop
nop
nop
add $37631, %r8
movw $0x5152, (%rdi)
nop
nop
nop
sub $41074, %r14
// Store
lea addresses_UC+0x1601b, %rcx
nop
nop
cmp %rdi, %rdi
movl $0x51525354, (%rcx)
nop
nop
inc %rsi
// REPMOV
lea addresses_WC+0x11fa3, %rsi
lea addresses_PSE+0x16b1b, %rdi
nop
nop
nop
nop
nop
xor $59318, %r8
mov $98, %rcx
rep movsb
xor $98, %rdi
// Store
lea addresses_normal+0x113e1, %r14
nop
nop
nop
sub $6366, %rsi
movb $0x51, (%r14)
cmp %r14, %r14
// Store
lea addresses_D+0x36fb, %rcx
nop
nop
nop
nop
nop
xor %rax, %rax
movl $0x51525354, (%rcx)
nop
nop
nop
nop
nop
cmp %rax, %rax
// Store
lea addresses_D+0xc9b, %r15
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x5152535455565758, %rsi
movq %rsi, (%r15)
nop
nop
nop
xor $38767, %rdi
// REPMOV
lea addresses_UC+0x18cfb, %rsi
lea addresses_WT+0x150a0, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
and $58183, %r8
mov $29, %rcx
rep movsq
nop
nop
cmp %r8, %r8
// Store
lea addresses_A+0x1409d, %r14
nop
nop
nop
cmp %r8, %r8
mov $0x5152535455565758, %rdi
movq %rdi, (%r14)
nop
nop
sub %r8, %r8
// Store
lea addresses_WC+0x44fb, %r8
nop
cmp $32861, %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm0
vmovups %ymm0, (%r8)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
// Load
lea addresses_D+0x80f3, %rcx
nop
add $38757, %rsi
mov (%rcx), %r8w
sub %rax, %rax
// Faulty Load
lea addresses_A+0x1fb, %r8
nop
nop
nop
nop
nop
cmp %rax, %rax
mov (%r8), %edi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_PSE', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': True}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 28.101156 | 2,999 | 0.652268 |
040b202deff1a5d68709ca58eb369d7d60491bb6 | 556 | asm | Assembly | source/Cosmos.Core.DebugStub/TracerEntry.asm | Geramy/Cosmos | 38c699d42d5a9e53c8a902c866130b64c4f2eab3 | [
"BSD-3-Clause"
] | 207 | 2017-07-30T13:01:52.000Z | 2022-03-25T14:33:53.000Z | source/Cosmos.Core.DebugStub/TracerEntry.asm | Geramy/Cosmos | 38c699d42d5a9e53c8a902c866130b64c4f2eab3 | [
"BSD-3-Clause"
] | 57 | 2017-08-13T13:58:13.000Z | 2022-02-25T21:12:09.000Z | source/Cosmos.Core.DebugStub/TracerEntry.asm | Geramy/Cosmos | 38c699d42d5a9e53c8a902c866130b64c4f2eab3 | [
"BSD-3-Clause"
] | 62 | 2017-08-13T09:56:34.000Z | 2022-03-29T15:53:16.000Z | ; Generated at 6/14/2016 12:11:29 PM
DebugStub_TracerEntry:
cli
Pushad
mov dword [DebugStub_PushAllPtr], ESP
mov dword [DebugStub_CallerEBP], EBP
mov dword EBP, ESP
add dword EBP, 0x20
mov dword EAX, [EBP]
add dword EBP, 0xC
mov dword [DebugStub_CallerESP], EBP
mov dword EBX, EAX
MOV EAX, DR6
and dword EAX, 0x4000
cmp dword EAX, 0x4000
JE near DebugStub_TracerEntry_Block1_End
dec dword EBX
DebugStub_TracerEntry_Block1_End:
mov dword EAX, EBX
mov dword [DebugStub_CallerEIP], EAX
Call DebugStub_Executing
Popad
sti
DebugStub_TracerEntry_Exit:
iret
| 17.935484 | 40 | 0.803957 |
3cecd8f5fe0939b70fb55435b9b6bbb94aa88c40 | 301 | asm | Assembly | programs/oeis/113/A113805.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/113/A113805.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/113/A113805.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A113805: Numbers that are congruent to {5, 9} mod 14.
; 5,9,19,23,33,37,47,51,61,65,75,79,89,93,103,107,117,121,131,135,145,149,159,163,173,177,187,191,201,205,215,219,229,233,243,247,257,261,271,275,285,289,299,303,313,317,327,331,341,345,355,359,369
mul $0,3
div $0,2
mul $0,14
div $0,3
add $0,5
| 33.444444 | 197 | 0.69103 |
d2195eed3e94bccb657abf58add66eb7b1f8a666 | 351 | asm | Assembly | oeis/021/A021147.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021147.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021147.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021147: Decimal expansion of 1/143.
; Submitted by Jon Maiga
; 0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9
mov $1,$0
mul $1,2
div $1,3
mov $2,3
pow $2,$1
mod $2,5
mov $0,$2
sub $0,1
mul $0,3
| 25.071429 | 201 | 0.549858 |
8c6c5758456b04a3b77f1aae60ccf27a8f500ff4 | 53,440 | asm | Assembly | target/cos_117/disasm/iop_overlay1/DISPLAY.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 49 | 2020-10-09T12:29:16.000Z | 2022-03-12T02:33:35.000Z | target/cos_117/disasm/iop_overlay1/DISPLAY.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 1 | 2021-12-29T15:59:25.000Z | 2021-12-29T15:59:25.000Z | target/cos_117/disasm/iop_overlay1/DISPLAY.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 6 | 2021-04-12T06:10:32.000Z | 2022-02-08T23:11:19.000Z | 0x0000 (0x000000) 0x2102- f:00020 d: 258 | A = OR[258]
0x0001 (0x000002) 0x142D- f:00012 d: 45 | A = A + 45 (0x002D)
0x0002 (0x000004) 0x2918- f:00024 d: 280 | OR[280] = A
0x0003 (0x000006) 0x2102- f:00020 d: 258 | A = OR[258]
0x0004 (0x000008) 0x1427- f:00012 d: 39 | A = A + 39 (0x0027)
0x0005 (0x00000A) 0x2919- f:00024 d: 281 | OR[281] = A
0x0006 (0x00000C) 0x2102- f:00020 d: 258 | A = OR[258]
0x0007 (0x00000E) 0x1421- f:00012 d: 33 | A = A + 33 (0x0021)
0x0008 (0x000010) 0x291A- f:00024 d: 282 | OR[282] = A
0x0009 (0x000012) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x000A (0x000014) 0x2924- f:00024 d: 292 | OR[292] = A
0x000B (0x000016) 0x2102- f:00020 d: 258 | A = OR[258]
0x000C (0x000018) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012)
0x000D (0x00001A) 0x2908- f:00024 d: 264 | OR[264] = A
0x000E (0x00001C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x000F (0x00001E) 0x291B- f:00024 d: 283 | OR[283] = A
0x0010 (0x000020) 0x2102- f:00020 d: 258 | A = OR[258]
0x0011 (0x000022) 0x1420- f:00012 d: 32 | A = A + 32 (0x0020)
0x0012 (0x000024) 0x2913- f:00024 d: 275 | OR[275] = A
0x0013 (0x000026) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0014 (0x000028) 0x1600- f:00013 d: 0 | A = A - 0 (0x0000)
0x0015 (0x00002A) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0016 (0x00002C) 0x5800- f:00054 d: 0 | B = A
0x0017 (0x00002E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0018 (0x000030) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x0019 (0x000032) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x001A (0x000034) 0x290D- f:00024 d: 269 | OR[269] = A
0x001B (0x000036) 0x310D- f:00030 d: 269 | A = (OR[269])
0x001C (0x000038) 0x4800- f:00044 d: 0 | A = A > B
0x001D (0x00003A) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x001E (0x00003C) 0x8604- f:00103 d: 4 | P = P + 4 (0x0022), A # 0
0x001F (0x00003E) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x0021 (0x000042) 0x291B- f:00024 d: 283 | OR[283] = A
0x0022 (0x000044) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0023 (0x000046) 0x290D- f:00024 d: 269 | OR[269] = A
0x0024 (0x000048) 0x3118- f:00030 d: 280 | A = (OR[280])
0x0025 (0x00004A) 0x8612- f:00103 d: 18 | P = P + 18 (0x0037), A # 0
0x0026 (0x00004C) 0x1009- f:00010 d: 9 | A = 9 (0x0009)
0x0027 (0x00004E) 0x2925- f:00024 d: 293 | OR[293] = A
0x0028 (0x000050) 0x2118- f:00020 d: 280 | A = OR[280]
0x0029 (0x000052) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x002A (0x000054) 0x2926- f:00024 d: 294 | OR[294] = A
0x002B (0x000056) 0x211B- f:00020 d: 283 | A = OR[283]
0x002C (0x000058) 0x2927- f:00024 d: 295 | OR[295] = A
0x002D (0x00005A) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x002E (0x00005C) 0x5800- f:00054 d: 0 | B = A
0x002F (0x00005E) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0031 (0x000062) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0032 (0x000064) 0x2006- f:00020 d: 6 | A = OR[6]
0x0033 (0x000066) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0034 (0x000068) 0x2908- f:00024 d: 264 | OR[264] = A
0x0035 (0x00006A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0036 (0x00006C) 0x290D- f:00024 d: 269 | OR[269] = A
0x0037 (0x00006E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0038 (0x000070) 0x3918- f:00034 d: 280 | (OR[280]) = A
0x0039 (0x000072) 0x210D- f:00020 d: 269 | A = OR[269]
0x003A (0x000074) 0x3119- f:00030 d: 281 | A = (OR[281])
0x003B (0x000076) 0x8602- f:00103 d: 2 | P = P + 2 (0x003D), A # 0
0x003C (0x000078) 0x7018- f:00070 d: 24 | P = P + 24 (0x0054)
0x003D (0x00007A) 0x2119- f:00020 d: 281 | A = OR[281]
0x003E (0x00007C) 0x290D- f:00024 d: 269 | OR[269] = A
0x003F (0x00007E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0040 (0x000080) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x0041 (0x000082) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0042 (0x000084) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0043 (0x000086) 0x840B- f:00102 d: 11 | P = P + 11 (0x004E), A = 0
0x0044 (0x000088) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0045 (0x00008A) 0x2925- f:00024 d: 293 | OR[293] = A
0x0046 (0x00008C) 0x210D- f:00020 d: 269 | A = OR[269]
0x0047 (0x00008E) 0x2926- f:00024 d: 294 | OR[294] = A
0x0048 (0x000090) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0049 (0x000092) 0x2927- f:00024 d: 295 | OR[295] = A
0x004A (0x000094) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x004B (0x000096) 0x5800- f:00054 d: 0 | B = A
0x004C (0x000098) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x004D (0x00009A) 0x7C09- f:00076 d: 9 | R = OR[9]
0x004E (0x00009C) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x004F (0x00009E) 0x2925- f:00024 d: 293 | OR[293] = A
0x0050 (0x0000A0) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0051 (0x0000A2) 0x5800- f:00054 d: 0 | B = A
0x0052 (0x0000A4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0053 (0x0000A6) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0054 (0x0000A8) 0x2100- f:00020 d: 256 | A = OR[256]
0x0055 (0x0000AA) 0x141D- f:00012 d: 29 | A = A + 29 (0x001D)
0x0056 (0x0000AC) 0x2913- f:00024 d: 275 | OR[275] = A
0x0057 (0x0000AE) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0058 (0x0000B0) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x0059 (0x0000B2) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x005A (0x0000B4) 0x5800- f:00054 d: 0 | B = A
0x005B (0x0000B6) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x005C (0x0000B8) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x005D (0x0000BA) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x005E (0x0000BC) 0x290D- f:00024 d: 269 | OR[269] = A
0x005F (0x0000BE) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0060 (0x0000C0) 0x4800- f:00044 d: 0 | A = A > B
0x0061 (0x0000C2) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0062 (0x0000C4) 0x2914- f:00024 d: 276 | OR[276] = A
0x0063 (0x0000C6) 0x2102- f:00020 d: 258 | A = OR[258]
0x0064 (0x0000C8) 0x1420- f:00012 d: 32 | A = A + 32 (0x0020)
0x0065 (0x0000CA) 0x2913- f:00024 d: 275 | OR[275] = A
0x0066 (0x0000CC) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0067 (0x0000CE) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x0068 (0x0000D0) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0069 (0x0000D2) 0x5800- f:00054 d: 0 | B = A
0x006A (0x0000D4) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x006B (0x0000D6) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x006C (0x0000D8) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x006D (0x0000DA) 0x290D- f:00024 d: 269 | OR[269] = A
0x006E (0x0000DC) 0x310D- f:00030 d: 269 | A = (OR[269])
0x006F (0x0000DE) 0x4800- f:00044 d: 0 | A = A > B
0x0070 (0x0000E0) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0071 (0x0000E2) 0x2915- f:00024 d: 277 | OR[277] = A
0x0072 (0x0000E4) 0x2114- f:00020 d: 276 | A = OR[276]
0x0073 (0x0000E6) 0x2715- f:00023 d: 277 | A = A - OR[277]
0x0074 (0x0000E8) 0x8602- f:00103 d: 2 | P = P + 2 (0x0076), A # 0
0x0075 (0x0000EA) 0x7064- f:00070 d: 100 | P = P + 100 (0x00D9)
0x0076 (0x0000EC) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0077 (0x0000EE) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x0078 (0x0000F0) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0079 (0x0000F2) 0x5800- f:00054 d: 0 | B = A
0x007A (0x0000F4) 0x2114- f:00020 d: 276 | A = OR[276]
0x007B (0x0000F6) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x007C (0x0000F8) 0x290D- f:00024 d: 269 | OR[269] = A
0x007D (0x0000FA) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x007E (0x0000FC) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x007F (0x0000FE) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x0080 (0x000100) 0x290E- f:00024 d: 270 | OR[270] = A
0x0081 (0x000102) 0x310E- f:00030 d: 270 | A = (OR[270])
0x0082 (0x000104) 0x4C00- f:00046 d: 0 | A = A >> B
0x0083 (0x000106) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x0084 (0x000108) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x0085 (0x00010A) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x0086 (0x00010C) 0x4E00- f:00047 d: 0 | A = A << B
0x0087 (0x00010E) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0088 (0x000110) 0x1800-0x029F f:00014 d: 0 | A = 671 (0x029F)
0x008A (0x000114) 0x2913- f:00024 d: 275 | OR[275] = A
0x008B (0x000116) 0x2114- f:00020 d: 276 | A = OR[276]
0x008C (0x000118) 0x8604- f:00103 d: 4 | P = P + 4 (0x0090), A # 0
0x008D (0x00011A) 0x1800-0x02A7 f:00014 d: 0 | A = 679 (0x02A7)
0x008F (0x00011E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0090 (0x000120) 0x2104- f:00020 d: 260 | A = OR[260]
0x0091 (0x000122) 0x290D- f:00024 d: 269 | OR[269] = A
0x0092 (0x000124) 0x2104- f:00020 d: 260 | A = OR[260]
0x0093 (0x000126) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x0094 (0x000128) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC)
0x0096 (0x00012C) 0x2904- f:00024 d: 260 | OR[260] = A
0x0097 (0x00012E) 0x2104- f:00020 d: 260 | A = OR[260]
0x0098 (0x000130) 0x2914- f:00024 d: 276 | OR[276] = A
0x0099 (0x000132) 0x1800-0x0008 f:00014 d: 0 | A = 8 (0x0008)
0x009B (0x000136) 0x2B04- f:00025 d: 260 | OR[260] = A + OR[260]
0x009C (0x000138) 0x2104- f:00020 d: 260 | A = OR[260]
0x009D (0x00013A) 0x2705- f:00023 d: 261 | A = A - OR[261]
0x009E (0x00013C) 0xB234- f:00131 d: 52 | R = OR[52], C = 1
0x009F (0x00013E) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B ****
0x00A0 (0x000140) 0x210D- f:00020 d: 269 | A = OR[269]
0x00A1 (0x000142) 0x3904- f:00034 d: 260 | (OR[260]) = A
0x00A2 (0x000144) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1
0x00A3 (0x000146) 0x2003- f:00020 d: 3 | A = OR[3]
0x00A4 (0x000148) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x00A5 (0x00014A) 0x290D- f:00024 d: 269 | OR[269] = A
0x00A6 (0x00014C) 0x2114- f:00020 d: 276 | A = OR[276]
0x00A7 (0x00014E) 0x290E- f:00024 d: 270 | OR[270] = A
0x00A8 (0x000150) 0x1800-0x0008 f:00014 d: 0 | A = 8 (0x0008)
0x00AA (0x000154) 0x290F- f:00024 d: 271 | OR[271] = A
0x00AB (0x000156) 0x7006- f:00070 d: 6 | P = P + 6 (0x00B1)
0x00AC (0x000158) 0x310D- f:00030 d: 269 | A = (OR[269])
0x00AD (0x00015A) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x00AE (0x00015C) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x00AF (0x00015E) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x00B0 (0x000160) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x00B1 (0x000162) 0x210F- f:00020 d: 271 | A = OR[271]
0x00B2 (0x000164) 0x8E06- f:00107 d: 6 | P = P - 6 (0x00AC), A # 0
0x00B3 (0x000166) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x00B4 (0x000168) 0x2925- f:00024 d: 293 | OR[293] = A
0x00B5 (0x00016A) 0x1800-0x0123 f:00014 d: 0 | A = 291 (0x0123)
0x00B7 (0x00016E) 0x2926- f:00024 d: 294 | OR[294] = A
0x00B8 (0x000170) 0x1800-0x0005 f:00014 d: 0 | A = 5 (0x0005)
0x00BA (0x000174) 0x2927- f:00024 d: 295 | OR[295] = A
0x00BB (0x000176) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x00BC (0x000178) 0x2928- f:00024 d: 296 | OR[296] = A
0x00BD (0x00017A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00BE (0x00017C) 0x2929- f:00024 d: 297 | OR[297] = A
0x00BF (0x00017E) 0x2114- f:00020 d: 276 | A = OR[276]
0x00C0 (0x000180) 0x292A- f:00024 d: 298 | OR[298] = A
0x00C1 (0x000182) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00C2 (0x000184) 0x292B- f:00024 d: 299 | OR[299] = A
0x00C3 (0x000186) 0x1800-0x0010 f:00014 d: 0 | A = 16 (0x0010)
0x00C5 (0x00018A) 0x292C- f:00024 d: 300 | OR[300] = A
0x00C6 (0x00018C) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x00C7 (0x00018E) 0x5800- f:00054 d: 0 | B = A
0x00C8 (0x000190) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x00CA (0x000194) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00CB (0x000196) 0x2F04- f:00027 d: 260 | OR[260] = OR[260] - 1
0x00CC (0x000198) 0x3104- f:00030 d: 260 | A = (OR[260])
0x00CD (0x00019A) 0x2904- f:00024 d: 260 | OR[260] = A
0x00CE (0x00019C) 0x2104- f:00020 d: 260 | A = OR[260]
0x00CF (0x00019E) 0x2706- f:00023 d: 262 | A = A - OR[262]
0x00D0 (0x0001A0) 0x8007- f:00100 d: 7 | P = P + 7 (0x00D7), C = 0
0x00D1 (0x0001A2) 0x2104- f:00020 d: 260 | A = OR[260]
0x00D2 (0x0001A4) 0x2705- f:00023 d: 261 | A = A - OR[261]
0x00D3 (0x0001A6) 0x8003- f:00100 d: 3 | P = P + 3 (0x00D6), C = 0
0x00D4 (0x0001A8) 0x8402- f:00102 d: 2 | P = P + 2 (0x00D6), A = 0
0x00D5 (0x0001AA) 0x7002- f:00070 d: 2 | P = P + 2 (0x00D7)
0x00D6 (0x0001AC) 0x7003- f:00070 d: 3 | P = P + 3 (0x00D9)
0x00D7 (0x0001AE) 0x7C34- f:00076 d: 52 | R = OR[52]
0x00D8 (0x0001B0) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B ****
0x00D9 (0x0001B2) 0x2104- f:00020 d: 260 | A = OR[260]
0x00DA (0x0001B4) 0x290D- f:00024 d: 269 | OR[269] = A
0x00DB (0x0001B6) 0x2104- f:00020 d: 260 | A = OR[260]
0x00DC (0x0001B8) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x00DD (0x0001BA) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC)
0x00DF (0x0001BE) 0x2904- f:00024 d: 260 | OR[260] = A
0x00E0 (0x0001C0) 0x2104- f:00020 d: 260 | A = OR[260]
0x00E1 (0x0001C2) 0x291D- f:00024 d: 285 | OR[285] = A
0x00E2 (0x0001C4) 0x1800-0x0028 f:00014 d: 0 | A = 40 (0x0028)
0x00E4 (0x0001C8) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x00E5 (0x0001CA) 0x2504- f:00022 d: 260 | A = A + OR[260]
0x00E6 (0x0001CC) 0x2904- f:00024 d: 260 | OR[260] = A
0x00E7 (0x0001CE) 0x2104- f:00020 d: 260 | A = OR[260]
0x00E8 (0x0001D0) 0x2705- f:00023 d: 261 | A = A - OR[261]
0x00E9 (0x0001D2) 0xB234- f:00131 d: 52 | R = OR[52], C = 1
0x00EA (0x0001D4) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B ****
0x00EB (0x0001D6) 0x210D- f:00020 d: 269 | A = OR[269]
0x00EC (0x0001D8) 0x3904- f:00034 d: 260 | (OR[260]) = A
0x00ED (0x0001DA) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1
0x00EE (0x0001DC) 0x211D- f:00020 d: 285 | A = OR[285]
0x00EF (0x0001DE) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x00F0 (0x0001E0) 0x291C- f:00024 d: 284 | OR[284] = A
0x00F1 (0x0001E2) 0x211C- f:00020 d: 284 | A = OR[284]
0x00F2 (0x0001E4) 0x290E- f:00024 d: 270 | OR[270] = A
0x00F3 (0x0001E6) 0x1800-0x0014 f:00014 d: 0 | A = 20 (0x0014)
0x00F5 (0x0001EA) 0x290D- f:00024 d: 269 | OR[269] = A
0x00F6 (0x0001EC) 0x210D- f:00020 d: 269 | A = OR[269]
0x00F7 (0x0001EE) 0x8407- f:00102 d: 7 | P = P + 7 (0x00FE), A = 0
0x00F8 (0x0001F0) 0x1800-0x2020 f:00014 d: 0 | A = 8224 (0x2020)
0x00FA (0x0001F4) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x00FB (0x0001F6) 0x2F0D- f:00027 d: 269 | OR[269] = OR[269] - 1
0x00FC (0x0001F8) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x00FD (0x0001FA) 0x7207- f:00071 d: 7 | P = P - 7 (0x00F6)
0x00FE (0x0001FC) 0x2100- f:00020 d: 256 | A = OR[256]
0x00FF (0x0001FE) 0x141D- f:00012 d: 29 | A = A + 29 (0x001D)
0x0100 (0x000200) 0x2915- f:00024 d: 277 | OR[277] = A
0x0101 (0x000202) 0x104C- f:00010 d: 76 | A = 76 (0x004C)
0x0102 (0x000204) 0x2913- f:00024 d: 275 | OR[275] = A
0x0103 (0x000206) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0104 (0x000208) 0x2914- f:00024 d: 276 | OR[276] = A
0x0105 (0x00020A) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0106 (0x00020C) 0x1600- f:00013 d: 0 | A = A - 0 (0x0000)
0x0107 (0x00020E) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0108 (0x000210) 0x5800- f:00054 d: 0 | B = A
0x0109 (0x000212) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x010A (0x000214) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x010B (0x000216) 0x2515- f:00022 d: 277 | A = A + OR[277]
0x010C (0x000218) 0x290D- f:00024 d: 269 | OR[269] = A
0x010D (0x00021A) 0x310D- f:00030 d: 269 | A = (OR[269])
0x010E (0x00021C) 0x4800- f:00044 d: 0 | A = A > B
0x010F (0x00021E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0110 (0x000220) 0xBE03-0x02AF f:00137 d: 3 | R = OR[3]+687 (0x02AF), A # 0
0x0112 (0x000224) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0113 (0x000226) 0x2B14- f:00025 d: 276 | OR[276] = A + OR[276]
0x0114 (0x000228) 0x1053- f:00010 d: 83 | A = 83 (0x0053)
0x0115 (0x00022A) 0x2913- f:00024 d: 275 | OR[275] = A
0x0116 (0x00022C) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0117 (0x00022E) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x0118 (0x000230) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0119 (0x000232) 0x5800- f:00054 d: 0 | B = A
0x011A (0x000234) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x011B (0x000236) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x011C (0x000238) 0x2515- f:00022 d: 277 | A = A + OR[277]
0x011D (0x00023A) 0x290D- f:00024 d: 269 | OR[269] = A
0x011E (0x00023C) 0x310D- f:00030 d: 269 | A = (OR[269])
0x011F (0x00023E) 0x4800- f:00044 d: 0 | A = A > B
0x0120 (0x000240) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0121 (0x000242) 0xBE03-0x02AF f:00137 d: 3 | R = OR[3]+687 (0x02AF), A # 0
0x0123 (0x000246) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0124 (0x000248) 0x2B14- f:00025 d: 276 | OR[276] = A + OR[276]
0x0125 (0x00024A) 0x1052- f:00010 d: 82 | A = 82 (0x0052)
0x0126 (0x00024C) 0x2913- f:00024 d: 275 | OR[275] = A
0x0127 (0x00024E) 0x2102- f:00020 d: 258 | A = OR[258]
0x0128 (0x000250) 0x1420- f:00012 d: 32 | A = A + 32 (0x0020)
0x0129 (0x000252) 0x2915- f:00024 d: 277 | OR[277] = A
0x012A (0x000254) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x012B (0x000256) 0x1600- f:00013 d: 0 | A = A - 0 (0x0000)
0x012C (0x000258) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x012D (0x00025A) 0x5800- f:00054 d: 0 | B = A
0x012E (0x00025C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x012F (0x00025E) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x0130 (0x000260) 0x2515- f:00022 d: 277 | A = A + OR[277]
0x0131 (0x000262) 0x290D- f:00024 d: 269 | OR[269] = A
0x0132 (0x000264) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0133 (0x000266) 0x4800- f:00044 d: 0 | A = A > B
0x0134 (0x000268) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0135 (0x00026A) 0xBE03-0x02AF f:00137 d: 3 | R = OR[3]+687 (0x02AF), A # 0
0x0137 (0x00026E) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0138 (0x000270) 0x2B14- f:00025 d: 276 | OR[276] = A + OR[276]
0x0139 (0x000272) 0x104D- f:00010 d: 77 | A = 77 (0x004D)
0x013A (0x000274) 0x2913- f:00024 d: 275 | OR[275] = A
0x013B (0x000276) 0x2100- f:00020 d: 256 | A = OR[256]
0x013C (0x000278) 0x1415- f:00012 d: 21 | A = A + 21 (0x0015)
0x013D (0x00027A) 0x2908- f:00024 d: 264 | OR[264] = A
0x013E (0x00027C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x013F (0x00027E) 0x2915- f:00024 d: 277 | OR[277] = A
0x0140 (0x000280) 0x2115- f:00020 d: 277 | A = OR[277]
0x0141 (0x000282) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040)
0x0142 (0x000284) 0x8003- f:00100 d: 3 | P = P + 3 (0x0145), C = 0
0x0143 (0x000286) 0x8402- f:00102 d: 2 | P = P + 2 (0x0145), A = 0
0x0144 (0x000288) 0x7C34- f:00076 d: 52 | R = OR[52]
0x0145 (0x00028A) 0x0000- f:00000 d: 0 | PASS
0x0146 (0x00028C) 0x2115- f:00020 d: 277 | A = OR[277]
0x0147 (0x00028E) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040)
0x0148 (0x000290) 0xBE03-0x02AF f:00137 d: 3 | R = OR[3]+687 (0x02AF), A # 0
0x014A (0x000294) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x014B (0x000296) 0x2925- f:00024 d: 293 | OR[293] = A
0x014C (0x000298) 0x1800-0x0041 f:00014 d: 0 | A = 65 (0x0041)
0x014E (0x00029C) 0x2926- f:00024 d: 294 | OR[294] = A
0x014F (0x00029E) 0x1800-0x0000 f:00014 d: 0 | A = 0 (0x0000)
0x0151 (0x0002A2) 0x2927- f:00024 d: 295 | OR[295] = A
0x0152 (0x0002A4) 0x211C- f:00020 d: 284 | A = OR[284]
0x0153 (0x0002A6) 0x2928- f:00024 d: 296 | OR[296] = A
0x0154 (0x0002A8) 0x1800-0x0020 f:00014 d: 0 | A = 32 (0x0020)
0x0156 (0x0002AC) 0x2929- f:00024 d: 297 | OR[297] = A
0x0157 (0x0002AE) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0158 (0x0002B0) 0x292A- f:00024 d: 298 | OR[298] = A
0x0159 (0x0002B2) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x015A (0x0002B4) 0x292B- f:00024 d: 299 | OR[299] = A
0x015B (0x0002B6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x015C (0x0002B8) 0x292C- f:00024 d: 300 | OR[300] = A
0x015D (0x0002BA) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x015E (0x0002BC) 0x5800- f:00054 d: 0 | B = A
0x015F (0x0002BE) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0161 (0x0002C2) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0162 (0x0002C4) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0163 (0x0002C6) 0x2925- f:00024 d: 293 | OR[293] = A
0x0164 (0x0002C8) 0x1800-0x0041 f:00014 d: 0 | A = 65 (0x0041)
0x0166 (0x0002CC) 0x2926- f:00024 d: 294 | OR[294] = A
0x0167 (0x0002CE) 0x1800-0x0002 f:00014 d: 0 | A = 2 (0x0002)
0x0169 (0x0002D2) 0x2927- f:00024 d: 295 | OR[295] = A
0x016A (0x0002D4) 0x211C- f:00020 d: 284 | A = OR[284]
0x016B (0x0002D6) 0x2928- f:00024 d: 296 | OR[296] = A
0x016C (0x0002D8) 0x1800-0x0015 f:00014 d: 0 | A = 21 (0x0015)
0x016E (0x0002DC) 0x2929- f:00024 d: 297 | OR[297] = A
0x016F (0x0002DE) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0170 (0x0002E0) 0x292A- f:00024 d: 298 | OR[298] = A
0x0171 (0x0002E2) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0172 (0x0002E4) 0x292B- f:00024 d: 299 | OR[299] = A
0x0173 (0x0002E6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0174 (0x0002E8) 0x292C- f:00024 d: 300 | OR[300] = A
0x0175 (0x0002EA) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0176 (0x0002EC) 0x5800- f:00054 d: 0 | B = A
0x0177 (0x0002EE) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0179 (0x0002F2) 0x7C09- f:00076 d: 9 | R = OR[9]
0x017A (0x0002F4) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x017B (0x0002F6) 0x2925- f:00024 d: 293 | OR[293] = A
0x017C (0x0002F8) 0x1800-0x0123 f:00014 d: 0 | A = 291 (0x0123)
0x017E (0x0002FC) 0x2926- f:00024 d: 294 | OR[294] = A
0x017F (0x0002FE) 0x1800-0x0005 f:00014 d: 0 | A = 5 (0x0005)
0x0181 (0x000302) 0x2927- f:00024 d: 295 | OR[295] = A
0x0182 (0x000304) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0183 (0x000306) 0x2928- f:00024 d: 296 | OR[296] = A
0x0184 (0x000308) 0x1026- f:00010 d: 38 | A = 38 (0x0026)
0x0185 (0x00030A) 0x2929- f:00024 d: 297 | OR[297] = A
0x0186 (0x00030C) 0x211C- f:00020 d: 284 | A = OR[284]
0x0187 (0x00030E) 0x292A- f:00024 d: 298 | OR[298] = A
0x0188 (0x000310) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0189 (0x000312) 0x292B- f:00024 d: 299 | OR[299] = A
0x018A (0x000314) 0x1800-0x0028 f:00014 d: 0 | A = 40 (0x0028)
0x018C (0x000318) 0x292C- f:00024 d: 300 | OR[300] = A
0x018D (0x00031A) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x018E (0x00031C) 0x5800- f:00054 d: 0 | B = A
0x018F (0x00031E) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0191 (0x000322) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0192 (0x000324) 0x2100- f:00020 d: 256 | A = OR[256]
0x0193 (0x000326) 0x1415- f:00012 d: 21 | A = A + 21 (0x0015)
0x0194 (0x000328) 0x2908- f:00024 d: 264 | OR[264] = A
0x0195 (0x00032A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0196 (0x00032C) 0x2913- f:00024 d: 275 | OR[275] = A
0x0197 (0x00032E) 0x2113- f:00020 d: 275 | A = OR[275]
0x0198 (0x000330) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020)
0x0199 (0x000332) 0x8004- f:00100 d: 4 | P = P + 4 (0x019D), C = 0
0x019A (0x000334) 0x8403- f:00102 d: 3 | P = P + 3 (0x019D), A = 0
0x019B (0x000336) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x019C (0x000338) 0x2913- f:00024 d: 275 | OR[275] = A
0x019D (0x00033A) 0x2100- f:00020 d: 256 | A = OR[256]
0x019E (0x00033C) 0x1419- f:00012 d: 25 | A = A + 25 (0x0019)
0x019F (0x00033E) 0x2908- f:00024 d: 264 | OR[264] = A
0x01A0 (0x000340) 0x3108- f:00030 d: 264 | A = (OR[264])
0x01A1 (0x000342) 0x8604- f:00103 d: 4 | P = P + 4 (0x01A5), A # 0
0x01A2 (0x000344) 0x2113- f:00020 d: 275 | A = OR[275]
0x01A3 (0x000346) 0x8602- f:00103 d: 2 | P = P + 2 (0x01A5), A # 0
0x01A4 (0x000348) 0x7041- f:00070 d: 65 | P = P + 65 (0x01E5)
0x01A5 (0x00034A) 0x2F24- f:00027 d: 292 | OR[292] = OR[292] - 1
0x01A6 (0x00034C) 0x2124- f:00020 d: 292 | A = OR[292]
0x01A7 (0x00034E) 0x8402- f:00102 d: 2 | P = P + 2 (0x01A9), A = 0
0x01A8 (0x000350) 0x703D- f:00070 d: 61 | P = P + 61 (0x01E5)
0x01A9 (0x000352) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x01AA (0x000354) 0x2925- f:00024 d: 293 | OR[293] = A
0x01AB (0x000356) 0x1800-0x0123 f:00014 d: 0 | A = 291 (0x0123)
0x01AD (0x00035A) 0x2926- f:00024 d: 294 | OR[294] = A
0x01AE (0x00035C) 0x1800-0x0003 f:00014 d: 0 | A = 3 (0x0003)
0x01B0 (0x000360) 0x2927- f:00024 d: 295 | OR[295] = A
0x01B1 (0x000362) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B2 (0x000364) 0x2928- f:00024 d: 296 | OR[296] = A
0x01B3 (0x000366) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B4 (0x000368) 0x2929- f:00024 d: 297 | OR[297] = A
0x01B5 (0x00036A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B6 (0x00036C) 0x292A- f:00024 d: 298 | OR[298] = A
0x01B7 (0x00036E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B8 (0x000370) 0x292B- f:00024 d: 299 | OR[299] = A
0x01B9 (0x000372) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01BA (0x000374) 0x292C- f:00024 d: 300 | OR[300] = A
0x01BB (0x000376) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x01BC (0x000378) 0x5800- f:00054 d: 0 | B = A
0x01BD (0x00037A) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x01BF (0x00037E) 0x7C09- f:00076 d: 9 | R = OR[9]
0x01C0 (0x000380) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01C1 (0x000382) 0x2914- f:00024 d: 276 | OR[276] = A
0x01C2 (0x000384) 0x1032- f:00010 d: 50 | A = 50 (0x0032)
0x01C3 (0x000386) 0x2915- f:00024 d: 277 | OR[277] = A
0x01C4 (0x000388) 0x2102- f:00020 d: 258 | A = OR[258]
0x01C5 (0x00038A) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012)
0x01C6 (0x00038C) 0x2908- f:00024 d: 264 | OR[264] = A
0x01C7 (0x00038E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x01C8 (0x000390) 0x2913- f:00024 d: 275 | OR[275] = A
0x01C9 (0x000392) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x01CA (0x000394) 0x2925- f:00024 d: 293 | OR[293] = A
0x01CB (0x000396) 0x1800-0x001B f:00014 d: 0 | A = 27 (0x001B)
0x01CD (0x00039A) 0x2926- f:00024 d: 294 | OR[294] = A
0x01CE (0x00039C) 0x2113- f:00020 d: 275 | A = OR[275]
0x01CF (0x00039E) 0x2927- f:00024 d: 295 | OR[295] = A
0x01D0 (0x0003A0) 0x2115- f:00020 d: 277 | A = OR[277]
0x01D1 (0x0003A2) 0x2928- f:00024 d: 296 | OR[296] = A
0x01D2 (0x0003A4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01D3 (0x0003A6) 0x2929- f:00024 d: 297 | OR[297] = A
0x01D4 (0x0003A8) 0x2113- f:00020 d: 275 | A = OR[275]
0x01D5 (0x0003AA) 0x292A- f:00024 d: 298 | OR[298] = A
0x01D6 (0x0003AC) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x01D7 (0x0003AE) 0x292B- f:00024 d: 299 | OR[299] = A
0x01D8 (0x0003B0) 0x1015- f:00010 d: 21 | A = 21 (0x0015)
0x01D9 (0x0003B2) 0x292C- f:00024 d: 300 | OR[300] = A
0x01DA (0x0003B4) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x01DB (0x0003B6) 0x292D- f:00024 d: 301 | OR[301] = A
0x01DC (0x0003B8) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x01DD (0x0003BA) 0x5800- f:00054 d: 0 | B = A
0x01DE (0x0003BC) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x01E0 (0x0003C0) 0x7C09- f:00076 d: 9 | R = OR[9]
0x01E1 (0x0003C2) 0x2124- f:00020 d: 292 | A = OR[292]
0x01E2 (0x0003C4) 0x8603- f:00103 d: 3 | P = P + 3 (0x01E5), A # 0
0x01E3 (0x0003C6) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x01E4 (0x0003C8) 0x2924- f:00024 d: 292 | OR[292] = A
0x01E5 (0x0003CA) 0x2F04- f:00027 d: 260 | OR[260] = OR[260] - 1
0x01E6 (0x0003CC) 0x3104- f:00030 d: 260 | A = (OR[260])
0x01E7 (0x0003CE) 0x2904- f:00024 d: 260 | OR[260] = A
0x01E8 (0x0003D0) 0x2104- f:00020 d: 260 | A = OR[260]
0x01E9 (0x0003D2) 0x2706- f:00023 d: 262 | A = A - OR[262]
0x01EA (0x0003D4) 0x8007- f:00100 d: 7 | P = P + 7 (0x01F1), C = 0
0x01EB (0x0003D6) 0x2104- f:00020 d: 260 | A = OR[260]
0x01EC (0x0003D8) 0x2705- f:00023 d: 261 | A = A - OR[261]
0x01ED (0x0003DA) 0x8003- f:00100 d: 3 | P = P + 3 (0x01F0), C = 0
0x01EE (0x0003DC) 0x8402- f:00102 d: 2 | P = P + 2 (0x01F0), A = 0
0x01EF (0x0003DE) 0x7002- f:00070 d: 2 | P = P + 2 (0x01F1)
0x01F0 (0x0003E0) 0x7003- f:00070 d: 3 | P = P + 3 (0x01F3)
0x01F1 (0x0003E2) 0x7C34- f:00076 d: 52 | R = OR[52]
0x01F2 (0x0003E4) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B ****
0x01F3 (0x0003E6) 0x211A- f:00020 d: 282 | A = OR[282]
0x01F4 (0x0003E8) 0x290D- f:00024 d: 269 | OR[269] = A
0x01F5 (0x0003EA) 0x310D- f:00030 d: 269 | A = (OR[269])
0x01F6 (0x0003EC) 0xAE03-0x020F f:00127 d: 3 | P = OR[3]+527 (0x020F), A # 0
0x01F8 (0x0003F0) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x01F9 (0x0003F2) 0x2925- f:00024 d: 293 | OR[293] = A
0x01FA (0x0003F4) 0x210D- f:00020 d: 269 | A = OR[269]
0x01FB (0x0003F6) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x01FC (0x0003F8) 0x2926- f:00024 d: 294 | OR[294] = A
0x01FD (0x0003FA) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01FE (0x0003FC) 0x2927- f:00024 d: 295 | OR[295] = A
0x01FF (0x0003FE) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0200 (0x000400) 0x5800- f:00054 d: 0 | B = A
0x0201 (0x000402) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0203 (0x000406) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0204 (0x000408) 0x2006- f:00020 d: 6 | A = OR[6]
0x0205 (0x00040A) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0206 (0x00040C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0207 (0x00040E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0208 (0x000410) 0x7215- f:00071 d: 21 | P = P - 21 (0x01F3)
0x0209 (0x000412) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x020A (0x000414) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x020B (0x000416) 0x2102- f:00020 d: 258 | A = OR[258]
0x020C (0x000418) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006)
0x020D (0x00041A) 0x2908- f:00024 d: 264 | OR[264] = A
0x020E (0x00041C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x020F (0x00041E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0210 (0x000420) 0x2113- f:00020 d: 275 | A = OR[275]
0x0211 (0x000422) 0x8602- f:00103 d: 2 | P = P + 2 (0x0213), A # 0
0x0212 (0x000424) 0x7076- f:00070 d: 118 | P = P + 118 (0x0288)
0x0213 (0x000426) 0x2102- f:00020 d: 258 | A = OR[258]
0x0214 (0x000428) 0x1416- f:00012 d: 22 | A = A + 22 (0x0016)
0x0215 (0x00042A) 0x2908- f:00024 d: 264 | OR[264] = A
0x0216 (0x00042C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0217 (0x00042E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0218 (0x000430) 0x2102- f:00020 d: 258 | A = OR[258]
0x0219 (0x000432) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007)
0x021A (0x000434) 0x2908- f:00024 d: 264 | OR[264] = A
0x021B (0x000436) 0x3108- f:00030 d: 264 | A = (OR[264])
0x021C (0x000438) 0x2914- f:00024 d: 276 | OR[276] = A
0x021D (0x00043A) 0x2113- f:00020 d: 275 | A = OR[275]
0x021E (0x00043C) 0x2714- f:00023 d: 276 | A = A - OR[276]
0x021F (0x00043E) 0x8602- f:00103 d: 2 | P = P + 2 (0x0221), A # 0
0x0220 (0x000440) 0x700F- f:00070 d: 15 | P = P + 15 (0x022F)
0x0221 (0x000442) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0222 (0x000444) 0x2925- f:00024 d: 293 | OR[293] = A
0x0223 (0x000446) 0x1800-0x0153 f:00014 d: 0 | A = 339 (0x0153)
0x0225 (0x00044A) 0x2926- f:00024 d: 294 | OR[294] = A
0x0226 (0x00044C) 0x2114- f:00020 d: 276 | A = OR[276]
0x0227 (0x00044E) 0x2927- f:00024 d: 295 | OR[295] = A
0x0228 (0x000450) 0x2113- f:00020 d: 275 | A = OR[275]
0x0229 (0x000452) 0x2928- f:00024 d: 296 | OR[296] = A
0x022A (0x000454) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x022B (0x000456) 0x5800- f:00054 d: 0 | B = A
0x022C (0x000458) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x022E (0x00045C) 0x7C09- f:00076 d: 9 | R = OR[9]
0x022F (0x00045E) 0x2102- f:00020 d: 258 | A = OR[258]
0x0230 (0x000460) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x0231 (0x000462) 0x2908- f:00024 d: 264 | OR[264] = A
0x0232 (0x000464) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0233 (0x000466) 0x2913- f:00024 d: 275 | OR[275] = A
0x0234 (0x000468) 0x2102- f:00020 d: 258 | A = OR[258]
0x0235 (0x00046A) 0x1416- f:00012 d: 22 | A = A + 22 (0x0016)
0x0236 (0x00046C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0237 (0x00046E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0238 (0x000470) 0x2914- f:00024 d: 276 | OR[276] = A
0x0239 (0x000472) 0x2114- f:00020 d: 276 | A = OR[276]
0x023A (0x000474) 0x1E00-0x0004 f:00017 d: 0 | A = A - 4 (0x0004)
0x023C (0x000478) 0x8406- f:00102 d: 6 | P = P + 6 (0x0242), A = 0
0x023D (0x00047A) 0x2114- f:00020 d: 276 | A = OR[276]
0x023E (0x00047C) 0x1E00-0x000A f:00017 d: 0 | A = A - 10 (0x000A)
0x0240 (0x000480) 0x8402- f:00102 d: 2 | P = P + 2 (0x0242), A = 0
0x0241 (0x000482) 0x703C- f:00070 d: 60 | P = P + 60 (0x027D)
0x0242 (0x000484) 0x2102- f:00020 d: 258 | A = OR[258]
0x0243 (0x000486) 0x1414- f:00012 d: 20 | A = A + 20 (0x0014)
0x0244 (0x000488) 0x2908- f:00024 d: 264 | OR[264] = A
0x0245 (0x00048A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0246 (0x00048C) 0x2915- f:00024 d: 277 | OR[277] = A
0x0247 (0x00048E) 0x2115- f:00020 d: 277 | A = OR[277]
0x0248 (0x000490) 0x8602- f:00103 d: 2 | P = P + 2 (0x024A), A # 0
0x0249 (0x000492) 0x7034- f:00070 d: 52 | P = P + 52 (0x027D)
0x024A (0x000494) 0x2102- f:00020 d: 258 | A = OR[258]
0x024B (0x000496) 0x1415- f:00012 d: 21 | A = A + 21 (0x0015)
0x024C (0x000498) 0x2908- f:00024 d: 264 | OR[264] = A
0x024D (0x00049A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x024E (0x00049C) 0x2916- f:00024 d: 278 | OR[278] = A
0x024F (0x00049E) 0x2116- f:00020 d: 278 | A = OR[278]
0x0250 (0x0004A0) 0x271B- f:00023 d: 283 | A = A - OR[283]
0x0251 (0x0004A2) 0x8002- f:00100 d: 2 | P = P + 2 (0x0253), C = 0
0x0252 (0x0004A4) 0x7023- f:00070 d: 35 | P = P + 35 (0x0275)
0x0253 (0x0004A6) 0x2102- f:00020 d: 258 | A = OR[258]
0x0254 (0x0004A8) 0x1420- f:00012 d: 32 | A = A + 32 (0x0020)
0x0255 (0x0004AA) 0x2917- f:00024 d: 279 | OR[279] = A
0x0256 (0x0004AC) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x0257 (0x0004AE) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x0258 (0x0004B0) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F)
0x0259 (0x0004B2) 0x5800- f:00054 d: 0 | B = A
0x025A (0x0004B4) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x025B (0x0004B6) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004)
0x025C (0x0004B8) 0x2517- f:00022 d: 279 | A = A + OR[279]
0x025D (0x0004BA) 0x290D- f:00024 d: 269 | OR[269] = A
0x025E (0x0004BC) 0x310D- f:00030 d: 269 | A = (OR[269])
0x025F (0x0004BE) 0x4800- f:00044 d: 0 | A = A > B
0x0260 (0x0004C0) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0261 (0x0004C2) 0x8602- f:00103 d: 2 | P = P + 2 (0x0263), A # 0
0x0262 (0x0004C4) 0x7005- f:00070 d: 5 | P = P + 5 (0x0267)
0x0263 (0x0004C6) 0x1800-0x7530 f:00014 d: 0 | A = 30000 (0x7530)
0x0265 (0x0004CA) 0x2916- f:00024 d: 278 | OR[278] = A
0x0266 (0x0004CC) 0x7007- f:00070 d: 7 | P = P + 7 (0x026D)
0x0267 (0x0004CE) 0x2102- f:00020 d: 258 | A = OR[258]
0x0268 (0x0004D0) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x0269 (0x0004D2) 0x2908- f:00024 d: 264 | OR[264] = A
0x026A (0x0004D4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x026B (0x0004D6) 0x2916- f:00024 d: 278 | OR[278] = A
0x026C (0x0004D8) 0x2D16- f:00026 d: 278 | OR[278] = OR[278] + 1
0x026D (0x0004DA) 0x2102- f:00020 d: 258 | A = OR[258]
0x026E (0x0004DC) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x026F (0x0004DE) 0x2908- f:00024 d: 264 | OR[264] = A
0x0270 (0x0004E0) 0x2116- f:00020 d: 278 | A = OR[278]
0x0271 (0x0004E2) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0272 (0x0004E4) 0x2115- f:00020 d: 277 | A = OR[277]
0x0273 (0x0004E6) 0x2916- f:00024 d: 278 | OR[278] = A
0x0274 (0x0004E8) 0x7004- f:00070 d: 4 | P = P + 4 (0x0278)
0x0275 (0x0004EA) 0x2116- f:00020 d: 278 | A = OR[278]
0x0276 (0x0004EC) 0x271B- f:00023 d: 283 | A = A - OR[283]
0x0277 (0x0004EE) 0x2916- f:00024 d: 278 | OR[278] = A
0x0278 (0x0004F0) 0x2102- f:00020 d: 258 | A = OR[258]
0x0279 (0x0004F2) 0x1415- f:00012 d: 21 | A = A + 21 (0x0015)
0x027A (0x0004F4) 0x2908- f:00024 d: 264 | OR[264] = A
0x027B (0x0004F6) 0x2116- f:00020 d: 278 | A = OR[278]
0x027C (0x0004F8) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x027D (0x0004FA) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x027E (0x0004FC) 0x2925- f:00024 d: 293 | OR[293] = A
0x027F (0x0004FE) 0x2113- f:00020 d: 275 | A = OR[275]
0x0280 (0x000500) 0x2926- f:00024 d: 294 | OR[294] = A
0x0281 (0x000502) 0x2114- f:00020 d: 276 | A = OR[276]
0x0282 (0x000504) 0x2927- f:00024 d: 295 | OR[295] = A
0x0283 (0x000506) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0284 (0x000508) 0x5800- f:00054 d: 0 | B = A
0x0285 (0x00050A) 0x1800-0x1B18 f:00014 d: 0 | A = 6936 (0x1B18)
0x0287 (0x00050E) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0288 (0x000510) 0x211A- f:00020 d: 282 | A = OR[282]
0x0289 (0x000512) 0x290D- f:00024 d: 269 | OR[269] = A
0x028A (0x000514) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x028B (0x000516) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x028C (0x000518) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x028D (0x00051A) 0x310D- f:00030 d: 269 | A = (OR[269])
0x028E (0x00051C) 0x8409- f:00102 d: 9 | P = P + 9 (0x0297), A = 0
0x028F (0x00051E) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0290 (0x000520) 0x2925- f:00024 d: 293 | OR[293] = A
0x0291 (0x000522) 0x210D- f:00020 d: 269 | A = OR[269]
0x0292 (0x000524) 0x2926- f:00024 d: 294 | OR[294] = A
0x0293 (0x000526) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0294 (0x000528) 0x5800- f:00054 d: 0 | B = A
0x0295 (0x00052A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0296 (0x00052C) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0297 (0x00052E) 0x7A03-0x0011 f:00075 d: 3 | P = OR[3]+17 (0x0011)
0x0299 (0x000532) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F ****
0x029A (0x000534) 0x474F- f:00043 d: 335 | C = 1, IOB = BZ | **** non-standard encoding with D:0x014F ****
0x029B (0x000536) 0x4646- f:00043 d: 70 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0046 ****
0x029C (0x000538) 0x2049- f:00020 d: 73 | A = OR[73]
0x029D (0x00053A) 0x4E49- f:00047 d: 73 | A = A << B | **** non-standard encoding with D:0x0049 ****
0x029E (0x00053C) 0x5449- f:00052 d: 73 | A = A + B | **** non-standard encoding with D:0x0049 ****
0x029F (0x00053E) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN
0x02A0 (0x000540) 0x4544- f:00042 d: 324 | C = 1, IOB = DN | **** non-standard encoding with D:0x0144 ****
0x02A1 (0x000542) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A2 (0x000544) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A3 (0x000546) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A4 (0x000548) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A5 (0x00054A) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A6 (0x00054C) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A7 (0x00054E) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A8 (0x000550) 0x2020- f:00020 d: 32 | A = OR[32]
0x02A9 (0x000552) 0x2113- f:00020 d: 275 | A = OR[275]
0x02AA (0x000554) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x02AB (0x000556) 0x290D- f:00024 d: 269 | OR[269] = A
0x02AC (0x000558) 0x2114- f:00020 d: 276 | A = OR[276]
0x02AD (0x00055A) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x02AE (0x00055C) 0x251C- f:00022 d: 284 | A = A + OR[284]
0x02AF (0x00055E) 0x290E- f:00024 d: 270 | OR[270] = A
0x02B0 (0x000560) 0x2114- f:00020 d: 276 | A = OR[276]
0x02B1 (0x000562) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x02B2 (0x000564) 0x2908- f:00024 d: 264 | OR[264] = A
0x02B3 (0x000566) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02B4 (0x000568) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x02B5 (0x00056A) 0x8607- f:00103 d: 7 | P = P + 7 (0x02BC), A # 0
0x02B6 (0x00056C) 0x310E- f:00030 d: 270 | A = (OR[270])
0x02B7 (0x00056E) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x02B8 (0x000570) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x02B9 (0x000572) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x02BA (0x000574) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x02BB (0x000576) 0x7006- f:00070 d: 6 | P = P + 6 (0x02C1)
0x02BC (0x000578) 0x310E- f:00030 d: 270 | A = (OR[270])
0x02BD (0x00057A) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x02BF (0x00057E) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x02C0 (0x000580) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x02C1 (0x000582) 0x0200- f:00001 d: 0 | EXIT
0x02C2 (0x000584) 0x0000- f:00000 d: 0 | PASS
0x02C3 (0x000586) 0x0000- f:00000 d: 0 | PASS
| 80.603318 | 127 | 0.462706 |
7c72207d145b2c4c3e04f50c3480e6b90aab557b | 2,410 | asm | Assembly | computer engeneering/ARQ1/T1/soma.asm | kehwhyn/PUC-RS | 6bead86bb738df60da1491030f9d6b511be0fcb5 | [
"MIT"
] | null | null | null | computer engeneering/ARQ1/T1/soma.asm | kehwhyn/PUC-RS | 6bead86bb738df60da1491030f9d6b511be0fcb5 | [
"MIT"
] | null | null | null | computer engeneering/ARQ1/T1/soma.asm | kehwhyn/PUC-RS | 6bead86bb738df60da1491030f9d6b511be0fcb5 | [
"MIT"
] | null | null | null | ###############################################################################################
# Exemplo de programa em linguagem de montagem do MIPS : Manipulando vetores
# Autor: Ney Calazans
# Fun��o: Este programa soma o valor de uma constante (const) a cada elemento do vetor array
###############################################################################################
# PUS IOS NOPS AONDE EU ACHEI DEPENDENCIAS
.text # Diretiva para o montador - adiciona o que vem abaixo
# � mem�ria de programa do processador
.globl main # Declara o r�tulo main Como sendo global
# este � o ponto a partir de onde se inicia a execu��o
main:
la $t0, array # o registrador $t0 cont�m o endere�o do vetor
la $t1, size # obt�m o endere�o da posi��o da mem�ria de dados onde se guarda
nop
nop
nop # o tamanho do vetor
lw $t1, 0($t1) # o registrador $t1 cont�m o tamanho do vetor
la $t2, const # obt�m o endere�o da constante const
nop
nop
nop
lw $t2, 0($t2) # o registrador $t2 cont�m a constante a somar
loop: blez $t1, end # se o tamanho chega a 0, fim do processamento
lw $t3, 0($t0) # obt�m um elemento do vetor
nop
nop
nop
addu $t3, $t3, $t2 # soma a constante
nop
nop
nop
sw $t3, 0($t0) # atualiza o vetor
addiu $t0, $t0 ,4 # atualiza o apontador do vetor
# lembrar que 1 palavra no MIPS ocupa 4 endere�os consecutivos de mem�ria
addiu $t1,$t1,-1 # decrementa o contador de tamanho do vetor
j loop # continua a execu��o
end: jr $ra # Agora volta para o programa monitor
.data # Diretiva para o montador - adiciona o que vem abaixo
# � mem�ria de dados do processador
array: .word 0x12 0xff 0x3 0x14 0x878 0x31 0x62 0x10 0x5 0x16 0x20 # o vetor
# A diretiva ,.word carrega a lista de inteiros em posi��es successivas
# da mem�ria de dados
size: .word 11 # Vari�vel que armazena o tamanho do vetor
const: .word 0x100 # Constante a somar a cada elemento do vetor
| 49.183673 | 103 | 0.504564 |
2342a10ad7f8afcf5029f6b13703079f6bcc23ca | 295 | asm | Assembly | src/firmware-tests/Platform/Smps/EnableDisable/EnableDisableSmpsHighPowerModeShiftOutTest.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | 1 | 2019-12-12T09:07:08.000Z | 2019-12-12T09:07:08.000Z | src/firmware-tests/Platform/Smps/EnableDisable/EnableDisableSmpsHighPowerModeShiftOutTest.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | src/firmware-tests/Platform/Smps/EnableDisable/EnableDisableSmpsHighPowerModeShiftOutTest.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | #include "Platform.inc"
#include "FarCalls.inc"
#include "Smps.inc"
radix decimal
EnableDisableSmpsHighPowerModeShiftOutTest code
global doEnableCall
global doDisableCall
doEnableCall:
fcall enableSmpsHighPowerMode
return
doDisableCall:
fcall disableSmpsHighPowerMode
return
end
| 14.75 | 47 | 0.820339 |
ba4f3ae7b74919548331866d99f91f66d02453b0 | 2,748 | asm | Assembly | lib/target/pasopia7/classic/pasopia7_crt0.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | lib/target/pasopia7/classic/pasopia7_crt0.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | lib/target/pasopia7/classic/pasopia7_crt0.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ;
; Startup for Pasopia 7
MODULE pasopia7_crt0
;--------
; Include zcc_opt.def to find out some info
;--------
defc crt0 = 1
INCLUDE "zcc_opt.def"
;--------
; Some scope definitions
;--------
EXTERN _main ;main() is always external to crt0 code
EXTERN asm_im1_handler
EXTERN asm_nmi_handler
PUBLIC cleanup ;jp'd to by exit()
PUBLIC l_dcal ;jp(hl)
defc TAR__clib_exit_stack_size = 32
defc TAR__register_sp = 65280
defc TAR__fputc_cons_generic = 1
defc CRT_KEY_DEL = 12
defc CRT_ORG_CODE = 0
defc CONSOLE_COLUMNS = 40
defc CONSOLE_ROWS = 25
defc __CPU_CLOCK = 4000000
defc CLIB_FGETC_CONS_DELAY = 150
defc GRAPHICS_CHAR_SET = 135
defc GRAPHICS_CHAR_UNSET = 32
PUBLIC GRAPHICS_CHAR_SET
PUBLIC GRAPHICS_CHAR_UNSET
INCLUDE "crt/classic/crt_rules.inc"
org CRT_ORG_CODE
if (ASMPC<>$0000)
defs CODE_ALIGNMENT_ERROR
endif
jp program
defs $0008-ASMPC
if (ASMPC<>$0008)
defs CODE_ALIGNMENT_ERROR
endif
jp restart08
defs $0010-ASMPC
if (ASMPC<>$0010)
defs CODE_ALIGNMENT_ERROR
endif
jp restart10
defs $0018-ASMPC
if (ASMPC<>$0018)
defs CODE_ALIGNMENT_ERROR
endif
jp restart18
defs $0020-ASMPC
if (ASMPC<>$0020)
defs CODE_ALIGNMENT_ERROR
endif
jp restart20
defs $0028-ASMPC
if (ASMPC<>$0028)
defs CODE_ALIGNMENT_ERROR
endif
jp restart28
defs $0030-ASMPC
if (ASMPC<>$0030)
defs CODE_ALIGNMENT_ERROR
endif
jp restart30
defs $0038-ASMPC
if (ASMPC<>$0038)
defs CODE_ALIGNMENT_ERROR
endif
jp asm_im1_handler
; NMI routine
defs $0066-ASMPC
if (ASMPC<>$0066)
defs CODE_ALIGNMENT_ERROR
endif
jp asm_nmi_handler
restart08:
restart10:
restart18:
restart20:
restart28:
restart30:
ret
program:
di
INCLUDE "crt/classic/crt_init_sp.asm"
INCLUDE "crt/classic/crt_init_atexit.asm"
call crt0_init_bss
ld (exitsp),sp
ld a,2
ld (__pasopia_page),a
im 1
ei
; Optional definition for auto MALLOC init
; it assumes we have free space between the end of
; the compiled program and the stack pointer
IF DEFINED_USING_amalloc
INCLUDE "crt/classic/crt_init_amalloc.asm"
ENDIF
call _main
cleanup:
jp cleanup
l_dcal: jp (hl) ;Used for function pointer calls
INCLUDE "crt/classic/crt_runtime_selection.asm"
INCLUDE "crt/classic/crt_section.asm"
SECTION bss_crt
PUBLIC __pasopia_page
__pasopia_page: defb 0
INCLUDE "target/pasopia7/classic/bootstrap.asm"
| 18.951724 | 73 | 0.639374 |
a386c15d9fe927adc993a6ef33bb3c74b9d2013a | 437 | asm | Assembly | oeis/165/A165663.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/165/A165663.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/165/A165663.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A165663: Decimal expansion of 3 + sqrt(3).
; Submitted by Jon Maiga
; 4,7,3,2,0,5,0,8,0,7,5,6,8,8,7,7,2,9,3,5,2,7,4,4,6,3,4,1,5,0,5,8,7,2,3,6,6,9,4,2,8,0,5,2,5,3,8,1,0,3,8,0,6,2,8,0,5,5,8,0,6,9,7,9,4,5,1,9,3,3,0,1,6,9,0,8,8,0,0,0,3,7,0,8,1,1,4,6,1,8,6,7,5,7,2,4,8,5,7,5
mov $1,5
mov $2,1
mov $3,$0
mul $3,4
lpb $3
add $1,$2
add $1,$2
add $2,$1
sub $3,1
lpe
sub $1,1
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 19.863636 | 201 | 0.535469 |
a3f09667c4b63830e83fa272a2af5768720c98fa | 2,378 | asm | Assembly | libsrc/video/tms9918/graphics/pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/video/tms9918/graphics/pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/video/tms9918/graphics/pixladdr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z |
MODULE __tms9918_pixeladdress
SECTION code_clib
PUBLIC __tms9918_pixeladdress
PUBLIC __tms9918_pix_return
EXTERN __tms9918_attribute
EXTERN l_tms9918_disable_interrupts
EXTERN l_tms9918_enable_interrupts
INCLUDE "graphics/grafix.inc"
INCLUDE "video/tms9918/vdp.inc"
;
; $Id: pixladdr.asm $
;
.__tms9918_pixeladdress
ld c,h ; X
ld b,l ; Y
ld a,h ; X
and @11111000
ld l,a
ld a,b ; Y
rra
rra
rra
and @00011111
ld h,a ; + ((Y & @11111000) << 5)
ld a,b ; Y
and 7
ld e,a
ld d,0
add hl,de ; + Y&7
;-------
call l_tms9918_disable_interrupts
IF VDP_CMD < 0
ld a,l
ld (-VDP_CMD),a
ld a,h ;4
and @00111111 ;7
ld (-VDP_CMD),a
ld a,(-VDP_DATAIN)
ELSE
push bc
ld bc,VDP_CMD
out (c), l ; LSB of video memory ptr
ld a,h ; MSB of video mem ptr
and @00111111 ; masked with "read command" bits
out (c), a
ld bc,VDP_DATAIN
in a,(c)
pop bc
ENDIF
ex de,hl ;de = VDP address
ld hl,__tms9918_pixelbyte
ld (hl),a
call l_tms9918_enable_interrupts
;-------
ld a,c
and @00000111
xor @00000111
ret
.__tms9918_pix_return
ld (hl),a ; hl points to "__tms9918_pixelbyte"
call l_tms9918_disable_interrupts
IF VDP_CMD < 0
ld a,e
ld (-VDP_CMD),a
ld a,d
and @00111111
or @01000000
ld (-VDP_CMD),a
ld a,(__tms9918_pixelbyte)
ld (-VDP_DATA),a
; And support colour as well
ld a,e
ld (-VDP_CMD),a
ld a,d
add $20 ;Move to bitmap to colour
and @00111111
or @01000000
ld (-VDP_CMD),a
ld a,(__tms9918_attribute)
ld (-VDP_DATA),a
ELSE
ld bc,VDP_CMD
out (c),e
ld a,d ; MSB of video mem ptr
and @00111111 ; masked with "write command" bits
or @01000000
out (c),a
ld a,(__tms9918_pixelbyte) ; Can it be optimized ? what about VDP timing ?
ld bc,VDP_DATA
out (c),a
ld bc,VDP_CMD
out (c),e
ld a,d ; MSB of video mem ptr
add $20
and @00111111 ; masked with "write command" bits
or @01000000
out (c),a
ld a,(__tms9918_attribute)
ld bc,VDP_DATA
out (c),a
ENDIF
call l_tms9918_enable_interrupts
pop bc
ret
SECTION bss_clib
PUBLIC __tms9918_pixelbyte
.__tms9918_pixelbyte
defb 0
| 18.873016 | 87 | 0.595879 |
eb29d4600865488d337d543e24cf9cf917276b71 | 2,841 | asm | Assembly | source/games/roadrunner.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | source/games/roadrunner.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | source/games/roadrunner.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | ; **********************************************************************************************************
; **********************************************************************************************************
;
; Road Runner
;
; All in one page !
;
; **********************************************************************************************************
; **********************************************************************************************************
page
RRLastObject = 10 ; Road Objects are 0-10.
RRLastKillObject = 6 ; Fatal Objects are 0-6 these flash.
RoadRunner:
jsrp ClearScreen ; Get rid of everything
lbi 0,Player ; Player on far right central
stii 7
lbi 1,Player
stii 8+2
;
; Main loop
;
RRMainLoop:
jsrp Update ; Update display
jsrp MoveVPlayer ; Player moves vertically
nop
;
; Make all the objects flash. Swap with page 2.
;
RRSwapOver:
lbi 0,RRLastKillObject
RRSwapLoop:
ld 2
x 2
xds 0
jp RRSwapLoop
lbi Timer4 ; Check timer
clra
ske
jp RRMainLoop
jp RRMoveAll
jp RRMainLoop
;
; Work through all the objects
;
RRMoveAll:
lbi 0,RRLastObject
RRMoveObjects:
ld 2 ; Get X and switch to 2
add ; Add it. At least one of these is zero.
aisc 15 ; Skips if non-zero, e.g. in use.
jp RRCreateObject
ld 0 ; Read 2.obj. ID which as X.
aisc 15 ; Skip if this is non-zero.
ld 2 ; Switch to 0.x which must be non-zero.
ld 0 ; Read and bump X, it cannot overflow
aisc 1
x 0
clra ; A = 0
skmbz 3 ; skip if bit 3 is clear, not reached edge.
x 0 ; Kills it.
clra ; Back to page 2.
aisc 2
xabr
RRNext:
ld 0 ; Fetch obj.2
xds 2 ; Loop back, switching back to page 0
jp RRMoveObjects
lbi 0,Player ; Check for collision
jsrp CheckCollision
jmp RRMainLoop
aisc 15-RRLastKillObject ; If 0,1,2 are fatals, this is 13, 0,1,2 don't skip.
jmp ShowHolo2LifeLost ; show holo 2, life lost (can save a byte here if needed)
jsrp BumpCounter
jsrp SFXHighShortBeep
jp RRMainLoop ; and loop round again
;
; Object not in use.
;
RRCreateObject:
jsr Random ; Get random value
aisc 6 ; Will skip with value 0-5 if creating this time
jp RRNext
;
; Create new object B = 2,X, A = Y position.
;
x 2 ; Save Y in 2.obj, go to 0.obj
clra
aisc 1
x 2 ; Set 0.obj to 1, switch back to 2.obj
clra
x 3 ; Clear that, switch to 1.obj and retrieve Y
x 3 ; Save in obj.1 and switch back to page 2
jp RRNext
| 27.317308 | 108 | 0.475185 |
6168ad10aa82f1d30c9274dd76373d7a36aa4206 | 688 | asm | Assembly | laturi/decompressor32.asm | temisu/BR4096 | 0e2cac8b468c853eb78ba773f082610a75405ff4 | [
"BSD-2-Clause"
] | 8 | 2018-09-15T16:49:53.000Z | 2021-11-17T03:16:19.000Z | laturi/decompressor32.asm | temisu/BR4096 | 0e2cac8b468c853eb78ba773f082610a75405ff4 | [
"BSD-2-Clause"
] | null | null | null | laturi/decompressor32.asm | temisu/BR4096 | 0e2cac8b468c853eb78ba773f082610a75405ff4 | [
"BSD-2-Clause"
] | 1 | 2019-09-22T13:52:19.000Z | 2019-09-22T13:52:19.000Z | ; Copyright (C) Teemu Suutari
; x86
bits 32
section .text
global __ONEKPAQ__CodeStart
__ONEKPAQ__CodeStart:
sub esp,byte 12
%ifdef COMPRESSION_1 COMPRESSION_2 COMPRESSION_3 COMPRESSION_4
mov ebx,__ONEKPAQ_source
mov edi,__ONEKPAQ_destination
push edi
%ifdef COMPRESSION_1
%define ONEKPAQ_DECOMPRESSOR_MODE 1
%elifdef COMPRESSION_2
%define ONEKPAQ_DECOMPRESSOR_MODE 2
%elifdef COMPRESSION_3
%define ONEKPAQ_DECOMPRESSOR_MODE 3
%elifdef COMPRESSION_4
%define ONEKPAQ_DECOMPRESSOR_MODE 4
%endif
%include "onekpaq/onekpaq_decompressor32.asm"
global __ONEKPAQ_shift
__ONEKPAQ_shift: equ onekpaq_decompressor.shift
ret
%endif
extern __ONEKPAQ_source
extern __ONEKPAQ_destination
| 18.594595 | 62 | 0.848837 |
24ef485b7ecdf752ab6806d623f80f66169e2d77 | 13,347 | asm | Assembly | Cameras/Hitman2016/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 623 | 2016-12-02T16:01:05.000Z | 2022-03-29T19:59:10.000Z | Cameras/Hitman2016/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 113 | 2016-12-10T17:34:24.000Z | 2022-02-06T21:59:42.000Z | Cameras/Hitman2016/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 232 | 2016-12-17T06:32:08.000Z | 2022-03-27T16:51:29.000Z | ;////////////////////////////////////////////////////////////////////////////////////////////////////////
;// Part of Injectable Generic Camera System
;// Copyright(c) 2017, Frans Bouma
;// All rights reserved.
;// https://github.com/FransBouma/InjectableGenericCameraSystem
;//
;// 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.
;//
;// 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 HOLDER 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.
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;---------------------------------------------------------------
; Game specific asm file to intercept execution flow to obtain addresses, prevent writes etc.
;---------------------------------------------------------------
;---------------------------------------------------------------
; Public definitions so the linker knows which names are present in this file
PUBLIC cameraAddressInterceptor
PUBLIC cameraWriteInterceptor1
PUBLIC cameraWriteInterceptor2
PUBLIC cameraWriteInterceptor3
PUBLIC cameraReadInterceptor1
PUBLIC gamespeedAddressInterceptor
PUBLIC fovWriteInterceptor
;---------------------------------------------------------------
;---------------------------------------------------------------
; Externs which are used and set by the system. Read / write these
; values in asm to communicate with the system
EXTERN g_cameraStructAddress: qword
EXTERN g_gamespeedStructAddress: qword
EXTERN g_cameraEnabled: BYTE
EXTERN g_aimFrozen: BYTE
;---------------------------------------------------------------
;---------------------------------------------------------------
; Own externs, defined in InterceptorHelper.cpp
EXTERN _cameraStructInterceptionContinue: qword
EXTERN _cameraWriteInterceptionContinue1: qword
EXTERN _cameraWriteInterceptionContinue2: qword
EXTERN _cameraWriteInterceptionContinue3: qword
EXTERN _cameraReadInterceptionContinue1: qword
EXTERN _gamespeedInterceptionContinue: qword
EXTERN _fovWriteInterceptionContinue: qword
; Scratch pad
;hitman.exe+E609DA - 0F28 CE - movaps xmm1,xmm6
;hitman.exe+E609DD - 8B 0D 19EFD300 - mov ecx,[hitman.exe+1B9F8FC]
;hitman.exe+E609E3 - F3 0F10 05 9D6C0C02 - movss xmm0,[hitman.exe+2F27688] << supersampling read here
;hitman.exe+E609EB - 85 C9 - test ecx,ecx
;hitman.exe+E609ED - 74 08 - je hitman.exe+E609F7
;
;---------------------------------------------------------------
.code
cameraAddressInterceptor PROC
;hitman.exe+43B9E24 - F3 0F10 44 24 50 - movss xmm0,[rsp+50]
;hitman.exe+43B9E2A - F3 0F11 83 90000000 - movss [rbx+00000090],xmm0 <<<<<<<< HERE
;hitman.exe+43B9E32 - F3 0F10 44 24 58 - movss xmm0,[rsp+58]
;hitman.exe+43B9E38 - F3 0F11 83 98000000 - movss [rbx+00000098],xmm0 <<<<<<<< CONTINUE
;hitman.exe+43B9E40 - F3 0F11 8B 94000000 - movss [rbx+00000094],xmm1
;
; Game jmps to this location due to the hook set in C function SetCameraStructInterceptorHook
cmp BYTE ptr [rbx+038h], 0 ; check if this is the camera in rbx. For this game: Check with a 0-check. Could also check +20 or +24 for 0 if the above fails
jne originalCode
mov [g_cameraStructAddress], rbx ; intercept address of camera struct
cmp BYTE ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
je exit ; our own camera is enabled, just skip the writes
originalCode:
movss dword ptr [rbx+090h], xmm0 ; original statement
exit:
movss xmm0, dword ptr [rsp+058h] ; original statement
jmp qword ptr [_cameraStructInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraAddressInterceptor ENDP
gamespeedAddressInterceptor PROC
;hitman.exe+43BCC87 - 48 C1 F8 14 - sar rax,14 { 20 }
;hitman.exe+43BCC8B - 48 89 43 28 - mov [rbx+28],rax <<< HERE
;hitman.exe+43BCC8F - 48 8B 4B 18 - mov rcx,[rbx+18]
;hitman.exe+43BCC93 - 48 89 4B 20 - mov [rbx+20],rcx
;hitman.exe+43BCC97 - 48 01 43 18 - add [rbx+18],rax
;hitman.exe+43BCC9B - EB 3B - jmp hitman.exe+43BCCD8 <<< CONTINUE. JMP offset can differ per build.
mov [g_gamespeedStructAddress], rbx
mov [rbx+028h],rax
mov rcx,[rbx+018h]
mov [rbx+020h],rcx
add [rbx+018h],rax
jmp qword ptr [_gamespeedInterceptionContinue]
gamespeedAddressInterceptor ENDP
;-------------------------------------------------------------------
; Camera values write interceptions. For each block of statements in the game's exe which write to the camera values, we intercept them and execute them if our
; own camera is disabled, otherwise we skip them. Each block checks whether the current struct pointer is the camera struct. If it's not the camera struct, it will
; execute the code regardless of whether our camera is enabled.
cameraWriteInterceptor1 PROC
;hitman.exe+43B9E14 - F3 0F10 4C 24 54 - movss xmm1,[rsp+54]
;hitman.exe+43B9E1A - 0F28 00 - movaps xmm0,[rax] <<<< HERE
;hitman.exe+43B9E1D - 0F11 83 80000000 - movups [rbx+00000080],xmm0
;hitman.exe+43B9E24 - F3 0F10 44 24 50 - movss xmm0,[rsp+50]
;hitman.exe+43B9E2A - F3 0F11 83 90000000 - movss [rbx+00000090],xmm0 <<<< CONTINUE
; Game jmps to this location due to the hook set in C function SetMatrixWriteInterceptorHooks.
; first check if this is really a call for the camera. Other logic will use this code too. Check rbx with our known cameraStruct address to be sure
cmp qword ptr rbx, [g_cameraStructAddress]
jne originalCode
cmp BYTE ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
je exit ; our own camera is enabled, just skip the writes
originalCode:
movaps xmm0, xmmword ptr [rax] ; original statement
movups xmmword ptr [rbx+080h],xmm0 ; original statement
exit:
movss xmm0, dword ptr [rsp+050h] ; original statement
jmp qword ptr [_cameraWriteInterceptionContinue1] ; jmp back into the original game code which is the location after the original statements above.
cameraWriteInterceptor1 ENDP
cameraWriteInterceptor2 PROC
;hitman.exe+43B9E32 - F3 0F10 44 24 58 - movss xmm0,[rsp+58]
;hitman.exe+43B9E38 - F3 0F11 83 98000000 - movss [rbx+00000098],xmm0 <<<<< HERE
;hitman.exe+43B9E40 - F3 0F11 8B 94000000 - movss [rbx+00000094],xmm1
;hitman.exe+43B9E48 - EB 44 - jmp hitman.exe+43B9E8E <<<<< CONTINUE
; Game jmps to this location due to the hook set in C function SetMatrixWriteInterceptorHooks.
; first check if this is really a call for the camera. Other logic will use this code too. Check rbx with our known cameraStruct address to be sure
cmp qword ptr rbx, [g_cameraStructAddress]
jne originalCode
cmp BYTE ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
je exit ; our own camera is enabled, just skip the writes
originalCode:
movss dword ptr [rbx+98h],xmm0 ; original statement
movss dword ptr [rbx+94h],xmm1 ; original statement
exit:
jmp qword ptr [_cameraWriteInterceptionContinue2] ; jmp back into the original game code which is the location after the original statements above.
cameraWriteInterceptor2 ENDP
cameraWriteInterceptor3 PROC
;hitman.exe+43B9E5D - 0F28 00 - movaps xmm0,[rax]
;hitman.exe+43B9E60 - 0F11 83 80000000 - movups [rbx+00000080],xmm0 <<<< HERE
;hitman.exe+43B9E67 - 0F28 4F 30 - movaps xmm1,[rdi+30]
;hitman.exe+43B9E6B - 0F28 C1 - movaps xmm0,xmm1
;hitman.exe+43B9E6E - F3 0F11 8B 90000000 - movss [rbx+00000090],xmm1
;hitman.exe+43B9E76 - 0FC6 C1 55 - shufps xmm0,xmm1,55 { 85 }
;hitman.exe+43B9E7A - 0FC6 C9 AA - shufps xmm1,xmm1,-56 { 170 }
;hitman.exe+43B9E7E - F3 0F11 8B 98000000 - movss [rbx+00000098],xmm1
;hitman.exe+43B9E86 - F3 0F11 83 94000000 - movss [rbx+00000094],xmm0
;hitman.exe+43B9E8E - 48 8B 03 - mov rax,[rbx] <<<< CONTINUE
; Game jmps to this location due to the hook set in C function SetMatrixWriteInterceptorHooks.
; first check if this is really a call for the camera. Other logic will use this code too. Check rbx with our known cameraStruct address to be sure
cmp qword ptr rbx, [g_cameraStructAddress]
jne originalCode
cmp BYTE ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
je exit ; our own camera is enabled, just skip the writes
originalCode:
movups xmmword ptr [rbx+80h],xmm0 ; original statement
movaps xmm1,xmmword ptr [rdi+30h] ; original statement
movaps xmm0,xmm1 ; original statement
movss dword ptr [rbx+90h],xmm1 ; original statement
shufps xmm0,xmm1,55h ; original statement
shufps xmm1,xmm1,0AAh ; original statement
movss dword ptr [rbx+98h],xmm1 ; original statement
movss dword ptr [rbx+94h],xmm0 ; original statement
exit:
jmp qword ptr [_cameraWriteInterceptionContinue3] ; jmp back into the original game code which is the location after the original statements above.
cameraWriteInterceptor3 ENDP
cameraReadInterceptor1 PROC
; v1.13.2
;0000000140BDE4C0 | 40 53 | push rbx << INTERCEPT HERE
;0000000140BDE4C2 | 48 81 EC 80 00 00 00 | sub rsp,80
;0000000140BDE4C9 | F6 81 AE 00 00 00 02 | test BYTE ptr ds:[rcx+AE],2
;0000000140BDE4D0 | 48 8B D9 | mov rbx,rcx << CONTINUE
;0000000140BDE4D3 | 0F 84 53 02 00 00 | je hitman_dump.140BDE72C
;0000000140BDE4D9 | 48 8B 41 18 | mov rax,qword ptr ds:[rcx+18]
;0000000140BDE4DD | F3 0F 10 81 98 00 00 00 | movss xmm0,dword ptr ds:[rcx+98]
;0000000140BDE4E5 | 0F 29 7C 24 60 | movaps xmmword ptr ss:[rsp+60],xmm7
;0000000140BDE4EA | F3 0F 7E B9 90 00 00 00 | movq xmm7,qword ptr ds:[rcx+90]
;0000000140BDE4F2 | 44 0F 29 44 24 50 | movaps xmmword ptr ss:[rsp+50],xmm8
;0000000140BDE4F8 | 0F C6 F8 04 | shufps xmm7,xmm0,4
;0000000140BDE4FC | 44 0F 10 81 80 00 00 00 | movups xmm8,xmmword ptr ds:[rcx+80]
;0000000140BDE504 | 48 85 C0 | test rax,rax
cmp BYTE ptr [g_cameraEnabled], 1
jne originalCode
cmp BYTE ptr [g_aimFrozen], 1
jne originalCode
; aim is frozen and camera is enabled. We now issue a 'ret', which means it will return to the caller of the original code as we jmp-ed to this location
; from there. This means we won't continue in the original code.
ret
originalCode:
push rbx
sub rsp, 00000080h
test BYTE ptr [rcx+000000AEh],02h
exit:
jmp qword ptr [_cameraReadInterceptionContinue1] ; jmp back into the original game code which is the location after the original statements above.
cameraReadInterceptor1 ENDP
fovWriteInterceptor PROC
; FOV write: (1.13.2)
; hitman.exe+398799 - 0F28 C1 - movaps xmm0,xmm1
; hitman.exe+39879C - 48 8B 89 E8060000 - mov rcx,[rcx+000006E8]
; hitman.exe+3987A3 - 48 85 C9 - test rcx,rcx
; hitman.exe+3987A6 - 74 05 - je hitman.exe+3987AD
; hitman.exe+3987A8 - E8 A3C0FEFF - call hitman.exe+384850
; hitman.exe+3987AD - 0F28 C8 - movaps xmm1,xmm0
; hitman.exe+3987B0 - F3 0F11 83 00070000 - movss [rbx+00000700],xmm0 << INTERCEPT HERE << FOV WRITE (Degrees. Default is 40)
; hitman.exe+3987B8 - 48 8B CB - mov rcx,rbx
; hitman.exe+3987BB - 48 83 C4 20 - add rsp,20 { 32 }
; hitman.exe+3987BF - 5B - pop rbx << CONTINUE HERE
cmp BYTE ptr [g_cameraEnabled], 1
je exit
originalCode:
movss dword ptr [rbx+00000700h],xmm0
exit:
mov rcx,rbx
add rsp,20h
jmp qword ptr [_fovWriteInterceptionContinue] ; jmp back into the original game code which is the location after the original statements above.
fovWriteInterceptor ENDP
END | 56.795745 | 163 | 0.669888 |
cba3631827284d624e31d5a5b28583ddf007771d | 1,110 | asm | Assembly | 2018-11/retardedAO/AO-TP-EXOs/TP-EXO5.asm | djalilhebal/shit | 42b65d37c1af93780b345403cdad7a9cc7d6a5cf | [
"WTFPL"
] | 3 | 2017-12-05T17:00:30.000Z | 2019-01-24T23:02:07.000Z | 2018-11/retardedAO/AO-TP-EXOs/TP-EXO5.asm | djalilhebal/shit | 42b65d37c1af93780b345403cdad7a9cc7d6a5cf | [
"WTFPL"
] | null | null | null | 2018-11/retardedAO/AO-TP-EXOs/TP-EXO5.asm | djalilhebal/shit | 42b65d37c1af93780b345403cdad7a9cc7d6a5cf | [
"WTFPL"
] | null | null | null | ; TP-EXO5: Reads user's name and prints "Bonjour, NAME." on the next line.
pile segment para stack 'pile'
db 256 dup(0)
pile ends
data segment
buf db 25+1, ?, 25+1 dup(?) ; maxLength+1 + actualLength + data+1
msg db 'Entrez votre nom: $'
bjr db 13, 10, 'Bonjour, $'
data ends
code segment
main proc far
assume cs:code, ds:data, ss:pile
mov ax, data
mov ds, ax
mov ah, 09h ; print string function
mov dx, offset msg
int 21h
mov ah, 0Ah ; read buffer function
mov dx, offset buf
int 21h
mov bx, 0
mov bl, buf[1] ; "Data Length"
mov buf[bx+2], '$'
mov ah, 09h ; print string function
mov dx, offset bjr
int 21h
mov ah, 09h ; print string function
mov dx, offset buf + 2
int 21h
mov ah, 02h ; print character function
mov dl, '.'
int 21h
mov ah, 4Ch ; exit to MS-DOS function
mov al, 0 ; exit code success
int 21h
main endp
code ends
end main
| 23.125 | 75 | 0.532432 |
6d4c52cc66af234972a895039e64b1dff6ed315d | 51,957 | asm | Assembly | ls.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null | ls.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null | ls.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
close(fd);
}
int
main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 56 push %esi
4: 53 push %ebx
5: 83 e4 f0 and $0xfffffff0,%esp
8: 83 ec 10 sub $0x10,%esp
b: 8b 45 08 mov 0x8(%ebp),%eax
e: 8b 55 0c mov 0xc(%ebp),%edx
int i;
if(argc < 2){
11: 83 f8 01 cmp $0x1,%eax
14: 7e 27 jle 3d <main+0x3d>
16: 8d 5a 04 lea 0x4(%edx),%ebx
19: 8d 34 82 lea (%edx,%eax,4),%esi
1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ls(".");
exit(0);
}
for(i=1; i<argc; i++)
ls(argv[i]);
20: 8b 03 mov (%ebx),%eax
22: 83 c3 04 add $0x4,%ebx
25: 89 04 24 mov %eax,(%esp)
28: e8 d3 00 00 00 call 100 <ls>
for(i=1; i<argc; i++)
2d: 39 f3 cmp %esi,%ebx
2f: 75 ef jne 20 <main+0x20>
exit(0);
31: c7 04 24 00 00 00 00 movl $0x0,(%esp)
38: e8 9b 05 00 00 call 5d8 <exit>
ls(".");
3d: c7 04 24 00 0b 00 00 movl $0xb00,(%esp)
44: e8 b7 00 00 00 call 100 <ls>
exit(0);
49: c7 04 24 00 00 00 00 movl $0x0,(%esp)
50: e8 83 05 00 00 call 5d8 <exit>
55: 66 90 xchg %ax,%ax
57: 66 90 xchg %ax,%ax
59: 66 90 xchg %ax,%ax
5b: 66 90 xchg %ax,%ax
5d: 66 90 xchg %ax,%ax
5f: 90 nop
00000060 <fmtname>:
{
60: 55 push %ebp
61: 89 e5 mov %esp,%ebp
63: 56 push %esi
64: 53 push %ebx
65: 83 ec 10 sub $0x10,%esp
68: 8b 5d 08 mov 0x8(%ebp),%ebx
for(p=path+strlen(path); p >= path && *p != '/'; p--)
6b: 89 1c 24 mov %ebx,(%esp)
6e: e8 9d 03 00 00 call 410 <strlen>
73: 01 d8 add %ebx,%eax
75: 73 0e jae 85 <fmtname+0x25>
77: eb 11 jmp 8a <fmtname+0x2a>
79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80: 48 dec %eax
81: 39 c3 cmp %eax,%ebx
83: 77 05 ja 8a <fmtname+0x2a>
85: 80 38 2f cmpb $0x2f,(%eax)
88: 75 f6 jne 80 <fmtname+0x20>
p++;
8a: 8d 58 01 lea 0x1(%eax),%ebx
if(strlen(p) >= DIRSIZ)
8d: 89 1c 24 mov %ebx,(%esp)
90: e8 7b 03 00 00 call 410 <strlen>
95: 83 f8 0d cmp $0xd,%eax
98: 77 54 ja ee <fmtname+0x8e>
memmove(buf, p, strlen(p));
9a: 89 1c 24 mov %ebx,(%esp)
9d: e8 6e 03 00 00 call 410 <strlen>
a2: 89 5c 24 04 mov %ebx,0x4(%esp)
a6: c7 04 24 38 0e 00 00 movl $0xe38,(%esp)
ad: 89 44 24 08 mov %eax,0x8(%esp)
b1: e8 ea 04 00 00 call 5a0 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
b6: 89 1c 24 mov %ebx,(%esp)
b9: e8 52 03 00 00 call 410 <strlen>
be: 89 1c 24 mov %ebx,(%esp)
return buf;
c1: bb 38 0e 00 00 mov $0xe38,%ebx
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
c6: 89 c6 mov %eax,%esi
c8: e8 43 03 00 00 call 410 <strlen>
cd: ba 0e 00 00 00 mov $0xe,%edx
d2: 29 f2 sub %esi,%edx
d4: 89 54 24 08 mov %edx,0x8(%esp)
d8: ba 20 00 00 00 mov $0x20,%edx
dd: 89 54 24 04 mov %edx,0x4(%esp)
e1: 05 38 0e 00 00 add $0xe38,%eax
e6: 89 04 24 mov %eax,(%esp)
e9: e8 52 03 00 00 call 440 <memset>
}
ee: 83 c4 10 add $0x10,%esp
f1: 89 d8 mov %ebx,%eax
f3: 5b pop %ebx
f4: 5e pop %esi
f5: 5d pop %ebp
f6: c3 ret
f7: 89 f6 mov %esi,%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <ls>:
{
100: 55 push %ebp
if((fd = open(path, 0)) < 0){
101: 31 c0 xor %eax,%eax
{
103: 89 e5 mov %esp,%ebp
105: 81 ec 88 02 00 00 sub $0x288,%esp
10b: 89 7d fc mov %edi,-0x4(%ebp)
10e: 8b 7d 08 mov 0x8(%ebp),%edi
if((fd = open(path, 0)) < 0){
111: 89 44 24 04 mov %eax,0x4(%esp)
{
115: 89 5d f4 mov %ebx,-0xc(%ebp)
118: 89 75 f8 mov %esi,-0x8(%ebp)
if((fd = open(path, 0)) < 0){
11b: 89 3c 24 mov %edi,(%esp)
11e: e8 f5 04 00 00 call 618 <open>
123: 85 c0 test %eax,%eax
125: 78 49 js 170 <ls+0x70>
if(fstat(fd, &st) < 0){
127: 8d b5 d4 fd ff ff lea -0x22c(%ebp),%esi
12d: 89 c3 mov %eax,%ebx
12f: 89 74 24 04 mov %esi,0x4(%esp)
133: 89 04 24 mov %eax,(%esp)
136: e8 f5 04 00 00 call 630 <fstat>
13b: 85 c0 test %eax,%eax
13d: 0f 88 dd 00 00 00 js 220 <ls+0x120>
switch(st.type){
143: 0f bf 85 d4 fd ff ff movswl -0x22c(%ebp),%eax
14a: 83 f8 01 cmp $0x1,%eax
14d: 0f 84 9d 00 00 00 je 1f0 <ls+0xf0>
153: 83 f8 02 cmp $0x2,%eax
156: 74 48 je 1a0 <ls+0xa0>
close(fd);
158: 89 1c 24 mov %ebx,(%esp)
15b: e8 a0 04 00 00 call 600 <close>
}
160: 8b 5d f4 mov -0xc(%ebp),%ebx
163: 8b 75 f8 mov -0x8(%ebp),%esi
166: 8b 7d fc mov -0x4(%ebp),%edi
169: 89 ec mov %ebp,%esp
16b: 5d pop %ebp
16c: c3 ret
16d: 8d 76 00 lea 0x0(%esi),%esi
printf(2, "ls: cannot open %s\n", path);
170: 89 7c 24 08 mov %edi,0x8(%esp)
174: bf b8 0a 00 00 mov $0xab8,%edi
179: 89 7c 24 04 mov %edi,0x4(%esp)
17d: c7 04 24 02 00 00 00 movl $0x2,(%esp)
184: e8 b7 05 00 00 call 740 <printf>
}
189: 8b 5d f4 mov -0xc(%ebp),%ebx
18c: 8b 75 f8 mov -0x8(%ebp),%esi
18f: 8b 7d fc mov -0x4(%ebp),%edi
192: 89 ec mov %ebp,%esp
194: 5d pop %ebp
195: c3 ret
196: 8d 76 00 lea 0x0(%esi),%esi
199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
1a0: 8b 95 e4 fd ff ff mov -0x21c(%ebp),%edx
1a6: 89 3c 24 mov %edi,(%esp)
1a9: 8b b5 dc fd ff ff mov -0x224(%ebp),%esi
1af: 89 95 b4 fd ff ff mov %edx,-0x24c(%ebp)
1b5: e8 a6 fe ff ff call 60 <fmtname>
1ba: 8b 95 b4 fd ff ff mov -0x24c(%ebp),%edx
1c0: b9 e0 0a 00 00 mov $0xae0,%ecx
1c5: 89 74 24 10 mov %esi,0x10(%esp)
1c9: 89 4c 24 04 mov %ecx,0x4(%esp)
1cd: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1d4: 89 54 24 14 mov %edx,0x14(%esp)
1d8: ba 02 00 00 00 mov $0x2,%edx
1dd: 89 54 24 0c mov %edx,0xc(%esp)
1e1: 89 44 24 08 mov %eax,0x8(%esp)
1e5: e8 56 05 00 00 call 740 <printf>
break;
1ea: e9 69 ff ff ff jmp 158 <ls+0x58>
1ef: 90 nop
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
1f0: 89 3c 24 mov %edi,(%esp)
1f3: e8 18 02 00 00 call 410 <strlen>
1f8: 83 c0 10 add $0x10,%eax
1fb: 3d 00 02 00 00 cmp $0x200,%eax
200: 76 4e jbe 250 <ls+0x150>
printf(1, "ls: path too long\n");
202: b8 ed 0a 00 00 mov $0xaed,%eax
207: 89 44 24 04 mov %eax,0x4(%esp)
20b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
212: e8 29 05 00 00 call 740 <printf>
break;
217: e9 3c ff ff ff jmp 158 <ls+0x58>
21c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printf(2, "ls: cannot stat %s\n", path);
220: be cc 0a 00 00 mov $0xacc,%esi
225: 89 7c 24 08 mov %edi,0x8(%esp)
229: 89 74 24 04 mov %esi,0x4(%esp)
22d: c7 04 24 02 00 00 00 movl $0x2,(%esp)
234: e8 07 05 00 00 call 740 <printf>
close(fd);
239: 89 1c 24 mov %ebx,(%esp)
23c: e8 bf 03 00 00 call 600 <close>
}
241: 8b 5d f4 mov -0xc(%ebp),%ebx
244: 8b 75 f8 mov -0x8(%ebp),%esi
247: 8b 7d fc mov -0x4(%ebp),%edi
24a: 89 ec mov %ebp,%esp
24c: 5d pop %ebp
24d: c3 ret
24e: 66 90 xchg %ax,%ax
strcpy(buf, path);
250: 89 7c 24 04 mov %edi,0x4(%esp)
254: 8d bd e8 fd ff ff lea -0x218(%ebp),%edi
25a: 89 3c 24 mov %edi,(%esp)
25d: e8 1e 01 00 00 call 380 <strcpy>
p = buf+strlen(buf);
262: 89 3c 24 mov %edi,(%esp)
265: e8 a6 01 00 00 call 410 <strlen>
26a: 01 f8 add %edi,%eax
*p++ = '/';
26c: 8d 48 01 lea 0x1(%eax),%ecx
p = buf+strlen(buf);
26f: 89 85 a8 fd ff ff mov %eax,-0x258(%ebp)
*p++ = '/';
275: 89 8d a4 fd ff ff mov %ecx,-0x25c(%ebp)
27b: c6 00 2f movb $0x2f,(%eax)
27e: 66 90 xchg %ax,%ax
while(read(fd, &de, sizeof(de)) == sizeof(de)){
280: b8 10 00 00 00 mov $0x10,%eax
285: 89 44 24 08 mov %eax,0x8(%esp)
289: 8d 85 c4 fd ff ff lea -0x23c(%ebp),%eax
28f: 89 44 24 04 mov %eax,0x4(%esp)
293: 89 1c 24 mov %ebx,(%esp)
296: e8 55 03 00 00 call 5f0 <read>
29b: 83 f8 10 cmp $0x10,%eax
29e: 0f 85 b4 fe ff ff jne 158 <ls+0x58>
if(de.inum == 0)
2a4: 66 83 bd c4 fd ff ff cmpw $0x0,-0x23c(%ebp)
2ab: 00
2ac: 74 d2 je 280 <ls+0x180>
memmove(p, de.name, DIRSIZ);
2ae: b8 0e 00 00 00 mov $0xe,%eax
2b3: 89 44 24 08 mov %eax,0x8(%esp)
2b7: 8d 85 c6 fd ff ff lea -0x23a(%ebp),%eax
2bd: 89 44 24 04 mov %eax,0x4(%esp)
2c1: 8b 85 a4 fd ff ff mov -0x25c(%ebp),%eax
2c7: 89 04 24 mov %eax,(%esp)
2ca: e8 d1 02 00 00 call 5a0 <memmove>
p[DIRSIZ] = 0;
2cf: 8b 85 a8 fd ff ff mov -0x258(%ebp),%eax
2d5: c6 40 0f 00 movb $0x0,0xf(%eax)
if(stat(buf, &st) < 0){
2d9: 89 74 24 04 mov %esi,0x4(%esp)
2dd: 89 3c 24 mov %edi,(%esp)
2e0: e8 1b 02 00 00 call 500 <stat>
2e5: 85 c0 test %eax,%eax
2e7: 78 6f js 358 <ls+0x258>
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
2e9: 8b 8d e4 fd ff ff mov -0x21c(%ebp),%ecx
2ef: 8b 95 dc fd ff ff mov -0x224(%ebp),%edx
2f5: 0f bf 85 d4 fd ff ff movswl -0x22c(%ebp),%eax
2fc: 89 3c 24 mov %edi,(%esp)
2ff: 89 8d ac fd ff ff mov %ecx,-0x254(%ebp)
305: 89 95 b0 fd ff ff mov %edx,-0x250(%ebp)
30b: 89 85 b4 fd ff ff mov %eax,-0x24c(%ebp)
311: e8 4a fd ff ff call 60 <fmtname>
316: 8b 8d ac fd ff ff mov -0x254(%ebp),%ecx
31c: 8b 95 b0 fd ff ff mov -0x250(%ebp),%edx
322: c7 04 24 01 00 00 00 movl $0x1,(%esp)
329: 89 4c 24 14 mov %ecx,0x14(%esp)
32d: 8b 8d b4 fd ff ff mov -0x24c(%ebp),%ecx
333: 89 54 24 10 mov %edx,0x10(%esp)
337: ba e0 0a 00 00 mov $0xae0,%edx
33c: 89 44 24 08 mov %eax,0x8(%esp)
340: 89 54 24 04 mov %edx,0x4(%esp)
344: 89 4c 24 0c mov %ecx,0xc(%esp)
348: e8 f3 03 00 00 call 740 <printf>
34d: e9 2e ff ff ff jmp 280 <ls+0x180>
352: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printf(1, "ls: cannot stat %s\n", buf);
358: b9 cc 0a 00 00 mov $0xacc,%ecx
35d: 89 7c 24 08 mov %edi,0x8(%esp)
361: 89 4c 24 04 mov %ecx,0x4(%esp)
365: c7 04 24 01 00 00 00 movl $0x1,(%esp)
36c: e8 cf 03 00 00 call 740 <printf>
continue;
371: e9 0a ff ff ff jmp 280 <ls+0x180>
376: 66 90 xchg %ax,%ax
378: 66 90 xchg %ax,%ax
37a: 66 90 xchg %ax,%ax
37c: 66 90 xchg %ax,%ax
37e: 66 90 xchg %ax,%ax
00000380 <strcpy>:
#include "fcntl.h"
#include "user.h"
#include "x86.h"
char *
strcpy(char *s, const char *t) {
380: 55 push %ebp
381: 89 e5 mov %esp,%ebp
383: 8b 45 08 mov 0x8(%ebp),%eax
386: 8b 4d 0c mov 0xc(%ebp),%ecx
389: 53 push %ebx
char *os;
os = s;
while ((*s++ = *t++) != 0);
38a: 89 c2 mov %eax,%edx
38c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
390: 41 inc %ecx
391: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
395: 42 inc %edx
396: 84 db test %bl,%bl
398: 88 5a ff mov %bl,-0x1(%edx)
39b: 75 f3 jne 390 <strcpy+0x10>
return os;
}
39d: 5b pop %ebx
39e: 5d pop %ebp
39f: c3 ret
000003a0 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
3a0: 55 push %ebp
char *os;
os = s;
while((n--) > 0 && ((*s++ = *t++) != 0));
3a1: 31 d2 xor %edx,%edx
{
3a3: 89 e5 mov %esp,%ebp
3a5: 56 push %esi
3a6: 8b 45 08 mov 0x8(%ebp),%eax
3a9: 53 push %ebx
3aa: 8b 75 0c mov 0xc(%ebp),%esi
3ad: 8b 5d 10 mov 0x10(%ebp),%ebx
while((n--) > 0 && ((*s++ = *t++) != 0));
3b0: eb 12 jmp 3c4 <strncpy+0x24>
3b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
3b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
3bc: 88 0c 10 mov %cl,(%eax,%edx,1)
3bf: 42 inc %edx
3c0: 84 c9 test %cl,%cl
3c2: 74 08 je 3cc <strncpy+0x2c>
3c4: 89 d9 mov %ebx,%ecx
3c6: 29 d1 sub %edx,%ecx
3c8: 85 c9 test %ecx,%ecx
3ca: 7f ec jg 3b8 <strncpy+0x18>
return os;
}
3cc: 5b pop %ebx
3cd: 5e pop %esi
3ce: 5d pop %ebp
3cf: c3 ret
000003d0 <strcmp>:
int
strcmp(const char *p, const char *q) {
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
3d3: 8b 4d 08 mov 0x8(%ebp),%ecx
3d6: 53 push %ebx
3d7: 8b 5d 0c mov 0xc(%ebp),%ebx
while (*p && *p == *q)
3da: 0f b6 01 movzbl (%ecx),%eax
3dd: 0f b6 13 movzbl (%ebx),%edx
3e0: 84 c0 test %al,%al
3e2: 75 18 jne 3fc <strcmp+0x2c>
3e4: eb 22 jmp 408 <strcmp+0x38>
3e6: 8d 76 00 lea 0x0(%esi),%esi
3e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
3f0: 41 inc %ecx
while (*p && *p == *q)
3f1: 0f b6 01 movzbl (%ecx),%eax
p++, q++;
3f4: 43 inc %ebx
3f5: 0f b6 13 movzbl (%ebx),%edx
while (*p && *p == *q)
3f8: 84 c0 test %al,%al
3fa: 74 0c je 408 <strcmp+0x38>
3fc: 38 d0 cmp %dl,%al
3fe: 74 f0 je 3f0 <strcmp+0x20>
return (uchar) *p - (uchar) *q;
}
400: 5b pop %ebx
return (uchar) *p - (uchar) *q;
401: 29 d0 sub %edx,%eax
}
403: 5d pop %ebp
404: c3 ret
405: 8d 76 00 lea 0x0(%esi),%esi
408: 5b pop %ebx
409: 31 c0 xor %eax,%eax
return (uchar) *p - (uchar) *q;
40b: 29 d0 sub %edx,%eax
}
40d: 5d pop %ebp
40e: c3 ret
40f: 90 nop
00000410 <strlen>:
uint
strlen(const char *s) {
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for (n = 0; s[n]; n++);
416: 80 39 00 cmpb $0x0,(%ecx)
419: 74 15 je 430 <strlen+0x20>
41b: 31 d2 xor %edx,%edx
41d: 8d 76 00 lea 0x0(%esi),%esi
420: 42 inc %edx
421: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
425: 89 d0 mov %edx,%eax
427: 75 f7 jne 420 <strlen+0x10>
return n;
}
429: 5d pop %ebp
42a: c3 ret
42b: 90 nop
42c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (n = 0; s[n]; n++);
430: 31 c0 xor %eax,%eax
}
432: 5d pop %ebp
433: c3 ret
434: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
43a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000440 <memset>:
void *
memset(void *dst, int c, uint n) {
440: 55 push %ebp
441: 89 e5 mov %esp,%ebp
443: 8b 55 08 mov 0x8(%ebp),%edx
446: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
447: 8b 4d 10 mov 0x10(%ebp),%ecx
44a: 8b 45 0c mov 0xc(%ebp),%eax
44d: 89 d7 mov %edx,%edi
44f: fc cld
450: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
452: 5f pop %edi
453: 89 d0 mov %edx,%eax
455: 5d pop %ebp
456: c3 ret
457: 89 f6 mov %esi,%esi
459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000460 <strchr>:
char *
strchr(const char *s, char c) {
460: 55 push %ebp
461: 89 e5 mov %esp,%ebp
463: 8b 45 08 mov 0x8(%ebp),%eax
466: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
46a: 0f b6 10 movzbl (%eax),%edx
46d: 84 d2 test %dl,%dl
46f: 74 1b je 48c <strchr+0x2c>
if (*s == c)
471: 38 d1 cmp %dl,%cl
473: 75 0f jne 484 <strchr+0x24>
475: eb 17 jmp 48e <strchr+0x2e>
477: 89 f6 mov %esi,%esi
479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
480: 38 ca cmp %cl,%dl
482: 74 0a je 48e <strchr+0x2e>
for (; *s; s++)
484: 40 inc %eax
485: 0f b6 10 movzbl (%eax),%edx
488: 84 d2 test %dl,%dl
48a: 75 f4 jne 480 <strchr+0x20>
return (char *) s;
return 0;
48c: 31 c0 xor %eax,%eax
}
48e: 5d pop %ebp
48f: c3 ret
00000490 <gets>:
char *
gets(char *buf, int max) {
490: 55 push %ebp
491: 89 e5 mov %esp,%ebp
493: 57 push %edi
494: 56 push %esi
int i, cc;
char c;
for (i = 0; i + 1 < max;) {
495: 31 f6 xor %esi,%esi
gets(char *buf, int max) {
497: 53 push %ebx
498: 83 ec 3c sub $0x3c,%esp
49b: 8b 5d 08 mov 0x8(%ebp),%ebx
cc = read(0, &c, 1);
49e: 8d 7d e7 lea -0x19(%ebp),%edi
for (i = 0; i + 1 < max;) {
4a1: eb 32 jmp 4d5 <gets+0x45>
4a3: 90 nop
4a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cc = read(0, &c, 1);
4a8: ba 01 00 00 00 mov $0x1,%edx
4ad: 89 54 24 08 mov %edx,0x8(%esp)
4b1: 89 7c 24 04 mov %edi,0x4(%esp)
4b5: c7 04 24 00 00 00 00 movl $0x0,(%esp)
4bc: e8 2f 01 00 00 call 5f0 <read>
if (cc < 1)
4c1: 85 c0 test %eax,%eax
4c3: 7e 19 jle 4de <gets+0x4e>
break;
buf[i++] = c;
4c5: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
4c9: 43 inc %ebx
4ca: 88 43 ff mov %al,-0x1(%ebx)
if (c == '\n' || c == '\r')
4cd: 3c 0a cmp $0xa,%al
4cf: 74 1f je 4f0 <gets+0x60>
4d1: 3c 0d cmp $0xd,%al
4d3: 74 1b je 4f0 <gets+0x60>
for (i = 0; i + 1 < max;) {
4d5: 46 inc %esi
4d6: 3b 75 0c cmp 0xc(%ebp),%esi
4d9: 89 5d d4 mov %ebx,-0x2c(%ebp)
4dc: 7c ca jl 4a8 <gets+0x18>
break;
}
buf[i] = '\0';
4de: 8b 45 d4 mov -0x2c(%ebp),%eax
4e1: c6 00 00 movb $0x0,(%eax)
return buf;
}
4e4: 8b 45 08 mov 0x8(%ebp),%eax
4e7: 83 c4 3c add $0x3c,%esp
4ea: 5b pop %ebx
4eb: 5e pop %esi
4ec: 5f pop %edi
4ed: 5d pop %ebp
4ee: c3 ret
4ef: 90 nop
4f0: 8b 45 08 mov 0x8(%ebp),%eax
4f3: 01 c6 add %eax,%esi
4f5: 89 75 d4 mov %esi,-0x2c(%ebp)
4f8: eb e4 jmp 4de <gets+0x4e>
4fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000500 <stat>:
int
stat(const char *n, struct stat *st) {
500: 55 push %ebp
int fd;
int r;
fd = open(n, O_RDONLY);
501: 31 c0 xor %eax,%eax
stat(const char *n, struct stat *st) {
503: 89 e5 mov %esp,%ebp
505: 83 ec 18 sub $0x18,%esp
fd = open(n, O_RDONLY);
508: 89 44 24 04 mov %eax,0x4(%esp)
50c: 8b 45 08 mov 0x8(%ebp),%eax
stat(const char *n, struct stat *st) {
50f: 89 5d f8 mov %ebx,-0x8(%ebp)
512: 89 75 fc mov %esi,-0x4(%ebp)
fd = open(n, O_RDONLY);
515: 89 04 24 mov %eax,(%esp)
518: e8 fb 00 00 00 call 618 <open>
if (fd < 0)
51d: 85 c0 test %eax,%eax
51f: 78 2f js 550 <stat+0x50>
521: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
523: 8b 45 0c mov 0xc(%ebp),%eax
526: 89 1c 24 mov %ebx,(%esp)
529: 89 44 24 04 mov %eax,0x4(%esp)
52d: e8 fe 00 00 00 call 630 <fstat>
close(fd);
532: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
535: 89 c6 mov %eax,%esi
close(fd);
537: e8 c4 00 00 00 call 600 <close>
return r;
}
53c: 89 f0 mov %esi,%eax
53e: 8b 5d f8 mov -0x8(%ebp),%ebx
541: 8b 75 fc mov -0x4(%ebp),%esi
544: 89 ec mov %ebp,%esp
546: 5d pop %ebp
547: c3 ret
548: 90 nop
549: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
550: be ff ff ff ff mov $0xffffffff,%esi
555: eb e5 jmp 53c <stat+0x3c>
557: 89 f6 mov %esi,%esi
559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000560 <atoi>:
int
atoi(const char *s) {
560: 55 push %ebp
561: 89 e5 mov %esp,%ebp
563: 8b 4d 08 mov 0x8(%ebp),%ecx
566: 53 push %ebx
int n;
n = 0;
while ('0' <= *s && *s <= '9')
567: 0f be 11 movsbl (%ecx),%edx
56a: 88 d0 mov %dl,%al
56c: 2c 30 sub $0x30,%al
56e: 3c 09 cmp $0x9,%al
n = 0;
570: b8 00 00 00 00 mov $0x0,%eax
while ('0' <= *s && *s <= '9')
575: 77 1e ja 595 <atoi+0x35>
577: 89 f6 mov %esi,%esi
579: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n * 10 + *s++ - '0';
580: 41 inc %ecx
581: 8d 04 80 lea (%eax,%eax,4),%eax
584: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while ('0' <= *s && *s <= '9')
588: 0f be 11 movsbl (%ecx),%edx
58b: 88 d3 mov %dl,%bl
58d: 80 eb 30 sub $0x30,%bl
590: 80 fb 09 cmp $0x9,%bl
593: 76 eb jbe 580 <atoi+0x20>
return n;
}
595: 5b pop %ebx
596: 5d pop %ebp
597: c3 ret
598: 90 nop
599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000005a0 <memmove>:
void *
memmove(void *vdst, const void *vsrc, int n) {
5a0: 55 push %ebp
5a1: 89 e5 mov %esp,%ebp
5a3: 56 push %esi
5a4: 8b 45 08 mov 0x8(%ebp),%eax
5a7: 53 push %ebx
5a8: 8b 5d 10 mov 0x10(%ebp),%ebx
5ab: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while (n-- > 0)
5ae: 85 db test %ebx,%ebx
5b0: 7e 1a jle 5cc <memmove+0x2c>
5b2: 31 d2 xor %edx,%edx
5b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
5ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
*dst++ = *src++;
5c0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
5c4: 88 0c 10 mov %cl,(%eax,%edx,1)
5c7: 42 inc %edx
while (n-- > 0)
5c8: 39 d3 cmp %edx,%ebx
5ca: 75 f4 jne 5c0 <memmove+0x20>
return vdst;
}
5cc: 5b pop %ebx
5cd: 5e pop %esi
5ce: 5d pop %ebp
5cf: c3 ret
000005d0 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
5d0: b8 01 00 00 00 mov $0x1,%eax
5d5: cd 40 int $0x40
5d7: c3 ret
000005d8 <exit>:
SYSCALL(exit)
5d8: b8 02 00 00 00 mov $0x2,%eax
5dd: cd 40 int $0x40
5df: c3 ret
000005e0 <wait>:
SYSCALL(wait)
5e0: b8 03 00 00 00 mov $0x3,%eax
5e5: cd 40 int $0x40
5e7: c3 ret
000005e8 <pipe>:
SYSCALL(pipe)
5e8: b8 04 00 00 00 mov $0x4,%eax
5ed: cd 40 int $0x40
5ef: c3 ret
000005f0 <read>:
SYSCALL(read)
5f0: b8 05 00 00 00 mov $0x5,%eax
5f5: cd 40 int $0x40
5f7: c3 ret
000005f8 <write>:
SYSCALL(write)
5f8: b8 10 00 00 00 mov $0x10,%eax
5fd: cd 40 int $0x40
5ff: c3 ret
00000600 <close>:
SYSCALL(close)
600: b8 15 00 00 00 mov $0x15,%eax
605: cd 40 int $0x40
607: c3 ret
00000608 <kill>:
SYSCALL(kill)
608: b8 06 00 00 00 mov $0x6,%eax
60d: cd 40 int $0x40
60f: c3 ret
00000610 <exec>:
SYSCALL(exec)
610: b8 07 00 00 00 mov $0x7,%eax
615: cd 40 int $0x40
617: c3 ret
00000618 <open>:
SYSCALL(open)
618: b8 0f 00 00 00 mov $0xf,%eax
61d: cd 40 int $0x40
61f: c3 ret
00000620 <mknod>:
SYSCALL(mknod)
620: b8 11 00 00 00 mov $0x11,%eax
625: cd 40 int $0x40
627: c3 ret
00000628 <unlink>:
SYSCALL(unlink)
628: b8 12 00 00 00 mov $0x12,%eax
62d: cd 40 int $0x40
62f: c3 ret
00000630 <fstat>:
SYSCALL(fstat)
630: b8 08 00 00 00 mov $0x8,%eax
635: cd 40 int $0x40
637: c3 ret
00000638 <link>:
SYSCALL(link)
638: b8 13 00 00 00 mov $0x13,%eax
63d: cd 40 int $0x40
63f: c3 ret
00000640 <mkdir>:
SYSCALL(mkdir)
640: b8 14 00 00 00 mov $0x14,%eax
645: cd 40 int $0x40
647: c3 ret
00000648 <chdir>:
SYSCALL(chdir)
648: b8 09 00 00 00 mov $0x9,%eax
64d: cd 40 int $0x40
64f: c3 ret
00000650 <dup>:
SYSCALL(dup)
650: b8 0a 00 00 00 mov $0xa,%eax
655: cd 40 int $0x40
657: c3 ret
00000658 <getpid>:
SYSCALL(getpid)
658: b8 0b 00 00 00 mov $0xb,%eax
65d: cd 40 int $0x40
65f: c3 ret
00000660 <sbrk>:
SYSCALL(sbrk)
660: b8 0c 00 00 00 mov $0xc,%eax
665: cd 40 int $0x40
667: c3 ret
00000668 <sleep>:
SYSCALL(sleep)
668: b8 0d 00 00 00 mov $0xd,%eax
66d: cd 40 int $0x40
66f: c3 ret
00000670 <uptime>:
SYSCALL(uptime)
670: b8 0e 00 00 00 mov $0xe,%eax
675: cd 40 int $0x40
677: c3 ret
00000678 <detach>:
SYSCALL(detach)
678: b8 16 00 00 00 mov $0x16,%eax
67d: cd 40 int $0x40
67f: c3 ret
00000680 <priority>:
SYSCALL(priority)
680: b8 17 00 00 00 mov $0x17,%eax
685: cd 40 int $0x40
687: c3 ret
00000688 <policy>:
SYSCALL(policy)
688: b8 18 00 00 00 mov $0x18,%eax
68d: cd 40 int $0x40
68f: c3 ret
00000690 <wait_stat>:
SYSCALL(wait_stat)
690: b8 19 00 00 00 mov $0x19,%eax
695: cd 40 int $0x40
697: c3 ret
698: 66 90 xchg %ax,%ax
69a: 66 90 xchg %ax,%ax
69c: 66 90 xchg %ax,%ax
69e: 66 90 xchg %ax,%ax
000006a0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
6a0: 55 push %ebp
6a1: 89 e5 mov %esp,%ebp
6a3: 57 push %edi
6a4: 56 push %esi
6a5: 53 push %ebx
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
6a6: 89 d3 mov %edx,%ebx
6a8: c1 eb 1f shr $0x1f,%ebx
{
6ab: 83 ec 4c sub $0x4c,%esp
if(sgn && xx < 0){
6ae: 84 db test %bl,%bl
{
6b0: 89 45 c0 mov %eax,-0x40(%ebp)
6b3: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
6b5: 74 79 je 730 <printint+0x90>
6b7: f6 45 08 01 testb $0x1,0x8(%ebp)
6bb: 74 73 je 730 <printint+0x90>
neg = 1;
x = -xx;
6bd: f7 d8 neg %eax
neg = 1;
6bf: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
6c6: 31 f6 xor %esi,%esi
6c8: 8d 5d d7 lea -0x29(%ebp),%ebx
6cb: eb 05 jmp 6d2 <printint+0x32>
6cd: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
6d0: 89 fe mov %edi,%esi
6d2: 31 d2 xor %edx,%edx
6d4: f7 f1 div %ecx
6d6: 8d 7e 01 lea 0x1(%esi),%edi
6d9: 0f b6 92 0c 0b 00 00 movzbl 0xb0c(%edx),%edx
}while((x /= base) != 0);
6e0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
6e2: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
6e5: 75 e9 jne 6d0 <printint+0x30>
if(neg)
6e7: 8b 55 c4 mov -0x3c(%ebp),%edx
6ea: 85 d2 test %edx,%edx
6ec: 74 08 je 6f6 <printint+0x56>
buf[i++] = '-';
6ee: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
6f3: 8d 7e 02 lea 0x2(%esi),%edi
6f6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
6fa: 8b 7d c0 mov -0x40(%ebp),%edi
6fd: 8d 76 00 lea 0x0(%esi),%esi
700: 0f b6 06 movzbl (%esi),%eax
703: 4e dec %esi
write(fd, &c, 1);
704: 89 5c 24 04 mov %ebx,0x4(%esp)
708: 89 3c 24 mov %edi,(%esp)
70b: 88 45 d7 mov %al,-0x29(%ebp)
70e: b8 01 00 00 00 mov $0x1,%eax
713: 89 44 24 08 mov %eax,0x8(%esp)
717: e8 dc fe ff ff call 5f8 <write>
while(--i >= 0)
71c: 39 de cmp %ebx,%esi
71e: 75 e0 jne 700 <printint+0x60>
putc(fd, buf[i]);
}
720: 83 c4 4c add $0x4c,%esp
723: 5b pop %ebx
724: 5e pop %esi
725: 5f pop %edi
726: 5d pop %ebp
727: c3 ret
728: 90 nop
729: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
730: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
737: eb 8d jmp 6c6 <printint+0x26>
739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000740 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 57 push %edi
744: 56 push %esi
745: 53 push %ebx
746: 83 ec 3c sub $0x3c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
749: 8b 75 0c mov 0xc(%ebp),%esi
74c: 0f b6 1e movzbl (%esi),%ebx
74f: 84 db test %bl,%bl
751: 0f 84 d1 00 00 00 je 828 <printf+0xe8>
state = 0;
757: 31 ff xor %edi,%edi
759: 46 inc %esi
ap = (uint*)(void*)&fmt + 1;
75a: 8d 45 10 lea 0x10(%ebp),%eax
write(fd, &c, 1);
75d: 89 fa mov %edi,%edx
75f: 8b 7d 08 mov 0x8(%ebp),%edi
ap = (uint*)(void*)&fmt + 1;
762: 89 45 d0 mov %eax,-0x30(%ebp)
765: eb 41 jmp 7a8 <printf+0x68>
767: 89 f6 mov %esi,%esi
769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
770: 83 f8 25 cmp $0x25,%eax
773: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
776: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
77b: 74 1e je 79b <printf+0x5b>
write(fd, &c, 1);
77d: b8 01 00 00 00 mov $0x1,%eax
782: 89 44 24 08 mov %eax,0x8(%esp)
786: 8d 45 e2 lea -0x1e(%ebp),%eax
789: 89 44 24 04 mov %eax,0x4(%esp)
78d: 89 3c 24 mov %edi,(%esp)
790: 88 5d e2 mov %bl,-0x1e(%ebp)
793: e8 60 fe ff ff call 5f8 <write>
798: 8b 55 d4 mov -0x2c(%ebp),%edx
79b: 46 inc %esi
for(i = 0; fmt[i]; i++){
79c: 0f b6 5e ff movzbl -0x1(%esi),%ebx
7a0: 84 db test %bl,%bl
7a2: 0f 84 80 00 00 00 je 828 <printf+0xe8>
if(state == 0){
7a8: 85 d2 test %edx,%edx
c = fmt[i] & 0xff;
7aa: 0f be cb movsbl %bl,%ecx
7ad: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
7b0: 74 be je 770 <printf+0x30>
} else {
putc(fd, c);
}
} else if(state == '%'){
7b2: 83 fa 25 cmp $0x25,%edx
7b5: 75 e4 jne 79b <printf+0x5b>
if(c == 'd'){
7b7: 83 f8 64 cmp $0x64,%eax
7ba: 0f 84 f0 00 00 00 je 8b0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
7c0: 81 e1 f7 00 00 00 and $0xf7,%ecx
7c6: 83 f9 70 cmp $0x70,%ecx
7c9: 74 65 je 830 <printf+0xf0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
7cb: 83 f8 73 cmp $0x73,%eax
7ce: 0f 84 8c 00 00 00 je 860 <printf+0x120>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
7d4: 83 f8 63 cmp $0x63,%eax
7d7: 0f 84 13 01 00 00 je 8f0 <printf+0x1b0>
putc(fd, *ap);
ap++;
} else if(c == '%'){
7dd: 83 f8 25 cmp $0x25,%eax
7e0: 0f 84 e2 00 00 00 je 8c8 <printf+0x188>
write(fd, &c, 1);
7e6: b8 01 00 00 00 mov $0x1,%eax
7eb: 46 inc %esi
7ec: 89 44 24 08 mov %eax,0x8(%esp)
7f0: 8d 45 e7 lea -0x19(%ebp),%eax
7f3: 89 44 24 04 mov %eax,0x4(%esp)
7f7: 89 3c 24 mov %edi,(%esp)
7fa: c6 45 e7 25 movb $0x25,-0x19(%ebp)
7fe: e8 f5 fd ff ff call 5f8 <write>
803: ba 01 00 00 00 mov $0x1,%edx
808: 8d 45 e6 lea -0x1a(%ebp),%eax
80b: 89 54 24 08 mov %edx,0x8(%esp)
80f: 89 44 24 04 mov %eax,0x4(%esp)
813: 89 3c 24 mov %edi,(%esp)
816: 88 5d e6 mov %bl,-0x1a(%ebp)
819: e8 da fd ff ff call 5f8 <write>
for(i = 0; fmt[i]; i++){
81e: 0f b6 5e ff movzbl -0x1(%esi),%ebx
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
822: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
824: 84 db test %bl,%bl
826: 75 80 jne 7a8 <printf+0x68>
}
}
}
828: 83 c4 3c add $0x3c,%esp
82b: 5b pop %ebx
82c: 5e pop %esi
82d: 5f pop %edi
82e: 5d pop %ebp
82f: c3 ret
printint(fd, *ap, 16, 0);
830: c7 04 24 00 00 00 00 movl $0x0,(%esp)
837: b9 10 00 00 00 mov $0x10,%ecx
83c: 8b 5d d0 mov -0x30(%ebp),%ebx
83f: 89 f8 mov %edi,%eax
841: 8b 13 mov (%ebx),%edx
843: e8 58 fe ff ff call 6a0 <printint>
ap++;
848: 89 d8 mov %ebx,%eax
state = 0;
84a: 31 d2 xor %edx,%edx
ap++;
84c: 83 c0 04 add $0x4,%eax
84f: 89 45 d0 mov %eax,-0x30(%ebp)
852: e9 44 ff ff ff jmp 79b <printf+0x5b>
857: 89 f6 mov %esi,%esi
859: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
s = (char*)*ap;
860: 8b 45 d0 mov -0x30(%ebp),%eax
863: 8b 10 mov (%eax),%edx
ap++;
865: 83 c0 04 add $0x4,%eax
868: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
86b: 85 d2 test %edx,%edx
86d: 0f 84 aa 00 00 00 je 91d <printf+0x1dd>
while(*s != 0){
873: 0f b6 02 movzbl (%edx),%eax
s = (char*)*ap;
876: 89 d3 mov %edx,%ebx
while(*s != 0){
878: 84 c0 test %al,%al
87a: 74 27 je 8a3 <printf+0x163>
87c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
880: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
883: b8 01 00 00 00 mov $0x1,%eax
s++;
888: 43 inc %ebx
write(fd, &c, 1);
889: 89 44 24 08 mov %eax,0x8(%esp)
88d: 8d 45 e3 lea -0x1d(%ebp),%eax
890: 89 44 24 04 mov %eax,0x4(%esp)
894: 89 3c 24 mov %edi,(%esp)
897: e8 5c fd ff ff call 5f8 <write>
while(*s != 0){
89c: 0f b6 03 movzbl (%ebx),%eax
89f: 84 c0 test %al,%al
8a1: 75 dd jne 880 <printf+0x140>
state = 0;
8a3: 31 d2 xor %edx,%edx
8a5: e9 f1 fe ff ff jmp 79b <printf+0x5b>
8aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
8b0: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8b7: b9 0a 00 00 00 mov $0xa,%ecx
8bc: e9 7b ff ff ff jmp 83c <printf+0xfc>
8c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
8c8: b9 01 00 00 00 mov $0x1,%ecx
8cd: 8d 45 e5 lea -0x1b(%ebp),%eax
8d0: 89 4c 24 08 mov %ecx,0x8(%esp)
8d4: 89 44 24 04 mov %eax,0x4(%esp)
8d8: 89 3c 24 mov %edi,(%esp)
8db: 88 5d e5 mov %bl,-0x1b(%ebp)
8de: e8 15 fd ff ff call 5f8 <write>
state = 0;
8e3: 31 d2 xor %edx,%edx
8e5: e9 b1 fe ff ff jmp 79b <printf+0x5b>
8ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
putc(fd, *ap);
8f0: 8b 5d d0 mov -0x30(%ebp),%ebx
8f3: 8b 03 mov (%ebx),%eax
ap++;
8f5: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
8f8: 89 3c 24 mov %edi,(%esp)
putc(fd, *ap);
8fb: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
8fe: b8 01 00 00 00 mov $0x1,%eax
903: 89 44 24 08 mov %eax,0x8(%esp)
907: 8d 45 e4 lea -0x1c(%ebp),%eax
90a: 89 44 24 04 mov %eax,0x4(%esp)
90e: e8 e5 fc ff ff call 5f8 <write>
state = 0;
913: 31 d2 xor %edx,%edx
ap++;
915: 89 5d d0 mov %ebx,-0x30(%ebp)
918: e9 7e fe ff ff jmp 79b <printf+0x5b>
s = "(null)";
91d: bb 02 0b 00 00 mov $0xb02,%ebx
while(*s != 0){
922: b0 28 mov $0x28,%al
924: e9 57 ff ff ff jmp 880 <printf+0x140>
929: 66 90 xchg %ax,%ax
92b: 66 90 xchg %ax,%ax
92d: 66 90 xchg %ax,%ax
92f: 90 nop
00000930 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
930: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
931: a1 48 0e 00 00 mov 0xe48,%eax
{
936: 89 e5 mov %esp,%ebp
938: 57 push %edi
939: 56 push %esi
93a: 53 push %ebx
93b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
93e: 8d 4b f8 lea -0x8(%ebx),%ecx
941: eb 0d jmp 950 <free+0x20>
943: 90 nop
944: 90 nop
945: 90 nop
946: 90 nop
947: 90 nop
948: 90 nop
949: 90 nop
94a: 90 nop
94b: 90 nop
94c: 90 nop
94d: 90 nop
94e: 90 nop
94f: 90 nop
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
950: 39 c8 cmp %ecx,%eax
952: 8b 10 mov (%eax),%edx
954: 73 32 jae 988 <free+0x58>
956: 39 d1 cmp %edx,%ecx
958: 72 04 jb 95e <free+0x2e>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
95a: 39 d0 cmp %edx,%eax
95c: 72 32 jb 990 <free+0x60>
break;
if(bp + bp->s.size == p->s.ptr){
95e: 8b 73 fc mov -0x4(%ebx),%esi
961: 8d 3c f1 lea (%ecx,%esi,8),%edi
964: 39 fa cmp %edi,%edx
966: 74 30 je 998 <free+0x68>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
968: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
96b: 8b 50 04 mov 0x4(%eax),%edx
96e: 8d 34 d0 lea (%eax,%edx,8),%esi
971: 39 f1 cmp %esi,%ecx
973: 74 3c je 9b1 <free+0x81>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
975: 89 08 mov %ecx,(%eax)
freep = p;
}
977: 5b pop %ebx
freep = p;
978: a3 48 0e 00 00 mov %eax,0xe48
}
97d: 5e pop %esi
97e: 5f pop %edi
97f: 5d pop %ebp
980: c3 ret
981: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
988: 39 d0 cmp %edx,%eax
98a: 72 04 jb 990 <free+0x60>
98c: 39 d1 cmp %edx,%ecx
98e: 72 ce jb 95e <free+0x2e>
{
990: 89 d0 mov %edx,%eax
992: eb bc jmp 950 <free+0x20>
994: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
998: 8b 7a 04 mov 0x4(%edx),%edi
99b: 01 fe add %edi,%esi
99d: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
9a0: 8b 10 mov (%eax),%edx
9a2: 8b 12 mov (%edx),%edx
9a4: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
9a7: 8b 50 04 mov 0x4(%eax),%edx
9aa: 8d 34 d0 lea (%eax,%edx,8),%esi
9ad: 39 f1 cmp %esi,%ecx
9af: 75 c4 jne 975 <free+0x45>
p->s.size += bp->s.size;
9b1: 8b 4b fc mov -0x4(%ebx),%ecx
freep = p;
9b4: a3 48 0e 00 00 mov %eax,0xe48
p->s.size += bp->s.size;
9b9: 01 ca add %ecx,%edx
9bb: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
9be: 8b 53 f8 mov -0x8(%ebx),%edx
9c1: 89 10 mov %edx,(%eax)
}
9c3: 5b pop %ebx
9c4: 5e pop %esi
9c5: 5f pop %edi
9c6: 5d pop %ebp
9c7: c3 ret
9c8: 90 nop
9c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000009d0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
9d0: 55 push %ebp
9d1: 89 e5 mov %esp,%ebp
9d3: 57 push %edi
9d4: 56 push %esi
9d5: 53 push %ebx
9d6: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9d9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
9dc: 8b 15 48 0e 00 00 mov 0xe48,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9e2: 8d 78 07 lea 0x7(%eax),%edi
9e5: c1 ef 03 shr $0x3,%edi
9e8: 47 inc %edi
if((prevp = freep) == 0){
9e9: 85 d2 test %edx,%edx
9eb: 0f 84 8f 00 00 00 je a80 <malloc+0xb0>
9f1: 8b 02 mov (%edx),%eax
9f3: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
9f6: 39 cf cmp %ecx,%edi
9f8: 76 66 jbe a60 <malloc+0x90>
9fa: 81 ff 00 10 00 00 cmp $0x1000,%edi
a00: bb 00 10 00 00 mov $0x1000,%ebx
a05: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
a08: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
a0f: eb 10 jmp a21 <malloc+0x51>
a11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a18: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
a1a: 8b 48 04 mov 0x4(%eax),%ecx
a1d: 39 f9 cmp %edi,%ecx
a1f: 73 3f jae a60 <malloc+0x90>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
a21: 39 05 48 0e 00 00 cmp %eax,0xe48
a27: 89 c2 mov %eax,%edx
a29: 75 ed jne a18 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
a2b: 89 34 24 mov %esi,(%esp)
a2e: e8 2d fc ff ff call 660 <sbrk>
if(p == (char*)-1)
a33: 83 f8 ff cmp $0xffffffff,%eax
a36: 74 18 je a50 <malloc+0x80>
hp->s.size = nu;
a38: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
a3b: 83 c0 08 add $0x8,%eax
a3e: 89 04 24 mov %eax,(%esp)
a41: e8 ea fe ff ff call 930 <free>
return freep;
a46: 8b 15 48 0e 00 00 mov 0xe48,%edx
if((p = morecore(nunits)) == 0)
a4c: 85 d2 test %edx,%edx
a4e: 75 c8 jne a18 <malloc+0x48>
return 0;
}
}
a50: 83 c4 1c add $0x1c,%esp
return 0;
a53: 31 c0 xor %eax,%eax
}
a55: 5b pop %ebx
a56: 5e pop %esi
a57: 5f pop %edi
a58: 5d pop %ebp
a59: c3 ret
a5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
a60: 39 cf cmp %ecx,%edi
a62: 74 4c je ab0 <malloc+0xe0>
p->s.size -= nunits;
a64: 29 f9 sub %edi,%ecx
a66: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
a69: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
a6c: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
a6f: 89 15 48 0e 00 00 mov %edx,0xe48
}
a75: 83 c4 1c add $0x1c,%esp
return (void*)(p + 1);
a78: 83 c0 08 add $0x8,%eax
}
a7b: 5b pop %ebx
a7c: 5e pop %esi
a7d: 5f pop %edi
a7e: 5d pop %ebp
a7f: c3 ret
base.s.ptr = freep = prevp = &base;
a80: b8 4c 0e 00 00 mov $0xe4c,%eax
a85: ba 4c 0e 00 00 mov $0xe4c,%edx
base.s.size = 0;
a8a: 31 c9 xor %ecx,%ecx
base.s.ptr = freep = prevp = &base;
a8c: a3 48 0e 00 00 mov %eax,0xe48
base.s.size = 0;
a91: b8 4c 0e 00 00 mov $0xe4c,%eax
base.s.ptr = freep = prevp = &base;
a96: 89 15 4c 0e 00 00 mov %edx,0xe4c
base.s.size = 0;
a9c: 89 0d 50 0e 00 00 mov %ecx,0xe50
aa2: e9 53 ff ff ff jmp 9fa <malloc+0x2a>
aa7: 89 f6 mov %esi,%esi
aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
prevp->s.ptr = p->s.ptr;
ab0: 8b 08 mov (%eax),%ecx
ab2: 89 0a mov %ecx,(%edx)
ab4: eb b9 jmp a6f <malloc+0x9f>
| 35.733838 | 73 | 0.420425 |
431ea5cf41981650870afe7e418d2d37d200d47c | 282 | asm | Assembly | programs/oeis/133/A133655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/133/A133655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/133/A133655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A133655: a(n) = 2*A016777(n) + A016777(n-1) - (n+1).
; 1,7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127,135,143,151,159,167,175,183,191,199,207,215,223,231,239,247,255,263,271,279,287,295,303,311,319,327,335,343,351,359,367,375,383,391,399,407,415
mul $0,8
trn $0,2
add $0,1
| 40.285714 | 198 | 0.666667 |
cb1511ba732b66f6541b80cb3f8c1c3ed1c01c5c | 564 | asm | Assembly | oeis/158/A158688.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/158/A158688.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/158/A158688.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A158688: a(n) = 1089*n^2 + 33.
; 33,1122,4389,9834,17457,27258,39237,53394,69729,88242,108933,131802,156849,184074,213477,245058,278817,314754,352869,393162,435633,480282,527109,576114,627297,680658,736197,793914,853809,915882,980133,1046562,1115169,1185954,1258917,1334058,1411377,1490874,1572549,1656402,1742433,1830642,1921029,2013594,2108337,2205258,2304357,2405634,2509089,2614722,2722533,2832522,2944689,3059034,3175557,3294258,3415137,3538194,3663429,3790842,3920433,4052202,4186149,4322274,4460577,4601058,4743717,4888554
pow $0,2
mul $0,1089
add $0,33
| 80.571429 | 498 | 0.824468 |
e76f0e5100ed009eb7d576fe55a074a054911776 | 3,992 | asm | Assembly | sources/ippcp/asm_intel64/pcpbnuincm7as.asm | ntyukaev/ipp-crypto | 19b408cfd21a59f994b64dd47b18eb0c2f94e4e0 | [
"Apache-2.0"
] | 30 | 2017-07-26T20:03:19.000Z | 2021-10-14T23:38:54.000Z | sources/ippcp/asm_intel64/pcpbnuincm7as.asm | ntyukaev/ipp-crypto | 19b408cfd21a59f994b64dd47b18eb0c2f94e4e0 | [
"Apache-2.0"
] | 9 | 2018-09-25T18:32:42.000Z | 2022-02-18T12:23:40.000Z | sources/ippcp/asm_intel64/pcpbnuincm7as.asm | ntyukaev/ipp-crypto | 19b408cfd21a59f994b64dd47b18eb0c2f94e4e0 | [
"Apache-2.0"
] | 14 | 2017-08-31T19:53:23.000Z | 2021-02-27T01:08:14.000Z | ;===============================================================================
; Copyright 2014-2020 Intel Corporation
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Big Number Operations
;
; Content:
; cpInc_BNU()
; cpDec_BNU()
;
;
%include "asmdefs.inc"
%include "ia_32e.inc"
%if (_IPP32E >= _IPP32E_M7)
segment .text align=IPP_ALIGN_FACTOR
;*************************************************************
;* Ipp64u cpInc_BNU(Ipp64u* pDst,
;* const Ipp64u* pSrc, int len,
;* Ipp64u increment)
;* returns carry
;*************************************************************
align IPP_ALIGN_FACTOR
IPPASM cpInc_BNU,PUBLIC
%assign LOCAL_FRAME 0
USES_GPR rsi,rdi
USES_XMM
COMP_ABI 4
; rdi = pDst
; rsi = pSrc
; rdx = len
; rcx = increment
movsxd rdx, edx ; length
mov r8, qword [rsi] ; r[0] = r[0]+increment
add r8, rcx
mov qword [rdi], r8
lea rsi, [rsi+rdx*sizeof(qword)]
lea rdi, [rdi+rdx*sizeof(qword)]
lea rcx, [rdx*sizeof(qword)]
sbb rax, rax ; save cf
neg rcx ; rcx = negative length (bytes)
add rcx, sizeof(qword)
jrcxz .exit
add rax, rax ; restore cf
jnc .copy
align IPP_ALIGN_FACTOR
.inc_loop:
mov r8, qword [rsi+rcx]
adc r8, 0
mov qword [rdi+rcx], r8
lea rcx, [rcx+sizeof(qword)]
jrcxz .exit_loop
jnc .exit_loop
jmp .inc_loop
.exit_loop:
sbb rax, rax ; save cf
.copy:
cmp rsi, rdi
jz .exit
jrcxz .exit
.copy_loop:
mov r8, qword [rsi+rcx]
mov qword [rdi+rcx], r8
add rcx, sizeof(qword)
jnz .copy_loop
.exit:
neg rax
REST_XMM
REST_GPR
ret
ENDFUNC cpInc_BNU
;*************************************************************
;* Ipp64u cpDec_BNU(Ipp64u* pDst,
;* const Ipp64u* pSrc, int len,
;* Ipp64u increment)
;* returns borrow
;*************************************************************
align IPP_ALIGN_FACTOR
IPPASM cpDec_BNU,PUBLIC
%assign LOCAL_FRAME 0
USES_GPR rsi,rdi
USES_XMM
COMP_ABI 4
; rdi = pDst
; rsi = pSrc
; rdx = len
; rcx = increment
movsxd rdx, edx ; length
mov r8, qword [rsi] ; r[0] = r[0]+increment
sub r8, rcx
mov qword [rdi], r8
lea rsi, [rsi+rdx*sizeof(qword)]
lea rdi, [rdi+rdx*sizeof(qword)]
lea rcx, [rdx*sizeof(qword)]
sbb rax, rax ; save cf
neg rcx ; rcx = negative length (bytes)
add rcx, sizeof(qword)
jrcxz .exit
add rax, rax ; restore cf
jnc .copy
align IPP_ALIGN_FACTOR
.inc_loop:
mov r8, qword [rsi+rcx]
sbb r8, 0
mov qword [rdi+rcx], r8
lea rcx, [rcx+sizeof(qword)]
jrcxz .exit_loop
jnc .exit_loop
jmp .inc_loop
.exit_loop:
sbb rax, rax ; save cf
.copy:
cmp rsi, rdi
jz .exit
jrcxz .exit
.copy_loop:
mov r8, qword [rsi+rcx]
mov qword [rdi+rcx], r8
add rcx, sizeof(qword)
jnz .copy_loop
.exit:
neg rax
REST_XMM
REST_GPR
ret
ENDFUNC cpDec_BNU
%endif
| 23.761905 | 80 | 0.50977 |
f69cb1e8ef74f9eb9d6da25aa74280220f302283 | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/chip/ys_mpldt0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/chip/ys_mpldt0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/chip/ys_mpldt0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_mpldt0.asm
Type: file
Size: 11127
Last-Modified: '2016-05-13T04:51:40Z'
SHA-1: 4D5860FBA4FEB10F8394CC1D7C4383AF167CF20F
Description: null
| 21 | 47 | 0.816327 |
8276d88351602882974aad2d847dfe8051cb692a | 2,527 | asm | Assembly | video_2.asm | funkacer/ZX80 | ba9fb70cc8ec35742ef776cebf09f6723e710504 | [
"BSD-3-Clause"
] | null | null | null | video_2.asm | funkacer/ZX80 | ba9fb70cc8ec35742ef776cebf09f6723e710504 | [
"BSD-3-Clause"
] | null | null | null | video_2.asm | funkacer/ZX80 | ba9fb70cc8ec35742ef776cebf09f6723e710504 | [
"BSD-3-Clause"
] | null | null | null | DEVICE ZXSPECTRUM48
org $8000
jp start ; jump over data to code (extended immediate)
string:
db "hello"
STRING_LENGTH = 5
ROM_CLS = $0DAF ; ROM address for "Clear Screen" routine
COLOR_ATTR = $5800 ; start of color attribute memory
ENTER = $0D ; Character code for Enter key
BLACK_WHITE = $47 ; black paper, white ink
start:
im 1 ; Set interrupt mode to 1 (interrupt mode)
call ROM_CLS ; Call clear screen routine from ROM (extended immediate)
ld hl,string ; HL = address of string (register,extended immediate)
ld b,STRING_LENGTH ; B = length of string (register,immediate)
loop:
ld a,(hl) ; A = byte at address in HL (register,register indirect)
rst $10 ; print character code in A (modified page zero)
inc hl ; increment HL to address of next character (register)
dec b ; decrement B (register)
jr nz,loop ; if B not zero, jump back to top of loop (condition,relative)
ld a,ENTER ; A = Enter character code (register,immediate)
rst $10 ; print Enter for new line (modified page zero)
; Let's change the color of the first character we printed
ld a,BLACK_WHITE ; A = black/white color attribute (register,immediate)
ld (COLOR_ATTR),a ; Color attribute(0,0) = A (extended,register)
; Let's do it again, but unrolled and with the first letter capitalized
ld ix,string ; IX = address of string (register,extended immediate)
res 5,(ix) ; reset bit 5 of first character (bit,indexed)
ld a,(ix) ; A = string[0] (register,indexed)
rst $10 ; print character (modified page zero)
ld a,(ix+1) ; A = string[1] (register,indexed)
rst $10 ; print character (modified page zero)
ld a,(ix+2) ; A = string[2] (register,indexed)
rst $10 ; print character (modified page zero)
ld a,(ix+3) ; A = string[3] (register,indexed)
rst $10 ; print character (modified page zero)
ld a,(ix+4) ; A = string[4] (register,indexed)
rst $10 ; print character (modified page zero)
ld a,ENTER ; A = Enter character code (register,immediate)
rst $10 ; print Enter for new line (modified page zero)
; And, we're done
ret ; return from call (implied)
; Deployment: Snapshot
SAVESNA "video_2.sna", start
| 44.333333 | 86 | 0.599129 |
5c7676ef3894cacdf6661af4233ca5e042c84824 | 313 | asm | Assembly | oeis/329/A329837.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/329/A329837.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/329/A329837.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A329837: Beatty sequence for (4+sqrt(26))/5.
; Submitted by Jamie Morken(s3)
; 1,3,5,7,9,10,12,14,16,18,20,21,23,25,27,29,30,32,34,36,38,40,41,43,45,47,49,50,52,54,56,58,60,61,63,65,67,69,70,72,74,76,78,80,81,83,85,87,89,90,92,94,96,98,100,101,103,105,107,109,111,112,114
add $0,1
mul $0,91
sub $0,1
div $0,50
| 34.777778 | 194 | 0.664537 |
6b8b66f242c39898ebcb084d29099dfbe7c58d0e | 1,435 | asm | Assembly | programs/oeis/257/A257083.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/257/A257083.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/257/A257083.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A257083: Partial sums of A257088.
; 1,2,6,9,17,22,34,41,57,66,86,97,121,134,162,177,209,226,262,281,321,342,386,409,457,482,534,561,617,646,706,737,801,834,902,937,1009,1046,1122,1161,1241,1282,1366,1409,1497,1542,1634,1681,1777,1826,1926,1977,2081,2134,2242,2297,2409,2466,2582,2641,2761,2822,2946,3009,3137,3202,3334,3401,3537,3606,3746,3817,3961,4034,4182,4257,4409,4486,4642,4721,4881,4962,5126,5209,5377,5462,5634,5721,5897,5986,6166,6257,6441,6534,6722,6817,7009,7106,7302,7401,7601,7702,7906,8009,8217,8322,8534,8641,8857,8966,9186,9297,9521,9634,9862,9977,10209,10326,10562,10681,10921,11042,11286,11409,11657,11782,12034,12161,12417,12546,12806,12937,13201,13334,13602,13737,14009,14146,14422,14561,14841,14982,15266,15409,15697,15842,16134,16281,16577,16726,17026,17177,17481,17634,17942,18097,18409,18566,18882,19041,19361,19522,19846,20009,20337,20502,20834,21001,21337,21506,21846,22017,22361,22534,22882,23057,23409,23586,23942,24121,24481,24662,25026,25209,25577,25762,26134,26321,26697,26886,27266,27457,27841,28034,28422,28617,29009,29206,29602,29801,30201,30402,30806,31009,31417,31622,32034,32241,32657,32866,33286,33497,33921,34134,34562,34777,35209,35426,35862,36081,36521,36742,37186,37409,37857,38082,38534,38761,39217,39446,39906,40137,40601,40834,41302,41537,42009,42246,42722,42961,43441,43682,44166,44409,44897,45142,45634,45881,46377,46626
mul $0,6
add $0,5
div $0,4
pow $0,2
mov $1,$0
div $1,3
add $1,1
| 130.454545 | 1,333 | 0.797213 |
045096891634b2fd6f7963cd19ef49fa1b902ccb | 7,936 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1667.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1667.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1667.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1d93e, %rsi
lea addresses_D_ht+0x77fe, %rdi
nop
nop
nop
nop
xor $43829, %r9
mov $43, %rcx
rep movsb
nop
nop
add %r11, %r11
lea addresses_A_ht+0x140ee, %rsi
lea addresses_D_ht+0x159d0, %rdi
nop
nop
nop
nop
inc %rbp
mov $64, %rcx
rep movsw
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x191fe, %rcx
cmp %r8, %r8
movb (%rcx), %r11b
nop
add $61605, %r9
lea addresses_WC_ht+0x7a4e, %r9
nop
nop
nop
cmp $29641, %r11
mov (%r9), %ebp
nop
nop
nop
nop
xor $33796, %rbp
lea addresses_D_ht+0x83fe, %rcx
and %r8, %r8
mov $0x6162636465666768, %r11
movq %r11, (%rcx)
sub $37126, %r11
lea addresses_UC_ht+0x8eae, %rsi
add %rbp, %rbp
vmovups (%rsi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r9
nop
nop
nop
and $4068, %rdi
lea addresses_UC_ht+0x14773, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
xor %rbp, %rbp
mov (%rcx), %si
nop
nop
nop
sub %r8, %r8
lea addresses_WT_ht+0x1dfb2, %rsi
nop
nop
nop
nop
nop
sub %r8, %r8
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
vmovups %ymm7, (%rsi)
nop
nop
nop
nop
nop
dec %rsi
lea addresses_UC_ht+0x143fe, %rdi
xor $53872, %rsi
movw $0x6162, (%rdi)
nop
add %rdi, %rdi
lea addresses_WC_ht+0x157fe, %rsi
nop
xor $38870, %r9
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
add $14751, %r11
lea addresses_WT_ht+0x41fe, %rsi
lea addresses_D_ht+0x11dfe, %rdi
nop
nop
nop
dec %rdx
mov $96, %rcx
rep movsq
nop
nop
dec %rdx
lea addresses_A_ht+0x132be, %rsi
nop
nop
nop
nop
cmp $58295, %rbp
mov $0x6162636465666768, %rcx
movq %rcx, (%rsi)
nop
nop
sub %r9, %r9
lea addresses_D_ht+0x19bfe, %rdx
nop
nop
nop
nop
nop
and $971, %rdi
mov (%rdx), %cx
nop
add %r9, %r9
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rbx
push %rcx
push %rsi
// Store
lea addresses_D+0xfe16, %rsi
nop
nop
nop
nop
and $48546, %rcx
movl $0x51525354, (%rsi)
nop
nop
inc %rsi
// Store
lea addresses_WC+0x705e, %r14
nop
nop
nop
nop
nop
and %r13, %r13
movl $0x51525354, (%r14)
nop
nop
nop
nop
nop
sub %rcx, %rcx
// Load
mov $0x6006a100000008fe, %rcx
nop
nop
nop
nop
inc %r10
vmovups (%rcx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r14
nop
cmp $40842, %r15
// Faulty Load
lea addresses_WC+0x193fe, %r10
nop
sub $42646, %r15
mov (%r10), %r13w
lea oracles, %r10
and $0xff, %r13
shlq $12, %r13
mov (%r10,%r13,1), %r13
pop %rsi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 3, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WC', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'}
{'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
*/
| 32.129555 | 2,999 | 0.653478 |
82afee58daad453cae8617d6c84de6b54b30738c | 1,971 | asm | Assembly | rom_src/strings.asm | UzixLS/zx-sizif-512 | a785ff44d2d07241bd08f201daa745f8490761d9 | [
"MIT"
] | 85 | 2020-06-01T07:51:37.000Z | 2022-03-22T05:47:54.000Z | rom_src/strings.asm | UzixLS/zx-sizif-512 | a785ff44d2d07241bd08f201daa745f8490761d9 | [
"MIT"
] | 5 | 2021-01-16T22:50:40.000Z | 2022-03-20T10:12:28.000Z | rom_src/strings.asm | UzixLS/zx-sizif-512 | a785ff44d2d07241bd08f201daa745f8490761d9 | [
"MIT"
] | 12 | 2020-06-01T07:51:44.000Z | 2022-03-10T21:37:44.000Z | DB 0
IFDEF SIZIFXXS
str_sizif: DB "SIZIF-XXS",0
str_sizif_end:
ENDIF
IFDEF SIZIF512
str_sizif: DB "SIZIF-512",0
str_sizif_end:
ENDIF
str_pause DB " PAUSE ",0
str_pause_end:
str_exit: DB "Exit",0
str_exit_end:
str_exit_reboot: DB "& reboot ",0
str_exit_reboot_end:
str_exit_no_reboot: DB " ",0
str_exit_no_reboot_end:
str_on: DB " ON",0
str_on_end:
str_off: DB " OFF",0
str_off_end:
str_machine: DB "Machine",0
str_machine_end:
str_machine_48: DB " 48",0
str_machine_48_end:
str_machine_128: DB " 128",0
str_machine_128_end:
str_machine_3e: DB " +3e",0
str_machine_3e_end:
str_machine_pentagon: DB "Pentagon",0
str_machine_pentagon_end:
str_cpu: DB "CPU freq",0
str_cpu_end:
str_cpu_35: DB "3.5MHz",0
str_cpu_35_end:
str_cpu_44: DB "4.4MHz",0
str_cpu_44_end:
str_cpu_52: DB "5.2MHz",0
str_cpu_52_end:
str_cpu_7: DB " 7MHz",0
str_cpu_7_end:
str_cpu_14: DB " 14MHz",0
str_cpu_14_end:
str_panning: DB "Panning",0
str_panning_end:
str_panning_abc: DB " ABC",0
str_panning_abc_end:
str_panning_acb: DB " ACB",0
str_panning_acb_end:
str_panning_mono: DB "Mono",0
str_panning_mono_end:
str_joystick: DB "Joystick",0
str_joystick_end:
str_joystick_kempston: DB "Kempston",0
str_joystick_kempston_end:
str_joystick_sinclair: DB "Sinclair",0
str_joystick_sinclair_end:
str_rom48: DB "48K ROM",0
str_rom48_end:
str_rom48_default: DB "Default",0
str_rom48_default_end:
str_rom48_lg: DB " LG",0
str_rom48_lg_end:
str_rom48_opense: DB " OpenSE",0
str_rom48_opense_end:
str_divmmc: DB "DivMMC",0
str_divmmc_end:
str_divmmc_noos: DB "NO OS",0
str_divmmc_noos_end:
str_ulaplus: DB "ULA+",0
str_ulaplus_end
str_dac: DB "DAC",0
str_dac_end
str_dac_covox: DB " Covox",0
str_dac_covox_end
str_dac_sd: DB " SD",0
str_dac_sd_end
str_dac_covoxsd: DB "Covox+SD",0
str_dac_covoxsd_end
str_tsfm: DB "TSFM+MIDI",0
str_tsfm_end
str_saa: DB "SAA1099",0
str_saa_end
str_gs: DB "GS",0
str_gs_end
| 15.642857 | 40 | 0.747336 |
23c6d8cb202aafd2fcea7e890094a36cca0d45b0 | 287 | asm | Assembly | libsrc/_DEVELOPMENT/arch/sms/globals/z80/_GLOBAL_SMS_VDP_R0R1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/sms/globals/z80/_GLOBAL_SMS_VDP_R0R1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/sms/globals/z80/_GLOBAL_SMS_VDP_R0R1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | INCLUDE "config_private.inc"
SECTION data_arch
PUBLIC _GLOBAL_SMS_VDP_R0R1
PUBLIC _GLOBAL_SMS_VDP_R0
PUBLIC _GLOBAL_SMS_VDP_R1
_GLOBAL_SMS_VDP_R0R1:
defb __SMS_VDP_R0, __SMS_VDP_R1
defc _GLOBAL_SMS_VDP_R0 = _GLOBAL_SMS_VDP_R0R1
defc _GLOBAL_SMS_VDP_R1 = _GLOBAL_SMS_VDP_R0R1 + 1
| 19.133333 | 50 | 0.860627 |
b878072b0f3da468571f71996308d22a2653dd96 | 735 | asm | Assembly | oeis/291/A291006.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/291/A291006.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/291/A291006.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A291006: p-INVERT of (1,1,1,1,1,...), where p(S) = 1 - S - S^2 - S^3 - S^4.
; Submitted by Jamie Morken(s4)
; 1,3,9,27,80,235,688,2013,5891,17244,50482,147791,432672,1266680,3708288,10856241,31782309,93044665,272394011,797450348,2334585333,6834643282,20008841823,58577124509,171488162320,502042223184,1469759722591,4302812676894,12596750780526,36877768599840,107961953093765,316065308676367,925300779450229,2708875377802959,7930400552377400,23216739107488335,67968442605790000,198981828105504761,582531633773756415,1705397460551995652,4992656758597165506,14616312083106896043,42790159476295373664
lpb $0
sub $0,1
add $1,1
add $3,$2
add $2,1
sub $3,$4
add $3,$1
add $4,$2
add $1,$4
add $2,$3
lpe
mov $0,$2
add $0,1
| 40.833333 | 488 | 0.770068 |
55486738324f5c09407cebf9521534c666571179 | 630 | asm | Assembly | LOWERCASE TO UPPERCASE.asm | selectiveduplicate/8086-assembly | c7c1e9e2a0841a9ed775cb10380122fb6c8122b6 | [
"MIT"
] | 2 | 2020-04-11T00:32:34.000Z | 2022-02-05T16:23:25.000Z | LOWERCASE TO UPPERCASE.asm | selectiveduplicate/8086-assembly | c7c1e9e2a0841a9ed775cb10380122fb6c8122b6 | [
"MIT"
] | null | null | null | LOWERCASE TO UPPERCASE.asm | selectiveduplicate/8086-assembly | c7c1e9e2a0841a9ed775cb10380122fb6c8122b6 | [
"MIT"
] | 3 | 2018-04-16T13:46:18.000Z | 2021-05-07T06:51:31.000Z | TITLE LOWER_TO_UPPER
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV AX, @DATA ;initializing DS
MOV DS, AX
MOV AH, 1 ;signle character input
INT 021H
MOV BL, AL ;store the char temporarily on BL
AND BL, 0DFH ;change 5-th bit to get lowercase
MOV AH, 2 ;code for a newline
MOV DL, 0DH
INT 021H
MOV DL, 0AH
INT 021H
MOV DL, BL ;move to DL for displaying
INT 021H ;display the shit
MAIN ENDP
END MAIN | 21.724138 | 66 | 0.477778 |
889b258d8e7c3d674fab3b6bebe6699a3d1f494d | 61 | asm | Assembly | P5/P5_TestCode/P5_L1_testcase28/P5_L1_testcase28/mips28.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P5/P5_TestCode/P5_L1_testcase28/mips28.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P5/P5_TestCode/P5_L1_testcase28/mips28.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | ori $t1,$t1,1
ori $t2,$t2,2
addu $t0,$t1,$t2
nop
sw $t0,0($0) | 12.2 | 16 | 0.57377 |
8cf01c4e6c732e495218e1c335cec2ee29c714d8 | 7,705 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_357.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_357.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_357.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x13082, %rbx
nop
inc %rcx
mov (%rbx), %r13
nop
nop
add %r12, %r12
lea addresses_WC_ht+0x103e2, %rdx
nop
nop
nop
nop
nop
and $6686, %r15
movl $0x61626364, (%rdx)
nop
cmp $5049, %r12
lea addresses_A_ht+0x1ceaa, %rsi
lea addresses_WT_ht+0x134aa, %rdi
nop
nop
add $11603, %r13
mov $37, %rcx
rep movsw
nop
and $26311, %r15
lea addresses_normal_ht+0x123aa, %rbx
cmp $46941, %rdi
mov (%rbx), %cx
nop
nop
nop
dec %rdx
lea addresses_normal_ht+0x921a, %rdx
clflush (%rdx)
nop
nop
nop
and $49778, %r12
mov (%rdx), %rcx
nop
nop
and $49106, %rbx
lea addresses_WC_ht+0x8caa, %rsi
lea addresses_WC_ht+0x1dcaa, %rdi
nop
xor %r15, %r15
mov $103, %rcx
rep movsq
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x194aa, %rdx
nop
nop
nop
xor %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%rdx)
nop
nop
inc %r15
lea addresses_UC_ht+0x1b9c2, %r13
nop
sub $46962, %rcx
mov (%r13), %r12
nop
nop
nop
add $32818, %rsi
lea addresses_WC_ht+0xe0aa, %rsi
lea addresses_WT_ht+0x1a682, %rdi
dec %rdx
mov $60, %rcx
rep movsw
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0xfaac, %rdx
nop
nop
nop
nop
and $52413, %r15
mov (%rdx), %r12d
nop
sub %rdi, %rdi
lea addresses_WC_ht+0x252a, %rsi
nop
nop
nop
nop
nop
inc %rdx
mov (%rsi), %r13d
nop
nop
and %r15, %r15
lea addresses_A_ht+0xf9ea, %rsi
lea addresses_D_ht+0x1e42a, %rdi
and $49800, %rbx
mov $47, %rcx
rep movsl
nop
xor %r12, %r12
lea addresses_D_ht+0x16267, %r15
add %rbx, %rbx
mov $0x6162636465666768, %r12
movq %r12, %xmm4
vmovups %ymm4, (%r15)
nop
nop
add %r15, %r15
lea addresses_WT_ht+0xb06a, %rdi
nop
xor %rcx, %rcx
movw $0x6162, (%rdi)
nop
nop
add $10124, %rbx
lea addresses_normal_ht+0x658a, %rsi
lea addresses_normal_ht+0xeb52, %rdi
clflush (%rsi)
clflush (%rdi)
nop
xor %rdx, %rdx
mov $55, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $10458, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %rax
push %rbp
push %rdx
push %rsi
// Faulty Load
lea addresses_WT+0xacaa, %rdx
nop
nop
nop
nop
nop
and $38955, %rsi
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %rbp
lea oracles, %rax
and $0xff, %rbp
shlq $12, %rbp
mov (%rax,%rbp,1), %rbp
pop %rsi
pop %rdx
pop %rbp
pop %rax
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': True}}
{'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
*/
| 36.516588 | 2,999 | 0.658144 |
cd87e21654aba88d716d08d3a4d6fda567cfb15d | 110 | asm | Assembly | pkgs/tools/yasm/src/modules/objfmts/bin/tests/reserve.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/objfmts/bin/tests/reserve.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/objfmts/bin/tests/reserve.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | ; Test res* family
resb 5
resw 10
resd 50
resq 1
rest 0
[section .bss]
resb 1
resw 5
resd 10
resq 40
rest 4
| 7.333333 | 18 | 0.7 |
c3ddcdd94b705f60a4b220ba9aec6d43be39bb06 | 871 | asm | Assembly | data/pokemon/base_stats/venusaur.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/base_stats/venusaur.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/base_stats/venusaur.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | db 0 ; species ID placeholder
db 80, 82, 83, 80, 100, 100
; hp atk def spd sat sdf
db GRASS, POISON ; type
db 45 ; catch rate
db 208 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F12_5 ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/venusaur/front.dimensions"
db GROWTH_MEDIUM_SLOW ; growth rate
dn EGG_MONSTER, EGG_PLANT ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm ROAR, TOXIC, BULLET_SEED, HIDDEN_POWER, SUNNY_DAY, HYPER_BEAM, PROTECT, GIGA_DRAIN, FRUSTRATION, SOLARBEAM, EARTHQUAKE, RETURN, DOUBLE_TEAM, SLUDGE_BOMB, FACADE, SECRET_POWER, REST, ATTRACT, ENERGY_BALL, ENDURE, GIGA_IMPACT, FLASH, SWORDS_DANCE, CAPTIVATE, SLEEP_TALK, NATURAL_GIFT, GRASS_KNOT, SWAGGER, SUBSTITUTE, CUT, STRENGTH, ROCK_SMASH, ROCK_CLIMB, FRENZY_PLANT, FURY_CUTTER, KNOCK_OFF, MUD_SLAP, OUTRAGE, SEED_BOMB, SNORE, SYNTHESIS
; end
| 43.55 | 446 | 0.753157 |
784ab680e03973a8d5283ff34b1576ba599f8ea1 | 430 | asm | Assembly | oeis/012/A012960.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/012/A012960.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/012/A012960.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A012960: Expansion of e.g.f. exp(arctan(x)+log(x+1)).
; Submitted by Christian Krause
; 1,2,3,2,-11,-30,175,1010,-6135,-60670,374875,5719650,-35199875,-779710750,4687746375,145208599250,-836951243375,-35435177514750,191995883837875,10975003189933250,-54688433347786875
mov $2,1
mov $4,1
lpb $0
sub $3,$4
sub $3,$2
mul $2,$0
mul $3,$0
sub $0,1
add $2,$4
add $3,$4
mov $4,$2
add $2,$3
mov $3,$1
lpe
mov $0,$4
| 21.5 | 182 | 0.662791 |
3215d6d8f4f7ed09e6e5620ffcba1264fb98e706 | 85,155 | asm | Assembly | Library/Cards/game.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Cards/game.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Cards/game.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: Solitaire
FILE: game.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 9/90 Initial Version
DESCRIPTION:
This file contains method handlers for GameClass.
RCS STAMP:
$Id: game.asm,v 1.1 97/04/04 17:44:41 newdeal Exp $
------------------------------------------------------------------------------@
CardsClassStructures segment resource
GameClass
CardsClassStructures ends
;---------------------------------------------------
CardsCodeResource segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSaveState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Game method for MSG_GAME_SAVE_STATE
Marks the game object dirty, and sends a message to the
decks telling them to save state.
Called by: MSG_GAME_SAVE_STATE
Pass: *ds:si = Game object
ds:di = Game instance
Return: nothing
Destroyed: ax
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Feb 18, 1993 Initial version.
PW March 23, 1993 modified.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSaveState method dynamic GameClass, MSG_GAME_SAVE_STATE
.enter
call ObjMarkDirty
mov ax, MSG_DECK_SAVE_STATE
call VisSendToChildren
.leave
ret
GameSaveState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRestoreState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Game method for MSG_GAME_RESTORE_STATE
seeds the random number generator.
Called by: MSG_GAME_RESTORE_STATE
Pass: *ds:si = Game object
ds:di = Game instance
Return: nothing
Destroyed: ax, dx
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Feb 18, 1993 Initial version.
PW March 23, 1993 modified.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRestoreState method dynamic GameClass, MSG_GAME_RESTORE_STATE
.enter
call TimerGetCount
mov_trash dx, ax
mov ax, MSG_GAME_SEED_RANDOM
call ObjCallInstanceNoLock
.leave
ret
GameRestoreState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSendToDecksNoSave
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Sends a message to all the decks, *not* saving
registers between calls
Pass: *ds:si - game
ax,cx,dx,bp - message data
Return: ax,cx,dx,bp - return values from message
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Feb 18, 1993 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if 0
GameSendToDecksNoSave proc near
uses bx, di
.enter
clr bx ; initial child (first
push bx ; child of
push bx ; composite)
mov bx, offset VI_link ; Pass offset to LinkPart
push bx
clr bx ; Use standard function
push bx
mov bx, OCCT_DONT_SAVE_PARAMS_DONT_TEST_ABORT
push bx
mov bx, offset Vis_offset
mov di, offset VCI_comp
call ObjCompProcessChildren
.leave
ret
GameSendToDecksNoSave endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameGetVMFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Game method for MSG_GAME_GET_VM_FILE
Called by: MSG_GAME_GET_VM_FILE
Pass: *ds:si = Game object
ds:di = Game instance
Return: carry set if error, else
cx - VM file handle of card bitmaps
ax - map block to bitmaps
Destroyed: ax
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Sep 2, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameGetVMFile method dynamic GameClass, MSG_GAME_GET_VM_FILE
.enter
mov cx, ds:[di].GI_vmFile
mov ax, ds:[di].GI_mapBlock
.leave
ret
GameGetVMFile endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRestoreBitmaps
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Will read in the BitMap's of the cards
CALLED BY: MSG_GEM_PROCESS_OPEN_APPLICATION handler
PASS: *ds:si = GameClass object
RETURN: nothing
DESTROYED: di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
PW 3/17/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRestoreBitmaps method dynamic GameClass,
MSG_GAME_RESTORE_BITMAPS
.enter
;
; find out our display scheme, determine which resolutio
; to use for the card deck, and setup our geometry
;
mov ax, MSG_GEN_APPLICATION_GET_DISPLAY_SCHEME
call GenCallApplication
push ax ;save DisplayType
Deref_DI Game_offset
mov ds:[di].GI_displayScheme, ah
NOFXIP< segmov es, dgroup, bx ;es = dgroup >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefES ;es = dgroup >
mov bx, es:vmFileHandle
mov ds:[di].GI_vmFile, bx
call ObjMarkDirty
call VMGetMapBlock
call VMLock
pop bx ;bh <- DisplayType
push bp ;save handle
mov es, ax ;ds <- segment of
;map block
;; now run through the map block and find the set of bitmaps
;; we want given the DisplayType.
mov cx, es:[DDS_arrayLength]
mov di, offset DDS_DRS - size DeckResStruct
; es:[di] -> first DRS minus one DRS
; to account for how the
; loop's written
startLoop:
add di, size DeckResStruct
cmp bh, es:[di].DRS_displayType
loopne startLoop
;es:di = DeckResStruct of resolution map to use. This means we
;default to the last entry in the array if nothing else matches.
mov bp, ds:[si]
add bp, ds:[bp].Game_offset
mov ax, es:[di].DRS_mapBlock
mov ds:[bp].GI_mapBlock, ax
call ObjMarkDirty
pop bp ;restore mapblock handle
call VMUnlock
mov ax, MSG_GAME_GET_VM_FILE
call ObjCallInstanceNoLock
mov_tr bx, cx ;bx <- vm file handle
call VMLock
push bp ;save block handle for
;unlocking
push ax ;save block segment for later
mov di, ds ;di <- game segment
mov ds, ax ;ds <- bitmap segment
push si
mov si, ds:[0].DMS_interior ;*ds:si -> interior region
call CopyRegionToChunk
pop si
Deref_DI Game_offset
mov ds:[di].GI_interiorReg, ax
call ObjMarkDirty
pop ax ;restore block segment
mov di, ds ;di <- game segment
mov ds, ax ;ds <- bitmap segment
push si
mov si, ds:[DMS_frame] ;*ds:si -> frame reg
call CopyRegionToChunk
pop si
Deref_DI Game_offset
mov ds:[di].GI_frameReg, ax
call ObjMarkDirty
pop bp
call VMUnlock
push si
mov al, mask OCF_IGNORE_DIRTY ;fade array don't go to state
mov bx, size optr ;each element of the array
;will hold an optr
clr cx, si
call ChunkArrayCreate
mov bp, si ;bp <- array offset
pop si
Deref_DI Game_offset
mov ds:[di].GI_fadeArray, bp
mov ax, MSG_GAME_SEND_CARD_BACK_NOTIFICATION
call ObjCallInstanceNoLock
.leave
ret
GameRestoreBitmaps endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetupStuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SETUP_STUFF handler for GameClass
Sets up various sizes and defaults necessary when first
loading the game in.
CALLED BY: called by MSG_GEN_PROCESS_OPEN_APPLICATION handler
PASS: *ds:si = game object
CHANGES: initializes some data slots
RETURN: nothing
DESTROYED: di
PSEUDO CODE/STRATEGY:
sets size (currently height=width=600)
tells geometry manager to not manage children
KNOWN BUGS/IDEAS:
could be moved to some ui file?
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetupStuff method GameClass,MSG_GAME_SETUP_STUFF
call TimerGetCount
mov_trash dx, ax
mov ax, MSG_GAME_SEED_RANDOM
call ObjCallInstanceNoLock
;
; find out our display scheme, determine which resolutio
; to use for the card deck, and setup our geometry
;
mov ax, MSG_GEN_APPLICATION_GET_DISPLAY_SCHEME
call GenCallApplication
push ax ;save DisplayType
Deref_DI Game_offset
mov ds:[di].GI_displayScheme, ah
NOFXIP< segmov es, dgroup, bx ;es = dgroup >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefES ;es = dgroup >
mov bx, es:vmFileHandle
mov ds:[di].GI_vmFile, bx
call ObjMarkDirty
call VMGetMapBlock
call VMLock
pop bx ;bh <- DisplayType
push bp ;save handle
mov es, ax ;ds <- segment of
;map block
;; now run through the map block and find the set of bitmaps
;; we want given the DisplayType.
mov cx, es:[DDS_arrayLength]
mov di, offset DDS_DRS - size DeckResStruct
; es:[di] -> first DRS minus one DRS
; to account for how the
; loop's written
startLoop:
add di, size DeckResStruct
cmp bh, es:[di].DRS_displayType
loopne startLoop
;es:di = DeckResStruct of resolution map to use. This means we
;default to the last entry in the array if nothing else matches.
mov bp, ds:[si]
add bp, ds:[bp].Game_offset
mov ax, es:[di].DRS_mapBlock
mov ds:[bp].GI_mapBlock, ax
call ObjMarkDirty
mov cx, es:[di].DRS_upSpreadX
mov dx, es:[di].DRS_upSpreadY
mov ax, MSG_GAME_SET_UP_SPREADS
call ObjCallInstanceNoLock
mov cx, es:[di].DRS_downSpreadX
mov dx, es:[di].DRS_downSpreadY
mov ax, MSG_GAME_SET_DOWN_SPREADS
call ObjCallInstanceNoLock
mov cx, es:[di].DRS_fontSize
mov ax, MSG_GAME_SET_FONT_SIZE
call ObjCallInstanceNoLock
pop bp ;restore mapblock handle
push es:[di].DRS_deckSpreadX
push es:[di].DRS_deckSpreadY
call VMUnlock
mov ax, MSG_GAME_GET_VM_FILE
call ObjCallInstanceNoLock
mov_tr bx, cx ;bx <- vm file handle
call VMLock
push bp ;save block handle for
;unlocking
push ax ;save block segment for later
mov di, ds ;di <- game segment
mov ds, ax ;ds <- bitmap segment
push si
mov si, ds:[0].DMS_interior ;*ds:si -> interior region
call CopyRegionToChunk
pop si
Deref_DI Game_offset
mov ds:[di].GI_interiorReg, ax
call ObjMarkDirty
pop ax ;restore block segment
mov di, ds ;di <- game segment
mov ds, ax ;ds <- bitmap segment
push si
mov si, ds:[DMS_frame] ;*ds:si -> frame reg
call CopyRegionToChunk
pop si
Deref_DI Game_offset
mov ds:[di].GI_frameReg, ax
call ObjMarkDirty
mov ax, MSG_GAME_SET_CARD_DIMENSIONS
call ObjCallInstanceNoLock
pop bp
call VMUnlock
push si
mov al, mask OCF_IGNORE_DIRTY ;fade array don't go to state
mov bx, size optr ;each element of the array
;will hold an optr
clr cx, si
call ChunkArrayCreate
mov bp, si ;bp <- array offset
pop si
Deref_DI Game_offset
mov ds:[di].GI_fadeArray, bp
pop dx
pop cx
mov ax, MSG_GAME_SETUP_GEOMETRY
call ObjCallInstanceNoLock
mov ax, MSG_GAME_SEND_CARD_BACK_NOTIFICATION
call ObjCallInstanceNoLock
ret
GameSetupStuff endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetCardDimensions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_CARD_DIMENSIONS handler for GameClass
CALLED BY:
PASS: *ds:si = game instance
cx, dx = width, height of a card
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 27 nov 1992 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetCardDimensions method dynamic GameClass, MSG_GAME_SET_CARD_DIMENSIONS
uses cx, dx, bp
.enter
mov ds:[di].GI_cardWidth, cx
mov ds:[di].GI_cardHeight, dx
call ObjMarkDirty
mov ax, MSG_VIS_SET_SIZE
call VisSendToChildren
.leave
ret
GameSetCardDimensions endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetUpSpreads
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_UP_SPREADS handler for GameClass
CALLED BY:
PASS: *ds:si = game instance
cx, dx = x,y spreads for face up cards
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 27 nov 1992 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetUpSpreads method dynamic GameClass, MSG_GAME_SET_UP_SPREADS
.enter
mov ds:[di].GI_upSpreadX, cx
mov ds:[di].GI_upSpreadY, dx
call ObjMarkDirty
mov ax, MSG_DECK_SET_UP_SPREADS
call VisSendToChildren
.leave
ret
GameSetUpSpreads endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetDownSpreads
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_DOWN_SPREADS handler for GameClass
CALLED BY:
PASS: *ds:si = game instance
cx, dx = x,y spreads for face down cards
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 27 nov 1992 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetDownSpreads method dynamic GameClass, MSG_GAME_SET_DOWN_SPREADS
.enter
mov ds:[di].GI_downSpreadX, cx
mov ds:[di].GI_downSpreadY, dx
call ObjMarkDirty
mov ax, MSG_DECK_SET_DOWN_SPREADS
call VisSendToChildren
.leave
ret
GameSetDownSpreads endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSendCardBackNotification
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Game method for MSG_GAME_SEND_CARD_BACK_NOTIFICATION
Called by: MSG_GAME_SEND_CARD_BACK_NOTIFICATION
Pass: *ds:si = Game object
ds:di = Game instance
Return: nothing
Destroyed: ax
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Oct 19, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSendCardBackNotification method dynamic GameClass,
MSG_GAME_SEND_CARD_BACK_NOTIFICATION
uses cx,dx,bp
.enter
mov bx, size NotifyCardBackChange
call GameAllocNotifyBlock
jc done
call MemLock
mov es, ax
mov ax, MSG_GAME_GET_VM_FILE
call ObjCallInstanceNoLock
mov es:[NCBC_vmFile], cx
mov es:[NCBC_mapBlock], ax
mov di, ds:[si]
add di, ds:[di].Game_offset
mov ax, ds:[di].GI_cardWidth
mov es:[NCBC_cardWidth], ax
mov ax, ds:[di].GI_cardHeight
mov es:[NCBC_cardHeight], ax
call MemUnlock
mov dx, GWNT_CARD_BACK_CHANGE
mov cx, GAGCNLT_APP_TARGET_NOTIFY_CARD_BACK_CHANGE
call GameUpdateControllerLow
done:
.leave
ret
GameSendCardBackNotification endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameAllocNotifyBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate the block of memory that will be used to
update the UI.
CALLED BY:
PASS: bx - size to allocate
RETURN: bx - block handle
carry set if unable to allocate
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Initialize to zero
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 1/ 2/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameAllocNotifyBlock proc near
uses ax, cx
.enter
mov ax, bx ; size
mov cx, ALLOC_DYNAMIC or mask HF_SHARABLE or \
(mask HAF_ZERO_INIT) shl 8
call MemAlloc
jc done
mov ax, 1
call MemInitRefCount
clc
done:
.leave
ret
GameAllocNotifyBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameUpdateControllerLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Low-level routine to update a UI controller
CALLED BY:
PASS: bx - Data block to send to controller, or 0 to send
null data (on LOST_SELECTION)
cx - GenAppGCNListType
dx - NotifyStandardNotificationTypes
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 12/30/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameUpdateControllerLow proc far
uses ax,bx,cx,dx,di,si,bp
.enter
; create the event
call MemIncRefCount ;one more reference
push bx, cx, si
mov ax, MSG_META_NOTIFY_WITH_DATA_BLOCK
mov cx, MANUFACTURER_ID_GEOWORKS
mov bp, bx ; data block
clr bx, si
mov di, mask MF_RECORD
call ObjMessage ; di is event
pop bx, cx, si
; Create messageParams structure on stack
mov dx, size GCNListMessageParams ; create stack frame
sub sp, dx
mov bp, sp
mov ss:[bp].GCNLMP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS
mov ss:[bp].GCNLMP_ID.GCNLT_type, cx
push bx ; data block
mov ss:[bp].GCNLMP_block, bx
mov ss:[bp].GCNLMP_event, di
; If data block is null, then set the IGNORE flag, otherwise
; just set the SET_STATUS_EVENT flag
mov ax, mask GCNLSF_SET_STATUS
tst bx
jnz gotFlags
ornf ax, mask GCNLSF_IGNORE_IF_STATUS_TRANSITIONING
gotFlags:
mov ss:[bp].GCNLMP_flags, ax
mov ax, MSG_GEN_PROCESS_SEND_TO_APP_GCN_LIST
mov bx, ds:[LMBH_handle]
call MemOwner ; bx <- owner
clr si
mov di, mask MF_STACK or mask MF_FIXUP_DS
call ObjMessage
pop bx ; data block
add sp, size GCNListMessageParams ; fix stack
call MemDecRefCount ; we're done with it
.leave
ret
GameUpdateControllerLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameUpdateFadeArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_UPDATE_FADE_ARRAY handler for GameClass
Manages the chunkarray that keeps track of which
cards are fading. Cards send this method to the
game object, along with a request to add or remove it
from the array. This method also controls the timer
used to send fade methods (i.e., it starts and stops
the timer when necessary).
If a card that already appears in the array asks to be
added, or if a card not in the array asks to be removed,
no action is taken.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = card requesting an array change
bp = PLEASE_ADD_ME_TO_THE_ARRAY if card wants its OD
included in the array,
PLEASE_REMOVE_ME_FROM_THE_ARRAY if card wants
its OD out of the array
CHANGES: If array initially has 0 items, and adds a card to
itself, then a timer is started (which tells the game
when to fade cards in) and a gstate is created (to fade
the cards through).
If the array has an item to begin with, and removes it,
then the timer is stopped and the gstate destroyed.
RETURN: nothing
DESTROYED: ax, bx, cx, dx, bp, di
PSEUDO CODE/STRATEGY:
if (card is already in the array) {
if (card wants to be removed) {
remove it;
}
}
else {
if (card wants to be added) {
add it;
}
}
if (array was empty to start with) {
if (array is not empty now) {
create gstate;
start timer;
}
}
else if (array had one element to start with) {
if (array is now empty) {
stop timer;
destroy gstate;
}
}
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11/29/90 Added to implement the
chunkarray fading mechanism
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PLEASE_ADD_ME_TO_THE_ARRAY = 1
PLEASE_REMOVE_ME_FROM_THE_ARRAY = -1
ADDED_TO_THE_ARRAY = 100
REMOVED_FROM_THE_ARRAY = -100
CARD_FADE_PERIOD = 2 ;Timer ticks between fades
GameUpdateFadeArray method GameClass, MSG_GAME_UPDATE_FADE_ARRAY
push si
mov si, ds:[di].GI_fadeArray ;*ds:si = array
push cx
call ChunkArrayGetCount ;get initial array
pop ax ;length
push cx
mov cx, ax
mov bx, cs
mov di, offset FindElementInFadeArray
clr ax
call ChunkArrayEnum ;check to see whether
tst ax ;the card is already
jz didntFindCard ;in the array
cmp bp, PLEASE_ADD_ME_TO_THE_ARRAY ;if card wants to fade and is
je endGameUpdateFadeArray ;already on the list, then done
mov di, ax
call ChunkArrayDelete ;else get it off the list.
mov bp, REMOVED_FROM_THE_ARRAY
CallObjectCXDX MSG_CARD_CLEAR_FADING, MF_FIXUP_DS
jmp endGameUpdateFadeArray
didntFindCard:
cmp bp, PLEASE_REMOVE_ME_FROM_THE_ARRAY ;if card wants to be
je endGameUpdateFadeArray ;removed and already
;is, then done.
call ChunkArrayAppend
mov bp, ADDED_TO_THE_ARRAY
mov ds:[di].handle, cx
mov ds:[di].chunk, dx
endGameUpdateFadeArray:
pop ax
pop si
cmp ax, 1
jg done
je hadOneCardToBeginWith
;didntHaveCardsToBeginWith:
cmp bp, ADDED_TO_THE_ARRAY
jne done
;
; we had no cards to begin with, and now we've added one,
; so we need to start a timer and a gstate
;
mov ax, MSG_VIS_VUP_CREATE_GSTATE
call ObjCallInstanceNoLock
mov bx, ds:[LMBH_handle]
mov al, TIMER_EVENT_ONE_SHOT
mov cx, CARD_FADE_PERIOD
mov dx, MSG_GAME_DISTRIBUTE_FADE
call TimerStart
Deref_DI Game_offset
mov ds:[di].GI_gState, bp
call ObjMarkDirty
if 0 ;;; unnecessary for one shot
mov ds:[di].GI_faderHandle, bx
call ObjMarkDirty
endif
jmp done
hadOneCardToBeginWith:
cmp bp, REMOVED_FROM_THE_ARRAY
jne done
;
; we had one card at the beginning, and removed it, so
; we need to stop our fade timer and destroy our gstate
;
Deref_DI Game_offset
if 0 ;;;changed to one-shot
clr bx
xchg bx, ds:[di].GI_faderHandle
call ObjMarkDirty
EC< tst bx >
EC< ERROR_Z CANT_STOP_TIMER_WITH_NULL_HANDLE >
clr ax ; 0 => continual
call TimerStop
endif
clr bx
xchg bx, ds:[di].GI_gState
call ObjMarkDirty
EC< tst bx >
EC< ERROR_Z CANT_DESTROY_GSTATE_WITH_NULL_HANDLE >
mov di, bx
call GrDestroyState
done:
ret
GameUpdateFadeArray endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FindElementInArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for chunk array to find an OD in the
array
CALLED BY: ChunkArrayEnum within GameUpdateFadeArray
PASS: ds:di = array element
^lcx:dx = card to check
CHANGES:
RETURN: if card OD matches this element, then:
carry set
ds:ax = element
if card OD doesn't match this element, then
carry clear
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FindElementInFadeArray proc far
cmp ds:[di].chunk, dx
jne noMatch
cmp ds:[di].handle, cx
jne noMatch
mov ax, di
stc
jmp done
noMatch:
clc
done:
ret
FindElementInFadeArray endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRegisterDrag
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_REGISTER_DRAG handler for GameClass
Stores the OD of the deck dragging cards so that we know
to pass on MSG_META_EXPOSED to it.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = instance of DeckClass
CHANGES:
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRegisterDrag method GameClass, MSG_GAME_REGISTER_DRAG
mov ds:[di].GI_dragger.handle, cx ;^lGI_dragger <- OD
mov ds:[di].GI_dragger.chunk, dx ;of dragging deck
call ObjMarkDirty
ret
GameRegisterDrag endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDeckSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_DECK_SELECTED handler for GameClass
CALLED BY:
PASS: ^lcx:dx = selected deck
bp = # of card in deck's composite that was selected
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
default action is to send deck a MSG_DECK_DRAG_OR_FLIP
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDeckSelected method GameClass, MSG_GAME_DECK_SELECTED
mov bx, cx
mov si, dx
mov ax, MSG_DECK_DRAG_OR_FLIP
mov di, mask MF_FIXUP_DS
GOTO ObjMessage
GameDeckSelected endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_VIS_DRAW handler for GameClass
CALLED BY:
PASS: *ds:si = game object
bp = gstate to draw through
cl = DrawFlags
CHANGES:
RETURN: nothing
DESTROYED: ax, bx, cx, dx, bp, di
PSEUDO CODE/STRATEGY:
call super class
check to see if we have a dragging deck
if so, and if this MSG_VIS_DRAW is an update, tell
the deck to draw the dragged cards.
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDraw method GameClass, MSG_VIS_DRAW
push cx ;save DrawFlags
push bp
mov di, offset GameClass
CallSuper MSG_VIS_DRAW
pop bp ;restore gstate
Deref_DI Game_offset
mov bx, ds:[di].GI_dragger.handle ;bx <- dragger handle
pop cx ;restore DrawFlags
tst bx
jz dontDrawDragger ;if no dragger, end
test cl, mask DF_EXPOSED ;is it an update?
jz dontDrawDragger ;if not, end
;drawDragger:
;
; If we have a dragging deck and the call is an update,
; we want to draw the dragged cards in case they went off the
; edge of the screen and came back
;
mov si, ds:[di].GI_dragger.chunk
mov ax, MSG_DECK_DRAW_DRAGS
mov di, mask MF_FIXUP_DS or mask MF_CALL
call ObjMessage
dontDrawDragger:
ret
GameDraw endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameUpdateScore
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Updates the score internally and on screen
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
if score is to be zeroed:
cx = dx = 0
if score is to be set absolutely but not to 0:
cx = value to set score to
if score is to be incremented or decremented:
cx = 0, dx = amount to add to current score
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
sets up score, time then calls ScoreToTextObject
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 7/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameUpdateScore method GameClass, MSG_GAME_UPDATE_SCORE
tst cx ;set score absolutely?
jnz continue ;if so, do it
tst dx ;setting score to zero?
jz continue ;if so, do it
;addToScore: ;otherwise we're adjusting
mov cx, ds:[di].GI_score ;the score relatively
add cx, dx
continue:
mov ax, MSG_GAME_CHECK_MINIMUM_SCORE
call ObjCallInstanceNoLock
;setScore:
mov ds:[di].GI_score, cx ;save the score
call ObjMarkDirty
mov si, ds:[di].GI_scoreOutput.chunk
mov di, ds:[di].GI_scoreOutput.handle
; segmov es, ss
call ScoreToTextObject ;write score out
;endGameUpdateScore:
ret
GameUpdateScore endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameGetBackBitmap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_GET_BACK_BITMAP handler for GameClass
Returns a pointer to the bitmap to be drawn as the backside
of the deck.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES: nothing
RETURN: ^lcx:dx = bitmap
DESTROYED: bx, cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameGetBackBitmap method GameClass, MSG_GAME_GET_BACK_BITMAP
push ds:[di].GI_whichBack
mov ax, MSG_GAME_GET_VM_FILE
call ObjCallInstanceNoLock
mov bx, cx ;bx <- vm file handle
mov di, ds:[si]
add di, ds:[di].Game_offset
pop si ;si <- which back
call VMLock
push bp
test ds:[di].GI_gameAttrs, mask GA_USE_WIN_BACK
push ds
mov ds, ax
jz regularBack
mov cx, ds:[DMS_winBack].handle
mov dx, ds:[DMS_winBack].chunk
jmp unlock
regularBack:
cmp si, ds:DMS_numBacks
jb haveBack
;
; For some reason, the back doesn't exist anymore (most likely,
; there's a new deck file with fewer backs), so we'll just use
; the first one
;
clr si
haveBack:
shl si
shl si ;si <- fptr
mov cx, ds:DMS_backs[si].handle
mov dx, ds:DMS_backs[si].chunk
unlock:
pop ds
pop bp
call VMUnlock
ret
GameGetBackBitmap endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameGetFaceBitmap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_GET_FACE_BITMAP handler for GameClass
Returns a pointer to the bitmap to be drawn
given a set of card attributes (card must be face
up)
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
bp - CardAttrs
CHANGES: nothing
RETURN: ^lcx:dx = bitmap
DESTROYED: cx, dx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameGetFaceBitmap method GameClass, MSG_GAME_GET_FACE_BITMAP
;;calculate which card we want, ordered as follows:
;;Ace of Diamonds = 0
;;2 of Diamonds = 1
;;...
;;King of Diamonds = 12
;;Ace of Hearts = 13
;;...
;;Ace of Clubs = 26
;;...
;;Ace of Spades = 39
;;...
;;King of Spades = 51
;
; ax <- suit * 13
; diamonds = 0
; hearts = 1
; clubs = 2
; spades = 3
;
mov ax, bp
ANDNF ax, mask CA_SUIT
rept offset CA_SUIT
shr ax
endm
mov cx, 13
mul cx
;
; ax += rank - 1
; cx = ax
;
mov dx, bp
ANDNF dx, mask CA_RANK
mov cl, offset CA_RANK
shr dx, cl
dec dx
add ax, dx
shl ax
shl ax
push ax
;
; now that cx has the card number, get the bitmap
;
mov ax, MSG_GAME_GET_VM_FILE
call ObjCallInstanceNoLock
pop di
mov_tr bx, cx
call VMLock
mov ds, ax
mov cx, ds:DMS_cards[di].handle
mov dx, ds:DMS_cards[di].chunk
call VMUnlock
ret
GameGetFaceBitmap endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDroppingDragCards
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_DROPPING_DRAG_CARDS handler for GameClass
This method is called by the dragging deck when the user
has released the cards. Game calls children asking
for a deck to accept the dropped cards.
CALLED BY: DeckEndSelect
PASS: *ds:si = game object
^lcx:dx = dropping deck
bp = drop card attributes
CHANGES:
RETURN: if cards are accepted elsewhere, carry is set
else carry clear
DESTROYED:
PSEUDO CODE/STRATEGY:
gets deck's drop card attributes, then calls children with
drop deck OD and attributes
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDroppingDragCards method GameClass, MSG_GAME_DROPPING_DRAG_CARDS
mov ax, MSG_DECK_TAKE_CARDS_IF_OK
call VisSendToChildrenWithTest
ret
GameDroppingDragCards endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameBroadCastDoubleClick
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_BROADCAST_DOUBLE_CLICK handler for GameClass
This method is called by a deck when the user double clicks
one of its cards. Game calls children asking
for a deck to accept the double-clicked card.
CALLED BY: DeckCardDoubleClicked
PASS: *ds:si = game object
^lcx:dx = double clicked deck
bp = attributes of double-clicked card
CHANGES:
RETURN: if card was accepted elsewhere, carry is set
else carry clear
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameBroadcastDoubleClick method GameClass,MSG_GAME_BROADCAST_DOUBLE_CLICK
mov ax, MSG_DECK_TAKE_DOUBLE_CLICK_IF_OK
call VisSendToChildrenWithTest
ret
GameBroadcastDoubleClick endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameCheckHilites
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_CHECK_HILITES handler for GameClass
Broadcasts to children to hilite themselves if they would
be the destination if cards were dropped right now.
CALLED BY: DeckOutlinePtr
PASS: *ds:si = game object
^lcx:dx = dragging deck
bp = card attributes of drop card
CHANGES:
RETURN: nothing
DESTROYED: ax, bp, cx, dx
PSEUDO CODE/STRATEGY:
Broadcast MSG_DECK_CHECK_POTENTIAL_DROP to children, asking
to abort after first potential drop. If no potential drop,
send message to self clearing all hilites.
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameCheckHilites method GameClass, MSG_GAME_CHECK_HILITES
mov ax, MSG_DECK_CHECK_POTENTIAL_DROP ;see if the current
call VisSendToChildrenWithTest ;drag will go anywhere
jc endGameCheckHilites ;if so, ok
clr cx ;otherwise, clear
clr dx ;the hilited slots
mov ax, MSG_GAME_REGISTER_HILITED
call ObjCallInstanceNoLock
endGameCheckHilites:
ret
GameCheckHilites endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameInvertAcceptors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_INVERT_ACCEPTORS handler for GameClass
Asks all decks to hilite themselves if they would accept
the current drag based on the drop card (not on the current
position of the drag)
CALLED BY: DeckDraggableCardSelected, DeckEndSelect
PASS: *ds:si = game object
^lcx:dx = dragging deck
bp = card attributes of drop card
CHANGES:
RETURN: nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameInvertAcceptors method GameClass, MSG_GAME_INVERT_ACCEPTORS
cmp ds:[di].GI_userMode, BEGINNER_MODE
jne done
mov ax, MSG_DECK_INVERT_IF_ACCEPT
call VisSendToChildren
done:
ret
GameInvertAcceptors endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameMarkAcceptors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_MARK_ACCEPTORS handler for GameClass
Asks all decks to set their DA_WANTS_DRAG bit if they
would accept the current drag based on the drop card
(not on the current position of the drag)
CALLED BY:
PASS: *ds:si = game object
^lcx:dx = dragging deck
bp = card attributes of drop card
CHANGES:
RETURN: nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameMarkAcceptors method GameClass, MSG_GAME_MARK_ACCEPTORS
push cx,dx ;save dragger OD
mov ax, MSG_DECK_MARK_IF_ACCEPT ;tell decks to mark themselves
call VisSendToChildren
pop cx,dx ;restore dragger OD
;;now we want to unmark any special cases (for example, in
;;klondike, we want to unmark any 2's if we're dragging an ace)
mov ax, MSG_GAME_UNMARK_ACCEPTORS
call ObjCallInstanceNoLock
;endGameMarkAcceptors:
ret
GameMarkAcceptors endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRegisterHilited
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_REGISTER_HILITED handler for GameClass
Keeps track of the one (if any) deck that is currently
hilited. Also issues a MSG_DECK_INVERT to this deck
if it is just now getting hilited (vs. having been hilited
for multiple calls already). Also re-inverts the used-to-be
hlited deck (if any), to make it unhilited.
CALLED BY: GameCheckHilites, DeckCheckPotentialDrop, DeckEndSelect
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = hilited deck
(cx = dx = 0 for no hilited deck)
CHANGES:
RETURN: nothing
DESTROYED: ax, bx, cx, dx, di
PSEUDO CODE/STRATEGY:
if (old hilited = new hilited) {
don't do anything
}
else {
if (handle != 0) {
invert new hilited
}
GI_hilited = new hilited
invert old hilited
}
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRegisterHilited method GameClass, MSG_GAME_REGISTER_HILITED
cmp ds:[di].GI_hilited.chunk, dx ;old hilited = new?
je endGameRegisterHilited ;if so, done
jcxz swap ;new hilited = 0?
;if so, erase old
CallObjectCXDX MSG_DECK_INVERT, MF_FIXUP_DS ;else invert new
swap:
Deref_DI Game_offset
xchg ds:[di].GI_hilited.handle, cx ;GI_hilited <- new
xchg ds:[di].GI_hilited.chunk, dx ;^lcx:dx <- old
call ObjMarkDirty
jcxz endGameRegisterHilited
;
; Forcing this to the queue is a hack that solved
; a visual bug in intermediate mode klondike...
;
CallObjectCXDX MSG_DECK_CLEAR_INVERTED, MF_FORCE_QUEUE
endGameRegisterHilited:
ret
GameRegisterHilited endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameCollectAllCards
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_COLLECT_ALL_CARDS handler for GameClass
Takes all the cards from all the decks and gives them to
the hand.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED: ax, cx, dx
PSEUDO CODE/STRATEGY:
tell all decks to give their cards to the hand object
redraw the screen
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameCollectAllCards method GameClass, MSG_GAME_COLLECT_ALL_CARDS
mov cx, ds:[di].GI_hand.handle ;^lcx:dx <- hand
mov dx, ds:[di].GI_hand.chunk
mov ax, MSG_DECK_GET_RID_OF_CARDS ;tell all decks to return
;cards to hand
call VisSendToChildren
mov ax, MSG_VIS_INVALIDATE ;redraw the screen
call ObjCallInstanceNoLock
ret
GameCollectAllCards endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisSendToChildrenWithTest
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calls children in order with a given method and data, and
stops after the first one that returns carry set.
(Just like VisSendToChildren, except tests abort on carry)
CALLED BY: GameDroppingDragCards, GameBroadcastDoubleClick, GameCheckHilites
PASS: *ds:si = game object
ax = method to call children with
cx, dx, bp = other data (if any)
CHANGES:
RETURN: if any child returned carry set, carry is returned set
if no child returned carry set, carry is returned clear
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisSendToChildrenWithTest proc far
class GameClass ; Indicate function is a friend
; of GameClass so it can play with
; instance data.
clr bx ; initial child (first
push bx ; child of composite)
push bx
mov bx, offset VI_link ; Pass offset to LinkPart
push bx
clr bx ; Use standard function
push bx
mov di, OCCT_SAVE_PARAMS_TEST_ABORT
push di
mov bx, offset Vis_offset
mov di, offset VCI_comp
;DO NOT CHANGE THIS TO A GOTO! We are passing stuff on the stack.
call ObjCompProcessChildren ;must use a call (no GOTO) since
;parameters are passed on the stack
ret
VisSendToChildrenWithTest endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ScoreToTextObject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Creates a score string and sets the Text Object to display
this string.
CALLED BY: GameUpdateScore
PASS:
DS = Relocatable segment
DI:SI = Block:chunk of TextObject
CX = Score
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 8/6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SCORE_BUFFER_SIZE = 14
ScoreToTextObject proc far
uses di, es
.enter
mov bx, di ; BX:SI is the TextEditObject
segmov es, ss, dx ; SS to ES and DX!
sub sp, SCORE_BUFFER_SIZE ; allocate room on the stack
mov di, sp ; ES:DI => buffer to fill
mov bp, di ; buffer also in DX:BP
call CreateScoreString ; create the string
clr cx ; string is NULL terminated
mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR
mov di, mask MF_FIXUP_DS or mask MF_CALL
call ObjMessage ; send the method
add sp, SCORE_BUFFER_SIZE ; restore the stack
.leave
ret
ScoreToTextObject endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateScoreString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create the score text string
CALLED BY: ScoreToTextObject
PASS: cx = score
ES:DI = String buffer to fill
RETURN: ES:DI = Points to end of string (NULL termination)
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 8/6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateScoreString proc near
uses ax, bx, cx, dx
.enter
; Create the score
;
mov ax, cx
call WriteNum
;Done:
SBCS < mov {char}es:[di], 0 ; NULL terminated >
DBCS < mov {wchar}es:[di], 0 ; NULL terminated >
.leave
ret
CreateScoreString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteNum
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Converts a number to ASCII, and writes it into a buffer
CALLED BY: CreateScoreString, WriteTime
PASS: ES:DI = Start of string buffer
AX = Value to write
RETURN: ES:DI = Updated to next string position
DESTROYED: AX
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteNum proc far
push ax, bx, cx, dx ;save regs. necessary?
clr bx ;# digits so far
tst ax ;negative or positive?
jge readValue
;negative:
SBCS < mov {byte} es:[di],'-' ;if negative, add a '-' >
DBCS < mov {wchar} es:[di],'-' ;if negative, add a '-' >
LocalNextChar esdi ;advance pointer
neg ax ;turn value positive
readValue:
mov cx, 10 ; put divisor in DL
startReadLoop:
clr dx ;we're dividing dx:ax,
;so we need to clear dx
div cx ; do the division
push dx ;here's our remainder
inc bx ;one more digit...
cmp ax, 0 ; check the quotient
jg startReadLoop
;endReadLoop:
mov cx, bx ;cx <- total # of digits
DBCS < shl cx, 1 ;cx <- total # of bytes >
clr bx ;bx <- # digits printed so far
startWriteLoop:
pop dx ;pop digit
add dl, '0' ;make it a char
SBCS < mov {byte} es:[di][bx], dl ;write it to string >
DBCS < mov {wchar} es:[di][bx], dx ;write it to string >
LocalNextChar esbx ;note we've written another
cmp bx, cx ;done yet?
jl startWriteLoop
;endWriteLoop:
add di, cx ;point di after string
pop ax, bx, cx, dx ;restore regs
ret
WriteNum endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteTime
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Converts a time to ASCII, and writes it into a buffer
CALLED BY: CreatetTimeString
PASS: ES:BP = Start of string buffer
AX = # of seconds
RETURN: nothing
DESTROYED: AX
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteTime proc far
uses ax, bx, cx, dx, si, di
.enter
;
; ch <- hours
; dl <- minutes
; dh <- seconds
mov cx, 3600
clr dx
div cx ;ax <- hours, dx <- seconds
mov ch, al
mov ax, dx
clr dx
mov bx, 60
div bx ;ax <- minutes; dx <- seconds
mov dh, dl
mov dl, al
mov si, DTF_HMS_24HOUR
tst ch
jnz callLocal
mov si, DTF_MS
callLocal:
mov di, bp
call LocalFormatDateTime
.leave
ret
WriteTime endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetDonor
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_DONOR handler for GameClass.
Stores OD of the deck giving cards to another so
we can undo if need be.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = donating deck
CHANGES: GI_lastDonor <- ^lcx:dx
Undo trigger is enabled
RETURN: nothing
DESTROYED: bp, di
PSEUDO CODE/STRATEGY:
store away info and enable undo button
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetDonor method GameClass, MSG_GAME_SET_DONOR
mov ds:[di].GI_lastDonor.handle, cx
mov ds:[di].GI_lastDonor.chunk, dx
mov bp, ds:[di].GI_score ;preserve the score so
mov ds:[di].GI_lastScore, bp ;we can undo that, too.
call ObjMarkDirty
mov ax, MSG_GAME_ENABLE_UNDO ;since we have the info
call ObjCallInstanceNoLock ;to do an undo, let's
;allow it
ret
GameSetDonor endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameEnableUndo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_ENABLE_UNDO handler for GameClass
Sends a MSG_GEN_SET_ENABLED to the undo trigger
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES: nothing
RETURN: nothing
DESTROYED: ax, bx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameEnableUndo method GameClass, MSG_GAME_ENABLE_UNDO
mov dl, VUM_NOW
mov bx, ds:[di].GI_undoTrigger.handle
mov si, ds:[di].GI_undoTrigger.chunk
mov ax, MSG_GEN_SET_ENABLED
mov di, mask MF_FIXUP_DS
GOTO ObjMessage
GameEnableUndo endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDisableUndo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_DISABLE_UNDO handler for GameClass
Sends a MSG_GEN_SET_NOT_ENABLED to the undo trigger
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES: nothing
RETURN: nothing
DESTROYED: ax, bx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDisableUndo method GameClass, MSG_GAME_DISABLE_UNDO
mov dl, VUM_NOW
mov bx, ds:[di].GI_undoTrigger.handle
mov si, ds:[di].GI_undoTrigger.chunk
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_FIXUP_DS
GOTO ObjMessage
GameDisableUndo endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameQueryDragCard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_QUERY_DRAG_CARD handler for GameClass
This is the method that a deck calls when one of
its cards is selected. This method determines whether
a given card should be included in the drag or not,
depending on the deck's attributes. For example, in the
following scenario:
+--------------------+
! !
! 6 Hearts !
! !
+--------------------+
! !
! 5 Clubs !
! !
+--------------------+
! !
! 4 Diamonds !
! !
+--------------------+
! !
! 3 Clubs !
! !
! !
! !
! !
! !
! !
! !
! !
! !
+--------------------+
if the 4 is selected, and we are playing klondike
with the windows-type extension, we want to drag
the 3 and the 4; we would make three calls to this method;
calls concering the 3 and 4 would indicate that the
cards should be draggedf, whereas the 5 would be
rejected.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
ch = # of selected card ;(the 4 in the above example)
cl = attrs of selected card ;(the 4 in the above example)
dh = # of query card
dl = attrs of query card
bp = deck attrs
CHANGES:
RETURN: carry set if accept
carry clear if no accept
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 9/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameQueryDragCard method GameClass, MSG_GAME_QUERY_DRAG_CARD
ANDNF bp, mask DA_DDWC ;filter through
;the info on which
;cards to drag
cmp bp, DDWC_NONE shl offset DA_DDWC ;check if this deck
;drags cards at all
jne notNone
;none:
clc ;if the deck doesn't
jmp endGameQueryDragCard ;drag cards, then
;clear the carry and
;return
notNone:
cmp bp, DDWC_TOP_ONLY shl offset DA_DDWC
jne notTopOnly
;topOnly:
tst ch ;if we can only drag the top card, see
jz selectedIsTop ;if the selected card is the top
clc
jmp endGameQueryDragCard
selectedIsTop:
tst dh ;if selected = query = top card, then accept
jz nIsTop
clc
jmp endGameQueryDragCard
nIsTop:
stc
jmp endGameQueryDragCard
notTopOnly:
cmp bp, DDWC_UNTIL_SELECTED shl offset DA_DDWC
jne notUntilSelected
;untilSelected: ;if we're dragging all cards above and
cmp dh, ch ;including the selected card, see if
jg queryGreater ;query card is <= selected card
;queryNotGreater:
stc
jmp endGameQueryDragCard
queryGreater:
clc
jmp endGameQueryDragCard
notUntilSelected: ;must be DDWC_TOP_OR_UPS
tst ch ;selected = top card?
jnz ups ;if not, drag all up cards
;top:
tst dh ;if so, see if query = top
jnz topSelectedAndQueryNotTop
stc
jmp endGameQueryDragCard
topSelectedAndQueryNotTop:
clc
jmp endGameQueryDragCard
ups:
test dl, mask CA_FACE_UP ;we want all up cards, so see
jnz cardIsUp ;if query card is face up.
clc
jmp endGameQueryDragCard
cardIsUp:
stc
endGameQueryDragCard:
ret
GameQueryDragCard endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDistributeFade
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_DISTRIBUTE_FADE handler for GameClass
Sends a MSG_CARD_FADE_DRAW to every card in the fade array.
CALLED BY: A timer
PASS: ds:di = game instance
*ds:si = game object
CHANGES: any fading cards fade in one more step
RETURN: nothing
DESTROYED: ax, bx, cx, bp, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDistributeFade method GameClass, MSG_GAME_DISTRIBUTE_FADE
push ds:[LMBH_handle], si
mov bp, ds:[di].GI_gState
mov cl, ds:[di].GI_incrementalFadeMask
mov si, ds:[di].GI_fadeArray
mov bx, cs
mov di, offset SendCardMethodFade
call ChunkArrayEnum
;
; If there're still cards in the array, we need to start another timer
;
call ChunkArrayGetCount ;get initial array
pop bx, si
jcxz done
mov al, TIMER_EVENT_ONE_SHOT
mov cx, CARD_FADE_PERIOD
mov dx, MSG_GAME_DISTRIBUTE_FADE
call TimerStart
done:
ret
GameDistributeFade endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SendCardMethodFade
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for fading that sends a MSG_CARD_FADE_DRAW
to a card
CALLED BY: ChunkArrayEnum in GameDistributeFade
PASS: ds:di = array element
bp = gstate to draw through
cl = incremental fade mask
CHANGES:
RETURN: nothing
DESTROYED: ax, bx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11/29/90 This callback routine was added when
the fade mechanism was rewritten to
incorporate the chunkarray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SendCardMethodFade proc far
mov bx, ds:[di].handle
mov si, ds:[di].chunk
mov di, mask MF_FIXUP_DS
mov ax, MSG_CARD_FADE_DRAW
call ObjMessage
clc ;continue the enumeration
ret
SendCardMethodFade endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameZeroFadeArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_ZERO_FADE_ARRAY handler for GameClass
Informs all the cards in the fade array that
they are done fading (like it or not), then
clears the array and stops the timer (if any) and
destroys the gstate (if any).
CALLED BY:
PASS: ds:di = game instance
CHANGES: clears the fade array, tells any cards that were there
that they're done fading, kills the timer and gstate
RETURN: nothing
DESTROYED: ax, bx, cx, dx,
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11/29/90 Added to implement chunkarray fading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameZeroFadeArray method GameClass, MSG_GAME_ZERO_FADE_ARRAY
push si ;save offset
mov si, ds:[di].GI_fadeArray
call ChunkArrayGetCount
jcxz done
if 0 ;;;unnecessary for one shot timer
clr bx
xchg bx, ds:[di].GI_faderHandle
EC< tst bx >
EC< ERROR_Z CANT_STOP_TIMER_WITH_NULL_HANDLE >
clr ax ; 0 => continual
call TimerStop
endif
clr bx
xchg bx, ds:[di].GI_gState
EC< tst bx >
EC< ERROR_Z CANT_DESTROY_GSTATE_WITH_NULL_HANDLE >
mov di, bx
call GrDestroyState
mov bx, cs
mov di, offset SendCardMethodClearFading
call ChunkArrayEnum
call ChunkArrayZero
done:
pop si ;restore offset
call ObjMarkDirty
ret
GameZeroFadeArray endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SendCardMethodClearFading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine that sends a card a method informing
it that it should mark itself as done fading,
CALLED BY: ChunkArrayEnum in GameZeroFadeArray
PASS: ds:di = array element
CHANGES: card in array element gets its CA_FADING bit cleared
RETURN: nothing
DESTROYED: ax, bx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11/29/90 Added to implement chunkarray fading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SendCardMethodClearFading proc far
mov bx, ds:[di].handle
mov si, ds:[di].chunk
mov di, mask MF_FIXUP_DS
mov ax, MSG_CARD_CLEAR_FADING
call ObjMessage
clc
ret
SendCardMethodClearFading endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSeedRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SEED_RANDOM
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
dx = seed
CHANGES: nothing
RETURN: nothing
DESTROYED: di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSeedRandom method GameClass, MSG_GAME_SEED_RANDOM
mov ds:[di].GI_randomSeed, dx
call ObjMarkDirty
ret
GameSeedRandom endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return a random number between 0 and DL
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
DL = max for returned number
RETURN: DX = number between 0 and DL
DESTROYED: AX
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This random number generator is not a very good one; it is sufficient
for a wide range of tasks requiring random numbers (it will work
fine for shuffling, etc.), but if either the "randomness" or the
distribution of the random numbers is crucial, you may want to look
elsewhere.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/11/89 Initial version
jon 10/90 Customized for GameClass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRandom method GameClass, MSG_GAME_RANDOM
mov cx, dx
mov ax, ds:[di].GI_randomSeed
mov dx, 4e6dh
mul dx
mov ds:[di].GI_randomSeed, ax
call ObjMarkDirty
sar dx, 1
ror ax, 1
sar dx, 1
ror ax, 1
sar dx, 1
ror ax, 1
sar dx, 1
ror ax, 1
push ax
mov al, 255
mul cl
mov dx, ax
pop ax
Random2:
sub ax, dx
ja Random2
add ax, dx
div cl
clr dx
mov dl, ah
ret
GameRandom endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDrawBlankCard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_DRAW_BLANK_CARD handler for GameClass
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
bp = gstate to draw through
cx,dx = left,top of card
CHANGES: nothing
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDrawBlankCard method GameClass, MSG_GAME_DRAW_BLANK_CARD
push ds:[di].GI_frameReg
mov si, ds:[di].GI_interiorReg
mov si, ds:[si]
mov di, bp
mov ax, cx
mov bx, dx
call GrDrawRegion
push ax
mov ax, C_BLACK
call GrSetAreaColor
pop ax
pop si
mov si, ds:[si]
call GrDrawRegion
ret
GameDrawBlankCard endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameDrawFrame
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY:
PASS:
CHANGES:
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 12/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameDrawFrame method GameClass, MSG_GAME_DRAW_FRAME
push ds:[di].GI_frameReg
mov di, bp
mov ax, C_BLACK
call GrSetAreaColor
mov ax, cx
mov bx, dx
pop si
mov si, ds:[si]
call GrDrawRegion
ret
GameDrawFrame endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameFakeBlankCard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_FAKE_BLANK_CARD handler for GameClass
Draws a faked blank card (a black-bordered write rectangle
the size of a card) at the specified place
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
cx,dx = left,top of fake blank card
bp = gstate to draw through
CHANGES:
RETURN: nothing
DESTROYED: ax, bx, cx, dx, bp, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameFakeBlankCard method GameClass, MSG_GAME_FAKE_BLANK_CARD
mov ax, cx
mov bx, dx
mov cx, ds:[di].GI_cardWidth
mov dx, ds:[di].GI_cardHeight
dec cx
dec dx
add cx, ax
add dx, bx
mov di, bp
call GrFillRect
push ax
mov ax, C_BLACK
call GrSetAreaColor
pop ax
call GrDrawRect
ret
GameFakeBlankCard endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameShutdown
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SHUTDOWN handler for GameClass
Takes care of things that need to be taken care of before
exiting the application (e.g., turn off the fade timer, etc.)
CALLED BY:
PASS: *ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameShutdown method GameClass, MSG_GAME_SHUTDOWN
;
; Stop any fading
;
mov ax, MSG_GAME_ZERO_FADE_ARRAY
call ObjCallInstanceNoLock
ret
GameShutdown endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CopyRegionToChunk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copies a passed region into a passed lmem chunk
CALLED BY: GameSetupStuff
PASS: ds:si = region
di = object block segment
CHANGES:
RETURN: *di:ax = newly copied region (suitable for drawing)
cx = region width
dx = region height
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CopyRegionToChunk proc near
push si
call GrGetPtrRegBounds ;si <- end reg,
;ax,bx <- left, top
;cx,dx <- right, bottom
sub cx, ax
inc cx ;cx <- width
sub dx, bx
inc dx ;dx <- height
pop bx
push ds
mov ds, di ;di <- bitmap segment
pop di ;ds <- game segment
push cx, dx ;save width, height
mov cx, bx
xchg cx, si ;cx <- end, si <- start
sub cx, si ;cx <- size of region
add cx, size Rectangle
mov al, mask OCF_IGNORE_DIRTY ; ObjChunkFlags for new
; chunk
call LMemAlloc ;get space to store our
;region
push es ;save dgroup
segmov es, ds ;es <- game segment
mov ds, di ;ds <- bitmap segment
mov di, ax
mov di, es:[di] ; *es:di = clear space
push ax, cx, si
call GrGetPtrRegBounds
stosw
mov ax, bx
stosw
mov ax, cx
stosw
mov ax, dx
stosw
pop ax, cx, si
sub cx, size Rectangle
;;at this point, cx = size of region,
;; *ds:si = original region
;; *es:di = empty space for us to copy region into
rep movsb ; copy region in
segmov ds, es
pop es ; restore dgroup
pop cx, dx ;region width, height
ret
CopyRegionToChunk endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameVupQuery
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_VIS_VUP_QUERY handler for GameClass.
CALLED BY:
PASS: *ds:si = game object
cx = VisUpwardQueryType
CHANGES:
RETURN: depends on a lot of things...
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameVupQuery method GameClass, MSG_VIS_VUP_QUERY
cmp cx, VUQ_GAME_OD
jne checkAttrs
mov cx, ds:[LMBH_handle]
mov dx, si
jmp markQueryHandled
checkAttrs:
cmp cx, VUQ_GAME_ATTRIBUTES
jne checkFadeMask
mov cl, ds:[di].GI_gameAttrs
jmp markQueryHandled
checkFadeMask:
cmp cx, VUQ_INITIAL_FADE_MASK
jne checkBitmaps
mov cl, ds:[di].GI_initialFadeMask
jmp markQueryHandled
checkBitmaps:
cmp cx, VUQ_CARD_BITMAP
jne checkDimensionQuery
mov ax, MSG_GAME_GET_BACK_BITMAP
test bp, mask CA_FACE_UP ;see if card is face down
jz getBitmap
mov ax, MSG_GAME_GET_FACE_BITMAP
getBitmap:
call ObjCallInstanceNoLock
jmp markQueryHandled
checkDimensionQuery:
cmp cx, VUQ_CARD_DIMENSIONS
jne passItOnUp
mov cx, ds:[di].GI_cardWidth
mov dx, ds:[di].GI_cardHeight
markQueryHandled:
stc
jmp endGameVupQuery
passItOnUp:
clc
endGameVupQuery:
ret
GameVupQuery endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameVisOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_VIS_OPEN handler for GameClass
game marks itself as visually open, then calls superclass
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameVisOpen method GameClass, MSG_VIS_OPEN
RESET ds:[di].GI_gameAttrs, GA_ICONIFIED
call ObjMarkDirty
mov di, offset GameClass
CallSuper MSG_VIS_OPEN
ret
GameVisOpen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameVisClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_VIS_CLOSE handler for GameClass
Makes sure that all fading cards are stopped here, then
calls superclass
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameVisClose method GameClass, MSG_VIS_CLOSE
SET ds:[di].GI_gameAttrs, GA_ICONIFIED
call ObjMarkDirty
;
; Stop any fading
;
mov ax, MSG_GAME_ZERO_FADE_ARRAY
call ObjCallInstanceNoLock
mov di, offset GameClass
mov ax, MSG_VIS_CLOSE
CallSuper MSG_VIS_CLOSE
ret
GameVisClose endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameReloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear out the optr of the cardback-selection summons when
we're first brought in from the resource or state.
CALLED BY: MSG_META_RELOCATE/MSG_META_UNRELOCATE
PASS: *ds:si = game object
ds:di = GameInstance
ax = MSG_META_RELOCATE/MSG_META_UNRELOCATE
RETURN: carry set on error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
c
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 1/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameReloc method GameClass, reloc
.enter
cmp ax, MSG_META_RELOCATE
jne done
mov ds:[di].GI_faderHandle, 0
mov ds:[di].GI_gState, 0
mov ds:[di].GI_vmFile, 0
call ObjMarkDirty
done:
clc
.leave
mov di, offset GameClass
call ObjRelocOrUnRelocSuper
ret
GameReloc endp
if 0
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameChangeBack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gives user a summons through which she can select
among possible card backs
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameChangeBack method GameClass, MSG_GAME_CHANGE_BACK
mov cx, ds:[di].GI_backSummons.handle
mov dx, ds:[di].GI_backSummons.chunk
jcxz createSummons
haveSummons:
CallObjectCXDX MSG_GEN_INTERACTION_INITIATE, MF_FIXUP_DS
ret
createSummons:
mov ax, MSG_GAME_CREATE_BACK_SUMMONS
call ObjCallInstanceNoLock
Deref_DI Game_offset
mov ds:[di].GI_backSummons.handle, cx
mov ds:[di].GI_backSummons.chunk, dx
call ObjMarkDirty
jmp haveSummons
GameChangeBack endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameChooseBack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the backs of all the cards to match the one
the user has chosen.
CALLED BY: MSG_GAME_CHOOSE_BACK
PASS: ds:di = game instance
*ds:si = game object
cx - which back
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11/ 1/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameChooseBack method GameClass, MSG_GAME_CHOOSE_BACK
;; user has the right to get rid of the win back, if
;; he so chooses...
RESET ds:[di].GI_gameAttrs, GA_USE_WIN_BACK
mov ds:[di].GI_whichBack, cx
call ObjMarkDirty
mov ax, MSG_DECK_CHANGE_KIDS_BACKS
call VisSendToChildren
mov ax, MSG_DECK_REDRAW
call VisSendToChildren
ret
GameChooseBack endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetFadeParameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_FADE_PARAMETERS handler for GameClass
Sets the value of the initial and incremental area masks
to use while fading cards in.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
dl = initial area mask (e.g., SDM_0 for full-fledged fading,
SDM_100 for no fading).
cl = incremental area mask (e.g., SDM_25 - SDM_0)
CHANGES:
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 10/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetFadeParameters method GameClass, MSG_GAME_SET_FADE_PARAMETERS
mov ds:[di].GI_incrementalFadeMask, cl
mov ds:[di].GI_initialFadeMask, dl
call ObjMarkDirty
ret
GameSetFadeParameters endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameGetDragType
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_GET_DRAG_TYPE handler for GameClass
Returns the drag mode we're in (i.e., full or outline drag)
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES: nothing
RETURN: cl = DragType
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameGetDragType method GameClass, MSG_GAME_GET_DRAG_TYPE
mov cl, ds:[di].GI_dragType
ret
GameGetDragType endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetDragType
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_DRAG_TYPE handler for GameClass
Sets the drag mode to the passed value
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
cl = DragType
CHANGES:
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetDragType method GameClass, MSG_GAME_SET_DRAG_TYPE
mov ds:[di].GI_dragType, cl
call ObjMarkDirty
ret
GameSetDragType endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameGetUserMode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_GET_USER_MODE handler for GameClass
Returns UserMode (Beginner, Intermediate, Advanced)
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: cl = UserMode
DESTROYED: cl
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameGetUserMode method GameClass, MSG_GAME_GET_USER_MODE
mov cl, ds:[di].GI_userMode
ret
GameGetUserMode endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSetUserMode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_SET_USER_MODE handler for GameClass
Sets the user mode to the passed value
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
cl = desired UserMode
CHANGES:
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSetUserMode method GameClass, MSG_GAME_SET_USER_MODE
mov ds:[di].GI_userMode, cl
call ObjMarkDirty
ret
GameSetUserMode endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameHandSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_HAND_SELECTED handler for GameClass
This is actually a method that will be widely subclassed,
but I'm putting in this default handler 'cause I get
off on these things.
CALLED BY:
PASS: ds:di = game instance
*ds:si = game object
CHANGES:
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
default is to send self MSG_GAME_DECK_SELECTED with
the deck = the hand and the selected card = the top card
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 12/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameHandSelected method GameClass, MSG_GAME_HAND_SELECTED
mov cx, ds:[di].GI_hand.handle
mov dx, ds:[di].GI_hand.offset
clr bp
mov ax, MSG_GAME_DECK_SELECTED
call ObjCallInstanceNoLock
ret
GameHandSelected endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CBLESetup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set up a CardBackListEntry object
CALLED BY: MSG_CBLE_SETUP
PASS: ds:di = game instance
*ds:si = CardBackListEntry object
ds:di = CardBackListEntryInstance
cx:dx = VM handle and offset of bitmap to show
bp = VM File handle of deck
RETURN: nothing
DESTROYED: ax, bx, cx, dx, si, di, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 1/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if 0
CBLESetup method CardBackListEntryClass, MSG_CBLE_SETUP
.enter
;
; Record the handle and offset of our color-with-bitmap thingummy
;
mov ds:[di].CBLE_bitmap.handle, cx
mov ds:[di].CBLE_bitmap.offset, dx
mov ds:[di].CBLE_file, bp
push cx
mov cx, size VisMoniker + size OpEndString
mov ax, mask OCF_IGNORE_DIRTY
call LMemAlloc
mov di, ax
mov di, ds:[di]
;
; Initialize the visual moniker we're going to give ourselves. The
; thing is an empty string with the height and width of the bitmap
; we're displaying (so our entry is the right size on-screen).
;
mov ds:[di].VM_type, VisMonikerType <
0, ; not a list
1, ; is a gstring
VMAR_NORMAL, ; regular aspect
DC_COLOR_4 ; color type (no one cares)
>
pop cx
push ax
xchg ax, cx
mov bx, bp
call VMLock
mov es, ax
mov bx, dx
mov cx, es:[bx+2].B_width
mov dx, es:[bx+2].B_height
call VMUnlock
mov ds:[di].VM_size.XYS_width, cx
mov ds:[di].VM_size.XYS_height, dx
mov ({OpEndString}ds:[di].VM_data).OES_opcode, GR_END_STRING
;
; Now set the chunk as our moniker.
;
mov di, ds:[si]
add di, ds:[di].Gen_offset
pop ds:[di].GI_visMoniker
call ObjMarkDirty
.leave
ret
CBLESetup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CBLEDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a CardBackListEntry properly
CALLED BY: MSG_VIS_DRAW
PASS: *ds:si = CardBackListEntry object
bp = gstate to use
RETURN: nothing
DESTROYED: ?
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 1/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CBLEDraw method CardBackListEntryClass, MSG_VIS_DRAW
.enter
;
; Let our superclass do its list-entry thing.
;
push bp
mov di, offset CardBackListEntryClass
CallSuper MSG_VIS_DRAW
pop di
;
; Now figure our actual width and height and save our origin.
;
mov bx, ds:[si]
add bx, ds:[bx].Vis_offset
push ds:[bx].VI_bounds.R_left
push ds:[bx].VI_bounds.R_top
mov cx, ds:[bx].VI_bounds.R_right
sub cx, ds:[bx].VI_bounds.R_left
inc cx
mov dx, ds:[bx].VI_bounds.R_bottom
sub dx, ds:[bx].VI_bounds.R_top
inc dx
;
; Lock down our bitmap.
;
mov bx, ds:[si]
add bx, ds:[bx].Gen_offset
mov ax, ds:[bx].CBLE_bitmap.handle
mov si, ds:[bx].CBLE_bitmap.offset
mov bx, ds:[bx].CBLE_file
call VMLock
mov ds, ax
;
; Set the area color properly.
;
lodsw
call GrSetAreaColor
;
; Figure where to position the bitmap by taking the difference of our
; actual width/height and the bitmap's width/height, dividing it by
; two and adding it to our origin.
;
sub cx, ds:[si].B_width
sub dx, ds:[si].B_height
shr cx
shr dx
pop ax
add ax, dx
xchg bx, ax
pop ax
add ax, cx
;
; Draw the bitmap itself.
;
clr dx ; no callback...
call GrDrawBitmap
;
; Unlock the bitmap.
;
call VMUnlock
;
; Return gstate in bp, in case it's needed there...
;
mov bp, di
.leave
ret
CBLEDraw endp
endif
GameGetWhichBack method GameClass, MSG_GAME_GET_WHICH_BACK
mov cx, ds:[di].GI_whichBack
ret
GameGetWhichBack endm
GameSetWhichBack method GameClass, MSG_GAME_SET_WHICH_BACK
mov ds:[di].GI_whichBack, cx
call ObjMarkDirty
ret
GameSetWhichBack endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameTransferringCards
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_TRANSFERRING_CARDS handler for GameClass
This is called by the donor deck when cards are dropped and
transferred to another deck. Makes a good message to
intercept for generating sound.
CALLED BY: Donor deck object
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = deck to which cards will be transferred
CHANGES: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameTransferringCards method GameClass, MSG_GAME_TRANSFERRING_CARDS
ret
GameTransferringCards endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameTransferFailed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_GAME_TRANSFER_FAILED handler for GameClass
This is called by the source deck when cards are dropped and
no deck accepts them, just prior to animating the failed
transfer. Makes a good message to intercept for generating
sound.
CALLED BY: Source deck object
PASS: ds:di = game instance
*ds:si = game object
^lcx:dx = source deck
CHANGES: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 8/90 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameTransferFailed method GameClass, MSG_GAME_TRANSFER_FAILED
ret
GameTransferFailed endm
CardsCodeResource ends
| 23.089751 | 80 | 0.566308 |
8591174a6ed4adf5488f0d365dd3534df4a12e17 | 813 | asm | Assembly | programs/oeis/191/A191402.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/191/A191402.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/191/A191402.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A191402: A000201(n)+A000201(n+1).
; 1,4,7,10,14,17,20,23,26,30,33,36,40,43,46,49,52,56,59,62,65,68,72,75,78,82,85,88,91,94,98,101,104,108,111,114,117,120,124,127,130,133,136,140,143,146,150,153,156,159,162,166,169,172,175,178,182,185,188,192,195,198,201,204,208,211,214,218,221,224
mov $2,$0
add $2,1
mov $5,$0
lpb $2,1
mov $0,$5
sub $2,1
sub $0,$2
mov $7,2
mov $9,$0
lpb $7,1
mov $0,$9
sub $7,1
add $0,$7
sub $0,2
cal $0,306683 ; Integers k for which the base-phi representation of k does not include 1 or phi.
mov $10,$0
cmp $10,0
add $0,$10
mov $3,$0
sub $3,1
mul $3,10
mov $4,$3
mov $6,$7
lpb $6,1
sub $6,1
mov $8,$4
lpe
lpe
lpb $9,1
sub $8,$4
mov $9,0
lpe
mov $4,$8
div $4,10
add $4,1
add $1,$4
lpe
| 19.829268 | 247 | 0.554736 |
045a575478b60450819f5bc7c80fdb4ee82ba325 | 994 | asm | Assembly | oeis/109/A109194.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/109/A109194.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/109/A109194.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A109194: Number of returns to the x-axis (i.e., d or u steps hitting the x-axis) in all Grand Motzkin paths of length n. (A Grand Motzkin path of length n is a path in the half-plane x>=0, starting at (0,0), ending at (n,0) and consisting of steps u=(1,1), d=(1,-1) and h=(1,0).).
; Submitted by Simon Strandgaard
; 2,6,22,70,224,700,2174,6702,20572,62920,191932,584220,1775258,5386846,16326734,49435150,149557436,452133880,1366012832,4124825872,12449394278,37558361290,113266431860,341467468420,1029119688014,3100728586290,9340155873574,28128513051622,84693540280384,254960105285292,767395602354158,2309391043916974,6948836033589836,20905850128482760,62888185770783568,189155784065955072,568883061352489574,1710733508341886346,5143995512256731944,15466081047631184824,46496885031860408474,139776289042818055054
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,187306 ; Alternating sum of Motzkin numbers A001006.
mul $1,3
add $1,$0
lpe
mov $0,$1
mul $0,2
| 55.222222 | 497 | 0.78169 |
2e84ca9026a8c6915d034310ea0fd8484516d700 | 481 | asm | Assembly | programs/oeis/202/A202196.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/202/A202196.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/202/A202196.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A202196: Number of (n+2) X 4 binary arrays avoiding patterns 001 and 101 in rows and columns.
; 240,640,1400,2688,4704,7680,11880,17600,25168,34944,47320,62720,81600,104448,131784,164160,202160,246400,297528,356224,423200,499200,585000,681408,789264,909440,1042840,1190400,1353088,1531904,1727880,1942080
mov $1,3
mov $2,$0
add $2,5
bin $2,3
mov $4,$0
mov $0,9
mul $4,2
add $4,5
mov $3,$4
add $3,1
mul $3,$2
mul $1,$3
add $0,$1
mov $1,$0
sub $1,189
div $1,6
mul $1,8
add $1,240
| 21.863636 | 210 | 0.713098 |
783b462ad03336fdc551c157c2fbddcfd27f644b | 1,792 | asm | Assembly | Working Disassembly/General/Sprites/Robotnik/Map - Dragonfly.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | 5 | 2021-07-09T08:17:56.000Z | 2022-02-27T19:57:47.000Z | Working Disassembly/General/Sprites/Robotnik/Map - Dragonfly.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/General/Sprites/Robotnik/Map - Dragonfly.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | ; Dragonfly mappings
dc.w word_8DFEE-Map_Dragonfly
dc.w word_8E008-Map_Dragonfly
dc.w word_8E022-Map_Dragonfly
dc.w word_8E03C-Map_Dragonfly
dc.w word_8E056-Map_Dragonfly
dc.w word_8E070-Map_Dragonfly
dc.w word_8E078-Map_Dragonfly
dc.w word_8E080-Map_Dragonfly
dc.w word_8E08E-Map_Dragonfly
dc.w word_8E09C-Map_Dragonfly
word_8DFEE: dc.w 4 ; DATA XREF: ROM:0008DFDAo
dc.b $FA, 4, 0, 4, $FF, $F8
dc.b $FC, 0, 0, 6, $FF, $F0
dc.b $FC, 0, 0, 6, 0, 8
dc.b $F8, 5, 0, 0, $FF, $F8
word_8E008: dc.w 4 ; DATA XREF: ROM:0008DFDAo
byte_8E00A: dc.b $FB, 4, 0, 4, $FF, $F8
dc.b $FC, 0, 0, 6, $FF, $F0
dc.b $FC, 0, 0, 6, 0, 8
dc.b $F8, 5, 0, 0, $FF, $F8
word_8E022: dc.w 4 ; DATA XREF: ROM:0008DFDAo
dc.b $FC, 4, 0, 4, $FF, $F8
dc.b $FC, 0, 0, 6, $FF, $F0
dc.b $FC, 0, 0, 6, 0, 8
dc.b $F8, 5, 0, 0, $FF, $F8
word_8E03C: dc.w 4 ; DATA XREF: ROM:0008DFDAo
dc.b $FD, 4, 0, 4, $FF, $F8
dc.b $FC, 0, 0, 6, $FF, $F0
dc.b $FC, 0, 0, 6, 0, 8
dc.b $F8, 5, 0, 0, $FF, $F8
word_8E056: dc.w 4 ; DATA XREF: ROM:0008DFDAo
dc.b $FE, 4, 0, 4, $FF, $F8
dc.b $FC, 0, 0, 6, $FF, $F0
dc.b $FC, 0, 0, 6, 0, 8
dc.b $F8, 5, 0, 0, $FF, $F8
word_8E070: dc.w 1 ; DATA XREF: ROM:0008DFDAo
dc.b $FC, 4, 0, 7, $FF, $F8
word_8E078: dc.w 1 ; DATA XREF: ROM:0008DFDAo
dc.b $FC, 0, 0, 9, $FF, $FC
word_8E080: dc.w 2 ; DATA XREF: ROM:0008DFDAo
dc.b $F8, 8, 0, $A, $FF, $D8
dc.b $F8, 8, 8, $A, 0, $10
word_8E08E: dc.w 2 ; DATA XREF: ROM:0008DFDAo
dc.b 0, 8, $10, $A, $FF, $D8
dc.b 0, 8, $18, $A, 0, $10
word_8E09C: dc.w 0 ; DATA XREF: ROM:0008DFDAo
| 37.333333 | 48 | 0.517299 |
4ef7a12b82098ccedd22a1582ee5c7806c865943 | 558 | asm | Assembly | programs/oeis/133/A133477.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/133/A133477.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/133/A133477.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A133477: Sum of cubefree divisors of n excluding 1.
; 0,2,3,6,5,11,7,6,12,17,11,27,13,23,23,6,17,38,19,41,31,35,23,27,30,41,12,55,29,71,31,6,47,53,47,90,37,59,55,41,41,95,43,83,77,71,47,27,56,92,71,97,53,38,71,55,79,89,59,167,61,95,103,6,83,143,67,125,95,143,71,90,73,113,123,139,95,167,79,41,12,125,83,223,107,131,119,83,89,233,111,167,127,143,119,27,97,170,155,216
lpb $0
mov $2,$0
seq $2,62378 ; n divided by largest cubefree factor of n.
div $0,$2
lpe
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
sub $0,1
| 50.727273 | 314 | 0.670251 |
5f130d4a6de0e559d20feecdce3cb433445fb729 | 3,679 | asm | Assembly | external/source/shellcode/windows/x64/src/block/block_bind_tcp.asm | madhavarao-yejarla/VoIP | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 35 | 2015-08-08T07:23:38.000Z | 2021-04-07T18:00:44.000Z | external/source/shellcode/windows/x64/src/block/block_bind_tcp.asm | madhavarao-yejarla/VoIP | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-02-12T12:13:53.000Z | 2019-02-12T12:13:53.000Z | external/source/shellcode/windows/x64/src/block/block_bind_tcp.asm | fozavci/metasploit-framework-with-viproy | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 23 | 2015-08-11T05:07:47.000Z | 2020-11-06T03:55:10.000Z | ;-----------------------------------------------------------------------------;
; Author: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com)
; Compatible: Windows 7, 2003
; Architecture: x64
;-----------------------------------------------------------------------------;
[BITS 64]
; Input: RBP must be the address of 'api_call'.
; Output: RDI will be the newly connected clients socket
; Clobbers: RAX, RCX, RDX, RDI, R8, R9, R10, R12, R13, R14, R15
bind_tcp:
; setup the structures we need on the stack...
mov r14, 'ws2_32'
push r14 ; Push the bytes 'ws2_32',0,0 onto the stack.
mov r14, rsp ; save pointer to the "ws2_32" string for LoadLibraryA call.
sub rsp, 408+8 ; alloc sizeof( struct WSAData ) bytes for the WSAData structure (+8 for alignment)
mov r13, rsp ; save pointer to the WSAData structure for WSAStartup call.
mov r12, 0x000000005C110002
push r12 ; bind to 0.0.0.0 family AF_INET and port 4444
mov r12, rsp ; save pointer to sockaddr_in struct for bind call
; perform the call to LoadLibraryA...
mov rcx, r14 ; set the param for the library to load
mov r10d, 0x0726774C ; hash( "kernel32.dll", "LoadLibraryA" )
call rbp ; LoadLibraryA( "ws2_32" )
; perform the call to WSAStartup...
mov rdx, r13 ; second param is a pointer to this stuct
push 0x0101 ;
pop rcx ; set the param for the version requested
mov r10d, 0x006B8029 ; hash( "ws2_32.dll", "WSAStartup" )
call rbp ; WSAStartup( 0x0101, &WSAData );
; perform the call to WSASocketA...
push rax ; if we succeed, rax wil be zero, push zero for the flags param.
push rax ; push null for reserved parameter
xor r9, r9 ; we do not specify a WSAPROTOCOL_INFO structure
xor r8, r8 ; we do not specify a protocol
inc rax ;
mov rdx, rax ; push SOCK_STREAM
inc rax ;
mov rcx, rax ; push AF_INET
mov r10d, 0xE0DF0FEA ; hash( "ws2_32.dll", "WSASocketA" )
call rbp ; WSASocketA( AF_INET, SOCK_STREAM, 0, 0, 0, 0 );
mov rdi, rax ; save the socket for later
; perform the call to bind...
push byte 16 ;
pop r8 ; length of the sockaddr_in struct (we only set the first 8 bytes as the last 8 are unused)
mov rdx, r12 ; set the pointer to sockaddr_in struct
mov rcx, rdi ; socket
mov r10d, 0x6737DBC2 ; hash( "ws2_32.dll", "bind" )
call rbp ; bind( s, &sockaddr_in, 16 );
; perform the call to listen...
xor rdx, rdx ; backlog
mov rcx, rdi ; socket
mov r10d, 0xFF38E9B7 ; hash( "ws2_32.dll", "listen" )
call rbp ; listen( s, 0 );
; perform the call to accept...
xor r8, r8 ; we set length for the sockaddr struct to zero
xor rdx, rdx ; we dont set the optional sockaddr param
mov rcx, rdi ; listening socket
mov r10d, 0xE13BEC74 ; hash( "ws2_32.dll", "accept" )
call rbp ; accept( s, 0, 0 );
; perform the call to closesocket...
mov rcx, rdi ; the listening socket to close
mov rdi, rax ; swap the new connected socket over the listening socket
mov r10d, 0x614D6E75 ; hash( "ws2_32.dll", "closesocket" )
call rbp ; closesocket( s );
; restore RSP so we dont have any alignment issues with the next block...
add rsp, ( (408+8) + (8*4) + (32*7) ) ; cleanup the stack allocations | 54.102941 | 117 | 0.563197 |
784795328ce0ef02c337031276c9dceb25682979 | 276 | asm | Assembly | programs/oeis/062/A062779.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/062/A062779.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/062/A062779.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A062779: a(n) = 2*n*(2*n)!.
; 0,4,96,4320,322560,36288000,5748019200,1220496076800,334764638208000,115242726703104000,48658040163532800000,24728016011107368960000,14890761641597746544640000,10485577989291746525184000000
mul $0,2
mov $1,$0
lpb $1
mul $0,$1
sub $1,1
lpe
| 27.6 | 191 | 0.782609 |
34613db45562e4f0195e751ca20cd002ed7606cc | 1,381 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_93_942.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_93_942.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_93_942.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 %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x12ed1, %rsi
lea addresses_normal_ht+0x13611, %rdi
nop
cmp $27171, %r8
mov $34, %rcx
rep movsl
nop
nop
xor %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rax
push %rcx
push %rdx
// Faulty Load
lea addresses_US+0x10191, %r11
xor %r15, %r15
movups (%r11), %xmm4
vpextrq $0, %xmm4, %rcx
lea oracles, %rdx
and $0xff, %rcx
shlq $12, %rcx
mov (%rdx,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %rax
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'00': 93}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 22.639344 | 278 | 0.661115 |
9b0a1e4f507ea597dd8c4a7282af4ceef5b0c8bf | 12,756 | asm | Assembly | c/03-bootstrap/06-flappy-bird/build/main.rgbds.asm.tidy.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null | c/03-bootstrap/06-flappy-bird/build/main.rgbds.asm.tidy.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null | c/03-bootstrap/06-flappy-bird/build/main.rgbds.asm.tidy.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null |
; Public variables in this module
; special function registers
_p1_joypad = 0x0000
_interrupt_flag = 0x000f
_interrupt_enable = 0x00ff
_NR52 = 0x0026
_LCDC = 0x0040
_STAT = 0x0041
_SCY = 0x0042
_SCX = 0x0043
_LY = 0x0044
_LYC = 0x0045
_DMA = 0x0046
_BGP = 0x0047
_OBP0 = 0x0048
_OBP1 = 0x0049
; ram data
_tiles = 0x9000
_bgmap = 0x9800
_OAMRAM = 0xfe00
_HRAM = 0xff80
_oam = 0xfe00
_shadow_oam:
_previous_joypad:
_joypad:
_joypad_dpad_state:
_joypad_btn_state:
_cursor:
_player:
_game_over:
; absolute external ram data
;src\/gameboy.h:140: volatile u8 previous_joypad = 0;
ld hl, _previous_joypad
ld [hl], $00
;src\/gameboy.h:141: volatile u8 joypad = 0;
ld hl, _joypad
ld [hl], $00
;src\/gameboy.h:142: volatile u8 joypad_dpad_state = 0;
ld hl, _joypad_dpad_state
ld [hl], $00
;src\/gameboy.h:143: volatile u8 joypad_btn_state = 0;
ld hl, _joypad_btn_state
ld [hl], $00
;src\main.c:24: struct Point cursor = { .x = 0, .y = 0};
ld hl, _cursor
ld [hl], $00
ld hl, (_cursor + 0x0001)
ld [hl], $00
;src\main.c:28: u8 game_over = 0;
ld hl, _game_over
ld [hl], $00
; Home
; code
;src\/gameboy.h:148: void dma_copy(void)
; Function dma_copy
_dma_copy::
;src\/gameboy.h:150: nop();
nop
.l00101:
;src\/gameboy.h:162: }
ret
_char_map:
_IEF_HILO:
_IEF_SERIAL:
_IEF_TIMER:
_IEF_LCDC:
_IEF_VBLANK:
;src\/gameboy.h:165: void poll_joypad(void)
; Function poll_joypad
_poll_joypad::
;src\/gameboy.h:197: );
rP1 = #0xFF00
ld a, #0x20
ld (rP1), a
ld a, (rP1)
ld a, (rP1)
ld (_joypad_dpad_state), a
ld a, (#0x10)
ld (rP1), a
ld a, (rP1)
ld a, (rP1)
ld a, (rP1)
ld a, (rP1)
ld a, (rP1)
ld a, (rP1)
ld (_joypad_btn_state), a
ld a, (#0x30)
ld (rP1), a
;src\/gameboy.h:199: joypad_btn_state = (~joypad_btn_state) & 0x0F;
ld hl, _joypad_btn_state
ld a, [hl]
cpl
and a, $0F
ld [hl], a
;src\/gameboy.h:200: joypad_dpad_state = (~joypad_dpad_state) & 0x0F;
ld hl, _joypad_dpad_state
ld a, [hl]
cpl
and a, $0F
ld [hl], a
;src\/gameboy.h:202: previous_joypad = joypad;
push hl
ld hl, _joypad
ld a, [hl]
ld hl, _previous_joypad
ld [hl], a
pop hl
;src\/gameboy.h:204: joypad = (joypad_dpad_state << 4) ^ joypad_btn_state;
ld hl, _joypad_dpad_state
ld a, [hl]
swap a
and a, $F0
ld hl, _joypad_btn_state
xor a, [hl]
ld hl, _joypad
ld [hl], a
.l00101:
;src\/gameboy.h:205: }
ret
;src\/gameboy.h:212: void timer_isr(void) __critical __interrupt __naked
; Function timer_isr
_timer_isr::
;src\/gameboy.h:214: breakpoint();
ld b,b
;src\/gameboy.h:215: __asm__("reti");
reti
.l00101:
;src\/gameboy.h:216: }
;src\/gameboy.h:218: void vblank_isr(void) __critical __interrupt __naked
; Function vblank_isr
_vblank_isr::
;src\/gameboy.h:220: poll_joypad();
call _poll_joypad
;src\/gameboy.h:222: __asm__("reti");
reti
.l00101:
;src\/gameboy.h:223: }
;src\/gameboy.h:225: void lcd_isr(void) __critical __interrupt __naked
; Function lcd_isr
_lcd_isr::
;src\/gameboy.h:227: breakpoint();
ld b,b
;src\/gameboy.h:228: __asm__("reti");
reti
.l00101:
;src\/gameboy.h:229: }
;src\/gameboy.h:231: void serial_isr(void) __critical __interrupt __naked
; Function serial_isr
_serial_isr::
;src\/gameboy.h:233: breakpoint();
ld b,b
;src\/gameboy.h:234: __asm__("reti");
reti
.l00101:
;src\/gameboy.h:235: }
;src\/gameboy.h:237: void joypad_isr(void) __critical __interrupt __naked
; Function joypad_isr
_joypad_isr::
;src\/gameboy.h:239: breakpoint();
ld b,b
;src\/gameboy.h:240: __asm__("reti");
reti
.l00101:
;src\/gameboy.h:241: }
;src\/friend.h:15: void main(void) {
; Function main
_main::
;src\/friend.h:16: system_init();
call _system_init
;src\/friend.h:18: init();
call _init
;src\/friend.h:20: while(1) {
.l00102:
;src\/friend.h:21: update();
call _update
;src\/friend.h:23: halt();
halt
nop
;src\/friend.h:24: draw();
call _draw
jr .l00102
.l00104:
;src\/friend.h:26: }
ret
;src\/friend.h:30: void system_init(void) {
; Function system_init
_system_init::
;src\/friend.h:32: disable_interrupts();
di
;src\/friend.h:34: while (LY < 144) {} /* wait until vblank */
.l00101:
ldh a, (_LY+0)
sub a, $90
jr C,.l00101
;src\/friend.h:36: LCDC = LCDCF_OFF;
ld a, $00
ldh (_LCDC+0),a
;src\/friend.h:45: BGP = 0b11100100;
ld a, $E4
ldh (_BGP+0),a
;src\/friend.h:46: OBP0 = 0b11100100;
ld a, $E4
ldh (_OBP0+0),a
;src\/friend.h:47: OBP1 = 0b11100100;
ld a, $E4
ldh (_OBP1+0),a
;src\/friend.h:49: SCY = 0;
ld a, $00
ldh (_SCY+0),a
;src\/friend.h:50: SCX = 0;
ld a, $00
ldh (_SCX+0),a
;src\/friend.h:52: NR52 = 0;
ld a, $00
ldh (_NR52+0),a
.l00104:
;src\/friend.h:57: }
ret
;src\/friend_draw.h:25: u8 tile_pget(u8 tile_number, u8 x, u8 y)
; Function tile_pget
_tile_pget::
add sp, #-3
;src\/friend_draw.h:27: u8 mask = (128 >> x);
ld hl, [sp+6]
ld a, [hl]
push af
ld c, $80
ld b, $00
pop af
inc a
jr .l00120
.l00119:
sra b
rr c
.l00120:
dec a
jr NZ, .l00119
ld hl, [sp+0]
ld [hl], c
;src\/friend_draw.h:29: u8 *row = tile_get_row(tile_number, y);
ld hl, [sp+7]
ld a, [hl]
ld hl, [sp+2]
ld [hl], a
ld hl, [sp+5]
ld a, [hl]
;src\/friend_draw.h:10: u8 offset = tile_number << 4;
swap a
and a, $F0
ld c, a
;src\/friend_draw.h:16: u8 *tile = get_tile(tile_number);
ld a, _tiles & $FF
add a, c
ld c, a
ld a, _tiles >> 8
adc a, $00
ld b, a
;src\/friend_draw.h:19: u8 offset = y << 2;
ld hl, [sp+2]
ld a, [hl]
add a, a
add a, a
;src\/friend_draw.h:29: u8 *row = tile_get_row(tile_number, y);
add a, c
ld c, a
ld a, $00
adc a, b
ld b, a
;src\/friend_draw.h:31: u8 hi = *(row + 1) & mask;
ld hl, $0001
add hl, bc
ld a, l
ld d, h
ld hl, [sp+1]
ld [hl], a
inc hl
ld [hl], d
dec hl
ld e, [hl]
inc hl
ld d, [hl]
ld a,[de]
dec hl
dec hl
and a, [hl]
ld d, a
;src\/friend_draw.h:32: u8 lo = *(row + 0) & mask;
ld a, [bc]
and a, [hl]
ld e, a
;src\/friend_draw.h:34: return (hi ? 2 : 0) + (lo ? 1 : 0);
ld a, d
or a, a
jr Z,.l00105
ld bc, $0002
jr .l00106
.l00105:
ld bc, $0000
.l00106:
ld a, e
or a, a
jr Z,.l00107
ld de, $0001
jr .l00108
.l00107:
ld de, $0000
.l00108:
ld a, e
add a, c
ld e, a
.l00103:
;src\/friend_draw.h:35: }
add sp, #3
ret
_bytes_per_row:
_bytes_per_tile:
;src\/friend_draw.h:38: void tile_pset(u8 tile_number, u8 x, u8 y, u8 value)
; Function tile_pset
_tile_pset::
add sp, #-4
;src\/friend_draw.h:40: u8 *row = tile_get_row(tile_number, y);
ld hl, [sp+8]
ld a, [hl]
ld hl, [sp+3]
ld [hl], a
ld hl, [sp+6]
ld a, [hl]
;src\/friend_draw.h:10: u8 offset = tile_number << 4;
swap a
and a, $F0
ld c, a
;src\/friend_draw.h:16: u8 *tile = get_tile(tile_number);
ld a, _tiles & $FF
add a, c
ld c, a
ld a, _tiles >> 8
adc a, $00
ld b, a
;src\/friend_draw.h:19: u8 offset = y << 2;
ld hl, [sp+3]
ld a, [hl]
add a, a
add a, a
;src\/friend_draw.h:40: u8 *row = tile_get_row(tile_number, y);
add a, c
ld c, a
ld a, $00
adc a, b
ld b, a
;src\/friend_draw.h:42: u8 mask = (128 >> x);
ld hl, [sp+7]
ld a, [hl]
push af
ld e, $80
ld d, $00
pop af
inc a
jr .l00131
.l00130:
sra d
rr e
.l00131:
dec a
jr NZ, .l00130
ld hl, [sp+0]
ld [hl], e
;src\/friend_draw.h:47: *(row + 1) |= mask;
ld hl, $0001
add hl, bc
ld a, l
ld d, h
ld hl, [sp+1]
ld [hl], a
inc hl
ld [hl], d
;src\/friend_draw.h:51: *(row + 0) &= ~mask;
dec hl
dec hl
ld a, [hl]
cpl
ld hl, [sp+3]
ld [hl], a
;src\/friend_draw.h:44: switch (value) {
ld hl, [sp+9]
ld a, [hl]
or a, a
jp Z,.l00104
.l00132:
ld hl, [sp+9]
ld a, [hl]
dec a
jp Z,.l00103
.l00133:
ld hl, [sp+9]
ld a, [hl]
sub a, $02
jr Z,.l00102
.l00134:
ld hl, [sp+9]
ld a, [hl]
sub a, $03
jr Z,.l00136
.l00135:
jp .l00108
.l00136:
;src\/friend_draw.h:46: *(row + 0) |= mask;
ld a, [bc]
ld hl, [sp+0]
or a, [hl]
ld [bc], a
;src\/friend_draw.h:47: *(row + 1) |= mask;
inc hl
ld e, [hl]
inc hl
ld d, [hl]
ld a,[de]
dec hl
dec hl
or a, [hl]
ld c, a
inc hl
ld a, [hl]
inc hl
ld h, [hl]
ld l, a
ld [hl], c
;src\/friend_draw.h:48: break;
jp .l00108
;src\/friend_draw.h:50: case 0b10:
.l00102:
;src\/friend_draw.h:51: *(row + 0) &= ~mask;
ld a, [bc]
ld hl, [sp+3]
and a, [hl]
ld [bc], a
;src\/friend_draw.h:52: *(row + 1) |= mask;
dec hl
dec hl
ld e, [hl]
inc hl
ld d, [hl]
ld a,[de]
dec hl
dec hl
or a, [hl]
ld c, a
inc hl
ld a, [hl]
inc hl
ld h, [hl]
ld l, a
ld [hl], c
;src\/friend_draw.h:53: break;
jp .l00108
;src\/friend_draw.h:55: case 0b01:
.l00103:
;src\/friend_draw.h:56: *(row + 0) |= mask;
ld a, [bc]
ld hl, [sp+0]
or a, [hl]
ld [bc], a
;src\/friend_draw.h:57: *(row + 1) &= ~mask;
inc hl
ld e, [hl]
inc hl
ld d, [hl]
ld a,[de]
inc hl
and a, [hl]
ld c, a
dec hl
dec hl
ld a, [hl]
inc hl
ld h, [hl]
ld l, a
ld [hl], c
;src\/friend_draw.h:58: break;
jr .l00108
;src\/friend_draw.h:60: case 0b00:
.l00104:
;src\/friend_draw.h:61: *(row + 0) &= ~mask;
ld a, [bc]
ld hl, [sp+3]
and a, [hl]
ld [bc], a
;src\/friend_draw.h:62: *(row + 1) &= ~mask;
dec hl
dec hl
ld e, [hl]
inc hl
ld d, [hl]
ld a,[de]
inc hl
and a, [hl]
ld c, a
dec hl
dec hl
ld a, [hl]
inc hl
ld h, [hl]
ld l, a
ld [hl], c
;src\/friend_draw.h:64: }
.l00108:
;src\/friend_draw.h:65: }
add sp, #4
ret
;src\main.c:31: void init_player()
; Function init_player
_init_player::
;src\main.c:33: player.position.x = 40;
ld hl, _player
ld [hl], $28
;src\main.c:34: player.position.y = 40;
ld hl, (_player + 0x0001)
ld [hl], $28
;src\main.c:36: player.y_velocity = 1;
ld hl, (_player + 0x0002)
ld [hl], $01
;src\main.c:37: player.score = 0;
ld hl, (_player + 0x0003)
ld [hl], $00
.l00101:
;src\main.c:38: }
ret
_gravity:
_flap_velocity:
;src\main.c:41: void init(void)
; Function init
_init::
;src\main.c:43: init_player();
call _init_player
;src\main.c:45: memset(&oam, 0, sizeof(oam));
ld hl, $00A0
push hl
ld l, $00
push hl
ld hl, _oam
push hl
call _memset
add sp, #6
;src\main.c:46: memset(&tiles, 0, sizeof(tiles));
ld hl, $0001
push hl
ld l, $00
push hl
ld hl, _tiles
push hl
call _memset
add sp, #6
;src\main.c:47: memset(&bgmap, 0, sizeof(bgmap));
ld hl, $0400
push hl
ld h, $00
push hl
ld hl, _bgmap
push hl
call _memset
add sp, #6
;src\main.c:49: memcpy(&tiles, &char_map, sizeof(char_map));
ld hl, $0800
push hl
ld hl, _char_map
push hl
ld hl, _tiles
push hl
call ___memcpy
add sp, #6
;src\main.c:51: oam[0].tile = 0x19;
ld hl, (_oam + 0x0002)
ld [hl], $19
;src\main.c:52: oam[1].tile = 0x19;
ld hl, (_oam + 0x0006)
ld [hl], $19
;src\main.c:53: oam[2].tile = 0x19;
ld hl, (_oam + 0x000a)
ld [hl], $19
;src\main.c:54: oam[3].tile = 0x19;
ld hl, (_oam + 0x000e)
ld [hl], $19
;src\main.c:60: LCDCF_OBJON;
ld a, $83
ldh (_LCDC+0),a
;src\main.c:62: enable_interrupts();
ei
;src\main.c:63: interrupt_enable = IEF_VBLANK;
ld hl, _IEF_VBLANK
ld a, [hl]
ldh (_interrupt_enable+0),a
.l00101:
;src\main.c:64: }
ret
;src\main.c:67: void update(void)
; Function update
_update::
;src\main.c:70: if (btnp(j_a)) {
ld hl, _previous_joypad
ld c, [hl]
xor a, a
cpl
ld b, a
ld a, c
cpl
ld c, a
ld hl, _joypad
ld e, [hl]
ld d, $00
ld a, c
and a, e
ld c, a
ld a, b
and a, d
bit 0, c
jr Z,.l00102
.l00118:
;src\main.c:71: player.y_velocity = (flap_velocity << SUBPIXELS);
ld bc, _player+2
ld hl, _flap_velocity
ld a, [hl]
add a, a
add a, a
add a, a
ld [bc], a
jr .l00103
.l00102:
;src\main.c:74: player.y_velocity += gravity;
ld bc, _player+2
ld a, [bc]
ld e, a
ld hl, _gravity
ld a, [hl]
add a, e
ld [bc], a
.l00103:
;src\main.c:78: step = (player.y_velocity >> SUBPIXELS);
ld a, ((_player + 0x0002) + 0)
sra a
sra a
sra a
;src\main.c:79: player.position.y += step;
ld bc, _player + 1
push af
ld a, [bc]
ld e, a
pop af
add a, e
;src\main.c:86: if (player.position.y > (160 - 16)) {
ld [bc],a
ld c, a
ld a, $90
sub a, c
ret NC
;src\main.c:88: OBP0 += 1;
ldh a, (_OBP0+0)
inc a
ldh (_OBP0+0),a
;src\main.c:89: init_player();
call _init_player
.l00106:
;src\main.c:91: }
ret
;src\main.c:94: void draw(void)
; Function draw
_draw::
;src\main.c:96: oam[0].x = player.position.x;
ld de, _oam+1
ld bc, _player+0
ld a, [bc]
ld [de], a
;src\main.c:97: oam[0].y = player.position.y;
ld a, ((_player + 0x0001) + 0)
ld hl, _oam
ld [hl], a
;src\main.c:99: oam[1].x = player.position.x + 8;
ld de, _oam+5
ld a, [bc]
add a, $08
ld [de], a
;src\main.c:100: oam[1].y = player.position.y;
ld a, ((_player + 0x0001) + 0)
ld hl, (_oam + 0x0004)
ld [hl], a
;src\main.c:102: oam[2].x = player.position.x;
ld de, _oam+9
ld a, [bc]
ld [de], a
;src\main.c:103: oam[2].y = player.position.y + 8;
ld a, ((_player + 0x0001) + 0)
add a, $08
ld hl, (_oam + 0x0008)
ld [hl], a
;src\main.c:105: oam[3].x = player.position.x + 8;
ld de, _oam+13
ld a, [bc]
add a, $08
ld [de], a
;src\main.c:106: oam[3].y = player.position.y + 8;
ld bc, _oam+12
ld a, ((_player + 0x0001) + 0)
add a, $08
ld [bc], a
.l00101:
;src\main.c:144: }
ret
| 18.042433 | 76 | 0.621982 |
ddad1a785de34c810cecb0e61d56d3a22055b4e7 | 45,022 | asm | Assembly | zombie.asm | haniyehnasseri/xv6ProcessScheduling | cb908f7fa9cf0874db1c310d8d2220d923fda15b | [
"MIT-0"
] | null | null | null | zombie.asm | haniyehnasseri/xv6ProcessScheduling | cb908f7fa9cf0874db1c310d8d2220d923fda15b | [
"MIT-0"
] | null | null | null | zombie.asm | haniyehnasseri/xv6ProcessScheduling | cb908f7fa9cf0874db1c310d8d2220d923fda15b | [
"MIT-0"
] | null | null | null |
_zombie: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 51 push %ecx
e: 83 ec 04 sub $0x4,%esp
if(fork() > 0)
11: e8 54 02 00 00 call 26a <fork>
16: 85 c0 test %eax,%eax
18: 7e 0d jle 27 <main+0x27>
sleep(5); // Let child exit before parent.
1a: 83 ec 0c sub $0xc,%esp
1d: 6a 05 push $0x5
1f: e8 ee 02 00 00 call 312 <sleep>
24: 83 c4 10 add $0x10,%esp
exit();
27: e8 46 02 00 00 call 272 <exit>
2c: 66 90 xchg %ax,%ax
2e: 66 90 xchg %ax,%ax
00000030 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
30: 55 push %ebp
31: 89 e5 mov %esp,%ebp
33: 53 push %ebx
34: 8b 45 08 mov 0x8(%ebp),%eax
37: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
3a: 89 c2 mov %eax,%edx
3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
40: 83 c1 01 add $0x1,%ecx
43: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
47: 83 c2 01 add $0x1,%edx
4a: 84 db test %bl,%bl
4c: 88 5a ff mov %bl,-0x1(%edx)
4f: 75 ef jne 40 <strcpy+0x10>
;
return os;
}
51: 5b pop %ebx
52: 5d pop %ebp
53: c3 ret
54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000060 <strcmp>:
int
strcmp(const char *p, const char *q)
{
60: 55 push %ebp
61: 89 e5 mov %esp,%ebp
63: 56 push %esi
64: 53 push %ebx
65: 8b 55 08 mov 0x8(%ebp),%edx
68: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
6b: 0f b6 02 movzbl (%edx),%eax
6e: 0f b6 19 movzbl (%ecx),%ebx
71: 84 c0 test %al,%al
73: 75 1e jne 93 <strcmp+0x33>
75: eb 29 jmp a0 <strcmp+0x40>
77: 89 f6 mov %esi,%esi
79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
80: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
83: 0f b6 02 movzbl (%edx),%eax
p++, q++;
86: 8d 71 01 lea 0x1(%ecx),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
89: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
8d: 84 c0 test %al,%al
8f: 74 0f je a0 <strcmp+0x40>
91: 89 f1 mov %esi,%ecx
93: 38 d8 cmp %bl,%al
95: 74 e9 je 80 <strcmp+0x20>
p++, q++;
return (uchar)*p - (uchar)*q;
97: 29 d8 sub %ebx,%eax
}
99: 5b pop %ebx
9a: 5e pop %esi
9b: 5d pop %ebp
9c: c3 ret
9d: 8d 76 00 lea 0x0(%esi),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
a0: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
a2: 29 d8 sub %ebx,%eax
}
a4: 5b pop %ebx
a5: 5e pop %esi
a6: 5d pop %ebp
a7: c3 ret
a8: 90 nop
a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000000b0 <strlen>:
uint
strlen(const char *s)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
b6: 80 39 00 cmpb $0x0,(%ecx)
b9: 74 12 je cd <strlen+0x1d>
bb: 31 d2 xor %edx,%edx
bd: 8d 76 00 lea 0x0(%esi),%esi
c0: 83 c2 01 add $0x1,%edx
c3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
c7: 89 d0 mov %edx,%eax
c9: 75 f5 jne c0 <strlen+0x10>
;
return n;
}
cb: 5d pop %ebp
cc: c3 ret
uint
strlen(const char *s)
{
int n;
for(n = 0; s[n]; n++)
cd: 31 c0 xor %eax,%eax
;
return n;
}
cf: 5d pop %ebp
d0: c3 ret
d1: eb 0d jmp e0 <memset>
d3: 90 nop
d4: 90 nop
d5: 90 nop
d6: 90 nop
d7: 90 nop
d8: 90 nop
d9: 90 nop
da: 90 nop
db: 90 nop
dc: 90 nop
dd: 90 nop
de: 90 nop
df: 90 nop
000000e0 <memset>:
void*
memset(void *dst, int c, uint n)
{
e0: 55 push %ebp
e1: 89 e5 mov %esp,%ebp
e3: 57 push %edi
e4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
e7: 8b 4d 10 mov 0x10(%ebp),%ecx
ea: 8b 45 0c mov 0xc(%ebp),%eax
ed: 89 d7 mov %edx,%edi
ef: fc cld
f0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
f2: 89 d0 mov %edx,%eax
f4: 5f pop %edi
f5: 5d pop %ebp
f6: c3 ret
f7: 89 f6 mov %esi,%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <strchr>:
char*
strchr(const char *s, char c)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 53 push %ebx
104: 8b 45 08 mov 0x8(%ebp),%eax
107: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
10a: 0f b6 10 movzbl (%eax),%edx
10d: 84 d2 test %dl,%dl
10f: 74 1d je 12e <strchr+0x2e>
if(*s == c)
111: 38 d3 cmp %dl,%bl
113: 89 d9 mov %ebx,%ecx
115: 75 0d jne 124 <strchr+0x24>
117: eb 17 jmp 130 <strchr+0x30>
119: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
120: 38 ca cmp %cl,%dl
122: 74 0c je 130 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
124: 83 c0 01 add $0x1,%eax
127: 0f b6 10 movzbl (%eax),%edx
12a: 84 d2 test %dl,%dl
12c: 75 f2 jne 120 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
12e: 31 c0 xor %eax,%eax
}
130: 5b pop %ebx
131: 5d pop %ebp
132: c3 ret
133: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000140 <gets>:
char*
gets(char *buf, int max)
{
140: 55 push %ebp
141: 89 e5 mov %esp,%ebp
143: 57 push %edi
144: 56 push %esi
145: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
146: 31 f6 xor %esi,%esi
cc = read(0, &c, 1);
148: 8d 7d e7 lea -0x19(%ebp),%edi
return 0;
}
char*
gets(char *buf, int max)
{
14b: 83 ec 1c sub $0x1c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
14e: eb 29 jmp 179 <gets+0x39>
cc = read(0, &c, 1);
150: 83 ec 04 sub $0x4,%esp
153: 6a 01 push $0x1
155: 57 push %edi
156: 6a 00 push $0x0
158: e8 2d 01 00 00 call 28a <read>
if(cc < 1)
15d: 83 c4 10 add $0x10,%esp
160: 85 c0 test %eax,%eax
162: 7e 1d jle 181 <gets+0x41>
break;
buf[i++] = c;
164: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
168: 8b 55 08 mov 0x8(%ebp),%edx
16b: 89 de mov %ebx,%esi
if(c == '\n' || c == '\r')
16d: 3c 0a cmp $0xa,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
16f: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
173: 74 1b je 190 <gets+0x50>
175: 3c 0d cmp $0xd,%al
177: 74 17 je 190 <gets+0x50>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
179: 8d 5e 01 lea 0x1(%esi),%ebx
17c: 3b 5d 0c cmp 0xc(%ebp),%ebx
17f: 7c cf jl 150 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
181: 8b 45 08 mov 0x8(%ebp),%eax
184: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
188: 8d 65 f4 lea -0xc(%ebp),%esp
18b: 5b pop %ebx
18c: 5e pop %esi
18d: 5f pop %edi
18e: 5d pop %ebp
18f: c3 ret
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
190: 8b 45 08 mov 0x8(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
193: 89 de mov %ebx,%esi
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
195: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
199: 8d 65 f4 lea -0xc(%ebp),%esp
19c: 5b pop %ebx
19d: 5e pop %esi
19e: 5f pop %edi
19f: 5d pop %ebp
1a0: c3 ret
1a1: eb 0d jmp 1b0 <stat>
1a3: 90 nop
1a4: 90 nop
1a5: 90 nop
1a6: 90 nop
1a7: 90 nop
1a8: 90 nop
1a9: 90 nop
1aa: 90 nop
1ab: 90 nop
1ac: 90 nop
1ad: 90 nop
1ae: 90 nop
1af: 90 nop
000001b0 <stat>:
int
stat(const char *n, struct stat *st)
{
1b0: 55 push %ebp
1b1: 89 e5 mov %esp,%ebp
1b3: 56 push %esi
1b4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1b5: 83 ec 08 sub $0x8,%esp
1b8: 6a 00 push $0x0
1ba: ff 75 08 pushl 0x8(%ebp)
1bd: e8 f0 00 00 00 call 2b2 <open>
if(fd < 0)
1c2: 83 c4 10 add $0x10,%esp
1c5: 85 c0 test %eax,%eax
1c7: 78 27 js 1f0 <stat+0x40>
return -1;
r = fstat(fd, st);
1c9: 83 ec 08 sub $0x8,%esp
1cc: ff 75 0c pushl 0xc(%ebp)
1cf: 89 c3 mov %eax,%ebx
1d1: 50 push %eax
1d2: e8 f3 00 00 00 call 2ca <fstat>
1d7: 89 c6 mov %eax,%esi
close(fd);
1d9: 89 1c 24 mov %ebx,(%esp)
1dc: e8 b9 00 00 00 call 29a <close>
return r;
1e1: 83 c4 10 add $0x10,%esp
1e4: 89 f0 mov %esi,%eax
}
1e6: 8d 65 f8 lea -0x8(%ebp),%esp
1e9: 5b pop %ebx
1ea: 5e pop %esi
1eb: 5d pop %ebp
1ec: c3 ret
1ed: 8d 76 00 lea 0x0(%esi),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
1f0: b8 ff ff ff ff mov $0xffffffff,%eax
1f5: eb ef jmp 1e6 <stat+0x36>
1f7: 89 f6 mov %esi,%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <atoi>:
return r;
}
int
atoi(const char *s)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 53 push %ebx
204: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
207: 0f be 11 movsbl (%ecx),%edx
20a: 8d 42 d0 lea -0x30(%edx),%eax
20d: 3c 09 cmp $0x9,%al
20f: b8 00 00 00 00 mov $0x0,%eax
214: 77 1f ja 235 <atoi+0x35>
216: 8d 76 00 lea 0x0(%esi),%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
220: 8d 04 80 lea (%eax,%eax,4),%eax
223: 83 c1 01 add $0x1,%ecx
226: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
22a: 0f be 11 movsbl (%ecx),%edx
22d: 8d 5a d0 lea -0x30(%edx),%ebx
230: 80 fb 09 cmp $0x9,%bl
233: 76 eb jbe 220 <atoi+0x20>
n = n*10 + *s++ - '0';
return n;
}
235: 5b pop %ebx
236: 5d pop %ebp
237: c3 ret
238: 90 nop
239: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000240 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
240: 55 push %ebp
241: 89 e5 mov %esp,%ebp
243: 56 push %esi
244: 53 push %ebx
245: 8b 5d 10 mov 0x10(%ebp),%ebx
248: 8b 45 08 mov 0x8(%ebp),%eax
24b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
24e: 85 db test %ebx,%ebx
250: 7e 14 jle 266 <memmove+0x26>
252: 31 d2 xor %edx,%edx
254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
258: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
25c: 88 0c 10 mov %cl,(%eax,%edx,1)
25f: 83 c2 01 add $0x1,%edx
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
262: 39 da cmp %ebx,%edx
264: 75 f2 jne 258 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
266: 5b pop %ebx
267: 5e pop %esi
268: 5d pop %ebp
269: c3 ret
0000026a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
26a: b8 01 00 00 00 mov $0x1,%eax
26f: cd 40 int $0x40
271: c3 ret
00000272 <exit>:
SYSCALL(exit)
272: b8 02 00 00 00 mov $0x2,%eax
277: cd 40 int $0x40
279: c3 ret
0000027a <wait>:
SYSCALL(wait)
27a: b8 03 00 00 00 mov $0x3,%eax
27f: cd 40 int $0x40
281: c3 ret
00000282 <pipe>:
SYSCALL(pipe)
282: b8 04 00 00 00 mov $0x4,%eax
287: cd 40 int $0x40
289: c3 ret
0000028a <read>:
SYSCALL(read)
28a: b8 05 00 00 00 mov $0x5,%eax
28f: cd 40 int $0x40
291: c3 ret
00000292 <write>:
SYSCALL(write)
292: b8 10 00 00 00 mov $0x10,%eax
297: cd 40 int $0x40
299: c3 ret
0000029a <close>:
SYSCALL(close)
29a: b8 15 00 00 00 mov $0x15,%eax
29f: cd 40 int $0x40
2a1: c3 ret
000002a2 <kill>:
SYSCALL(kill)
2a2: b8 06 00 00 00 mov $0x6,%eax
2a7: cd 40 int $0x40
2a9: c3 ret
000002aa <exec>:
SYSCALL(exec)
2aa: b8 07 00 00 00 mov $0x7,%eax
2af: cd 40 int $0x40
2b1: c3 ret
000002b2 <open>:
SYSCALL(open)
2b2: b8 0f 00 00 00 mov $0xf,%eax
2b7: cd 40 int $0x40
2b9: c3 ret
000002ba <mknod>:
SYSCALL(mknod)
2ba: b8 11 00 00 00 mov $0x11,%eax
2bf: cd 40 int $0x40
2c1: c3 ret
000002c2 <unlink>:
SYSCALL(unlink)
2c2: b8 12 00 00 00 mov $0x12,%eax
2c7: cd 40 int $0x40
2c9: c3 ret
000002ca <fstat>:
SYSCALL(fstat)
2ca: b8 08 00 00 00 mov $0x8,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <link>:
SYSCALL(link)
2d2: b8 13 00 00 00 mov $0x13,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <mkdir>:
SYSCALL(mkdir)
2da: b8 14 00 00 00 mov $0x14,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <chdir>:
SYSCALL(chdir)
2e2: b8 09 00 00 00 mov $0x9,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <dup>:
SYSCALL(dup)
2ea: b8 0a 00 00 00 mov $0xa,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <getpid>:
SYSCALL(getpid)
2f2: b8 0b 00 00 00 mov $0xb,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <get_parent_id>:
SYSCALL(get_parent_id)
2fa: b8 16 00 00 00 mov $0x16,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <getchildren>:
SYSCALL(getchildren)
302: b8 17 00 00 00 mov $0x17,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <sbrk>:
SYSCALL(sbrk)
30a: b8 0c 00 00 00 mov $0xc,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <sleep>:
SYSCALL(sleep)
312: b8 0d 00 00 00 mov $0xd,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <uptime>:
SYSCALL(uptime)
31a: b8 0e 00 00 00 mov $0xe,%eax
31f: cd 40 int $0x40
321: c3 ret
00000322 <set>:
SYSCALL(set)
322: b8 18 00 00 00 mov $0x18,%eax
327: cd 40 int $0x40
329: c3 ret
0000032a <count>:
SYSCALL(count)
32a: b8 19 00 00 00 mov $0x19,%eax
32f: cd 40 int $0x40
331: c3 ret
00000332 <sleepp>:
SYSCALL(sleepp)
332: b8 1a 00 00 00 mov $0x1a,%eax
337: cd 40 int $0x40
339: c3 ret
0000033a <cmos>:
SYSCALL(cmos)
33a: b8 1b 00 00 00 mov $0x1b,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <chqueue>:
SYSCALL(chqueue)
342: b8 1c 00 00 00 mov $0x1c,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <setLottery>:
SYSCALL(setLottery)
34a: b8 1d 00 00 00 mov $0x1d,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <chprSRPF>:
SYSCALL(chprSRPF)
352: b8 1e 00 00 00 mov $0x1e,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <printinfo>:
SYSCALL(printinfo)
35a: b8 1f 00 00 00 mov $0x1f,%eax
35f: cd 40 int $0x40
361: c3 ret
362: 66 90 xchg %ax,%ax
364: 66 90 xchg %ax,%ax
366: 66 90 xchg %ax,%ax
368: 66 90 xchg %ax,%ax
36a: 66 90 xchg %ax,%ax
36c: 66 90 xchg %ax,%ax
36e: 66 90 xchg %ax,%ax
00000370 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 57 push %edi
374: 56 push %esi
375: 53 push %ebx
376: 89 c6 mov %eax,%esi
378: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
37b: 8b 5d 08 mov 0x8(%ebp),%ebx
37e: 85 db test %ebx,%ebx
380: 74 7e je 400 <printint+0x90>
382: 89 d0 mov %edx,%eax
384: c1 e8 1f shr $0x1f,%eax
387: 84 c0 test %al,%al
389: 74 75 je 400 <printint+0x90>
neg = 1;
x = -xx;
38b: 89 d0 mov %edx,%eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
38d: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
394: f7 d8 neg %eax
396: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
399: 31 ff xor %edi,%edi
39b: 8d 5d d7 lea -0x29(%ebp),%ebx
39e: 89 ce mov %ecx,%esi
3a0: eb 08 jmp 3aa <printint+0x3a>
3a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
3a8: 89 cf mov %ecx,%edi
3aa: 31 d2 xor %edx,%edx
3ac: 8d 4f 01 lea 0x1(%edi),%ecx
3af: f7 f6 div %esi
3b1: 0f b6 92 38 07 00 00 movzbl 0x738(%edx),%edx
}while((x /= base) != 0);
3b8: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
3ba: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
3bd: 75 e9 jne 3a8 <printint+0x38>
if(neg)
3bf: 8b 45 c4 mov -0x3c(%ebp),%eax
3c2: 8b 75 c0 mov -0x40(%ebp),%esi
3c5: 85 c0 test %eax,%eax
3c7: 74 08 je 3d1 <printint+0x61>
buf[i++] = '-';
3c9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
3ce: 8d 4f 02 lea 0x2(%edi),%ecx
3d1: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
3d5: 8d 76 00 lea 0x0(%esi),%esi
3d8: 0f b6 07 movzbl (%edi),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
3db: 83 ec 04 sub $0x4,%esp
3de: 83 ef 01 sub $0x1,%edi
3e1: 6a 01 push $0x1
3e3: 53 push %ebx
3e4: 56 push %esi
3e5: 88 45 d7 mov %al,-0x29(%ebp)
3e8: e8 a5 fe ff ff call 292 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
3ed: 83 c4 10 add $0x10,%esp
3f0: 39 df cmp %ebx,%edi
3f2: 75 e4 jne 3d8 <printint+0x68>
putc(fd, buf[i]);
}
3f4: 8d 65 f4 lea -0xc(%ebp),%esp
3f7: 5b pop %ebx
3f8: 5e pop %esi
3f9: 5f pop %edi
3fa: 5d pop %ebp
3fb: c3 ret
3fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
} else {
x = xx;
400: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
402: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
409: eb 8b jmp 396 <printint+0x26>
40b: 90 nop
40c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000410 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 57 push %edi
414: 56 push %esi
415: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
416: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
419: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
41c: 8b 75 0c mov 0xc(%ebp),%esi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
41f: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
422: 89 45 d0 mov %eax,-0x30(%ebp)
425: 0f b6 1e movzbl (%esi),%ebx
428: 83 c6 01 add $0x1,%esi
42b: 84 db test %bl,%bl
42d: 0f 84 b0 00 00 00 je 4e3 <printf+0xd3>
433: 31 d2 xor %edx,%edx
435: eb 39 jmp 470 <printf+0x60>
437: 89 f6 mov %esi,%esi
439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
440: 83 f8 25 cmp $0x25,%eax
443: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
446: ba 25 00 00 00 mov $0x25,%edx
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
44b: 74 18 je 465 <printf+0x55>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
44d: 8d 45 e2 lea -0x1e(%ebp),%eax
450: 83 ec 04 sub $0x4,%esp
453: 88 5d e2 mov %bl,-0x1e(%ebp)
456: 6a 01 push $0x1
458: 50 push %eax
459: 57 push %edi
45a: e8 33 fe ff ff call 292 <write>
45f: 8b 55 d4 mov -0x2c(%ebp),%edx
462: 83 c4 10 add $0x10,%esp
465: 83 c6 01 add $0x1,%esi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
468: 0f b6 5e ff movzbl -0x1(%esi),%ebx
46c: 84 db test %bl,%bl
46e: 74 73 je 4e3 <printf+0xd3>
c = fmt[i] & 0xff;
if(state == 0){
470: 85 d2 test %edx,%edx
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
472: 0f be cb movsbl %bl,%ecx
475: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
478: 74 c6 je 440 <printf+0x30>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
47a: 83 fa 25 cmp $0x25,%edx
47d: 75 e6 jne 465 <printf+0x55>
if(c == 'd'){
47f: 83 f8 64 cmp $0x64,%eax
482: 0f 84 f8 00 00 00 je 580 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
488: 81 e1 f7 00 00 00 and $0xf7,%ecx
48e: 83 f9 70 cmp $0x70,%ecx
491: 74 5d je 4f0 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
493: 83 f8 73 cmp $0x73,%eax
496: 0f 84 84 00 00 00 je 520 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
49c: 83 f8 63 cmp $0x63,%eax
49f: 0f 84 ea 00 00 00 je 58f <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4a5: 83 f8 25 cmp $0x25,%eax
4a8: 0f 84 c2 00 00 00 je 570 <printf+0x160>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4ae: 8d 45 e7 lea -0x19(%ebp),%eax
4b1: 83 ec 04 sub $0x4,%esp
4b4: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4b8: 6a 01 push $0x1
4ba: 50 push %eax
4bb: 57 push %edi
4bc: e8 d1 fd ff ff call 292 <write>
4c1: 83 c4 0c add $0xc,%esp
4c4: 8d 45 e6 lea -0x1a(%ebp),%eax
4c7: 88 5d e6 mov %bl,-0x1a(%ebp)
4ca: 6a 01 push $0x1
4cc: 50 push %eax
4cd: 57 push %edi
4ce: 83 c6 01 add $0x1,%esi
4d1: e8 bc fd ff ff call 292 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4d6: 0f b6 5e ff movzbl -0x1(%esi),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4da: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
4dd: 31 d2 xor %edx,%edx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4df: 84 db test %bl,%bl
4e1: 75 8d jne 470 <printf+0x60>
putc(fd, c);
}
state = 0;
}
}
}
4e3: 8d 65 f4 lea -0xc(%ebp),%esp
4e6: 5b pop %ebx
4e7: 5e pop %esi
4e8: 5f pop %edi
4e9: 5d pop %ebp
4ea: c3 ret
4eb: 90 nop
4ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
4f0: 83 ec 0c sub $0xc,%esp
4f3: b9 10 00 00 00 mov $0x10,%ecx
4f8: 6a 00 push $0x0
4fa: 8b 5d d0 mov -0x30(%ebp),%ebx
4fd: 89 f8 mov %edi,%eax
4ff: 8b 13 mov (%ebx),%edx
501: e8 6a fe ff ff call 370 <printint>
ap++;
506: 89 d8 mov %ebx,%eax
508: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
50b: 31 d2 xor %edx,%edx
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
50d: 83 c0 04 add $0x4,%eax
510: 89 45 d0 mov %eax,-0x30(%ebp)
513: e9 4d ff ff ff jmp 465 <printf+0x55>
518: 90 nop
519: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
520: 8b 45 d0 mov -0x30(%ebp),%eax
523: 8b 18 mov (%eax),%ebx
ap++;
525: 83 c0 04 add $0x4,%eax
528: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
s = "(null)";
52b: b8 30 07 00 00 mov $0x730,%eax
530: 85 db test %ebx,%ebx
532: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
535: 0f b6 03 movzbl (%ebx),%eax
538: 84 c0 test %al,%al
53a: 74 23 je 55f <printf+0x14f>
53c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
540: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
543: 8d 45 e3 lea -0x1d(%ebp),%eax
546: 83 ec 04 sub $0x4,%esp
549: 6a 01 push $0x1
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
54b: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
54e: 50 push %eax
54f: 57 push %edi
550: e8 3d fd ff ff call 292 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
555: 0f b6 03 movzbl (%ebx),%eax
558: 83 c4 10 add $0x10,%esp
55b: 84 c0 test %al,%al
55d: 75 e1 jne 540 <printf+0x130>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
55f: 31 d2 xor %edx,%edx
561: e9 ff fe ff ff jmp 465 <printf+0x55>
566: 8d 76 00 lea 0x0(%esi),%esi
569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
570: 83 ec 04 sub $0x4,%esp
573: 88 5d e5 mov %bl,-0x1b(%ebp)
576: 8d 45 e5 lea -0x1b(%ebp),%eax
579: 6a 01 push $0x1
57b: e9 4c ff ff ff jmp 4cc <printf+0xbc>
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
580: 83 ec 0c sub $0xc,%esp
583: b9 0a 00 00 00 mov $0xa,%ecx
588: 6a 01 push $0x1
58a: e9 6b ff ff ff jmp 4fa <printf+0xea>
58f: 8b 5d d0 mov -0x30(%ebp),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
592: 83 ec 04 sub $0x4,%esp
595: 8b 03 mov (%ebx),%eax
597: 6a 01 push $0x1
599: 88 45 e4 mov %al,-0x1c(%ebp)
59c: 8d 45 e4 lea -0x1c(%ebp),%eax
59f: 50 push %eax
5a0: 57 push %edi
5a1: e8 ec fc ff ff call 292 <write>
5a6: e9 5b ff ff ff jmp 506 <printf+0xf6>
5ab: 66 90 xchg %ax,%ax
5ad: 66 90 xchg %ax,%ax
5af: 90 nop
000005b0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5b0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5b1: a1 d0 09 00 00 mov 0x9d0,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
5b6: 89 e5 mov %esp,%ebp
5b8: 57 push %edi
5b9: 56 push %esi
5ba: 53 push %ebx
5bb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5be: 8b 10 mov (%eax),%edx
void
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
5c0: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5c3: 39 c8 cmp %ecx,%eax
5c5: 73 19 jae 5e0 <free+0x30>
5c7: 89 f6 mov %esi,%esi
5c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
5d0: 39 d1 cmp %edx,%ecx
5d2: 72 1c jb 5f0 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5d4: 39 d0 cmp %edx,%eax
5d6: 73 18 jae 5f0 <free+0x40>
static Header base;
static Header *freep;
void
free(void *ap)
{
5d8: 89 d0 mov %edx,%eax
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5da: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5dc: 8b 10 mov (%eax),%edx
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5de: 72 f0 jb 5d0 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5e0: 39 d0 cmp %edx,%eax
5e2: 72 f4 jb 5d8 <free+0x28>
5e4: 39 d1 cmp %edx,%ecx
5e6: 73 f0 jae 5d8 <free+0x28>
5e8: 90 nop
5e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
5f0: 8b 73 fc mov -0x4(%ebx),%esi
5f3: 8d 3c f1 lea (%ecx,%esi,8),%edi
5f6: 39 d7 cmp %edx,%edi
5f8: 74 19 je 613 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
5fa: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
5fd: 8b 50 04 mov 0x4(%eax),%edx
600: 8d 34 d0 lea (%eax,%edx,8),%esi
603: 39 f1 cmp %esi,%ecx
605: 74 23 je 62a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
607: 89 08 mov %ecx,(%eax)
freep = p;
609: a3 d0 09 00 00 mov %eax,0x9d0
}
60e: 5b pop %ebx
60f: 5e pop %esi
610: 5f pop %edi
611: 5d pop %ebp
612: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
613: 03 72 04 add 0x4(%edx),%esi
616: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
619: 8b 10 mov (%eax),%edx
61b: 8b 12 mov (%edx),%edx
61d: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
620: 8b 50 04 mov 0x4(%eax),%edx
623: 8d 34 d0 lea (%eax,%edx,8),%esi
626: 39 f1 cmp %esi,%ecx
628: 75 dd jne 607 <free+0x57>
p->s.size += bp->s.size;
62a: 03 53 fc add -0x4(%ebx),%edx
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
freep = p;
62d: a3 d0 09 00 00 mov %eax,0x9d0
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
632: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
635: 8b 53 f8 mov -0x8(%ebx),%edx
638: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
}
63a: 5b pop %ebx
63b: 5e pop %esi
63c: 5f pop %edi
63d: 5d pop %ebp
63e: c3 ret
63f: 90 nop
00000640 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
640: 55 push %ebp
641: 89 e5 mov %esp,%ebp
643: 57 push %edi
644: 56 push %esi
645: 53 push %ebx
646: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
649: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
64c: 8b 15 d0 09 00 00 mov 0x9d0,%edx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
652: 8d 78 07 lea 0x7(%eax),%edi
655: c1 ef 03 shr $0x3,%edi
658: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
65b: 85 d2 test %edx,%edx
65d: 0f 84 a3 00 00 00 je 706 <malloc+0xc6>
663: 8b 02 mov (%edx),%eax
665: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
668: 39 cf cmp %ecx,%edi
66a: 76 74 jbe 6e0 <malloc+0xa0>
66c: 81 ff 00 10 00 00 cmp $0x1000,%edi
672: be 00 10 00 00 mov $0x1000,%esi
677: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
67e: 0f 43 f7 cmovae %edi,%esi
681: ba 00 80 00 00 mov $0x8000,%edx
686: 81 ff ff 0f 00 00 cmp $0xfff,%edi
68c: 0f 46 da cmovbe %edx,%ebx
68f: eb 10 jmp 6a1 <malloc+0x61>
691: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
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){
698: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
69a: 8b 48 04 mov 0x4(%eax),%ecx
69d: 39 cf cmp %ecx,%edi
69f: 76 3f jbe 6e0 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6a1: 39 05 d0 09 00 00 cmp %eax,0x9d0
6a7: 89 c2 mov %eax,%edx
6a9: 75 ed jne 698 <malloc+0x58>
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
6ab: 83 ec 0c sub $0xc,%esp
6ae: 53 push %ebx
6af: e8 56 fc ff ff call 30a <sbrk>
if(p == (char*)-1)
6b4: 83 c4 10 add $0x10,%esp
6b7: 83 f8 ff cmp $0xffffffff,%eax
6ba: 74 1c je 6d8 <malloc+0x98>
return 0;
hp = (Header*)p;
hp->s.size = nu;
6bc: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
6bf: 83 ec 0c sub $0xc,%esp
6c2: 83 c0 08 add $0x8,%eax
6c5: 50 push %eax
6c6: e8 e5 fe ff ff call 5b0 <free>
return freep;
6cb: 8b 15 d0 09 00 00 mov 0x9d0,%edx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
6d1: 83 c4 10 add $0x10,%esp
6d4: 85 d2 test %edx,%edx
6d6: 75 c0 jne 698 <malloc+0x58>
return 0;
6d8: 31 c0 xor %eax,%eax
6da: eb 1c jmp 6f8 <malloc+0xb8>
6dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
6e0: 39 cf cmp %ecx,%edi
6e2: 74 1c je 700 <malloc+0xc0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
6e4: 29 f9 sub %edi,%ecx
6e6: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
6e9: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
6ec: 89 78 04 mov %edi,0x4(%eax)
}
freep = prevp;
6ef: 89 15 d0 09 00 00 mov %edx,0x9d0
return (void*)(p + 1);
6f5: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
6f8: 8d 65 f4 lea -0xc(%ebp),%esp
6fb: 5b pop %ebx
6fc: 5e pop %esi
6fd: 5f pop %edi
6fe: 5d pop %ebp
6ff: c3 ret
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
700: 8b 08 mov (%eax),%ecx
702: 89 0a mov %ecx,(%edx)
704: eb e9 jmp 6ef <malloc+0xaf>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
706: c7 05 d0 09 00 00 d4 movl $0x9d4,0x9d0
70d: 09 00 00
710: c7 05 d4 09 00 00 d4 movl $0x9d4,0x9d4
717: 09 00 00
base.s.size = 0;
71a: b8 d4 09 00 00 mov $0x9d4,%eax
71f: c7 05 d8 09 00 00 00 movl $0x0,0x9d8
726: 00 00 00
729: e9 3e ff ff ff jmp 66c <malloc+0x2c>
| 29.756775 | 60 | 0.412443 |
6067bb566409e57e725715e06fe790ff8afa1813 | 308 | asm | Assembly | programs/oeis/055/A055232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/055/A055232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/055/A055232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A055232: Expansion of (1+2*x+3*x^2)/((1-x)^3*(1-x^2)).
; 1,5,16,36,69,117,184,272,385,525,696,900,1141,1421,1744,2112,2529,2997,3520,4100,4741,5445,6216,7056,7969,8957,10024,11172,12405,13725,15136,16640,18241,19941,21744,23652,25669,27797,30040,32400
seq $0,89207 ; a(n) = 4n^3 + 2n^2.
add $0,2
div $0,8
| 44 | 196 | 0.688312 |
fde9eb9cd84b48eb9cf0038400b04ed1509f9588 | 567 | asm | Assembly | oeis/174/A174994.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/174/A174994.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/174/A174994.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A174994: Repeat (8*n+4)^2.
; 16,16,144,144,400,400,784,784,1296,1296,1936,1936,2704,2704,3600,3600,4624,4624,5776,5776,7056,7056,8464,8464,10000,10000,11664,11664,13456,13456,15376,15376,17424,17424,19600,19600,21904,21904,24336,24336,26896,26896,29584,29584,32400,32400,35344,35344,38416,38416,41616,41616,44944,44944,48400,48400,51984,51984,55696,55696,59536,59536,63504,63504,67600,67600,71824,71824,76176,76176,80656,80656,85264,85264,90000,90000,94864,94864,99856,99856,104976,104976,110224,110224,115600,115600,121104
div $0,-2
bin $0,2
mul $0,128
add $0,16
| 70.875 | 496 | 0.790123 |
a1c262cbc860f5473de7e3270603784df5f23bf0 | 737 | asm | Assembly | programs/oeis/163/A163817.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/163/A163817.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/163/A163817.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A163817: Expansion of (1 - x^2) * (1 - x^5) / ((1 - x) * (1 - x^6)) in powers of x.
; 1,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0,0,-1,0,1,0,0
mov $1,$0
mov $2,3
cmp $3,$0
lpb $1
sub $1,$2
sub $1,$2
lpe
lpb $1
mov $1,1
sub $3,1
lpe
add $1,$3
| 46.0625 | 542 | 0.466757 |
c764b9423496c75f2d6a63aa67e88340bb581b58 | 3,432 | asm | Assembly | tests/parsing/raw_keyword_parsing.asm | fengjixuchui/sjasmplus | df0fabd2411bf89e23637fce46d273f52dafbe16 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/parsing/raw_keyword_parsing.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/parsing/raw_keyword_parsing.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ; issue in v1.15.1 reported on pk-ru forum:
; sometimes the internal function "cmphstr" is used to detect keywords over raw line data
; which didn't undergo yet proper substitution and contain block/EOL comment, then it was
; possible to miss the keyword if the comment char was right after it without whitespace
DEFINE/*c*/xyz
IFDEF/*c*/xyz
DB/*c*/1
ELSE
ASSERT/*c*/0
ENDIF
UNDEFINE/*c*/xyz
; comment block focused
IF/*c*/1
; nested IF/IFN/IFNUSED
DB/*c*/2
IFN/*c*/0
DB/*c*/3
ELSE/*c*/
ASSERT/*c*/0
ENDIF/*c*/
; "//" EOL comment focused
IF/*c*/1
DB/*c*/4
ELSE//c
ASSERT/*c*/0
ENDIF//c
; ";" EOL comment focused
IFNUSED/*c*/someLabel
DB/*c*/5
ELSE;c
ASSERT/*c*/0
ENDIF;c
ELSE; comment - causing issue in v1.15.1
; nested + skipped IF/IFN/IFNUSED
ASSERT/*c*/0
IFN/*c*/0
DB/*c*/-1
ELSE/*c*/
ASSERT/*c*/0
ENDIF/*c*/
; "//" EOL comment focused
IF/*c*/1
DB/*c*/-2
ELSE//c
ASSERT/*c*/0
ENDIF//c
; ";" EOL comment focused
IFNUSED/*c*/someLabel
DB/*c*/-3
ELSE;c
ASSERT/*c*/0
ENDIF;c
ENDIF; comment - causing issue in v1.15.1
DUP/*c*/1
DB 6
EDUP//c
STRUCT/*c*/ TestStruct
s_a BYTE/*c*/-7
ENDS//c
TestStruct/*c*/{7}
;; LEVEL 2 - add empty defines into sensitive lines to verify they get skipped
DEFINE _EMPTINESS_
; DEFINE, IFDEF and UNDEFINE can't provide substitution, so they can't attend LEVEL 2
; comment block focused
IF/**/_EMPTINESS_/**/1
; nested IF/IFN/IFNUSED
DB/**/_EMPTINESS_/**/10
IFN/**/_EMPTINESS_/**/0
DB/**/_EMPTINESS_/**/11
ELSE/**/_EMPTINESS_/**/
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_/**/
; "//" EOL comment focused
IF/**/_EMPTINESS_/**/1
DB/**/_EMPTINESS_/**/12
ELSE/**/_EMPTINESS_//c
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_//c
; ";" EOL comment focused
IFNUSED/**/_EMPTINESS_/**/someLabel
DB/**/_EMPTINESS_/**/13
ELSE/**/_EMPTINESS_;c
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_;c
ELSE; comment - causing issue in v1.15.1
; nested + skipped IF/IFN/IFNUSED
ASSERT/**/_EMPTINESS_/**/0
IFN/**/_EMPTINESS_/**/0
DB/**/_EMPTINESS_/**/-11
ELSE/**/_EMPTINESS_/**/
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_/**/
; "//" EOL comment focused
IF/**/_EMPTINESS_/**/1
DB/**/_EMPTINESS_/**/-12
ELSE/**/_EMPTINESS_//c
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_//c
; ";" EOL comment focused
IFNUSED/**/_EMPTINESS_/**/someLabel
DB/**/_EMPTINESS_/**/-13
ELSE/**/_EMPTINESS_;c
ASSERT/**/_EMPTINESS_/**/0
ENDIF/**/_EMPTINESS_;c
ENDIF; comment - causing issue in v1.15.1
DUP/**/_EMPTINESS_/**/1
DB 14
EDUP/**/_EMPTINESS_//c
STRUCT/**/_EMPTINESS_/**/ TestStruct_L2
s_a BYTE/**/_EMPTINESS_/**/-14
ENDS/**/_EMPTINESS_//c
TestStruct_L2/**/_EMPTINESS_/**/{15}
| 27.456 | 89 | 0.514569 |
cb0d512b64b88033115cae160bdf938fa35ca5e2 | 747 | asm | Assembly | oeis/319/A319172.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/319/A319172.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/319/A319172.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A319172: a(n) = 2*(a(n-1) + a(n-3)) - a(n-4), with a(0) = 1, a(1) = 2, a(2) = 5 and a(3) = 12.
; Submitted by Jon Maiga
; 1,2,5,12,27,62,143,328,753,1730,3973,9124,20955,48126,110527,253840,582977,1338882,3074917,7061948,16218683,37248318,85545615,196466648,451211249,1036265410,2379918501,5465792852,12552905275,28829382142,66210431487,152060880672,349227620353,802046721538,1842004772933,4230403905900,9715673634523,22313310093374,51245423225615,117691789814376,270294526180977,620766588719810,1425671333842757,3274239930233092,7519718511724827,17270013102415358,39662834731454143,91090866556124848,209202040805355585
mov $1,1
lpb $0
sub $0,1
add $2,$1
add $3,$4
add $1,$3
add $1,1
add $4,$2
sub $4,$3
add $3,$4
lpe
mov $0,$1
| 43.941176 | 499 | 0.75502 |
10515ce38e7603eebe628f50dfa30cc7cee57158 | 8,322 | asm | Assembly | nasm assembly/test -1/abhi_test.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/test -1/abhi_test.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/test -1/abhi_test.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | section .data
msg1 : db 'debug here --',10
l1 : equ $-msg1
msg2 : db 'enter the size of array 1 (n1): '
l2 : equ $-msg2
msg3 : db 'enter the sorted array 1 (ascending) : ',10
l3 : equ $-msg3
msg4 : db 'enter the size of array 2 (n2): '
l4: equ $-msg4
msg5 : db 'enter the sorted array 2 (decending) : ',10
l5: equ $-msg5
msg6 : db 'the merged array is (ascending) =>',10
l6: equ $-msg6
space:db ' '
newline:db '',10
section .bss
num: resd 1
counter: resd 1
n: resd 10
array: resd 50
n1: resd 10
n2: resd 10
array1: resd 50
array2: resd 50
merged: resd 100
merge_count: resd 1
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, l2
int 80h
call read_num
mov ax,word[num]
mov [n1],ax
mov eax, 4
mov ebx, 1
mov ecx, msg3
mov edx, l3
int 80h
mov ebx, array1
mov ax,word[n1]
mov [n],ax
call read_array
mov eax, 4
mov ebx, 1
mov ecx, msg4
mov edx, l4
int 80h
call read_num
mov ax,word[num]
mov [n2],ax
mov eax, 4
mov ebx, 1
mov ecx, msg5
mov edx, l5
int 80h
mov ebx, array2
mov ax,word[n2]
mov [n],ax
call read_array
call merge_array
;; array have been merged .. now print the array
mov eax, 4
mov ebx, 1
mov ecx, msg6
mov edx, l6
int 80h
mov ebx,merged
mov eax,[merge_count]
mov [n],eax
mov eax , 0
call print_array
exit:
mov eax,1
mov ebx,0
int 80h
; section for procedures
;----------------------------
merge_array:
section .bss
cond1: resb 1
cond2: resb 1
num1: resd 1
num2: resd 1
counterFirst: resd 1
counterSecond: resd 1
section .text
push rax
push rbx
push rcx
mov ebx, array1
mov eax,0
mov word[counterFirst],0
mov ax, word[n2]
mov word[counterSecond],ax
mov word[merge_count],0
mov eax,0
loop1:
mov eax,[counterFirst]
cmp eax,dword[n1]
setb cl
mov byte[cond1], cl
mov eax,[counterSecond]
cmp eax, 1
setae cl
mov byte[cond2], cl
mov bl, [cond1]
mov cl,[cond2]
and bl,cl
cmp bl,1
jne exit_loop1
; call debugger
mov ebx, array1 ;; taking num1 = array1[i]
mov eax, [counterFirst]
mov cx,word[ebx+2*eax]
mov word[num1],cx
dec word[counterSecond]
mov ebx, array2
mov eax, [counterSecond] ;; taking num2 = array2[j]
mov cx,word[ebx+2*eax]
mov word[num2],cx
inc word[counterSecond]
; mov bx,word[num1]
; mov word[num], bx
; call print_num
; mov word[num], cx
; call print_num
cmp word[num1],cx
jbe selec_num1
mov cx,word[num2]
mov ebx,merged
mov eax,[merge_count]
; call debugger
mov word[ebx+2*eax],cx
inc word[merge_count]
dec word[counterSecond]
jmp exit_check_cond
selec_num1:
mov cx,word[num1]
mov ebx,merged
mov eax,[merge_count]
; call debugger2
mov word[ebx+2*eax],cx
inc word[merge_count]
inc word[counterFirst]
exit_check_cond:
jmp loop1
exit_loop1:
loop2:
mov eax,[counterFirst]
cmp eax,dword[n1]
jae exit_loop2
mov ebx, array1 ;; taking num1 = array1[i]
mov eax, [counterFirst]
mov cx,word[ebx+2*eax]
mov word[num1],cx
mov cx,word[num1]
; putting residue values to merge array
mov ebx,merged
mov eax,[merge_count]
mov word[ebx+2*eax],cx
inc word[merge_count]
inc word[counterFirst]
jmp loop2
exit_loop2:
loop3:
mov eax,[counterSecond]
cmp eax,1
jb exit_loop3
dec word[counterSecond]
mov ebx, array2 ;; taking num2 = array2[i]
mov eax, [counterSecond]
mov cx,word[ebx+2*eax]
mov word[num2],cx
mov cx,word[num2]
inc word[counterSecond]
; putting residue values to merge array
mov ebx,merged
mov eax,[merge_count]
mov word[ebx+2*eax],cx
inc word[merge_count]
dec word[counterSecond]
jmp loop3
exit_loop3:
pop rcx
pop rbx
pop rax
ret
debugger2:
section .data
msg_debugger2 : db 'execution stops here',10
msg_debugger_l2 : equ $-msg_debugger2
section .text
push rax
push rbx
push rcx
; debug----
mov eax, 4
mov ebx, 1
mov ecx, msg_debugger2
mov edx, msg_debugger_l2
int 80h
;debug ---
pop rcx
pop rbx
pop rax
; action
ret
debugger:
section .data
msg_debugger : db 'debug here --',10
msg_debugger_l : equ $-msg_debugger
section .text
push rax
push rbx
push rcx
; debug----
mov eax, 4
mov ebx, 1
mov ecx, msg_debugger
mov edx, msg_debugger_l
int 80h
;debug ---
pop rcx
pop rbx
pop rax
; action
ret
print_array:
; usage
;-------
; 1: base address of array in ebx mov ebx,array
; 2: size of array in n
push rax ; push all
push rbx
push rcx
mov eax,0
print_loop:
cmp eax,dword[n]
je end_print1
mov cx,word[ebx+2*eax]
mov word[num],cx
;;The number to be printed is copied to ’num’
; before calling print num function
push rax
push rbx
call print_num
pop rbx
pop rax
inc eax
jmp print_loop
end_print1:
; popa
pop rcx
pop rbx
pop rax ; pop all
ret
read_array:
; usage
;-------
; 1: base address of array in ebx
; 2: size of array in n
push rax ; push all
push rbx
push rcx
mov eax ,0
read_loop:
cmp eax,dword[n]
je end_read_1
push rax
push rbx
call read_num
pop rbx
pop rax
;;read num stores the input in ’num’
mov cx,word[num]
mov word[ebx+2*eax],cx
inc eax
;;Here, each word consists of two bytes, so the counter should be
; incremented by multiples of two. If the array is declared in bytes do mov word[ebx+eax],cx
jmp read_loop
end_read_1:
pop rcx
pop rbx
pop rax ; pop all
ret
print_num:
;usage
;------
; 1: create a variable num(word)
; 2: move number to print to num (word)
section .data
nwl_for_printnum :db ' ',10
nwl_l_printnum : equ $-nwl_for_printnum
section .bss
count_printnum : resb 10
temp_printnum : resb 1
section .text
push rax ; push all
push rbx
push rcx
mov byte[count_printnum],0
;call push_reg
extract_no:
cmp word[num], 0
je print_no
inc byte[count_printnum]
mov dx, 0
mov ax, word[num]
mov bx, 10
div bx
push dx ; recursion here
mov word[num], ax
jmp extract_no
print_no:
cmp byte[count_printnum], 0
je end_print
dec byte[count_printnum]
pop dx
mov byte[temp_printnum], dl ; dx is further divided into dh and dl
add byte[temp_printnum], 30h
mov eax, 4
mov ebx, 1
mov ecx, temp_printnum
mov edx, 1
int 80h
jmp print_no
end_print:
mov eax,4
mov ebx,1
mov ecx,nwl_for_printnum
mov edx,nwl_l_printnum
int 80h
;;The memory location ’newline’ should be declared with the ASCII key for new popa
;call pop_reg
pop rcx
pop rbx
pop rax ; pop all
ret
read_num:
;usage
;------
; 1: create a variable num(word)
; 2: the input number is stored into num(word)
section .bss
temp_for_read: resb 1
section .text
push rax ; push all
push rbx
push rcx
mov word[num], 0
loop_read:
;; read a digit
mov eax, 3
mov ebx, 0
mov ecx, temp_for_read
mov edx, 1
int 80h
;;check if the read digit is the end of number, i.e, the enter-key whose ASCII cmp byte[temp], 10
cmp byte[temp_for_read], 10
je end_read
mov ax, word[num]
mov bx, 10
mul bx
mov bl, byte[temp_for_read]
sub bl, 30h
mov bh, 0
add ax, bx
mov word[num], ax
jmp loop_read
end_read:
;;pop all the used registers from the stack using popa
;call pop_reg
pop rcx
pop rbx
pop rax
ret
| 14.153061 | 99 | 0.577505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.