max_stars_repo_path stringlengths 4 261 | max_stars_repo_name stringlengths 6 106 | max_stars_count int64 0 38.8k | id stringlengths 1 6 | text stringlengths 7 1.05M |
|---|---|---|---|---|
libsrc/_DEVELOPMENT/arch/zx/bifrost2/c/sdcc/BIFROST2_findAttrH.asm | jpoikela/z88dk | 640 | 94987 | <filename>libsrc/_DEVELOPMENT/arch/zx/bifrost2/c/sdcc/BIFROST2_findAttrH.asm<gh_stars>100-1000
; ----------------------------------------------------------------
; Z88DK INTERFACE LIBRARY FOR THE BIFROST*2 ENGINE
;
; See "bifrost2.h" for further details
; ----------------------------------------------------------------
; unsigned char *BIFROST2_findAttrH(unsigned char lin,unsigned char col)
SECTION code_clib
SECTION code_bifrost2
PUBLIC _BIFROST2_findAttrH
EXTERN asm_BIFROST2_findAttrH
_BIFROST2_findAttrH:
ld hl,3
add hl,sp
ld c,(hl) ; C = col
dec hl
ld l,(hl) ; L = lin
jp asm_BIFROST2_findAttrH
|
Ada/main.ada | FelixWangEOF/HelloWorld50 | 0 | 4557 | <filename>Ada/main.ada
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, World!");
end Hello; |
oeis/177/A177066.asm | neoneye/loda-programs | 11 | 170253 | ; A177066: Determinant of the symmetric n X n matrix M defined by M(i,j) = gcd(2i-1,2j-1) for 1 <= i,j <= n.
; Submitted by <NAME>(s4)
; 1,2,8,48,288,2880,34560,276480,4423680,79626240,955514880,21021327360,420426547200,7567677849600,211894979788800,6356849393664000,127136987873280000,3051287708958720000,109846357522513920000
mov $1,1
lpb $0
mov $2,$0
sub $0,1
mul $2,2
seq $2,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mul $1,$2
lpe
mov $0,$1
|
src/pycropml/transpiler/antlr_py/grammars/CymlLexer.g4 | AgriculturalModelExchangeInitiative/PyCropML | 3 | 7541 | lexer grammar CymlLexer;
options {
tokenVocab=CymlLexer;
} |
test/Succeed/OverloadedString.agda | cruhland/agda | 1,989 | 2347 | <filename>test/Succeed/OverloadedString.agda
module _ where
open import Common.Prelude
open import Common.String
record IsString {a} (A : Set a) : Set a where
field
fromString : String → A
open IsString {{...}} public
{-# BUILTIN FROMSTRING fromString #-}
instance
StringIsString : IsString String
StringIsString = record { fromString = λ s → s }
ListIsString : IsString (List Char)
ListIsString = record { fromString = stringToList }
foo : List Char
foo = "foo"
open import Common.Equality
thm : "foo" ≡ 'f' ∷ 'o' ∷ 'o' ∷ []
thm = refl
|
oeis/042/A042302.asm | neoneye/loda-programs | 11 | 99021 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A042302: Numerators of continued fraction convergents to sqrt(678).
; Submitted by <NAME>
; 26,677,35230,916657,47701394,1241152901,64587652246,1680520111297,87451633439690,2275422989543237,118409447089688014,3080921047321431601,160326303907804131266,4171564822650228844517,217081697081719704046150,5648295688947362534044417,293928457522344571474355834,7647788191269906220867296101,397978914403557468056573753086,10355099562683764075691784876337,538863156173959289404029387322610,14020797160085625288580455855264197,729620315480626474295587733861060854,18984148999656373956973861536242846401
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,2
mul $2,26
add $3,$2
lpe
mov $0,$3
|
audio/sfx/cry11_1.asm | AmateurPanda92/pokemon-rby-dx | 9 | 245316 | <reponame>AmateurPanda92/pokemon-rby-dx<filename>audio/sfx/cry11_1.asm
SFX_Cry11_1_Ch4:
dutycycle 240
squarenote 6, 15, 7, 1952
squarenote 8, 14, 6, 1956
squarenote 4, 13, 6, 1952
squarenote 15, 13, 3, 1824
squarenote 8, 12, 3, 1827
squarenote 2, 12, 2, 1832
squarenote 8, 11, 1, 1840
endchannel
SFX_Cry11_1_Ch5:
dutycycle 10
squarenote 4, 0, 8, 0
squarenote 6, 10, 7, 1857
squarenote 8, 8, 6, 1859
squarenote 4, 7, 6, 1857
squarenote 13, 8, 3, 1730
squarenote 7, 7, 3, 1729
squarenote 3, 8, 2, 1740
squarenote 8, 7, 1, 1752
endchannel
SFX_Cry11_1_Ch7:
noisenote 2, 15, 2, 76
noisenote 6, 14, 6, 58
noisenote 4, 13, 7, 58
noisenote 6, 13, 6, 44
noisenote 8, 14, 5, 60
noisenote 12, 13, 2, 61
noisenote 8, 13, 1, 44
endchannel
|
micro/assembler/mult_test.asm | andrewparlane/fiuba6633_lab_de_sistemas_digitales | 0 | 167764 | <filename>micro/assembler/mult_test.asm
# ----------------------------------------------------------------------
# Test_name: mult_test
# ----------------------------------------------------------------------
#
# RAM memory will be structured in the following manner:
#
# +---------+----------+
# | Address | Variable |
# +---------+----------+
# | RAM[00] | A |
# | RAM[01] | B |
# | RAM[02] | Y0 |
# | RAM[03] | Y1 |
# | RAM[04] | A0 |
# | RAM[05] | A1 |
# | RAM[06] | count |
# +---------+----------+
#
# Where:
# - Result: {Y1,Y0} = A*B
# - Auxiliary: {A1,A0}
# - count: multiplication loop counter
# ----------------------------------------------------------------------
LOADI A,0; # Acc = 0, load the accumulator with 0
STORE A,0; # A = 0, initialize A operand
STORE A,1; # B = 0, initialize B operand
$begin:
LOADI A,0; # Acc = 0, load the accumulator with 0
STORE A,2; # Y0 = 0, initialize result Y0
STORE A,3; # Y1 = 0, initialize result Y1
STORE A,4; # A0 = 0, initialize auxiliary A0
STORE A,5; # A1 = 0, initialize auxiliary A1
LOAD A,0; # Acc = A, load accum with A operand
STORE A,4; # A0 = A, store in auxiliary A0 the operand A
LOADI A,8; # Acc = 8, load the accumulator with 8
STORE A,6; # count = 8, store the accumulator in the multiplication loop counter
$iter1:
LOAD A,1; # Iteration 1, load accum with B operand
NORI A,254; # A = B-operand ~| "11111110"
JUMP $checkb; # Go to load the accumulator with Y0
$iter2:
LOAD A,1; # Iteration 2, load accum with B operand
NORI A,253; # A = B-operand ~| "11111101"
JUMP $checkb; # Go to load the accumulator with Y0
$iter3:
LOAD A,1; # Iteration 3, load accum with B operand
NORI A,251; # A = B-operand ~| "11111011"
JUMP $checkb; # Go to load the accumulator with Y0
$iter4:
LOAD A,1; # Iteration 4, load accum with B operand
NORI A,247; # A = B-operand ~| "11110111"
JUMP $checkb; # Go to load the accumulator with Y0
$iter5:
LOAD A,1; # Iteration 5, load accum with B operand
NORI A,239; # A = B-operand ~| "11101111"
JUMP $checkb; # Go to load the accumulator with Y0
$iter6:
LOAD A,1; # Iteration 6, load accum with B operand
NORI A,223; # A = B-operand ~| "11011111"
JUMP $checkb; # Go to load the accumulator with Y0
$iter7:
LOAD A,1; # Iteration 7, load accum with B operand
NORI A,191; # A = B-operand ~| "10111111"
JUMP $checkb; # Go to load the accumulator with Y0
$iter8:
LOAD A,1; # Iteration 8: Acc = B-operand
NORI A,127; # Acc = B-operand ~| "01111111"
$checkb:
JZ $loady0; # If B operand is "00000000" then go to load the accumulatr with Y0
JUMP $starta; # Go to start A left shifting, Acc = A0
$loady0:
LOAD A,2; # Load the accumulator with Y0
ADD A,4; # Acc = Y0 + A0
STORE A,2; # M[2] = Y0 + A0, store the accumulator in Y0
LOAD A,3; # Acc = Y1
ADDC A,5; # Acc = Acc + A1 + Cy = Y1 + A1 + Cy
STORE A,3; # Store M[3] = Y1 + A1 + Cy
$starta:
LOAD A,4; # Start A left shifting, Acc = A0
ADD A,4; # Acc = A0 + A0
STORE A,4; # M[4] = Acc = A0 + A0
LOAD A,5; # Acc = A1
ADDC A,5; # Acc = A1 + A1 + Cy
STORE A,5; # End of A left shifting
LOAD A,6; # Acc = count
SUBI A,1; # Acc = count - 1
JZ $end; # Jump to END (test is finished)
STORE A,6; # Store count with Acc
SUBI A,1; # Acc = Acc - 1 = count - 2
JZ $iter8; # Jump to iteration 8
SUBI A,1; # Acc = Acc - 1 = count - 3
JZ $iter7; # Jump to iteration 7
SUBI A,1; # Acc = Acc - 1 = count - 4
JZ $iter6; # Jump to iteration 6
SUBI A,1; # Acc = Acc - 1 = count - 5
JZ $iter5; # Jump to iteration 5
SUBI A,1; # Acc = Acc - 1 = count - 6
JZ $iter4; # Jump to iteration 4
SUBI A,1; # Acc = Acc - 1 = count - 7
JZ $iter3; # Jump to iteration 3
SUBI A,1; # Acc = Acc - 1 = count - 8
JZ $iter2; # Jump to iteration 2
$end:
LOAD A,0; # Load Acc with A
ADDI A,1; #
STORE A,0; # A = A + 1
JC $incb; # If carry, increment B
JUMP $begin; # Loop
$incb:
LOAD A,1; # Load Acc with B
ADDI A,1; #
STORE A,1; # B = B + 1
JUMP $begin; # Loop
|
programs/oeis/231/A231151.asm | neoneye/loda | 22 | 240477 | ; A231151: Least integer k such that n+1 + ... + n+k > 1 + ... + n.
; 2,2,2,3,3,4,4,4,5,5,6,6,7,7,7,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,14,15,15,16,16,16,17,17,18,18,19,19,19,20,20,21,21,21,22,22,23,23,23,24,24,25,25,26,26,26,27,27,28,28,28,29,29,30,30,31,31,31,32,32,33,33,33,34,34,35,35,36,36,36,37,37,38,38,38,39,39,40,40,40,41,41,42,42,43
mov $7,$0
mov $9,$0
add $9,1
lpb $9
mov $0,$7
sub $9,1
sub $0,$9
mov $3,2
mov $11,$0
lpb $3
mov $0,$11
sub $3,1
add $0,$3
add $0,1
mov $2,$0
pow $0,2
add $0,$2
mov $6,$5
lpb $0
add $6,1
sub $0,$6
trn $0,1
mov $10,3
mul $10,$6
lpe
mov $4,$10
mov $8,$3
lpb $8
sub $8,1
mov $12,$4
lpe
lpe
lpb $11
mov $11,0
sub $12,$4
lpe
mov $4,$12
sub $4,3
div $4,3
add $1,$4
lpe
mov $0,$1
|
oeis/005/A005779.asm | neoneye/loda-programs | 11 | 160176 | ; A005779: a(n) = largest integer such that every tournament on n nodes contains a consistent set of n arcs.
; Submitted by <NAME>
; 1,2,4,6,9,12,20,24,30,35,44,50
add $0,2
mov $2,2
mov $5,1
lpb $0
mov $3,$0
lpb $3
sub $1,1
sub $3,2
add $1,$3
lpe
div $0,$2
mov $4,$0
mul $4,$5
add $1,$4
mul $5,$2
lpe
mov $0,$1
add $0,1
|
code/non1996/34.asm | KongoHuster/assembly-exercise | 1 | 3666 | <gh_stars>1-10
DATA SEGMENT
NUM DW 10
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AX, NUM
CALL SKIPLINES
MOV AH, 4CH
INT 21H
SKIPLINES PROC
PUSH AX
PUSH CX
PUSH DX
MOV CX, AX
MOV AH, 02H
OUT:
MOV DL, '-'
INT 21H
MOV DL, 0DH
INT 21H
MOV DL, 0AH
INT 21H
LOOP OUT
POP DX
POP CX
POP AX
RET
SKIPLINES ENDP
CODE ENDS
END START |
ga_lib/src/ga_base_types.ads | rogermc2/GA_Ada | 3 | 13260 | <gh_stars>1-10
package GA_Base_Types is
type E1_T is private;
type E2_T is private;
type E3_T is private;
type NI_T is private;
type NI_Const is private;
type NO_T is private;
type NO_Const is private;
function "*" (I1, I2 : NI_T) return float;
function "*" (I : NI_T; O : NO_T) return float;
function "*" (O : NO_T; I : NI_T) return float;
function "*" (O1, O2 : NO_T) return float;
function NI return float;
function NI (N : NI_T) return float;
function NO return float;
function NO (N : NO_T) return float;
procedure Set_NI (N : out NI_T; Inf : float);
procedure Set_NO (N : out NO_T; Origin : float);
private
type E1_T is record
E1 : float := 0.0;
end record;
type E2_T is record
E2 : float := 0.0;
end record;
type E3_T is record
E3 : float := 0.0;
end record;
type NI_T is record
Inf : float := 1.0;
end record;
type NI_Const is new float;
type NO_T is record
Origin : float := 0.0;
end record;
type NO_Const is new float;
end GA_Base_Types;
|
oeis/129/A129164.asm | neoneye/loda-programs | 11 | 10044 | <reponame>neoneye/loda-programs
; A129164: Sum of pyramid weights in all skew Dyck paths of semilength n.
; Submitted by <NAME>
; 1,5,22,97,436,1994,9241,43257,204052,968440,4619011,22120630,106300507,512321437,2475395302,11986728457,58156146652,282640193312,1375737276787,6705522150972,32724071280517,159878425878847,781910419686412,3827639591654862,18753350784435811,91954143117762359,451213820509168876,2215588252254105217,10886057112557529292,53519060411527914274,263260628658902545753,1295650139148304826089,6379699289348334356572,31427567182339556157832,154884500787287750972971,763627066966190795267284
mov $1,1
mov $3,$0
add $3,1
mov $4,1
lpb $3
mul $1,$4
mul $1,$3
mul $1,2
add $5,$4
div $1,$5
div $2,2
add $2,$1
mul $2,2
sub $3,1
add $4,2
lpe
mov $0,$2
div $0,4
|
Task/Arbitrary-precision-integers--included-/Ada/arbitrary-precision-integers--included-.ada | LaudateCorpus1/RosettaCodeData | 1 | 30461 | <gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with GNATCOLL.GMP; use GNATCOLL.GMP;
with GNATCOLL.GMP.Integers; use GNATCOLL.GMP.Integers;
procedure ArbitraryInt is
type stracc is access String;
BigInt : Big_Integer;
len : Natural;
str : stracc;
begin
Set (BigInt, 5);
Raise_To_N (BigInt, Unsigned_Long (4**(3**2)));
str := new String'(Image (BigInt));
len := str'Length;
Put_Line ("Size is:"& Natural'Image (len));
Put_Line (str (1 .. 20) & "....." & str (len - 19 .. len));
end ArbitraryInt;
|
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Result.asm | prismotizm/gigaleak | 0 | 15219 | <reponame>prismotizm/gigaleak
Name: Result.asm
Type: file
Size: 69870
Last-Modified: '1992-11-18T01:48:25Z'
SHA-1: 8C56CA9E028D7F07EAC4448E3D1F8FB5A15C7AE7
Description: null
|
alloy4fun_models/trashltl/models/15/M2Ri2zRS9s54gX5iZ.als | Kaixi26/org.alloytools.alloy | 0 | 847 | open main
pred idM2Ri2zRS9s54gX5iZ_prop16 {
always all p: Protected | historically p in Protected and always p in Protected
}
pred __repair { idM2Ri2zRS9s54gX5iZ_prop16 }
check __repair { idM2Ri2zRS9s54gX5iZ_prop16 <=> prop16o } |
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_424_734.asm | ljhsiun2/medusa | 9 | 96786 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x77cd, %rbx
clflush (%rbx)
nop
add $3142, %r15
vmovups (%rbx), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbp
nop
and %rbx, %rbx
lea addresses_WT_ht+0x532d, %r13
nop
nop
nop
nop
nop
lfence
mov $0x6162636465666768, %rax
movq %rax, (%r13)
nop
nop
nop
nop
add $39188, %rbx
lea addresses_A_ht+0x942d, %r13
nop
nop
nop
nop
dec %r14
and $0xffffffffffffffc0, %r13
vmovntdqa (%r13), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rbp
nop
nop
add $30880, %r14
lea addresses_D_ht+0xa311, %rbp
clflush (%rbp)
inc %rbx
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
cmp %r13, %r13
lea addresses_WC_ht+0x212d, %rax
inc %r14
mov $0x6162636465666768, %rbx
movq %rbx, %xmm7
movups %xmm7, (%rax)
and %r15, %r15
lea addresses_D_ht+0x482d, %rbx
nop
nop
xor %rdx, %rdx
movl $0x61626364, (%rbx)
add %rdx, %rdx
lea addresses_normal_ht+0x542d, %rsi
lea addresses_WC_ht+0x12c2d, %rdi
nop
nop
nop
nop
and $50747, %rbx
mov $14, %rcx
rep movsb
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_normal_ht+0xdd0d, %r14
xor %rax, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm6
movups %xmm6, (%r14)
and %rdi, %rdi
lea addresses_WC_ht+0x72e5, %rcx
and %r15, %r15
movb $0x61, (%rcx)
cmp $51082, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %rbx
push %rdi
push %rdx
// Faulty Load
lea addresses_RW+0xb42d, %rdx
nop
nop
nop
and $22199, %r8
vmovups (%rdx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbx
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'32': 424}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
test/Succeed/Issue3434.agda | shlevy/agda | 1,989 | 11102 | <filename>test/Succeed/Issue3434.agda
module _ where
data Unit : Set where
unit : Unit
data D₁ : Set where
c₁ : D₁
module M (_ : Set₁) where
data D₂ : Set where
c₂ : D₂
open M Set
f : D₁ → D₂
f c₁ = c₂
record R (A : Set) : Set where
field a : A
open R ⦃ … ⦄ public
instance
r₁ : R D₁
r₁ = record { a = c₁ }
r₂ : ⦃ r : R D₁ ⦄ → R D₂
r₂ ⦃ r ⦄ = record { a = f (R.a r) }
postulate
P : (A : Set) → A → Set
g : (A : Set) (x : A) → P A x
accepted : P D₂ a
accepted = g D₂ a
rejected : P D₂ a
rejected = g _ a
-- WAS:
-- No instance of type (R D₂) was found in scope.
-- when checking that the expression a has type D₂
-- SHOULD: succeed
|
src/ada/src/utils/unit_conversion_utilities.ads | VVCAS-Sean/OpenUxAS | 88 | 15768 | -- linear/geographical conversions
generic
type Real is digits <>;
package Unit_Conversion_Utilities is
type Unit_Converter is tagged private;
procedure Initialize
(This : out Unit_Converter;
LatitudeInit_Rad : Real;
LongitudeInit_rad : Real);
-- FROM LAT/LONG TO NORTH/EAST
procedure Convert_LatLong_Degrees_To_NorthEast_Meters
(This : in out Unit_Converter;
Latitude_Deg : Real;
Longitude_Deg : Real;
North : out Real;
East : out Real);
-- FROM NORTH/EAST TO LAT/LONG
-- ...
-- const double m_dRadiusEquatorial_m{6378135.0};
dRadiusEquatorial_m : constant := 6_378_135.0;
-- const double m_dFlattening{3.352810664724998e-003};
dFlattening : constant := 3.352810664724998e-003;
-- const double m_dEccentricitySquared{6.694379990096503e-003};
dEccentricitySquared : constant := 6.694379990096503e-003;
private
type Unit_Converter is tagged record
-- static double m_dLatitudeInitial_rad;
m_dLatitudeInitial_rad : Real;
-- static double m_dLongitudeInitial_rad;
m_dLongitudeInitial_rad : Real;
-- static double m_dRadiusMeridional_m;
m_dRadiusMeridional_m : Real;
-- static double m_dRadiusTransverse_m;
m_dRadiusTransverse_m : Real;
-- static double m_dRadiusSmallCircleLatitude_m;
m_dRadiusSmallCircleLatitude_m : Real;
-- Static Bool M_BInitialized;
Initialized : Boolean := False;
end record;
end Unit_Conversion_Utilities;
|
nesthing.asm | Garydos/nesthing-prototype | 0 | 165670 | ;;;;;;;;;;;;;;;
; ROM header info
;;;;;;;;;;;;;;;
.inesprg 1 ; 1x 16KB PRG code
.ineschr 1 ; 1x 8KB CHR data
.inesmap 0 ; mapper 0 = NROM, no bank swapping
.inesmir 1 ; background mirroring
;;;;;;;;;;;;;;;
; Variable declerations
;;;;;;;;;;;;;;;
.rsset $0000
famitonescratch .rs 3 ; save some initial scratch space for the FamiTone audio engine
scratchptr .rs 2 ; scratch space, mostly for pointers
enemyptr .rs 1 ; pointer to recently accessed enemy in enemylist
num1 .rs 1 ; multiplicand
num2 .rs 1 ; multiplier, should be small
buttons1 .rs 1 ; buttons for player 1
buttons2 .rs 1 ; buttons for player 2
nextsprite .rs 1 ; keeps track of next sprite to be allocated to new entities
rect1_x .rs 1 ; bounding box variables for axis-aligned bounding box collisions
rect1_y .rs 1
rect1_width .rs 1
rect1_height .rs 1
rect2_x .rs 1
rect2_y .rs 1
rect2_width .rs 1
rect2_height .rs 1
testrectcollis .rs 1
; Player1 struct
player1x .rs 1 ; player1 x position
player1y .rs 1 ; player1 y position
player1xvel .rs 1
player1xvelfract .rs 1 ; fractional part of player1x used for
; velocity calculations
player1yvel .rs 1
player1yvelfract .rs 1 ; fractional part of player1y used for
; velocity calculations
player1xaccel .rs 1
player1yaccel .rs 1
player1dashing .rs 1
player1dashtimer .rs 1
player1jumping .rs 1
player1jumpingtimer .rs 1
player1invinc .rs 1
player1invinctimer .rs 1
player1knockback .rs 1
player1knockbacktimer .rs 1
player1hurt .rs 1
player1falling .rs 1
player1canjump .rs 1
player1anim .rs 1 ; animation number of current player1 animation
player1animtimer .rs 1 ; timer for current player1 frame
player1animframe .rs 1 ; frame number of current player1 animation
player1mirrored .rs 1 ; are player1's sprites mirrored
; Level variables
scrolling .rs 1 ; is the screen scrolling or not
scroll .rs 1 ; horizontal scroll count
nametable .rs 1 ; which nametable to use, 0 or 1
columnLow .rs 1 ; low byte of new column address
columnHigh .rs 1 ; high byte of new column address
sourceLow .rs 1 ; source for column data
sourceHigh .rs 1
columnNumber .rs 1 ; which column of level data to draw (or other use)
rowNumber .rs 1 ; row number to draw (or other use)
tiletest .rs 1
;enemy variables
.rsset $0400 ;enemy stack starts at $0400
enemylistsize .rs 1 ;size of enemy list
enemylist .rs $FE ; reserve full page for entities (this is just an estimate for now, once
; the enemy struct has been finalized, do some math to figure out
; roughly the max number of enemies on screen at any time)
;; enemy Struct
.rsset $0000
enemy_type .rs 1 ;the enemy's type, used
;to know what subroutines to run on it, what sprites
;to use in animations, etc..
enemy_spr_ptr .rs 1 ; pointer to first sprite of enemy. All sprites
; start with $02xx so no need for second byte in pointer
enemy_x .rs 1 ; x position
enemy_y .rs 1 ; y position
enemy_xvel .rs 1
enemy_xvelfract .rs 1 ; fractional part used for
; velocity calculations
enemy_yvel .rs 1
enemy_yvelfract .rs 1 ; fractional part used for
; velocity calculations
enemy_xaccel .rs 1
enemy_yaccel .rs 1
enemy_anim .rs 1 ; animation number of current animation
enemy_animtimer .rs 1 ; timer for current frame
enemy_animframe .rs 1 ; frame number of current animation
enemy_mirrored .rs 1 ; are enemy's sprites mirrored
enemy_size .rs 1 ; marks the end of the struct, and its size
ENEMY_STRUCT_SIZE = (enemy_size)
;;;;;;;;;;;;;;;
; Constant declerations
;;;;;;;;;;;;;;;
SPRITE_OFFSET = $0200 ;location of sprites in RAM
PLAYER_1_SPRITE = SPRITE_OFFSET + 0 ;location of PLAYER1 sprite in ram
PLAYER_1_ANIM_WALK_SPEED = $8 ;walk speed of player
PLAYER_1_ANIM_WALK_FRAMES = $01 ; total frames - 1
PLAYER_1_DASH_TIME = $20 ; amount of time dash lasts
PLAYER_1_DASH_BLINK_TIME = PLAYER_1_DASH_TIME + $40 ; amount of time dash lasts + amount of time before next dash
PLAYER_1_INVINC_BLINK_TIME = $40 ;amount of time player is invincible after being hurt
PLAYER_1_HURT_TIME = $20 ;amount of time player is hurt (player can't press buttons during this time)
PLAYER_1_KNOCKBACK_BLINK_TIME = $19 ;amount of time till player can jump back again)
PLAYER_1_KNOCKBACK_TIME = $18 ;amount of time player jumps back when hurt
PLAYER_1_JUMP_TIMER_LIM = $08 ;amount of time jump lasts
SCREEN_SCROLL_REGION = $78 ; the middle of the screen where scrolling will start
;;;;;;;;;;;;;;;
; PRG-ROM Bank 1
;;;;;;;;;;;;;;;
.bank 0
.org $8000
RESET:
SEI ; disable IRQs
CLD ; disable decimal mode
;LDX #$40
;STX $4017 ; disable APU frame IRQ
LDX #$FF
TXS ; Set up stack
INX ; now X = 0
STX $2000 ; disable NMI
STX $2001 ; disable rendering
;STX $4010 ; disable DMC IRQs
vblankwait1: ; First wait for vblank to make sure PPU is ready
BIT $2002
BPL vblankwait1
clrmem:
LDA #$00
STA $0000, x
STA $0100, x
STA $0300, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0200, x ;move all sprites off screen
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
;;;;;;;;;;
;move this code to its own subroutine later
;;;;;;;;;;
LoadPalettes:
LDA $2002 ; read PPU status to reset the high/low latch
LDA #$3F
STA $2006 ; write the high byte of $3F00 address
LDA #$00
STA $2006 ; write the low byte of $3F00 address
LDX #$00 ; start out at 0
LoadPalettesLoop:
LDA palette, x ; load data from address (palette + the value in x)
; 1st time through loop it will load palette+0
; 2nd time through loop it will load palette+1
; 3rd time through loop it will load palette+2
; etc
STA $2007 ; write to PPU
INX ; X = X + 1
CPX #$20 ; Compare X to hex $10, decimal 16 - copying 16 bytes = 4 sprites
BNE LoadPalettesLoop ; Branch to LoadPalettesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
LoadSprites:
LDX #$00 ; start at 0
LoadSpritesLoop:
LDA sprites, x ; load data from address (sprites + x)
STA $0200, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$20 ; Compare X to hex $20, decimal 32
BNE LoadSpritesLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
InitializeNametables:
LDA #$01
STA nametable
LDA #$00
STA scroll
STA columnNumber
InitializeNametablesLoop:
JSR DrawNewColumn ; draw bg column
LDA scroll ; go to next column
CLC
ADC #$08
STA scroll
INC columnNumber
LDA columnNumber ; repeat for first nametable
CMP #$20
BNE InitializeNametablesLoop
LDA #$00
STA nametable
LDA #$00
STA scroll
JSR DrawNewColumn ; draw first column of second nametable
INC columnNumber
LDA #$00 ; set back to increment +1 mode
STA $2000
InitializeNametablesDone:
InitializeAttributes:
LDA #$01
STA nametable
LDA #$00
STA scroll
STA columnNumber
InitializeAttributesLoop:
JSR DrawNewAttributes ; draw attribs
LDA scroll ; go to next column
CLC
ADC #$20
STA scroll
LDA columnNumber ; repeat for first nametable
CLC
ADC #$04
STA columnNumber
CMP #$20
BNE InitializeAttributesLoop
LDA #$00
STA nametable
LDA #$00
STA scroll
JSR DrawNewAttributes ; draw first column of second nametable
InitializeAttributesDone:
LDA #$21
STA columnNumber
LDA #%10010100 ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1,
; +32 increment mode
STA $2000
LDA #%00011110 ; enable sprites, enable background, no clipping on left side
STA $2001
ldx #LOW(nesthing_ost_music_data)
ldy #HIGH(nesthing_ost_music_data)
lda #$80;This sets Famitone to use NTSC mode.
jsr FamiToneInit
lda #0;Play first subsong
jsr FamiToneMusicPlay
;write the universal palette background color
LDA #$3F
STA $2006
LDA #$00
STA $2006
;$3C = sky blue
LDA #$3C
STA $2007
;;;;;;;;
; temp section, move later
;;;;;;;;
;initialize some variables
LDA #$00
STA player1anim
STA player1animtimer
STA nametable
STA scrolling
STA player1x
STA enemylistsize
STA player1invinc
STA player1hurt
STA player1knockback
LDA #$BF
STA player1y
LDA #PLAYER_1_DASH_BLINK_TIME
STA player1dashtimer
LDA #PLAYER_1_INVINC_BLINK_TIME
STA player1invinctimer
LDA #PLAYER_1_KNOCKBACK_BLINK_TIME
STA player1knockbacktimer
LDA #$01
STA player1canjump
LDA #$10
STA nextsprite ;player1 sprite takes 4 sprites, each sprite is 4 bytes
;$04 * $04 = $10
JSR TestSpawnEnemy
;;;;;;;;
; end temp section
;;;;;;;;
Forever:
JMP Forever ;jump back to Forever, infinite loop
NMI:
LDA scrolling
BEQ NotScrolling
NTSwapCheck:
LDA scroll ; check if the scroll just wrapped from 255 to 0
BNE NTSwapCheckDone
NTSwap:
LDA nametable ; load current nametable number (0 or 1)
EOR #$01 ; exclusive OR of bit 0 will flip that bit
STA nametable ; so if nametable was 0, now 1
; if nametable was 1, now 0
NTSwapCheckDone:
NewAttribCheck:
LDA scroll
AND #%00011111 ; check for multiple of 32
BNE NewAttribCheckDone ; if low 5 bits = 0, time to write new attribute bytes
jsr DrawNewAttributes
NewAttribCheckDone:
NewColumnCheck:
LDA scroll
AND #%00000111 ; throw away higher bits to check for multiple of 8
BNE NewColumnCheckDone ; done if lower bits != 0
JSR DrawNewColumn ; if lower bits = 0, time for new column
lda columnNumber
clc
adc #$01 ; go to next column
and #%01111111 ; only 128 columns of data, throw away top bit to wrap
sta columnNumber
NewColumnCheckDone:
NotScrolling:
LDA #$00
STA scrolling ; reset scrolling
STA $2006 ; clean up PPU address registers
STA $2006
LDA scroll
STA $2005 ; write the horizontal scroll count register
LDA #$00 ; no vertical scrolling
STA $2005
LDA #$00
STA $2003 ; set the low byte (00) of the RAM address
LDA #$02
STA $4014 ; set the high byte (02) of the RAM address, start the transfer
;;This is the PPU clean up section, so rendering the next frame starts properly.
LDA #%10010000 ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
ORA nametable ; select correct nametable for bit 0
STA $2000
LDA #%00011110 ; enable sprites, enable background, no clipping on left side
STA $2001
;;;;;;;;;;;;;;
; MAIN GAME LOOP FUNCTIONS
;;;;;;;;;;;;;;
JSR ResetPlayerAcceleration
JSR ReadControllers
JSR HandlePlayerInput
JSR ApplyPlayerGrav
JSR ApplyPlayer1Phys
JSR CheckPlatformCollisions
JSR UpdateEnemies
JSR TestBoxCollision
JSR UpdateSprites
JSR TickTimers
JSR TestGetTile
JSR FamiToneUpdate
RTI
TickTimers:
INC player1animtimer
JSR TickDashTimer
JSR TickHurtTimer
JSR TickKnockbackTimer
TickTimersDone:
RTS
TickHurtTimer:
LDA player1invinctimer
CMP #PLAYER_1_INVINC_BLINK_TIME
BCS TickHurtTimerDone
INC player1invinctimer
LDA player1invinctimer
CMP #PLAYER_1_HURT_TIME
BNE TickHurtTimerDone
LDA #$00 ;disable player hurt, no longer invincible
STA player1hurt
STA player1invinc
TickHurtTimerDone:
RTS
TickKnockbackTimer:
LDA player1knockbacktimer
CMP #PLAYER_1_KNOCKBACK_BLINK_TIME
BCS TickKnockbackTimerDone
INC player1knockbacktimer
LDA player1knockbacktimer
CMP #PLAYER_1_KNOCKBACK_TIME
BNE TickKnockbackTimerDone
LDA #$00 ;disable knockback, set walking animation
STA player1knockback
STA player1dashing
STA player1anim
STA player1animframe
STA player1animtimer
;past time when player knockback should be applied, so freeze player
LDA #$00
STA player1xvel
;allow dashing immedietely after recovering
LDA #PLAYER_1_DASH_BLINK_TIME
STA player1dashtimer
TickKnockbackTimerDone:
RTS
TickDashTimer:
LDA player1dashtimer
CMP #PLAYER_1_DASH_BLINK_TIME
BCS TickDashTimerDone
INC player1dashtimer
LDA player1dashtimer
CMP #PLAYER_1_DASH_TIME
BNE TickDashTimerDone
LDA #$00 ;disable dashing, set walking animation
STA player1dashing
STA player1anim
STA player1animframe
STA player1animtimer
TickDashTimerDone:
RTS
;;;;;;;;
; TEMP TEST FUNCTIONS, DELETE AFTER DONE TESTING
;;;;;;;;
TestBoxCollision:
LDA player1x
STA rect1_x
LDA player1y
STA rect1_y
LDA #$10
STA rect1_width
STA rect1_height
STA rect2_width
STA rect2_height
LDA enemylist+enemy_x
STA rect2_x
LDA enemylist+enemy_y
STA rect2_y
JSR CheckRectCollision
STA testrectcollis
BEQ TestBoxCollisionDone
;check if dashing or not
LDA player1dashing
BEQ PlayPlayerhurtanim ;player got hurt
;enemy got hurt
;load enemy hurt animation
LDA #$01
STA enemylist+enemy_anim
JMP TestBoxCollisionDone
PlayPlayerhurtanim:
LDA #$00 ;push to left
JSR Player1GetHurt
TestBoxCollisionDone:
RTS
TestGetTile:
LDA columnNumber
PHA
JSR SetRowNumberToPlayer
JSR SetColumnNumberToPlayer
JSR GetTileFromCurrentColumnRow
STA tiletest
PLA
STA columnNumber
RTS
TestSpawnEnemy:
LDA #$80
TAX
LDA #$80
TAY
LDA #$00
;spawn an enemy at screen location x = $80, y = $80, where type = $00
JSR SpawnEnemy
RTS
;;;;;;;;;;;;;;
; Enemy management
;;;;;;;;;;;;;;
UpdateEnemies:
LDA enemylistsize
TAX
LDA #$00
STA enemyptr
UpdateEnemiesLoop:
;first save X
TXA
PHA
;Use a jump table to decide how to initialize the enemy
;grab the proper offset
LDA enemyptr
TAX
LDA enemylist, X ;load in the enemy type number
ASL A; multiply by 2, since each address is 2 bytes long
TAX
LDA enemyupdatetable, X
STA scratchptr
LDA enemyupdatetable+1, X
STA scratchptr+1
;build the return address to put on the stack
;so that RTS returns to right after the jump
LDA #HIGH(EnemyUpdateReturnAdr-1)
PHA
LDA #LOW(EnemyUpdateReturnAdr-1)
PHA
JMP [scratchptr]
EnemyUpdateReturnAdr:
JSR AdvanceEnemyPtrLoop
;restore X
PLA
TAX
DEX
BNE UpdateEnemiesLoop
RTS
;Jump table for enemy routines
enemyupdatetable:
.dw UpdateBoomba ; $00
AdvanceEnemyPtr:
;advance enemyptr through enemylist, skipping over sections marked $FF
;which indicate holes in the list
AdvanceEnemyPtrLoop:
LDA enemyptr
CLC
ADC #ENEMY_STRUCT_SIZE ;advance to next enemy
STA enemyptr
TAX
LDA enemylist, X
CMP #$FF
BEQ AdvanceEnemyPtrLoop
RTS
UpdateBoomba:
JSR BoombaLogic
JSR BoombaPhysics
JSR BoombaCollision
JSR CheckEnemyPlatformCollisions
JSR UpdateEnemySpritePosition
JSR UpdateBoombaSpriteAnimation
RTS
BoombaCollision:
RTS
BoombaLogic:
;Boombas simply walk to the left
;get enemylist offset, store in Y
LDA enemyptr
TAY
;get sprite offset for enemy, store in X
LDA enemylist+enemy_spr_ptr, Y
TAX
;always walk left, unless dying
LDA enemylist+enemy_anim, Y
CMP #$01
BNE BoombaLogicWalk
;stop walking, boomba dead
LDA #$00
STA enemylist+enemy_xaccel, Y
STA enemylist+enemy_xvel, Y
JMP BoombaLogicWalkDone
BoombaLogicWalk:
LDA #-$04
STA enemylist+enemy_xaccel, Y
BoombaLogicWalkDone:
;gravity is applied
LDA #$02
STA enemylist+enemy_yaccel, Y
RTS
BoombaPhysics:
;Simply update x and y vels, no friction
;get enemylist offset, store in Y
LDA enemyptr
TAY
;Add accel to vels
;x accel
LDA enemylist+enemy_xvelfract, Y
CLC
ADC enemylist+enemy_xaccel, Y
STA enemylist+enemy_xvelfract, Y
;y accel
LDA enemylist+enemy_yvelfract, Y
CLC
ADC enemylist+enemy_yaccel, Y
STA enemylist+enemy_yvelfract, Y
;Apply vels
JSR ApplyEnemyXVel
JSR ApplyEnemyYVel
;speed limit
; x speed limit check
LDA enemylist+enemy_xvel, Y
BMI XSpeedLimitEnemyMinus
LDA enemylist+enemy_xvel, Y
CMP #$02
BCC XSpeedLimitEnemyDone
LDA #$01
JMP XSpeedLimitEnemyDone
XSpeedLimitEnemyMinus:
LDA enemylist+enemy_xvel, Y
CMP #$-01
BCS XSpeedLimitEnemyDone
LDA #$-01
XSpeedLimitEnemyDone:
STA enemylist+enemy_xvel, Y
; y speed limit check
LDA enemylist+enemy_yvel, Y
BMI YSpeedLimitEnemyMinus
LDA enemylist+enemy_yvel, Y
CMP #$03
BCC YSpeedLimitEnemyDone
LDA #$02
JMP YSpeedLimitEnemyDone
YSpeedLimitEnemyMinus:
LDA enemylist+enemy_yvel, Y
CMP #$-02
BCS YSpeedLimitEnemyDone
LDA #$-02
YSpeedLimitEnemyDone:
STA enemylist+enemy_yvel, Y
; apply current velocities
LDA enemylist+enemy_y, Y
CLC
ADC enemylist+enemy_yvel, Y
STA enemylist+enemy_y, Y
LDA enemylist+enemy_x, Y
CLC
ADC enemylist+enemy_xvel, Y
STA enemylist+enemy_x, Y
RTS
SpawnEnemy:
;Parameters: X, Y = x and y screen coordinates to spawn enemy, respectively
; A = type of enemy to spawn
;
;Create a new enemy in enemylist, set its type, then call InitializeEnemy
;to initialize it properly
PHA ;save type of enemy
;Multiply the size of an enemy struct by the amount of enemies in
;the list to get the proper offset
LDA enemylistsize
STA num2
LDA #ENEMY_STRUCT_SIZE
STA num1
JSR Mult
STA scratchptr ;temp store offset
PLA ;restore enemy type
STA scratchptr+$01 ;temp store enemy type
TXA
PHA ;temp store X
LDA scratchptr
TAX
LDA scratchptr+$01
STA enemylist, X ;use the proper offset to set enemy type byte
PLA ;restore X coordinate
STA enemylist + enemy_x, X ;store it in the proper place
TYA ;get the Y coordinate
STA enemylist + enemy_y, X ;store it in the proper place
INC enemylistsize ;we've added an enemy, increase size
TXA
STA enemyptr ;store offset into enemyptr in anticipation of call to InitializeEnemy
JSR InitializeEnemy
RTS
InitializeEnemy:
;Paramters: enemyptr = pointer to location of enemy struct
;
;Take the enemy at enemyptr and initialize its variables properly
;according to its type
;Use a jump table to decide how to initialize the enemy
;grab the proper offset
LDA enemyptr
TAX
LDA enemylist, X ;load in the enemy type number
ASL A; multiply by 2, since each address is 2 bytes long
TAX
LDA enemyinittable, X
STA scratchptr
LDA enemyinittable+1, X
STA scratchptr+1
JMP [scratchptr]
; no RTS needed as called functions have RTS in them
;Jump table for enemy inits
enemyinittable:
.dw InitEnemyBoomba ; $00
InitEnemyBoomba:
;get offset again
LDA enemyptr
TAX
TAY
;set walking animation
LDA #$00
STA enemylist+enemy_anim, Y
;allocate sprites
LDA nextsprite
PHA ;save our starting sprite position to avoid loading it again
STA enemylist + enemy_spr_ptr, X
CLC
ADC #$10 ;reserve 4 sprites (4 bytes per sprite)
STA nextsprite
PLA ;reload sprite start position
TAX ;now that we are dealing with the sprites, use it as the offset
; Restore sprites to default palettes
LDA #$02
STA $0202, X
STA $0206, X
STA $020A, X
STA $020E, X
RTS
;;;;;;;;;;;;;;
; Physics engine
;;;;;;;;;;;;;;
CheckRectCollision:
;checks if rect1 and rect2 are overlapping
;stores result in A
;rect1.x < rect2.x + rect2.width &&
LDA rect2_x
CLC
ADC rect2_width
STA scratchptr
LDA rect1_x
CMP scratchptr
BCS CheckRectNoCollision
;rect1.x + rect1.width > rect2.x &&
LDA rect1_x
CLC
ADC rect1_width
STA scratchptr
LDA rect2_x
CMP scratchptr
BCS CheckRectNoCollision
;rect1.y < rect2.y + rect2.height &&
LDA rect2_y
CLC
ADC rect2_height
STA scratchptr
LDA rect1_y
CMP scratchptr
BCS CheckRectNoCollision
;rect1.y + rect1.height > rect2.y
LDA rect1_y
CLC
ADC rect1_height
STA scratchptr
LDA rect2_y
CMP scratchptr
BCS CheckRectNoCollision
;there was a collision
LDA #$01
RTS
CheckRectNoCollision:
;there was no collision
LDA #$00
RTS
;;enemy physics section
IsEnemyXVelZero:
LDA enemylist+enemy_xvel, Y
ORA enemylist+enemy_xvelfract, Y
BNE EnemyXVelNotZero
; it is zero
LDA #$00
RTS
EnemyXVelNotZero:
; it isn't zero
LDA #$01
IsEnemyXVelNotZeroDone:
RTS
IsEnemyXVelNeg:
LDA enemylist+enemy_xvel, Y
BMI EnemyXVelNeg
LDA enemylist+enemy_xvelfract, Y
BMI EnemyXVelNeg
;it isn't negative
LDA #$01
RTS
EnemyXVelNeg:
; it is neg
LDA #$00
IsEnemyXVelNegDone:
RTS
ApplyEnemyXVel:
;Take the velocity from the fractional portion
;and apply it to the integral portion
LDA enemylist+enemy_xvelfract, Y
BMI ApplyEnemyXVelNeg ;if negative, make sure to keep it negative
LSR A
LSR A
CLC
ADC enemylist+enemy_xvel, Y
STA enemylist+enemy_xvel, Y
;remove the part we just added
LDA enemylist+enemy_xvelfract, Y
AND #%00000011
STA enemylist+enemy_xvelfract, Y
RTS
ApplyEnemyXVelNeg:
;offset due to two's compliment
SEC
SBC #$01
LSR A
ORA #%10000000
LSR A
ORA #%10000000
CLC
ADC #$01
CLC
ADC enemylist+enemy_xvel, Y
STA enemylist+enemy_xvel, Y
;remove the part we just added
LDA enemylist+enemy_xvelfract, Y
AND #%00000011
BEQ ApplyEnemyXVelNegDone ;if it's just 0, then don't two's compliment it
;apply 1's to make it negative
ORA #%11111100
ApplyEnemyXVelNegDone:
STA enemylist+enemy_xvelfract, Y
RTS
IsEnemyYVelZero:
LDA enemylist+enemy_yvel, Y
ORA enemylist+enemy_yvelfract, Y
BNE EnemyYVelNotZero
; it is zero
LDA #$00
RTS
EnemyYVelNotZero:
; it isn't zero
LDA #$01
IsEnemyYVelNotZeroDone:
RTS
IsEnemyYVelNeg:
LDA enemylist+enemy_yvel, Y
BMI EnemyYVelNeg
LDA enemylist+enemy_yvelfract, Y
BMI EnemyYVelNeg
;it isn't negative
LDA #$01
RTS
EnemyYVelNeg:
; it is neg
LDA #$00
IsEnemyYVelNegDone:
RTS
ApplyEnemyYVel:
;Take the velocity from the fractional portion
;and apply it to the integral portion
LDA enemylist+enemy_yvelfract, Y
BMI ApplyEnemyYVelNeg ;if negative, make sure to keep it negative
LSR A
LSR A
CLC
ADC enemylist+enemy_yvel, Y
STA enemylist+enemy_yvel, Y
;remove the part we just added
LDA enemylist+enemy_yvelfract, Y
AND #%00000011
STA enemylist+enemy_yvelfract, Y
RTS
ApplyEnemyYVelNeg:
;offset due to two's compliment
SEC
SBC #$01
LSR A
ORA #%10000000
LSR A
ORA #%10000000
CLC
ADC #$01
CLC
ADC enemylist+enemy_yvel, Y
STA enemylist+enemy_yvel, Y
;remove the part we just added
LDA enemylist+enemy_yvelfract, Y
AND #%00000011
BEQ ApplyEnemyYVelNegDone ;if it's just 0, then don't two's compliment it
;apply 1's to make it negative
ORA #%11111100
ApplyEnemyYVelNegDone:
STA enemylist+enemy_yvelfract, Y
RTS
;;end enemy section
ApplyPlayerGrav:
LDA player1dashing
BNE ApplyPlayerNoGrav;no gravity when dashing
LDA player1yaccel
CLC
ADC #$01
STA player1yaccel
RTS
ApplyPlayerNoGrav:
LDA #$00
STA player1yvel
STA player1yvelfract
STA player1yaccel
RTS
ResetPlayerAcceleration:
;If no buttons are being pushed, there should be no acceleration
;along the x axis
LDA #$00
STA player1xaccel
STA player1yaccel
RTS
IsPlayer1XVelZero:
LDA player1xvel
ORA player1xvelfract
BNE Player1XVelNotZero
; it is zero
LDA #$00
RTS
Player1XVelNotZero:
; it isn't zero
LDA #$01
IsPlayer1XVelNotZeroDone:
RTS
IsPlayer1XVelNeg:
LDA player1xvel
BMI Player1XVelNeg
LDA player1xvelfract
BMI Player1XVelNeg
;it isn't negative
LDA #$01
RTS
Player1XVelNeg:
; it is neg
LDA #$00
IsPlayer1XVelNegDone:
RTS
ApplyPlayer1XVel:
;Take the velocity from the fractional portion
;and apply it to the integral portion
LDA player1xvelfract
BMI ApplyPlayer1XVelNeg ;if negative, make sure to keep it negative
LSR A
LSR A
CLC
ADC player1xvel
STA player1xvel
;remove the part we just added
LDA player1xvelfract
AND #%00000011
STA player1xvelfract
RTS
ApplyPlayer1XVelNeg:
;offset due to two's compliment
SEC
SBC #$01
LSR A
ORA #%10000000
LSR A
ORA #%10000000
CLC
ADC #$01
CLC
ADC player1xvel
STA player1xvel
;remove the part we just added
LDA player1xvelfract
AND #%00000011
BEQ ApplyPlayer1XVelNegDone ;if it's just 0, then don't two's compliment it
;apply 1's to make it negative
ORA #%11111100
ApplyPlayer1XVelNegDone:
STA player1xvelfract
RTS
IsPlayer1YVelZero:
LDA player1yvel
ORA player1yvelfract
BNE Player1YVelNotZero
; it is zero
LDA #$00
RTS
Player1YVelNotZero:
; it isn't zero
LDA #$01
IsPlayer1YVelNotZeroDone:
RTS
IsPlayer1YVelNeg:
LDA player1yvel
BMI Player1YVelNeg
LDA player1yvelfract
BMI Player1YVelNeg
;it isn't negative
LDA #$01
RTS
Player1YVelNeg:
; it is neg
LDA #$00
IsPlayer1YVelNegDone:
RTS
ApplyPlayer1YVel:
;Take the velocity from the fractional portion
;and apply it to the integral portion
LDA player1yvelfract
BMI ApplyPlayer1YVelNeg ;if negative, make sure to keep it negative
LSR A
LSR A
CLC
ADC player1yvel
STA player1yvel
;remove the part we just added
LDA player1yvelfract
AND #%00000011
STA player1yvelfract
RTS
ApplyPlayer1YVelNeg:
;offset due to two's compliment
SEC
SBC #$01
LSR A
ORA #%10000000
LSR A
ORA #%10000000
CLC
ADC #$01
CLC
ADC player1yvel
STA player1yvel
;remove the part we just added
LDA player1yvelfract
AND #%00000011
BEQ ApplyPlayer1YVelNegDone ;if it's just 0, then don't two's compliment it
;apply 1's to make it negative
ORA #%11111100
ApplyPlayer1YVelNegDone:
STA player1yvelfract
RTS
ApplyPlayer1Phys:
;; - SPAGHETTI WARNING -
;; The following section of code may contain
;; hard-to-follow branching, may assume
;; prior conditions (i.e. it expects a certain
;; subroutine to be called before or after its
;; own execution in order to initialize values),
;; or may just be hard to follow in general.
;; Edit at your own risk.
; simulate friction and acceleration
Player1XAccel:
;first check for dashing
LDA player1dashing
BEQ xvelacc
;handle dash acceleration
LDA player1mirrored
BNE DashLeft
DashRight:
LDA #$02
STA player1xaccel
JMP xvelacc
DashLeft:
LDA #$-02
STA player1xaccel
xvelacc:
;x vel/acc friction
LDA player1xaccel
BNE Player1XApplyAccel
Player1XApplyFrict:
LDA player1falling
BNE Player1YAccel ;if player is in the air, don't apply friction
LDA player1hurt ;if player is in hurt animation, don't apply friction
BNE Player1YAccel
JSR IsPlayer1XVelZero
BEQ Player1YAccel
LDA player1xvel
BMI Player1XApplyFrictNeg
Player1XApplyFrictPos:
LDA player1xvelfract
SEC
SBC #$02
STA player1xvelfract
;correct friction to make sure it doesn't add velocity
LDA player1xvel
PHA
LDA player1xvelfract
PHA
JSR ApplyPlayer1XVel
LDA player1xvel
BMI Player1XFrictCorrect
JMP Player1XFrictCorrectDone
Player1XFrictCorrect:
PLA ;remove temp stored values
PLA
;set velocity to zero
LDA #$00
STA player1xvel
STA player1xvelfract
JMP Player1YAccel
Player1XFrictCorrectDone:
PLA
STA player1xvelfract
PLA
STA player1xvel
JMP Player1YAccel
Player1XApplyFrictNeg:
LDA player1xvelfract
CLC
ADC #$02
STA player1xvelfract
;correct friction to make sure it doesn't add velocity
LDA player1xvel
PHA
LDA player1xvelfract
PHA
JSR ApplyPlayer1XVel
LDA player1xvel
BMI Player1XFrictCorrectDone
PLA ;remove temp stored values
PLA
;set velocity to zero
LDA #$00
STA player1xvel
STA player1xvelfract
JMP Player1YAccel
Player1XApplyAccel:
;Apply the acceleration
LDA player1xvelfract
CLC
ADC player1xaccel
STA player1xvelfract
Player1YAccel:
;y vel/acc friction
LDA player1yaccel
BNE Player1YApplyAccel
JMP Player1ApplyVels ;no friction in the air
Player1YApplyAccel:
;Now apply the acceleration
LDA player1yaccel
CLC
ADC player1yvelfract
STA player1yvelfract
Player1ApplyVels:
JSR ApplyPlayer1XVel
JSR ApplyPlayer1YVel
; first make sure speed limit is enforced
; y speed limit check
BIT player1yvel
BMI YSpeedLimitMinus
LDA player1yvel
CMP #$05
BCC YSpeedLimitDone
LDA #$04
JMP YSpeedLimitDone
YSpeedLimitMinus:
LDA player1yvel
CMP #$-04
BCS YSpeedLimitDone
LDA #$-04
YSpeedLimitDone:
STA player1yvel
; x speed limit check
; first check if player's walking or dashing
LDA player1dashing
BNE XSpeedLimitDashing
;walking
BIT player1xvel
BMI XSpeedLimitMinusWalking
LDA player1xvel
CMP #$02
BCC XSpeedLimitDone
LDA #$01
JMP XSpeedLimitDone
XSpeedLimitMinusWalking:
LDA player1xvel
CMP #$-01
BCS XSpeedLimitDone
LDA #$-01
JMP XSpeedLimitDone
XSpeedLimitDashing:
;dashing
BIT player1xvel
BMI XSpeedLimitMinus
LDA player1xvel
CMP #$03
BCC XSpeedLimitDone
LDA #$02
JMP XSpeedLimitDone
XSpeedLimitMinus:
LDA player1xvel
CMP #$-02
BCS XSpeedLimitDone
LDA #$-02
XSpeedLimitDone:
STA player1xvel
; apply current velocities
LDA player1y
CLC
ADC player1yvel
STA player1y
LDA player1x
CLC
ADC player1xvel
;If player is on the very edge of the screen, keep him
;from going farther
CMP #$F8 ;comparing to the very last values of player1x
;due to wraparound
BCS ClampPlayerx
STA player1x
JMP HandleScrolling
ClampPlayerx:
LDA #$00
STA player1x
HandleScrolling:
;Handle any scrolling
LDA player1x
CMP #SCREEN_SCROLL_REGION
BCC ApplyPlayer1PhysDone;we are behind the line, no need to scroll
BEQ ApplyPlayer1PhysDone;we are standing on the line, no need to scroll
;calculate how much to scroll by
LDA player1x
SEC
SBC #SCREEN_SCROLL_REGION
STA scratchptr
BEQ ApplyPlayer1PhysDone ;if we're adding zero to the scroll, don't do anything
CMP #$02
BNE ContinueScrollAdjust
;if scroll amount is 2, we need to make sure scroll is even,
;otherwise we risk skipping over the new column check
LDA #%00000001
BIT scroll
BEQ ContinueScrollAdjust ;scroll is even, continue
;scroll is not even, adjust the $02 down to a $01 to align it
DEC scratchptr
ContinueScrollAdjust:
LDA scroll
CLC
ADC scratchptr
STA scroll
;set the scrolling variable
;to let the NMI next frame know to check for new columns
LDA #01
STA scrolling
;snap player x position back to middle of screen
LDA #SCREEN_SCROLL_REGION
STA player1x
ApplyPlayer1PhysDone:
RTS
SetColumnNumberToPlayer:
;calculate the current column number of player1 by using
;player1x, store in columnNumber
LDA player1x ;divide player1x by 8 to get the screen tile number
LSR A
LSR A
LSR A
STA scratchptr ;store resulting tile number in scratch variable
LDA columnNumber ;columnNumber is the column on the far right side of the screen,
;so subtract by $21 to get the column number on the left hand side of the
;current screen
SEC
SBC #$21
;now add that value to the tile value we just calculated from player1x
CLC
ADC scratchptr
AND #%01111111 ;clamp value
;and store it in columnNumber
STA columnNumber
RTS
SetRowNumberToPlayer:
;calculate the current row number of player1 by using
;player1y, store in columnNumber
LDA player1y ;divide player1x by 8 to get the screen tile number
LSR A
LSR A
LSR A
STA rowNumber ;store it into rowNumber
RTS
;; enemy platform functions
SetColumnNumberToEnemy:
;calculate the current column number of player1 by using
;player1x, store in columnNumber
LDA enemylist+enemy_x, Y ;divide player1x by 8 to get the screen tile number
LSR A
LSR A
LSR A
STA scratchptr ;store resulting tile number in scratch variable
LDA columnNumber ;columnNumber is the column on the far right side of the screen,
;so subtract by $21 to get the column number on the left hand side of the
;current screen
SEC
SBC #$21
;now add that value to the tile value we just calculated from player1x
CLC
ADC scratchptr
AND #%01111111 ;clamp value
;and store it in columnNumber
STA columnNumber
RTS
SetRowNumberToEnemy:
;calculate the current row number of player1 by using
;player1y, store in columnNumber
LDA enemylist+enemy_y, Y ;divide player1x by 8 to get the screen tile number
LSR A
LSR A
LSR A
STA rowNumber ;store it into rowNumber
RTS
CheckEnemyPlatformCollisions:
;Move the enemy offset stored in Y to X as well, in order
;to use the INC opcode correctly
TYA
TAX
;align enemy y to tiles by adding by 1
INC enemylist+enemy_y, X
;no need to check if enemy is falling for now
;account for scrolling
LDA scroll
AND #%00000111
CLC
ADC enemylist+enemy_x, Y
STA enemylist+enemy_x, Y
JSR CheckEnemyPlatformCollision
;restore enemy x
LDA scroll
AND #%00000111
STA scratchptr
LDA enemylist+enemy_x, Y
SEC
SBC scratchptr
STA enemylist+enemy_x, Y
;restore enemy y
DEC enemylist+enemy_y, X
RTS
CheckEnemyPlatformCollision:
LDA columnNumber
PHA
JSR SetRowNumberToEnemy
JSR SetColumnNumberToEnemy
JSR EnemyPlatformCollisDown
JSR EnemyPlatformCollisRight
JSR EnemyPlatformCollisLeft
;No need to check for updwards collisions
PLA
STA columnNumber
CheckEnemyPlatformCollisDone
RTS
EnemyPlatformCollisDown:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;If moving up, ignore downward collisions
LDA buttons1
AND #%00001000
BNE EnemyPlatformCollisDownDone
;Set row number to directly below player
INC rowNumber
INC rowNumber
;First tile under player
JSR EnemyStaticDownCollis
;Second tile under player
INC columnNumber
JSR EnemyStaticDownCollis
;Possible third tile under player
LDA enemylist+enemy_x, Y
AND #%0000111
BEQ EnemyPlatformCollisDownDone
INC columnNumber
JSR EnemyStaticDownCollis
EnemyPlatformCollisDownDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
EnemyStaticDownCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE EnemyStaticDownCollisDone
;We have collided with a downward tile, so move the player back up
LDA enemylist+enemy_y, Y
AND #%11111000
STA enemylist+enemy_y, Y
;no need to mark falling or jumping
EnemyStaticDownCollisDone:
RTS
EnemyPlatformCollisRight:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;Set row number to directly below player
INC columnNumber
INC columnNumber
;First tile under player
JSR EnemyStaticRightCollis
;Second tile under player
INC rowNumber
JSR EnemyStaticRightCollis
;Possible third tile under player
LDA enemylist+enemy_y, Y
AND #%0000111
BEQ EnemyPlatformCollisRightDone
INC rowNumber
JSR EnemyStaticRightCollis
EnemyPlatformCollisRightDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
EnemyStaticRightCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE EnemyStaticRightCollisDone
;We have collided with a downward tile, so move the player back up
LDA enemylist+enemy_x, Y
AND #%11111000
STA enemylist+enemy_x, Y
EnemyStaticRightCollisDone:
RTS
EnemyPlatformCollisLeft:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;First tile under player
JSR EnemyStaticLeftCollis
;Second tile under player
INC rowNumber
JSR EnemyStaticLeftCollis
;Possible third tile under player
LDA enemylist+enemy_y, Y
AND #%0000111
BEQ EnemyPlatformCollisLeftDone
INC rowNumber
JSR EnemyStaticLeftCollis
EnemyPlatformCollisLeftDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
EnemyStaticLeftCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE EnemyStaticLeftCollisDone
;We have collided with a downward tile, so move the player back up
LDA enemylist+enemy_x, Y
AND #%11111000
CLC
ADC #%00001000
STA enemylist+enemy_x, Y
EnemyStaticLeftCollisDone:
RTS
; end enemy platform functions
CheckPlatformCollisions:
;align player1y to tiles by adding by 1
INC player1y
;set player to falling, later if a down collision is detected,
;then it'll set falling back to $00
LDA #$01
STA player1falling
;account for scrolling
LDA scroll
AND #%00000111
CLC
ADC player1x
STA player1x
JSR CheckPlayerPlatformCollisions
;restore player1x
LDA scroll
AND #%00000111
STA scratchptr
LDA player1x
SEC
SBC scratchptr
STA player1x
;restore player1y
DEC player1y
RTS
CheckPlayerPlatformCollisions:
LDA columnNumber
PHA
JSR SetRowNumberToPlayer
JSR SetColumnNumberToPlayer
JSR PlayerPlatformCollisDown
JSR PlayerPlatformCollisRight
JSR PlayerPlatformCollisLeft
;No need to check for updwards collisions
PLA
STA columnNumber
CheckPlayerPlatformCollisDone
RTS
PlayerPlatformCollisDown:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;If moving up, ignore downward collisions
LDA buttons1
AND #%00001000
BNE PlayerPlatformCollisDownDone
;Set row number to directly below player
INC rowNumber
INC rowNumber
;First tile under player
JSR PlayerStaticDownCollis
;Second tile under player
INC columnNumber
JSR PlayerStaticDownCollis
;Possible third tile under player
LDA player1x
AND #%0000111
BEQ PlayerPlatformCollisDownDone
INC columnNumber
JSR PlayerStaticDownCollis
PlayerPlatformCollisDownDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
PlayerStaticDownCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE PlayerStaticDownCollisDone
;We have collided with a downward tile, so move the player back up
LDA player1y
AND #%11111000
STA player1y
;also mark that the player is no longer falling or jumping
LDA #$00
STA player1falling
STA player1jumping
PlayerStaticDownCollisDone:
RTS
PlayerPlatformCollisRight:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;If moving left, ignore rightward collisions
;LDA buttons1
;AND #%00000010
;BNE PlayerPlatformCollisRightDone
;Set row number to directly below player
INC columnNumber
INC columnNumber
;First tile under player
JSR PlayerStaticRightCollis
;Second tile under player
INC rowNumber
JSR PlayerStaticRightCollis
;Possible third tile under player
LDA player1y
AND #%0000111
BEQ PlayerPlatformCollisRightDone
INC rowNumber
JSR PlayerStaticRightCollis
PlayerPlatformCollisRightDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
PlayerStaticRightCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE PlayerStaticRightCollisDone
;We have collided with a downward tile, so move the player back up
LDA player1x
AND #%11111000
STA player1x
PlayerStaticRightCollisDone:
RTS
PlayerPlatformCollisLeft:
;; Assumes rowNumber and columnNumber currently point to upper-left of player
;; (first sprite)
;save rowNumber and columnNumber
LDA rowNumber
PHA
LDA columnNumber
PHA
;If moving right, ignore leftward collisions
;LDA buttons1
;AND #%00000001
;BNE PlayerPlatformCollisLeftDone
;First tile under player
JSR PlayerStaticLeftCollis
;Second tile under player
INC rowNumber
JSR PlayerStaticLeftCollis
;Possible third tile under player
LDA player1y
AND #%0000111
BEQ PlayerPlatformCollisLeftDone
INC rowNumber
JSR PlayerStaticLeftCollis
PlayerPlatformCollisLeftDone:
;restore rowNumber and columnNumber
PLA
STA columnNumber
PLA
STA rowNumber
RTS
PlayerStaticLeftCollis:
JSR GetTileFromCurrentColumnRow
CMP #$30 ; for now only tile $30 is collidable
BNE PlayerStaticLeftCollisDone
;We have collided with a downward tile, so move the player back up
LDA player1x
AND #%11111000
CLC
ADC #%00001000
STA player1x
PlayerStaticLeftCollisDone:
RTS
;;;;;;;;;;;;;;
; Level engine
;;;;;;;;;;;;;;
GetTileFromCurrentColumnRow:
;; Uses columnNumber and rowNumber to retrieve the appropriate tile from
;; the meta-tile map, and stores it into the accumulator A
;; Call this subroutine with "GetTileFromCurrentSource"
;; if you have already set sourceLow and sourceHigh to point to the correct column
JSR GetColumnDataStart
GetTileFromCurrentSource:
TYA ; save Y register
PHA
;divide row number by 2 to get meta-tile row
LDA rowNumber
LSR A
TAY
LDA [sourceLow], Y ;get appropriate meta-tile
PHA ; save meta-tile
;get the proper column in the meta-tile
LDA columnNumber
AND #%00000001 ; now either 0 or 1, depending on if it was odd or even
ASL A ; now either 0 or 2
STA scratchptr
;now get the proper row in the meta-tile
LDA rowNumber
AND #%00000001 ; now either 0 or 1, depending on if it was odd or even
CLC
ADC scratchptr ; add to what we got previously to get the final offset
STA scratchptr
;now we get the actual tile value
PLA ;get meta-tile
ASL A ;multiply by 4
ASL A
CLC
ADC scratchptr ;add the proper offset for the tile we want
TAY
LDA metatiles, Y ;load the tile
STA scratchptr ; temp store
PLA ; restore Y register
TAY
;restore return value
LDA scratchptr
RTS
GetColumnDataStart:
;; Gets the start of the column data for the column number
;; currently in columnNumber and stores the pointer inside
;; sourceLow and sourceHigh
;convert column number to metatile number
LDA columnNumber
AND #%00000001 ; If column number is odd, round down to nearest even number
; so that it's aligned to the meta tiles
BEQ ConvertToMetaTileEven
LDA columnNumber
SEC
SBC #$01
JMP ConvertToMetaTile
ConvertToMetaTileEven:
LDA columnNumber
ConvertToMetaTile:
LSR A ; column number / 2 = meta tile number
; now we find the offset for the meta tile
PHA; meta tile number * 16 = column data offset
ASL A
ASL A
ASL A
ASL A
STA sourceLow
PLA
LSR A
LSR A
LSR A
LSR A
STA sourceHigh
LDA sourceLow ; column data start + offset = address to load column data from
CLC
ADC #LOW(columnData)
STA sourceLow
LDA sourceHigh
ADC #HIGH(columnData)
STA sourceHigh
RTS
DrawMetaTileFirstColumn:
;save Y value
STA scratchptr
TYA
PHA
LDA scratchptr
;A register should already have meta-tile number
ASL A; multiply by 4, since each meta tile is 4 bytes long
ASL A
TAY
LDA metatiles, Y
STA $2007 ; write to PPU
LDA metatiles+$01, Y
STA $2007
;restore Y value
PLA
TAY
RTS
DrawMetaTileSecondColumn:
;save Y value
STA scratchptr
TYA
PHA
LDA scratchptr
;A register should already have meta-tile number
ASL A; multiply by 4, since each meta tile is bytes long
ASL A
TAY
LDA metatiles+$02, Y
STA $2007 ; write to PPU
LDA metatiles+$03, Y
STA $2007
;restore Y value
PLA
TAY
RTS
DrawNewColumn:
LDA scroll ; calculate new column address using scroll register
LSR A
LSR A
LSR A ; shift right 3 times = divide by 8
STA columnLow ; $00 to $1F, screen is 32 tiles wide
LDA nametable ; calculate new column address using current nametable
EOR #$01 ; invert low bit, A = $00 or $01
ASL A ; shift up, A = $00 or $02
ASL A ; $00 or $04
CLC
ADC #$20 ; add high byte of nametable base address ($2000)
STA columnHigh ; now address = $20 or $24 for nametable 0 or 1
JSR GetColumnDataStart
DrawColumn:
LDA #%00000100 ; set to increment +32 mode
STA $2000
LDA $2002 ; read PPU status to reset the high/low latch
LDA columnHigh
STA $2006 ; write the high byte of column address
LDA columnLow
STA $2006 ; write the low byte of column address
LDX #$0F ; copy 15 meta tiles
LDY #$00
LDA columnNumber
AND #%00000001 ; If column number is odd, then draw the second column
; of the meta tiles
BNE DrawColumnLoopOdd
DrawColumnLoop:
LDA [sourceLow], y
JSR DrawMetaTileFirstColumn
INY
DEX
BNE DrawColumnLoop
RTS
DrawColumnLoopOdd:
LDA [sourceLow], y
JSR DrawMetaTileSecondColumn
INY
DEX
BNE DrawColumnLoopOdd
RTS
DrawNewAttributes:
LDA nametable
EOR #$01 ; invert low bit, A = $00 or $01
ASL A ; shift up, A = $00 or $02
ASL A ; $00 or $04
CLC
ADC #$23 ; add high byte of attribute base address ($23C0)
STA columnHigh ; now address = $23 or $27 for nametable 0 or 1
LDA scroll
LSR A
LSR A
LSR A
LSR A
LSR A
CLC
ADC #$C0
STA columnLow ; attribute base + scroll / 32
LDA columnNumber ; (column number / 4) * 8 = column data offset
AND #%11111100
ASL A
STA sourceLow
LDA columnNumber
LSR A
LSR A
LSR A
LSR A
LSR A
LSR A
LSR A
STA sourceHigh
LDA sourceLow ; column data start + offset = address to load column data from
CLC
ADC #LOW(attribData)
STA sourceLow
LDA sourceHigh
ADC #HIGH(attribData)
STA sourceHigh
LDY #$00
LDA $2002 ; read PPU status to reset the high/low latch
DrawNewAttributesLoop
LDA columnHigh
STA $2006 ; write the high byte of column address
LDA columnLow
STA $2006 ; write the low byte of column address
LDA [sourceLow], y ; copy new attribute byte
STA $2007
INY
CPY #$08 ; copy 8 attribute bytes
BEQ DrawNewAttributesLoopDone
LDA columnLow ; next attribute byte is at address + 8
CLC
ADC #$08
STA columnLow
JMP DrawNewAttributesLoop
DrawNewAttributesLoopDone:
rts
;;;;;;;;;;;;;;
; Sprite updates
;;;;;;;;;;;;;;
UpdateSprites:
JSR UpdatePlayer1Sprite
RTS
UpdateEnemySpritePosition:
;Parameters - Expects enemyptr to point to offset from enemylist of current enemy
;get enemylist offset, store in Y
LDA enemyptr
TAY
;get sprite offset for enemy, store in X
LDA enemylist+enemy_spr_ptr, Y
TAX
;update the sprite
JSR UpdateSpritePosition2x2
RTS
UpdatePlayer1Sprite:
JSR UpdatePlayer1SpritePosition
JSR UpdatePlayer1SpriteAnimation
RTS
UpdatePlayer1SpritePosition:
;Player1 is made up of 4 sprites,
;so move them accordingly
;Do different things for mirrored player
LDA player1mirrored
BNE UpdatePlayer1SpritePositionMirrored
;Unmirror all sprites
JSR UnmirrorPlayer1Sprites
;y axis
LDA player1y
STA PLAYER_1_SPRITE ;upper left sprite
STA PLAYER_1_SPRITE+$04 ;upper right sprite
CLC
ADC #$08
STA PLAYER_1_SPRITE+$08 ;bottom left sprite
STA PLAYER_1_SPRITE+$0C ;bottom right sprite
;x axis
LDA player1x
STA PLAYER_1_SPRITE+$03 ;upper left sprite
STA PLAYER_1_SPRITE+$0B ;bottom left sprite
CLC
ADC #$08
STA PLAYER_1_SPRITE+$07 ;upper right sprite
STA PLAYER_1_SPRITE+$0F ;bottom right sprite
RTS
UpdatePlayer1SpritePositionMirrored:
;Mirrored
;Mirror all sprites
JSR MirrorPlayer1Sprites
;y axis
LDA player1y
STA PLAYER_1_SPRITE ;upper left sprite
STA PLAYER_1_SPRITE+$04 ;upper right sprite
CLC
ADC #$08
STA PLAYER_1_SPRITE+$08 ;bottom left sprite
STA PLAYER_1_SPRITE+$0C ;bottom right sprite
;x axis
LDA player1x
STA PLAYER_1_SPRITE+$07 ;upper right sprite
STA PLAYER_1_SPRITE+$0F ;bottom right sprite
CLC
ADC #$08
STA PLAYER_1_SPRITE+$03 ;upper left sprite
STA PLAYER_1_SPRITE+$0B ;bottom left sprite
RTS
MirrorPlayer1Sprites:
LDA PLAYER_1_SPRITE+$02
ORA #%01000000
STA PLAYER_1_SPRITE+$02
LDA PLAYER_1_SPRITE+$06
ORA #%01000000
STA PLAYER_1_SPRITE+$06
LDA PLAYER_1_SPRITE+$0A
ORA #%01000000
STA PLAYER_1_SPRITE+$0A
LDA PLAYER_1_SPRITE+$0E
ORA #%01000000
STA PLAYER_1_SPRITE+$0E
RTS
UnmirrorPlayer1Sprites:
LDA PLAYER_1_SPRITE+$02
AND #%10111111
STA PLAYER_1_SPRITE+$02
LDA PLAYER_1_SPRITE+$06
AND #%10111111
STA PLAYER_1_SPRITE+$06
LDA PLAYER_1_SPRITE+$0A
AND #%10111111
STA PLAYER_1_SPRITE+$0A
LDA PLAYER_1_SPRITE+$0E
AND #%10111111
STA PLAYER_1_SPRITE+$0E
RTS
;Enemy sprite functions
UpdateSpritePosition2x2:
;Player1 is made up of 4 sprites,
;so move them accordingly
;Do different things for mirrored player
LDA enemylist+enemy_mirrored, Y
BNE UpdateSpritePositionMirrored
;Unmirror all sprites
JSR UnmirrorSprites
;y axis
LDA enemylist+enemy_y, Y
STA $0200,X ;upper left sprite
STA $0204,X ;upper right sprite
CLC
ADC #$08
STA $0208,X ;bottom left sprite
STA $020C,X ;bottom right sprite
;x axis
LDA enemylist+enemy_x, Y
STA $0203,X ;upper left sprite
STA $020B,X ;bottom left sprite
CLC
ADC #$08
STA $0207,X ;upper right sprite
STA $020F,X ;bottom right sprite
RTS
UpdateSpritePositionMirrored:
;Mirrored
;Mirror all sprites
JSR MirrorSprites
;y axis
LDA enemylist+enemy_y, Y
STA $0200,X ;upper left sprite
STA $0204,X ;upper right sprite
CLC
ADC #$08
STA $0208,X ;bottom left sprite
STA $020C,X ;bottom right sprite
;x axis
LDA enemylist+enemy_x, Y
STA $0207,X ;upper right sprite
STA $020F,X ;bottom right sprite
CLC
ADC #$08
STA $0203,X ;upper left sprite
STA $020B,X ;bottom left sprite
RTS
MirrorSprites:
LDA $0202,X
ORA #%01000000
STA $0202,X
LDA $0206,X
ORA #%01000000
STA $0206
LDA $020A,X
ORA #%01000000
STA $020A,X
LDA $020E,X
ORA #%01000000
STA $020E,X
RTS
UnmirrorSprites:
LDA $0202,X
AND #%10111111
STA $0202,X
LDA $0206,X
AND #%10111111
STA $0206,X
LDA $020A,X
AND #%10111111
STA $020A,X
LDA $020E,X
AND #%10111111
STA $020E,X
RTS
;;;;;;;;;;;;;;
; Animation engine
;;;;;;;;;;;;;;
Player1GetHurt:
;Parameter: A indicates whether player will get pushed to the left ($00)
; or right ($01) when hurt
;push player towards proper direction
BNE Player1GetHurtToRight
LDA #-$01
STA scratchptr
JMP Player1GetHurtStart
Player1GetHurtToRight:
LDA #$01
STA scratchptr
Player1GetHurtStart:
LDA player1invinctimer
CMP #PLAYER_1_INVINC_BLINK_TIME
BCC Player1GetHurtDone
;player got hurt, initalize appropriate variables
LDA #$00
STA player1invinctimer
LDA #$03 ;player hurt animation
STA player1anim
LDA #$01 ;set player hurt and invincible variables
STA player1hurt
STA player1invinc
;make player get knocked back
JSR Player1GetKnockback
Player1GetHurtDone:
RTS
Player1GetKnockback:
;Parameter: the first byte of
; scratchptr is the velocity added to playerx to push him in that direction
LDA player1knockbacktimer
CMP #PLAYER_1_KNOCKBACK_BLINK_TIME
BCC Player1GetKnockbackDone
;player got knocked back, initalize appropriate variables
LDA #$00
STA player1knockbacktimer
STA player1dashing ;stop any dashing
STA player1xvelfract ;stop horizontal movement
STA player1yvelfract ;stop vertical movement
LDA #$01 ;set player knockback variable
STA player1knockback
;push player towards proper direction
LDA scratchptr
STA player1xvel
;make player jump slightly
LDA #-$02
STA player1yvel
Player1GetKnockbackDone:
RTS
UpdateBoombaSpriteAnimation:
;Use a jump table to decide which animation to draw
LDA enemylist+enemy_anim, Y
ASL A; multiply by 2, since each address is 2 bytes long
TAX
LDA boombaanimtable, X
STA scratchptr
LDA boombaanimtable+1, X
STA scratchptr+1
JMP [scratchptr]
; animation subroutine is expected to call RTS,
; so no RTS needed here
;Jump table for player 1 animations
boombaanimtable:
.dw BoombaWalking ; $00
.dw BoombaHurt ; $01
BoombaWalking:
;get sprite offset
LDA enemylist+enemy_spr_ptr, Y
TAX
; Restore sprites to default
LDA #$10
STA $0201, X
LDA #$11
STA $0205, X
LDA #$12
STA $0209, X
LDA #$13
STA $020D, X
RTS
BoombaHurt:
;get sprite offset
LDA enemylist+enemy_spr_ptr, Y
TAX
; Restore sprites to default
LDA #$14
STA $0201, X
LDA #$15
STA $0205, X
LDA #$16
STA $0209, X
LDA #$17
STA $020D, X
RTS
UpdatePlayer1SpriteAnimation:
;Use a jump table to decide which animation to draw
LDA player1anim
ASL A; multiply by 2, since each address is 2 bytes long
TAX
LDA player1animtable, X
STA scratchptr
LDA player1animtable+1, X
STA scratchptr+1
JMP [scratchptr]
; animation subroutine is expected to call RTS,
; so no RTS needed here
;Jump table for player 1 animations
player1animtable:
.dw Player1Standing ; $00
.dw Player1AnimWalk ; $01
.dw Player1AnimDash ; $02
.dw Player1HurtAnim ; $03
Player1HurtAnim:
LDA #$20
STA PLAYER_1_SPRITE + $01
LDA #$21
STA PLAYER_1_SPRITE + $05
LDA #$22
STA PLAYER_1_SPRITE + $09
LDA #$23
STA PLAYER_1_SPRITE + $0D
RTS
Player1Standing:
; Restore sprites to default
LDA #$00
STA PLAYER_1_SPRITE + $01
LDA #$01
STA PLAYER_1_SPRITE + $05
LDA #$02
STA PLAYER_1_SPRITE + $09
LDA #$03
STA PLAYER_1_SPRITE + $0D
RTS
Player1AnimDash:
; Load dashing sprites
LDA #$0C
STA PLAYER_1_SPRITE + $01
LDA #$0D
STA PLAYER_1_SPRITE + $05
LDA #$0E
STA PLAYER_1_SPRITE + $09
LDA #$0F
STA PLAYER_1_SPRITE + $0D
RTS
Player1AnimWalk:
;Take care of resetting timers, etc...
LDA #PLAYER_1_ANIM_WALK_SPEED
CMP player1animtimer
BCS Player1AnimWalkCont
LDA #$00 ; resetting animation timer for next frame
STA player1animtimer
INC player1animframe
LDA #PLAYER_1_ANIM_WALK_FRAMES ; check if we've run through all the frames
CMP player1animframe
BCS Player1AnimWalkCont
LDA #$00 ; go back to first frame
STA player1animframe
Player1AnimWalkCont:
; Use a jump table to decide which frame to draw
LDA player1animframe
ASL A; multiply by 2, since each address is 2 bytes long
TAX
LDA Player1WalkFrameTable, X
STA scratchptr
LDA Player1WalkFrameTable+1, X
STA scratchptr+1
JMP [scratchptr]
; animation subroutine is expected to call RTS,
; so no RTS needed here
Player1WalkFrameTable:
.dw Player1WalkFrame1
.dw Player1WalkFrame2
Player1WalkFrame1:
LDA #$00
STA PLAYER_1_SPRITE + $01
LDA #$01
STA PLAYER_1_SPRITE + $05
LDA #$04
STA PLAYER_1_SPRITE+$09
LDA #$05
STA PLAYER_1_SPRITE+$0D
RTS
Player1WalkFrame2:
LDA #$00
STA PLAYER_1_SPRITE + $01
LDA #$01
STA PLAYER_1_SPRITE + $05
LDA #$06
STA PLAYER_1_SPRITE+$09
LDA #$07
STA PLAYER_1_SPRITE+$0D
RTS
;;;;;;;;;;;;;;
; Input handling functions
;;;;;;;;;;;;;;
HandlePlayerInput:
JSR HandlePlayer1Input
RTS
HandlePlayer1Input:
;; - SPAGHETTI WARNING -
;; The following section of code may contain
;; hard-to-follow branching, may assume
;; prior conditions (i.e. it expects a certain
;; subroutine to be called before or after its
;; own execution in order to initialize values),
;; or may just be hard to follow in general.
;; Edit at your own risk.
;If currently being knocked back, don't allow movement
LDA player1knockback
CMP #$01
BNE HandlePlayer1InputUp
JMP HandlePlayer1InputDone
HandlePlayer1InputUp:
LDA #%00001000 ; check for up button
BIT buttons1
BEQ HandlePlayer1InputDown ;branch if up not pressed
LDA #$-01
STA player1yaccel
HandlePlayer1InputDown:
LDA #%00000100 ; check for down button
BIT buttons1
BEQ HandlePlayer1InputLeft ;branch if up not pressed
LDA #$01
STA player1yaccel
HandlePlayer1InputLeft:
;if dashing, ignore horizontal inputs
LDA player1dashing
BNE HandlePlayer1InputA
LDA #%00000010 ; check for left button
BIT buttons1
BEQ HandlePlayer1InputRight ;branch if up not pressed
LDA #$-01
STA player1xaccel
; Mirror player sprites
LDA #$01
STA player1mirrored
;start walking animation
LDA #$01
CMP player1anim
BEQ HandlePlayer1InputRight
STA player1anim
;make sure animation is started properly
LDA #$00
STA player1animframe
STA player1animtimer
HandlePlayer1InputRight:
LDA #%00000001 ; check for right button
BIT buttons1
BEQ HandlePlayer1InputHoriz ;branch if up not pressed
LDA #$01
STA player1xaccel
; Unmirror player sprites
LDA #$00
STA player1mirrored
;start walking animation
LDA #$01
CMP player1anim
BEQ HandlePlayer1InputA
STA player1anim
;make sure animation is started properly
LDA #$00
STA player1animframe
STA player1animtimer
JMP HandlePlayer1InputA
HandlePlayer1InputHoriz:
LDA #%0001111 ;check if ANY of the directional buttons are pressed
BIT buttons1
BNE HandlePlayer1InputA ;there was at least 1 directional button pressed
HandlePlayer1InputHorizNone:
;no horizontal buttons pressed, so stop the walking animation
;if walking
LDA player1anim
CMP #$01
BNE HandlePlayer1InputA
LDA #$00
STA player1anim
HandlePlayer1InputA:
LDA #%10000000 ; check for A button
BIT buttons1
BEQ HandlePlayer1InputANone ;branch if up not pressed
LDA player1jumping ;if in the middle of jumping, continue
BNE Player1JumpRoutine
LDA player1falling
BNE HandlePlayer1InputB ;if falling, don't allow the player to jump
LDA player1canjump
BEQ HandlePlayer1InputB ;only execute the following section of player can jump
;or is currently jumping
Player1JumpRoutine:
INC player1jumpingtimer
LDA player1jumpingtimer
CMP #PLAYER_1_JUMP_TIMER_LIM
BCS Player1ResetJumping ;if jump timer is over, don't allow jumping
;TODO: add code for jump timer to make jump
;last longer depending on how long
;a is held
LDA #$01
STA player1jumping
STA player1falling
LDA #$00
STA player1canjump ;don't let the player jump again
LDA #$-03
STA player1yvel
JMP HandlePlayer1InputB
HandlePlayer1InputANone:
;can jump again if already hit the ground
LDA player1falling
BNE Player1ResetJumping
LDA #$01
STA player1canjump
Player1ResetJumping:
LDA #$00
STA player1jumpingtimer
;A was not pressed, so not jumping
LDA #$00
STA player1jumping
HandlePlayer1InputB:
LDA #%01000000 ; check for B button
BIT buttons1
BEQ HandlePlayer1InputDone ;branch if up not pressed
;start dashing if the timer is over
LDA player1dashtimer
CMP #PLAYER_1_DASH_BLINK_TIME
BCC HandlePlayer1InputDone ; still in recovery period
LDA #$01
STA player1dashing
;start dashing animation
LDA #$02
STA player1anim
;make sure animation is started properly
LDA #$00
STA player1animframe
STA player1animtimer
;reset dashtimer
LDA #$00
STA player1dashtimer
HandlePlayer1InputDone:
RTS
;;;;;;;;;;;;;;
; Controller reading functions
;;;;;;;;;;;;;;
ReadControllers:
JSR ReadController1
JSR ReadController2
RTS
ReadController1:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController1Loop:
LDA $4016
LSR A ; bit0 -> Carry
ROL buttons1 ; bit0 <- Carry
DEX
BNE ReadController1Loop
RTS
ReadController2:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController2Loop:
LDA $4017
LSR A ; bit0 -> Carry
ROL buttons2 ; bit0 <- Carry
DEX
BNE ReadController2Loop
RTS
;;;;;;;;
; Math functions
;;;;;;;;
; General 8bit * 8bit = 8bit multiply
; by <NAME> 20030207
; Multiplies "num1" by "num2" and returns result in .A
; Instead of using a bit counter, this routine early-exits when num2 reaches zero, thus saving iterations.
; Input variables:
; num1 (multiplicand)
; num2 (multiplier), should be small for speed
; Signedness should not matter
; .X and .Y are preserved
; num1 and num2 get clobbered
Mult:
LDA #$00
BEQ MultEnterLoop
MultDoAdd:
CLC
ADC num1
MultLoop:
ASL num1
MultEnterLoop: ;For an accumulating multiply (.A = .A + num1*num2), set up num1 and num2, then enter here
LSR num2
BCS MultDoAdd
BNE MultLoop
MultEnd:
RTS
;;;;;;;;
; Famitone import
;;;;;;;;
.include "famitone2.asm"
;;;;;;;;;;;;;;
; PRG ROM Bank 2
;;;;;;;;;;;;;;
.bank 1
.org $A000
.incbin "nesthing_ost.dmc"
.include "nesthing_ost.asm"
palette:
.db $0F,$17,$18,$29,$34,$38,$18,$2A,$38,$39,$3A,$3B,$3C,$3D,$3E,$0F ;nametable palettes
.db $0F,$10,$37,$0F,$07,$10,$2D,$0F,$0F,$00,$0F,$36,$31,$02,$38,$3C ;sprite palettes
sprites:
;vert tile attr horiz
.db $80, $00, $00, $80 ;sprite 0
.db $80, $01, $00, $88 ;sprite 1
.db $88, $02, $01, $80 ;sprite 2
.db $88, $03, $01, $88 ;sprite 3
;Meta-tiles are arranged in column-first format,
;to make horizontal scrolling easier
;Each meta-tile is made up of 4 different tiles
;Maximum of 64 ($40; or $00-$39 numbered) meta-tiles
metatiles:
;Tile positions:
;top-left bot-left top-right bot-right
.db $24, $24, $24, $24 ; $00, should always be
; all background
.db $30, $31, $30, $31 ; $01, basic top ground tile
.db $31, $31, $31, $31 ; $02, all ground tile
.db $24, $32, $24, $24 ; $03, floor flower tile
.db $24, $24, $24, $33 ; $04, floor grass tile
.db $24, $36, $24, $37 ; $05, bushes tile A
.db $24, $30, $24, $24 ; $06, single-tile platform
;one column of map data to test out meta-tiles
;note: all columns will have 3 wasted bytes
columnData:
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $03, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $04, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $06, $00, $00, $00, $00
.db $00, $00, $00, $00, $05, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $01, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $03, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $01, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $03, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $04, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $01, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $01, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $01, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $01, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $01, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $01, $00, $00, $00, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $03, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $04, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $01, $02, $FF ; 15 meta tiles to fill a column plus one filler tile
attribData:
.incbin "attrib.bin"
.org $FFFA ;first of the three vectors starts here
.dw NMI ;when an NMI happens (once per frame if enabled) the
;processor will jump to the label NMI:
.dw RESET ;when the processor first turns on or is reset, it will jump
;to the label RESET:
.dw 0 ;external interrupt IRQ is not used in this tutorial
;;;;;;;;;;;;;;
; CHR ROM
;;;;;;;;;;;;;;
.bank 2
.org $0000
.incbin "nesthing.chr" |
programs/oeis/277/A277792.asm | neoneye/loda | 22 | 84025 | ; A277792: Squares that are also pentagonal pyramidal numbers.
; 0,1,196,2601,15376,60025,181476,461041,1032256,2099601,3960100,7027801,11861136,19193161,29964676,45360225,66846976,96216481,135629316,187662601,255360400,342287001,452583076,591024721,763085376,975000625,1233835876,1547556921,1925103376,2376465001,2912760900
pow $0,2
mul $0,2
mov $1,$0
sub $0,1
bin $1,2
mul $0,$1
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_exp2.asm | ahjelm/z88dk | 640 | 88724 |
SECTION code_fp_am9511
PUBLIC cam32_sdcc_exp2
EXTERN cam32_sdcc_read1, _am9511_exp2
.cam32_sdcc_exp2
call cam32_sdcc_read1
jp _am9511_exp2
|
ide/se/c.als | joireman/config | 0 | 4252 | <filename>ide/se/c.als
=surround_with_const_cast const_cast<%\c>(%\m sur_text%)
=surround_with_include_once(macro "Symbol"
)
#ifndef %(macro)
#define %(macro)
%\m sur_text%
#endif // %(macro)
=surround_with_if if (%\c) {
%\m sur_text -indent%
}
=surround_with_#if %\m begin_line%#if %\c
%\m sur_text%
%\m begin_line%#endif
=surround_with_try...catch...finally try {
%\m sur_text -indent%
} catch (%\c) { %\S
} finally {
}
gnucmain(filename "FileName"
)
/*************************************************
%(filename) - %\c
Created: %\d, %\t
Programmer: <NAME>
**************************************************/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) %\S
{
%\iexit(EXIT_SUCCESS);
}
doxygroup(grpLabel "Group Label (no spaces)"
grpName "Group Name"
briefDesc "Brief Description"
)
/**
* @defgroup %(grpLabel) %(grpName)
* @brief %(briefDesc)
*/
/* @{ */
/* @} */
=surround_with_braces {
%\m sur_text -indent%
}
=surround_with_default default:
%\m sur_text -indent%
=surround_with_#ifndef %\m begin_line%#ifndef %\c
%\m sur_text%
%\m begin_line%#endif
=surround_with_finally finally {
%\m sur_text -indent%
}
fefunction(name "Function name"
return "Return type" int
paramlist "Parameter list"
)
%\L %(return) %(name)(%(paramlist)) {
%\S
%\istatic char func[] = "%(name)";
%\S
%\S
} /* %(name) */
%\S
=surround_with_type_union typdef union %\c {
%\m sur_text -indent%
};
=surround_with_type_struct typedef struct %\c {
%\m sur_text -indent%
};
=surround_with_reinterpret_cast reinterpret_cast<%\c>(%\m sur_text%)
headerfile(preprocguard "Preprocessor Guard (_H_ added)"
)
/*!
@file
@brief %\c
@par Edit History
- [0] [<NAME>] %d Initial revision
@par Version:
$Id: $
@par Copyright © 2011 VG Bioinformatics, Inc. %\S
All rights reserved.
**************************************************/
// 1 2 3 4 5 6 7
//34567890123456789012345678901234567890123456789012345678901234567890
#ifndef %(preprocguard)_H_
#define %(preprocguard)_H_
#endif
=surround_with_#ifdef %\m begin_line%#ifdef %\c
%\m sur_text%
%\m begin_line%#endif
=surround_with_catch catch (%\c) {
%\m sur_text -indent%
}
=surround_with_try...finally try {
%\m sur_text -indent%
} finally {
%\i%\c
}
doxyancllbk(name "Callback Name"
chanId "Channel ID:"
genCallbk "Generic Callback"
author "Author Name:" <NAME>
)
/**
* %(name) %\S
* @brief %\c
* %\S
* @param anData - ID of Acnet data that changed
* @param anCllbkData - %\S
* %\S
* @par EXAMPLE
* @code
*
* @endcode
*
* @par WARNING
* %\S
* @par KEYWORDS
* %\S
* @par AUTHOR
* %\i%\i%(author)
* %\S
* @par FILES
* %\i%\i%\f
* %\S
* @see
*************************************************/
void %(name)(AnEvtId_t anData, void *anCllbkData ) {
%\istatic char func[] = "%(name)";
%\iAnIntFltId_t intFltId;
%\iint chanId; /* Updated Acnet device channel */
%\iint elmtId; /* Updated Acnet device channel element */
%\i/* Cast arguments to proper data types */
%\iintFltId = (AnIntFltId_t)AnCllbkAnObjGet( anData );
%\i/* Find the updated channel and element */
%\ichanId = AnCllbkChanIdxGet( anData ); /* %(chanId) AnIntFlt ANFLT channel */
%\ielmtId = AnCllbkElmtIdxGet( anData ); /* channel element updated */
%\i /* Check that this callback was added for the right device */
%\iif ( chanId != %(chanId) ) {
%\i%\iLogMsg(logId, LOG_SYS, LOG_ERR,"Wrong channel= ", chanId); %\S
%\i%\ireturn;
%\i}
%\i%(genCallbk)(anData, anCllbkData);
%\ireturn;
} /* %(name) */
=surround_with_union union {
%\m sur_text -indent%
} %\c;
doxyfeheader(name "Function Name"
return "Return type" int
author "Author" <NAME>
)
/**
* %(name)()
* @brief %\c
*
* @par EXAMPLE
* @code %\S
*
* @endcode
*
* @par RETURNS
* %\i 0 - No error
* %\i -1 - Error with LogMsg() reports
* %\S
* @par WARNING
* %\i Any warnings relative to using this function...
*
* @par TESTING
* %\i A description of a testing procedure for the function
*
* @par AUTHOR
* %\i%(author)
*
* @par FILES
* %\i%\f
*
* @par SEE ALSO
*
**********************************************/
%(return) %(name)( ) {
%\istatic char func[] = "%(name)";
%\ireturn(OK);
} /* %(name) */
cppclass(classname "Class Name"
)
/**
@brief %\S
*/
class %(classname) {
public:
%\i%(classname)();
%\i%(classname)(const %(classname) & rhs);
%\i~%(classname)();
%\i%(classname) & operator=(const %(classname) & rhs);
protected:
private:
};
// Default Constructor
%(classname)::%(classname)()
{ }
// Copy constructor
%(classname)::%(classname)(const %(classname) & rhs)
{ }
// Operator ==
%(classname) & %(classname)::operator=(const %(classname) & rhs)
{
%\iif (this == &rhs)
%\i%\ireturn *this;
%\i// Perform a deep copy
%\i return *this;
}
// Destructor
%(classname)::~%(classname)()
{ }
doxyfilecomment /**
* @file %\S
* @brief %\c
* %\S
* @par Edit History
* %\i - [0] [<NAME>] %\d Initial Revision
* %\S
* @par Version:
* %\i $Id: $
* %\S
* @par Copyright © 2011 VG Bioinformatics, Inc. All rights reserved.
*/
/* 1 2 3 4 5 6 7 8 */
/*345678901234567890123456789012345678901234567890123456789012345678901234567890 */
%\l
/* system header files */
%\l
/* local header files */
%\l
=surround_with_struct struct {
%\m sur_text -indent%
} %\c;
=surround_with_static_cast static_cast<%\c>(%\m sur_text%)
=surround_with_new_c_file #include <stdio.h>
%\l
int main (int argc, char *argv[])
{
%\m sur_text -indent%
%\ireturn(0);
}
%\l
%\l
cppderivedclass(classname "Class Name"
baseclass "Base Class"
)
class %(classname) : public %(baseclass) {
public:
%\i%(classname)();
%\i%(classname)(const %(classname) & rhs);
%\i~%(classname)();
%\i%(classname) & operator=(const %(classname) & rhs);
protected:
private:
};
// Default Constructor
%(classname)::%(classname)()
{ }
// Copy constructor
%(classname)::%(classname)(const %(classname) & rhs)
:%(baseclass)(rhs)
{ }
// Operator ==
%(classname) & %(classname)::operator=(const %(classname) & rhs)
{
%\iif (this == &rhs)
%\i%\ireturn *this;
%\i// Call base class assignment operator
%\i%(baseclass)::operator=(rhs);
%\i// Perform a deep copy
%\i return *this;
}
// Destructor
%(classname)::~%(classname)()
{ }
=surround_with_switch switch (%\c) {
%\m sur_text%
}
=surround_with_do...while do {
%\m sur_text -indent%
} while (%\c);
=surround_with_case case %\c:
%\m sur_text -indent%
break;
=surround_with_try...catch try {
%\m sur_text -indent%
} catch (%\c) { %\S
}
=surround_with_for for (%\c) {
%\m sur_text -indent%
}
=surround_with_dynamic_cast dynamic_cast<%\c>(%\m sur_text%)
=surround_with_#if...else %\m begin_line%#if %\c
%\m sur_text%
%\m begin_line%#else
%\m sur_text%
%\m begin_line%#endif
=surround_with_while while (%\c) {
%\m sur_text -indent%
}
=surround_with_new_cpp_file #include <iostream>
%\l
using namespace std;
%\l
int main (int argc, char *argv[])
{
%\m sur_text -indent%
%\ireturn(0);
}
%\l
=surround_with_try try {
%\m sur_text -indent%
}
=surround_with_if...else if (%\c) {
%\m sur_text -indent%
} else {
%\m sur_text -indent%
}
=surround_with_if_condition if (%\m sur_text -stripend ;%) {
%\i%\c
}
cpputestmain /**
@file %\S
@brief Main program to run all tests with CppUTest framework
%\l
Standard main program used with CppUTest unit testing
framework. See: http://www.cpputest.org/
%\l
Created: %\d, %\t
%\l
Programmer: <NAME>
**************************************************/
%\l
#include "CppUTest/CommandLineTestRunner.h"
%\l
int main(int argc, char* argv[]) {
return RUN_ALL_TESTS(argc, argv);
}
%\l
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1885.asm | ljhsiun2/medusa | 9 | 174189 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xe87a, %r9
nop
nop
nop
nop
nop
sub %rbx, %rbx
movb $0x61, (%r9)
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x17869, %rdi
nop
nop
nop
nop
and %r12, %r12
mov (%rdi), %rax
add $1440, %r10
lea addresses_UC_ht+0x1b0a2, %r12
xor $19470, %rsi
movb $0x61, (%r12)
nop
nop
nop
nop
nop
dec %r12
lea addresses_WC_ht+0xd00a, %rsi
lea addresses_UC_ht+0x1403a, %rdi
nop
nop
nop
nop
nop
sub %r12, %r12
mov $33, %rcx
rep movsb
and %rsi, %rsi
lea addresses_WC_ht+0x1bf28, %rsi
lea addresses_D_ht+0x717a, %rdi
nop
nop
dec %r10
mov $20, %rcx
rep movsq
nop
nop
nop
nop
nop
and $20723, %rcx
lea addresses_A_ht+0xec4a, %rsi
lea addresses_D_ht+0x217a, %rdi
clflush (%rdi)
nop
add %rbx, %rbx
mov $57, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x63ac, %rsi
lea addresses_WT_ht+0xb8a2, %rdi
nop
nop
xor $31789, %rbx
mov $80, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_D_ht+0xcd0a, %rbx
nop
nop
nop
nop
dec %rcx
movb $0x61, (%rbx)
nop
nop
add %rsi, %rsi
lea addresses_normal_ht+0xa583, %rbx
nop
nop
nop
and $46183, %r12
mov $0x6162636465666768, %rsi
movq %rsi, (%rbx)
nop
nop
dec %rdi
lea addresses_WT_ht+0x19ffa, %rsi
lea addresses_A_ht+0x2d72, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp %r10, %r10
mov $88, %rcx
rep movsq
nop
nop
nop
nop
nop
xor $20965, %r10
lea addresses_normal_ht+0x2aea, %rsi
lea addresses_normal_ht+0xbd7a, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
sub $42622, %r10
mov $86, %rcx
rep movsq
nop
nop
nop
nop
add $40231, %rsi
lea addresses_UC_ht+0x1e57a, %rdi
nop
nop
nop
nop
nop
xor $5977, %rbx
movw $0x6162, (%rdi)
nop
nop
nop
add $23167, %rsi
lea addresses_normal_ht+0x94a, %r12
nop
nop
nop
nop
nop
sub %rax, %rax
movl $0x61626364, (%r12)
nop
nop
nop
nop
cmp $14544, %r9
lea addresses_WT_ht+0xe97a, %rdi
nop
nop
nop
nop
xor %r12, %r12
mov $0x6162636465666768, %r10
movq %r10, %xmm0
movups %xmm0, (%rdi)
nop
nop
nop
nop
nop
cmp $28701, %r12
lea addresses_WT_ht+0xb5a, %rsi
lea addresses_normal_ht+0x17622, %rdi
nop
cmp $38239, %r12
mov $105, %rcx
rep movsq
nop
add %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_normal+0x1107a, %rsi
nop
nop
nop
nop
and $10857, %r10
movw $0x5152, (%rsi)
nop
nop
add $16459, %r9
// Load
lea addresses_A+0x1dc3a, %rcx
clflush (%rcx)
cmp %rsi, %rsi
vmovups (%rcx), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r9
nop
add %r9, %r9
// REPMOV
lea addresses_WT+0x5f7a, %rsi
lea addresses_A+0x1d55a, %rdi
nop
nop
xor %r11, %r11
mov $110, %rcx
rep movsl
nop
xor $35339, %r13
// Faulty Load
lea addresses_RW+0x257a, %r10
nop
nop
nop
nop
inc %rcx
mov (%r10), %r13d
lea oracles, %r10
and $0xff, %r13
shlq $12, %r13
mov (%r10,%r13,1), %r13
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_RW', 'congruent': 0}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 5}}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT'}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 6}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'dst': {'same': True, 'congruent': 10, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'dst': {'same': True, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 2}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': True, 'congruent': 3, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 4}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, '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
*/
|
oeis/054/A054995.asm | neoneye/loda-programs | 11 | 48 | <filename>oeis/054/A054995.asm
; A054995: A version of Josephus problem: a(n) is the surviving integer under the following elimination process. Arrange 1,2,3,...,n in a circle, increasing clockwise. Starting with i=1, delete the integer two places clockwise from i. Repeat, counting two places from the next undeleted integer, until only one integer remains.
; 1,2,2,1,4,1,4,7,1,4,7,10,13,2,5,8,11,14,17,20,2,5,8,11,14,17,20,23,26,29,1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91
mov $2,1
lpb $0
sub $0,1
add $1,3
add $2,1
mod $1,$2
lpe
mov $0,$1
add $0,1
|
DE-LAB-1/main.asm | tustunkok/CMPE236-Labs | 0 | 170696 | ORG 00H
SJMP MAIN
ORG 30H
MAIN: MOV P2,#0FFH
MOV DPTR,#STRD
MOV A,P2
MOVC A,@A+DPTR
ORG 200H
STRD: DB 0,1,4,9,16,25
END |
alloy4fun_models/trashltl/models/2/4ZRouggouMCwutp7q.als | Kaixi26/org.alloytools.alloy | 0 | 2886 | <gh_stars>0
open main
pred id4ZRouggouMCwutp7q_prop3 {
some File
}
pred __repair { id4ZRouggouMCwutp7q_prop3 }
check __repair { id4ZRouggouMCwutp7q_prop3 <=> prop3o } |
Commands/User Interaction suite/display/display dialog/hidden answer/test.applescript | looking-for-a-job/applescript-examples | 1 | 1973 | <reponame>looking-for-a-job/applescript-examples
#!/usr/bin/osascript
display dialog "err" with icon stop
|
programs/oeis/166/A166446.asm | karttu/loda | 0 | 99441 | <gh_stars>0
; A166446: Periodic (1,1,1,1,0,0,-1,-1,-1,-1,0,0).
; 1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0,-1,-1,-1,-1,0,0,1,1,1,1,0,0
mul $0,2
sub $0,5
mov $1,1
lpb $0,1
sub $0,4
add $2,$1
sub $1,$2
lpe
|
source/nodes/program-nodes-goto_statements.adb | reznikmm/gela | 0 | 4575 | <gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Goto_Statements is
function Create
(Goto_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Goto_Label : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Goto_Statement is
begin
return Result : Goto_Statement :=
(Goto_Token => Goto_Token, Goto_Label => Goto_Label,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Goto_Label : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Goto_Statement is
begin
return Result : Implicit_Goto_Statement :=
(Goto_Label => Goto_Label, Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Goto_Label
(Self : Base_Goto_Statement)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Goto_Label;
end Goto_Label;
overriding function Goto_Token
(Self : Goto_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Goto_Token;
end Goto_Token;
overriding function Semicolon_Token
(Self : Goto_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Goto_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Goto_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Goto_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Goto_Statement'Class) is
begin
Set_Enclosing_Element (Self.Goto_Label, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Goto_Statement
(Self : Base_Goto_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Goto_Statement;
overriding function Is_Statement
(Self : Base_Goto_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Statement;
overriding procedure Visit
(Self : not null access Base_Goto_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Goto_Statement (Self);
end Visit;
overriding function To_Goto_Statement_Text
(Self : in out Goto_Statement)
return Program.Elements.Goto_Statements.Goto_Statement_Text_Access is
begin
return Self'Unchecked_Access;
end To_Goto_Statement_Text;
overriding function To_Goto_Statement_Text
(Self : in out Implicit_Goto_Statement)
return Program.Elements.Goto_Statements.Goto_Statement_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Goto_Statement_Text;
end Program.Nodes.Goto_Statements;
|
oeis/233/A233833.asm | neoneye/loda-programs | 11 | 167049 | ; A233833: a(n) = 3*binomial(7*n+3, n)/(7*n+3).
; Submitted by <NAME>
; 1,3,24,253,3045,39627,543004,7718340,112752783,1682460520,25533901536,392912889915,6116090678334,96133810101609,1523687678528400,24324750346691480,390786855500604195,6313161418594235271,102494297789621214400,1671366110239940499000,27363391487081311422600,449603508010894964369643,7411540152875384751394260,122541293586707499632735880,2031624358910364034767722850,33767280487296914299531521732,562543706406887566633810386576,9391806517658068351386440962333,157111471114013560333180761511896
mov $2,$0
mul $0,2
add $0,1
mov $1,$0
add $1,$2
mul $1,2
add $1,$2
bin $1,$2
div $1,$0
mov $0,$1
|
src/finiteSet.agda | shinji-kono/automaton-in-agda | 0 | 14763 | <reponame>shinji-kono/automaton-in-agda
{-# OPTIONS --allow-unsolved-metas #-}
module finiteSet where
open import Data.Nat hiding ( _≟_ )
open import Data.Fin renaming ( _<_ to _<<_ ) hiding (_≤_)
-- open import Data.Fin.Properties hiding ( ≤-refl )
open import Data.Empty
open import Relation.Nullary
open import Relation.Binary.Definitions
open import Relation.Binary.PropositionalEquality
open import logic
open import nat
open import Data.Nat.Properties hiding ( _≟_ )
open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ )
record FiniteSet ( Q : Set ) : Set where
field
finite : ℕ
Q←F : Fin finite → Q
F←Q : Q → Fin finite
finiso→ : (q : Q) → Q←F ( F←Q q ) ≡ q
finiso← : (f : Fin finite ) → F←Q ( Q←F f ) ≡ f
exists1 : (m : ℕ ) → m Data.Nat.≤ finite → (Q → Bool) → Bool
exists1 zero _ _ = false
exists1 ( suc m ) m<n p = p (Q←F (fromℕ< {m} {finite} m<n)) \/ exists1 m (<to≤ m<n) p
exists : ( Q → Bool ) → Bool
exists p = exists1 finite ≤-refl p
open import Data.List
list1 : (m : ℕ ) → m Data.Nat.≤ finite → (Q → Bool) → List Q
list1 zero _ _ = []
list1 ( suc m ) m<n p with bool-≡-? (p (Q←F (fromℕ< {m} {finite} m<n))) true
... | yes _ = Q←F (fromℕ< {m} {finite} m<n) ∷ list1 m (<to≤ m<n) p
... | no _ = list1 m (<to≤ m<n) p
to-list : ( Q → Bool ) → List Q
to-list p = list1 finite ≤-refl p
equal? : Q → Q → Bool
equal? q0 q1 with F←Q q0 ≟ F←Q q1
... | yes p = true
... | no ¬p = false
|
src/test/ref/examples/mega65/32bit-addressing-mega65.asm | jbrandwood/kickc | 2 | 81977 | <gh_stars>1-10
// 32-bit addressing using the new addressing mode
// Absolute 32-bit address to use for storing/loading data
.cpu _45gs02
// MEGA65 platform PRG executable starting in MEGA65 mode.
.file [name="32bit-addressing-mega65.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.segment Basic
.byte $0a, $20, $0a, $00, $fe, $02, $20, $30, $00 // 10 BANK 0
.byte $15, $20, $14, $00, $9e, $20 // 20 SYS
.text toIntString(__start) // NNNN
.byte $00, $00, $00 //
// The address of the coloir RAM in MEGA65 main memory
.const MEGA65_MEM_COLOR_RAM = $ff80000
.label ADDR32 = 2
.segment Code
__start: {
// volatile __zp unsigned long ADDR32
lda #<0
sta.z ADDR32
sta.z ADDR32+1
lda #<0>>$10
sta.z ADDR32+2
lda #>0>>$10
sta.z ADDR32+3
jsr main
rts
}
main: {
// ADDR32 = MEGA65_MEM_COLOR_RAM
// Modify Color Ram using 32-bit addressing
lda #<MEGA65_MEM_COLOR_RAM
sta.z ADDR32
lda #>MEGA65_MEM_COLOR_RAM
sta.z ADDR32+1
lda #<MEGA65_MEM_COLOR_RAM>>$10
sta.z ADDR32+2
lda #>MEGA65_MEM_COLOR_RAM>>$10
sta.z ADDR32+3
// asm
ldz #0
!:
tza
sta ((ADDR32)),z
inz
cpz #$50
bne !-
// ADDR32 = 0x00000800
// Modify Screen using 32-bit addressing
lda #<$800
sta.z ADDR32
lda #>$800
sta.z ADDR32+1
lda #<$800>>$10
sta.z ADDR32+2
lda #>$800>>$10
sta.z ADDR32+3
// asm
lda #'*'
ldz #$4f
!:
sta ((ADDR32)),z
dez
bpl !-
// }
rts
}
|
alloy4fun_models/trashltl/models/4/MRAe5B6FA3KGt9vrG.als | Kaixi26/org.alloytools.alloy | 0 | 3856 | open main
pred idMRAe5B6FA3KGt9vrG_prop5 {
eventually (#File' < #File)
}
pred __repair { idMRAe5B6FA3KGt9vrG_prop5 }
check __repair { idMRAe5B6FA3KGt9vrG_prop5 <=> prop5o } |
libsrc/_DEVELOPMENT/target/vgl/driver/terminal/vgl_01_output_2000/vgl_01_output_2000_iterm_msg_bell.asm | jpoikela/z88dk | 38 | 10847 |
INCLUDE "config_private.inc"
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC vgl_01_output_2000_iterm_msg_bell
EXTERN vgl_01_output_2000_oterm_msg_bell
defc vgl_01_output_2000_iterm_msg_bell = vgl_01_output_2000_oterm_msg_bell
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_28_826.asm | ljhsiun2/medusa | 9 | 103021 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_28_826.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x17041, %r9
add %r15, %r15
mov (%r9), %ebp
nop
nop
nop
add $9902, %rbx
lea addresses_A_ht+0x11061, %r12
cmp %r10, %r10
mov $0x6162636465666768, %r8
movq %r8, %xmm0
movups %xmm0, (%r12)
nop
nop
cmp $18183, %r8
lea addresses_UC_ht+0x1a61, %rbx
nop
nop
inc %r8
mov $0x6162636465666768, %r12
movq %r12, %xmm4
movups %xmm4, (%rbx)
and $45457, %r8
lea addresses_A_ht+0x5061, %r8
nop
add $6772, %r9
movb $0x61, (%r8)
cmp %r12, %r12
lea addresses_D_ht+0xc621, %rbx
clflush (%rbx)
add %r12, %r12
vmovups (%rbx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r15
nop
nop
nop
nop
dec %rbx
lea addresses_D_ht+0xdc69, %rsi
lea addresses_WT_ht+0x1b3c9, %rdi
nop
xor %r12, %r12
mov $106, %rcx
rep movsb
nop
nop
nop
nop
nop
add $12797, %r9
lea addresses_A_ht+0x12261, %rsi
lea addresses_UC_ht+0xf261, %rdi
nop
nop
xor $15163, %rbx
mov $86, %rcx
rep movsb
nop
nop
xor %rbx, %rbx
lea addresses_D_ht+0x15a61, %rbp
cmp %r9, %r9
mov $0x6162636465666768, %r8
movq %r8, (%rbp)
nop
nop
nop
add $58160, %rsi
lea addresses_WT_ht+0xd1d8, %r12
nop
nop
nop
nop
nop
sub %r15, %r15
movl $0x61626364, (%r12)
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_WC_ht+0xdbec, %rsi
lea addresses_D_ht+0x10281, %rdi
nop
nop
nop
and %r10, %r10
mov $69, %rcx
rep movsq
nop
nop
cmp %r9, %r9
lea addresses_A_ht+0xdda1, %rsi
lea addresses_D_ht+0xac1d, %rdi
nop
nop
sub %rbp, %rbp
mov $54, %rcx
rep movsq
nop
nop
inc %r12
lea addresses_WT_ht+0x7d2d, %r10
xor $6987, %rbp
mov $0x6162636465666768, %rdi
movq %rdi, (%r10)
nop
nop
nop
nop
lfence
lea addresses_normal_ht+0x9e61, %rsi
lea addresses_WT_ht+0x122e1, %rdi
nop
nop
xor $62232, %r10
mov $74, %rcx
rep movsb
nop
nop
dec %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r9
push %rdi
push %rsi
// Store
lea addresses_WC+0x11c52, %rdi
nop
nop
sub %r10, %r10
movb $0x51, (%rdi)
nop
nop
and $61629, %r13
// Store
lea addresses_normal+0x1e12d, %r10
nop
add $29059, %r12
mov $0x5152535455565758, %r13
movq %r13, %xmm3
movups %xmm3, (%r10)
nop
and %r13, %r13
// Load
lea addresses_normal+0xf7b0, %r9
sub $56725, %r12
movb (%r9), %r13b
nop
nop
nop
and $58555, %r12
// Store
lea addresses_D+0x1fea1, %r13
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %rdi
movq %rdi, (%r13)
nop
nop
nop
sub $59121, %rdi
// Load
lea addresses_D+0x1eee1, %rdi
nop
nop
sub %r13, %r13
mov (%rdi), %r9w
nop
nop
nop
nop
nop
cmp %r12, %r12
// Faulty Load
lea addresses_US+0xfa61, %rdi
nop
nop
nop
nop
and $25317, %rsi
mov (%rdi), %r14d
lea oracles, %r10
and $0xff, %r14
shlq $12, %r14
mov (%r10,%r14,1), %r14
pop %rsi
pop %rdi
pop %r9
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'00': 28}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
src/ui/trades-ui.adb | thindil/steamsky | 80 | 2867 | <gh_stars>10-100
-- Copyright (c) 2020-2021 <NAME> <<EMAIL>>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Containers.Vectors; use Ada.Containers;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with CArgv; use CArgv;
with Tcl; use Tcl;
with Tcl.Ada; use Tcl.Ada;
with Tcl.Tk.Ada; use Tcl.Tk.Ada;
with Tcl.Tk.Ada.Grid;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas;
with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu;
with Tcl.Tk.Ada.Widgets.Toplevel.MainWindow;
use Tcl.Tk.Ada.Widgets.Toplevel.MainWindow;
with Tcl.Tk.Ada.Widgets.TtkEntry; use Tcl.Tk.Ada.Widgets.TtkEntry;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox;
with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame;
with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel;
with Tcl.Tk.Ada.Widgets.TtkPanedWindow; use Tcl.Tk.Ada.Widgets.TtkPanedWindow;
with Tcl.Tk.Ada.Widgets.TtkScrollbar; use Tcl.Tk.Ada.Widgets.TtkScrollbar;
with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo;
with Bases.Cargo; use Bases.Cargo;
with BasesTypes; use BasesTypes;
with Config; use Config;
with CoreUI; use CoreUI;
with Crew; use Crew;
with Dialogs; use Dialogs;
with Events; use Events;
with Factions; use Factions;
with Game; use Game;
with Maps; use Maps;
with Maps.UI; use Maps.UI;
with Missions; use Missions;
with Ships.Cargo; use Ships.Cargo;
with Ships.Crew; use Ships.Crew;
with Table; use Table;
with Utils.UI; use Utils.UI;
package body Trades.UI is
-- ****iv* TUI/TUI.TradeTable
-- FUNCTION
-- Table with info about the available items to trade
-- SOURCE
TradeTable: Table_Widget (8);
-- ****
-- ****iv* TUI/TUI.Items_Indexes
-- FUNCTION
-- Indexes of the items for trade
-- SOURCE
Items_Indexes: Natural_Container.Vector;
-- ****
-- ****it* TUI/TUI.Items_Sort_Orders
-- FUNCTION
-- Sorting orders for the trading list
-- OPTIONS
-- NAMEASC - Sort items by name ascending
-- NAMEDESC - Sort items by name descending
-- TYPEASC - Sort items by type ascending
-- TYPEDESC - Sort items by type descending
-- DURABILITYASC - Sort items by durability ascending
-- DURABILITYDESC - Sort items by durability descending
-- PRICEASC - Sort items by price ascending
-- PRICEDESC - Sort items by price descending
-- PROFITASC - Sort items by profit ascending
-- PROFITDESC - Sort items by profit descending
-- WEIGHTASC - Sort items by weight ascending
-- WEIGHTDESC - Sort items by weight descending
-- OWNEDASC - Sort items by owned amount ascending
-- OWNEDDESC - Sort items by owned amount descending
-- AVAILABLEASC - Sort items by available amount ascending
-- AVAILABLEDESC - Sort items by available amount descending
-- NONE - No sorting modules (default)
-- HISTORY
-- 6.4 - Added
-- SOURCE
type Items_Sort_Orders is
(NAMEASC, NAMEDESC, TYPEASC, TYPEDESC, DURABILITYASC, DURABILITYDESC,
PRICEASC, PRICEDESC, PROFITASC, PROFITDESC, WEIGHTASC, WEIGHTDESC,
OWNEDASC, OWNEDDESC, AVAILABLEASC, AVAILABLEDESC, NONE) with
Default_Value => NONE;
-- ****
-- ****id* TUI/TUI.Default_Items_Sort_Order
-- FUNCTION
-- Default sorting order for the trading list
-- HISTORY
-- 6.4 - Added
-- SOURCE
Default_Items_Sort_Order: constant Items_Sort_Orders := NONE;
-- ****
-- ****iv* TUI/TUI.Items_Sort_Order
-- FUNCTION
-- The current sorting order for the trading list
-- HISTORY
-- 6.4 - Added
-- SOURCE
Items_Sort_Order: Items_Sort_Orders := Default_Items_Sort_Order;
-- ****
-- ****o* TUI/TUI.Show_Trade_Command
-- FUNCTION
-- Show information about trading
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command.
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowTrade ?itemtype? ?searchstring?
-- Itemtype is type of items to show, searchstring is string which is
-- looking for in items names
-- SOURCE
function Show_Trade_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Show_Trade_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData);
TradeFrame: Ttk_Frame := Get_Widget(Main_Paned & ".tradeframe", Interp);
TradeCanvas: constant Tk_Canvas :=
Get_Widget(TradeFrame & ".canvas", Interp);
Label: Ttk_Label :=
Get_Widget(TradeCanvas & ".trade.options.typelabel", Interp);
ItemType, ProtoIndex, BaseType, ItemName, TradeInfo,
ItemDurability: Unbounded_String;
ItemsTypes: Unbounded_String := To_Unbounded_String("All");
Price: Positive;
ComboBox: Ttk_ComboBox;
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
BaseCargo: BaseCargo_Container.Vector;
BaseCargoIndex, BaseAmount: Natural;
IndexesList: Positive_Container.Vector;
EventIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).EventIndex;
Profit: Integer;
MoneyIndex2: constant Natural :=
FindItem(Player_Ship.Cargo, Money_Index);
SearchEntry: constant Ttk_Entry :=
Get_Widget(TradeCanvas & ".trade.options.search", Interp);
Page: constant Positive :=
(if Argc = 4 then Positive'Value(CArgv.Arg(Argv, 3)) else 1);
Start_Row: constant Positive :=
((Page - 1) * Game_Settings.Lists_Limit) + 1;
Current_Row: Positive := 1;
Arguments: constant String :=
(if Argc > 2 then
"{" & CArgv.Arg(Argv, 1) & "} {" & CArgv.Arg(Argv, 2) & "}"
elsif Argc = 2 then CArgv.Arg(Argv, 1) & " {}" else "All {}");
Current_Item_Index: Positive := 1;
begin
if Winfo_Get(Label, "exists") = "0" then
Tcl_EvalFile
(Get_Context,
To_String(Data_Directory) & "ui" & Dir_Separator & "trade.tcl");
Bind(TradeFrame, "<Configure>", "{ResizeCanvas %W.canvas %w %h}");
TradeFrame := Get_Widget(TradeCanvas & ".trade");
TradeTable :=
CreateTable
(Widget_Image(TradeFrame),
(To_Unbounded_String("Name"), To_Unbounded_String("Type"),
To_Unbounded_String("Durability"), To_Unbounded_String("Price"),
To_Unbounded_String("Profit"), To_Unbounded_String("Weight"),
To_Unbounded_String("Owned"), To_Unbounded_String("Available")),
Get_Widget(Main_Paned & ".tradeframe.scrolly"), "SortTradeItems",
"Press mouse button to sort the items.");
elsif Winfo_Get(Label, "ismapped") = "1" and Argc = 1 then
Items_Sort_Order := Default_Items_Sort_Order;
Tcl.Tk.Ada.Grid.Grid_Remove(Close_Button);
configure(Close_Button, "-command ShowSkyMap");
Entry_Configure(GameMenu, "Help", "-command {ShowHelp general}");
if BaseIndex = 0 and EventIndex > 0 then
DeleteEvent(EventIndex);
end if;
ShowSkyMap(True);
return TCL_OK;
end if;
if Argc < 3 then
Delete(SearchEntry, "0", "end");
end if;
configure(Close_Button, "-command {ShowSkyMap ShowTrade}");
Entry_Configure(GameMenu, "Help", "-command {ShowHelp trade}");
TradeFrame.Name := New_String(TradeCanvas & ".trade");
ComboBox := Get_Widget(TradeFrame & ".options.type", Interp);
ClearTable(TradeTable);
if BaseIndex > 0 then
BaseType := Sky_Bases(BaseIndex).Base_Type;
BaseCargo := Sky_Bases(BaseIndex).Cargo;
else
BaseType := To_Unbounded_String("0");
BaseCargo := TraderCargo;
end if;
if Items_Sort_Order = Default_Items_Sort_Order then
Items_Indexes.Clear;
for I in Player_Ship.Cargo.Iterate loop
Items_Indexes.Append(Inventory_Container.To_Index(I));
end loop;
Items_Indexes.Append(0);
for I in BaseCargo.Iterate loop
Items_Indexes.Append(BaseCargo_Container.To_Index(I));
end loop;
end if;
Show_Cargo_Items_Loop :
for I of Items_Indexes loop
Current_Item_Index := Current_Item_Index + 1;
exit Show_Cargo_Items_Loop when I = 0;
if Get_Price(BaseType, Player_Ship.Cargo(I).ProtoIndex) = 0 then
goto End_Of_Cargo_Loop;
end if;
ProtoIndex := Player_Ship.Cargo(I).ProtoIndex;
BaseCargoIndex :=
Find_Base_Cargo(ProtoIndex, Player_Ship.Cargo(I).Durability);
if BaseCargoIndex > 0 then
IndexesList.Append(New_Item => BaseCargoIndex);
end if;
ItemType :=
(if Items_List(ProtoIndex).ShowType = Null_Unbounded_String then
Items_List(ProtoIndex).IType
else Items_List(ProtoIndex).ShowType);
if Index(ItemsTypes, To_String("{" & ItemType & "}")) = 0 then
Append(ItemsTypes, " {" & ItemType & "}");
end if;
if Argc > 1 and then CArgv.Arg(Argv, 1) /= "All"
and then To_String(ItemType) /= CArgv.Arg(Argv, 1) then
goto End_Of_Cargo_Loop;
end if;
ItemName :=
To_Unbounded_String
(GetItemName(Player_Ship.Cargo(I), False, False));
if Argc = 3
and then
Index
(To_Lower(To_String(ItemName)), To_Lower(CArgv.Arg(Argv, 2))) =
0 then
goto End_Of_Cargo_Loop;
end if;
if Current_Row < Start_Row then
Current_Row := Current_Row + 1;
goto End_Of_Cargo_Loop;
end if;
if BaseCargoIndex = 0 then
Price := Get_Price(BaseType, ProtoIndex);
else
Price :=
(if BaseIndex > 0 then
Sky_Bases(BaseIndex).Cargo(BaseCargoIndex).Price
else TraderCargo(BaseCargoIndex).Price);
end if;
if EventIndex > 0 then
if Events_List(EventIndex).EType = DoublePrice
and then Events_List(EventIndex).ItemIndex = ProtoIndex then
Price := Price * 2;
end if;
end if;
Profit := Price - Player_Ship.Cargo(I).Price;
BaseAmount := 0;
if BaseCargoIndex > 0 and Is_Buyable(BaseType, ProtoIndex) then
BaseAmount := BaseCargo(BaseCargoIndex).Amount;
end if;
AddButton
(TradeTable, To_String(ItemName), "Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 1);
AddButton
(TradeTable, To_String(ItemType), "Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 2);
ItemDurability :=
(if Player_Ship.Cargo(I).Durability < 100 then
To_Unbounded_String
(GetItemDamage(Player_Ship.Cargo(I).Durability))
else To_Unbounded_String("Unused"));
AddProgressBar
(TradeTable, Player_Ship.Cargo(I).Durability,
Default_Item_Durability, To_String(ItemDurability),
"ShowTradeMenu" & Positive'Image(I), 3);
AddButton
(TradeTable, Positive'Image(Price),
"Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 4);
AddButton
(Table => TradeTable, Text => Positive'Image(Profit),
Tooltip => "Show available options for item",
Command => "ShowTradeMenu" & Positive'Image(I), Column => 5,
Color =>
(if Profit > 0 then "green" elsif Profit < 0 then "red"
else ""));
AddButton
(TradeTable, Positive'Image(Items_List(ProtoIndex).Weight) & " kg",
"Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 6);
AddButton
(TradeTable, Positive'Image(Player_Ship.Cargo(I).Amount),
"Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 7);
AddButton
(TradeTable, Positive'Image(BaseAmount),
"Show available options for item",
"ShowTradeMenu" & Positive'Image(I), 8, True);
exit Show_Cargo_Items_Loop when TradeTable.Row =
Game_Settings.Lists_Limit + 1;
<<End_Of_Cargo_Loop>>
end loop Show_Cargo_Items_Loop;
Show_Trader_Items_Loop :
for I in Current_Item_Index .. Items_Indexes.Last_Index loop
exit Show_Trader_Items_Loop when TradeTable.Row =
Game_Settings.Lists_Limit + 1;
if IndexesList.Find_Index(Item => Items_Indexes(I)) > 0 or
not Is_Buyable
(Base_Type => BaseType,
Item_Index => BaseCargo(Items_Indexes(I)).Proto_Index,
Base_Index => BaseIndex) or
BaseCargo(Items_Indexes(I)).Amount = 0 then
goto End_Of_Trader_Loop;
end if;
ProtoIndex := BaseCargo(Items_Indexes(I)).Proto_Index;
ItemType :=
(if Items_List(ProtoIndex).ShowType = Null_Unbounded_String then
Items_List(ProtoIndex).IType
else Items_List(ProtoIndex).ShowType);
if Index(ItemsTypes, To_String("{" & ItemType & "}")) = 0 then
Append(ItemsTypes, " {" & ItemType & "}");
end if;
if Argc > 1 and then CArgv.Arg(Argv, 1) /= "All"
and then To_String(ItemType) /= CArgv.Arg(Argv, 1) then
goto End_Of_Trader_Loop;
end if;
ItemName := Items_List(ProtoIndex).Name;
if Argc = 3
and then
Index
(To_Lower(To_String(ItemName)), To_Lower(CArgv.Arg(Argv, 2))) =
0 then
goto End_Of_Trader_Loop;
end if;
if Current_Row < Start_Row then
Current_Row := Current_Row + 1;
goto End_Of_Trader_Loop;
end if;
Price :=
(if BaseIndex > 0 then
Sky_Bases(BaseIndex).Cargo(Items_Indexes(I)).Price
else TraderCargo(Items_Indexes(I)).Price);
if EventIndex > 0 then
if Events_List(EventIndex).EType = DoublePrice
and then Events_List(EventIndex).ItemIndex = ProtoIndex then
Price := Price * 2;
end if;
end if;
BaseAmount :=
(if BaseIndex = 0 then TraderCargo(Items_Indexes(I)).Amount
else Sky_Bases(BaseIndex).Cargo(Items_Indexes(I)).Amount);
AddButton
(TradeTable, To_String(ItemName), "Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
1);
AddButton
(TradeTable, To_String(ItemType), "Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
2);
ItemDurability :=
(if BaseCargo(Items_Indexes(I)).Durability < 100 then
To_Unbounded_String
(GetItemDamage(BaseCargo(Items_Indexes(I)).Durability))
else To_Unbounded_String("Unused"));
AddProgressBar
(TradeTable, BaseCargo(Items_Indexes(I)).Durability,
Default_Item_Durability, To_String(ItemDurability),
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
3);
AddButton
(TradeTable, Positive'Image(Price),
"Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
4);
AddButton
(TradeTable, Integer'Image(-(Price)),
"Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
5, False, "red");
AddButton
(TradeTable, Positive'Image(Items_List(ProtoIndex).Weight) & " kg",
"Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
6);
AddButton
(TradeTable, " 0", "Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
7);
AddButton
(TradeTable, Natural'Image(BaseAmount),
"Show available options for item",
"ShowTradeMenu -" & Trim(Positive'Image(Items_Indexes(I)), Left),
8, True);
<<End_Of_Trader_Loop>>
end loop Show_Trader_Items_Loop;
if Page > 1 then
if TradeTable.Row < Game_Settings.Lists_Limit + 1 then
AddPagination
(TradeTable, "ShowTrade " & Arguments & Positive'Image(Page - 1),
"");
else
AddPagination
(TradeTable, "ShowTrade " & Arguments & Positive'Image(Page - 1),
"ShowTrade " & Arguments & Positive'Image(Page + 1));
end if;
elsif TradeTable.Row = Game_Settings.Lists_Limit + 1 then
AddPagination
(TradeTable, "",
"ShowTrade " & Arguments & Positive'Image(Page + 1));
end if;
UpdateTable
(TradeTable, (if Focus = Widget_Image(SearchEntry) then False));
Tcl_Eval(Get_Context, "update");
configure(ComboBox, "-values [list " & To_String(ItemsTypes) & "]");
if Argc = 1 then
Current(ComboBox, "0");
end if;
if MoneyIndex2 > 0 then
TradeInfo :=
To_Unbounded_String
("You have" &
Natural'Image(Player_Ship.Cargo(MoneyIndex2).Amount) & " " &
To_String(Money_Name) & ".");
else
TradeInfo :=
To_Unbounded_String
("You don't have any " & To_String(Money_Name) &
" to buy anything.");
end if;
declare
FreeSpace: Integer := FreeCargo(0);
begin
if FreeSpace < 0 then
FreeSpace := 0;
end if;
Append
(TradeInfo,
LF & "Free cargo space:" & Integer'Image(FreeSpace) & " kg.");
end;
Label.Name := New_String(TradeFrame & ".options.playerinfo");
configure(Label, "-text {" & To_String(TradeInfo) & "}");
TradeInfo := Null_Unbounded_String;
if BaseIndex > 0 then
if Sky_Bases(BaseIndex).Cargo(1).Amount = 0 then
Append
(TradeInfo,
"Base doesn't have any " & To_String(Money_Name) &
"to buy anything.");
else
Append
(TradeInfo,
"Base has" &
Positive'Image(Sky_Bases(BaseIndex).Cargo(1).Amount) & " " &
To_String(Money_Name) & ".");
end if;
else
if TraderCargo(1).Amount = 0 then
Append
(TradeInfo,
"Ship doesn't have any " & To_String(Money_Name) &
"to buy anything.");
else
Append
(TradeInfo,
"Ship has" & Positive'Image(TraderCargo(1).Amount) & " " &
To_String(Money_Name) & ".");
end if;
end if;
Label.Name := New_String(TradeFrame & ".options.baseinfo");
configure(Label, "-text {" & To_String(TradeInfo) & "}");
Tcl.Tk.Ada.Grid.Grid(Close_Button, "-row 0 -column 1");
configure
(TradeCanvas,
"-height [expr " & SashPos(Main_Paned, "0") & " - 20] -width " &
cget(Main_Paned, "-width"));
Tcl_Eval(Get_Context, "update");
Canvas_Create
(TradeCanvas, "window", "0 0 -anchor nw -window " & TradeFrame);
Tcl_Eval(Get_Context, "update");
configure
(TradeCanvas, "-scrollregion [list " & BBox(TradeCanvas, "all") & "]");
Xview_Move_To(TradeCanvas, "0.0");
Yview_Move_To(TradeCanvas, "0.0");
Show_Screen("tradeframe");
Tcl_SetResult(Interp, "1");
return TCL_OK;
end Show_Trade_Command;
-- ****if* TUI/TUI.ItemIndex
-- FUNCTION
-- Index of the currently selected item
-- SOURCE
ItemIndex: Integer;
-- ****
-- ****o* TUI/TUI.Show_Trade_Item_Info_Command
-- FUNCTION
-- Show information about the selected item
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed. Unused
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command. Unused
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowTradeItemInfo
-- SOURCE
function Show_Trade_Item_Info_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Show_Trade_Item_Info_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Interp, Argc, Argv);
use Tiny_String;
ItemInfo, ProtoIndex: Unbounded_String;
CargoIndex, BaseCargoIndex: Natural := 0;
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
ItemTypes: constant array(1 .. 6) of Unbounded_String :=
(Weapon_Type, Chest_Armor, Head_Armor, Arms_Armor, Legs_Armor,
Shield_Type);
begin
if ItemIndex < 0 then
BaseCargoIndex := abs (ItemIndex);
else
CargoIndex := ItemIndex;
end if;
if CargoIndex > Natural(Player_Ship.Cargo.Length) then
return TCL_OK;
end if;
if BaseIndex = 0 and BaseCargoIndex > Natural(TraderCargo.Length) then
return TCL_OK;
elsif BaseIndex > 0
and then BaseCargoIndex >
Natural(Sky_Bases(BaseIndex).Cargo.Length) then
return TCL_OK;
end if;
if CargoIndex > 0 then
ProtoIndex := Player_Ship.Cargo(CargoIndex).ProtoIndex;
else
ProtoIndex :=
(if BaseIndex = 0 then TraderCargo(BaseCargoIndex).Proto_Index
else Sky_Bases(BaseIndex).Cargo(BaseCargoIndex).Proto_Index);
end if;
if Items_List(ProtoIndex).IType = Weapon_Type then
Append
(ItemInfo,
"Skill: " &
To_String
(SkillsData_Container.Element
(Skills_List, Items_List(ProtoIndex).Value(3))
.Name) &
"/" &
To_String
(AttributesData_Container.Element
(Attributes_List,
SkillsData_Container.Element
(Skills_List, Items_List(ProtoIndex).Value(3))
.Attribute)
.Name) &
(if Items_List(ProtoIndex).Value(4) = 1 then
LF & "Can be used with shield."
else LF & "Can't be used with shield (two-handed weapon).") &
LF & "Damage type: ");
case Items_List(ProtoIndex).Value(5) is
when 1 =>
Append(ItemInfo, "cutting");
when 2 =>
Append(ItemInfo, "impaling");
when 3 =>
Append(ItemInfo, "blunt");
when others =>
null;
end case;
end if;
Show_More_Info_Loop :
for ItemType of ItemTypes loop
if Items_List(ProtoIndex).IType = ItemType then
if ItemInfo /= Null_Unbounded_String then
Append(ItemInfo, LF);
end if;
Append
(ItemInfo,
"Damage chance: " &
GetItemChanceToDamage(Items_List(ProtoIndex).Value(1)) & LF &
"Strength:" & Integer'Image(Items_List(ProtoIndex).Value(2)));
exit Show_More_Info_Loop;
end if;
end loop Show_More_Info_Loop;
if Tools_List.Contains(Items_List(ProtoIndex).IType) then
if ItemInfo /= Null_Unbounded_String then
Append(ItemInfo, LF);
end if;
Append
(ItemInfo,
"Damage chance: " &
GetItemChanceToDamage(Items_List(ProtoIndex).Value(1)));
end if;
if Length(Items_List(ProtoIndex).IType) > 4
and then
(Slice(Items_List(ProtoIndex).IType, 1, 4) = "Ammo" or
Items_List(ProtoIndex).IType = To_Unbounded_String("Harpoon")) then
if ItemInfo /= Null_Unbounded_String then
Append(ItemInfo, LF);
end if;
Append
(ItemInfo,
"Strength:" & Integer'Image(Items_List(ProtoIndex).Value(1)));
end if;
if Items_List(ProtoIndex).Description /= Null_Unbounded_String then
if ItemInfo /= Null_Unbounded_String then
Append(ItemInfo, LF & LF);
end if;
Append(ItemInfo, Items_List(ProtoIndex).Description);
end if;
ShowInfo
(Text => To_String(ItemInfo),
Title => To_String(Items_List(ProtoIndex).Name));
return TCL_OK;
end Show_Trade_Item_Info_Command;
-- ****o* TUI/TUI.Trade_Item_Command
-- FUNCTION
-- Buy or sell the selected item
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- TradeItem tradetype
-- Tradetype is type of trade action. Can be buy, buymax, sell, sellmax
-- SOURCE
function Trade_Item_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Trade_Item_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
BaseCargoIndex, CargoIndex: Natural := 0;
Trader: String(1 .. 4);
ProtoIndex: Unbounded_String;
TypeBox: constant Ttk_ComboBox :=
Get_Widget
(Main_Paned & ".tradeframe.canvas.trade.options.type", Interp);
AmountBox: constant Ttk_SpinBox :=
Get_Widget(".itemdialog.amount", Interp);
begin
if ItemIndex < 0 then
BaseCargoIndex := abs (ItemIndex);
else
CargoIndex := ItemIndex;
end if;
if CargoIndex > 0 then
ProtoIndex := Player_Ship.Cargo(CargoIndex).ProtoIndex;
if BaseCargoIndex = 0 then
BaseCargoIndex := Find_Base_Cargo(ProtoIndex);
end if;
else
ProtoIndex :=
(if BaseIndex = 0 then TraderCargo(BaseCargoIndex).Proto_Index
else Sky_Bases(BaseIndex).Cargo(BaseCargoIndex).Proto_Index);
end if;
Trader := (if BaseIndex > 0 then "base" else "ship");
if Argc > 2 then
if CArgv.Arg(Argv, 1) in "buy" then
BuyItems(BaseCargoIndex, CArgv.Arg(Argv, 2));
else
SellItems(CargoIndex, CArgv.Arg(Argv, 2));
end if;
else
if CArgv.Arg(Argv, 1) in "buy" then
BuyItems(BaseCargoIndex, Get(AmountBox));
else
SellItems(CargoIndex, Get(AmountBox));
end if;
if Close_Dialog_Command
(ClientData, Interp, 2,
CArgv.Empty & "CloseDialog" & ".itemdialog") =
TCL_ERROR then
return TCL_ERROR;
end if;
end if;
UpdateHeader;
Update_Messages;
return
Show_Trade_Command
(ClientData, Interp, 2, CArgv.Empty & "ShowTrade" & Get(TypeBox));
exception
when An_Exception : Trade_Cant_Buy =>
ShowMessage
(Text =>
"You can't buy " & Exception_Message(An_Exception) &
" in this " & Trader & ".",
Title => "Can't buy items");
return TCL_OK;
when An_Exception : Trade_Not_For_Sale_Now =>
ShowMessage
(Text =>
"You can't buy " & Exception_Message(An_Exception) &
" in this base at this moment.",
Title => "Can't buy items");
return TCL_OK;
when An_Exception : Trade_Buying_Too_Much =>
ShowMessage
(Text =>
Trader & " don't have that much " &
Exception_Message(An_Exception) & " for sale.",
Title => "Not enough items");
return TCL_OK;
when Trade_No_Free_Cargo =>
ShowMessage
(Text => "You don't have that much free space in your ship cargo.",
Title => "No free cargo space");
return TCL_OK;
when An_Exception : Trade_No_Money =>
ShowMessage
(Text =>
"You don't have any " & To_String(Money_Name) & " to buy " &
Exception_Message(An_Exception) & ".",
Title => "No money to buy items");
return TCL_OK;
when An_Exception : Trade_Not_Enough_Money =>
ShowMessage
(Text =>
"You don't have enough " & To_String(Money_Name) &
" to buy so much " & Exception_Message(An_Exception) & ".",
Title => "Not enough money to buy items");
return TCL_OK;
when Trade_Invalid_Amount =>
if CArgv.Arg(Argv, 1) = "buy" then
ShowMessage
(Text => "You entered invalid amount to buy.",
Title => "Invalid amount of items");
else
ShowMessage
(Text => "You entered invalid amount to sell.",
Title => "Invalid amount of items");
end if;
return TCL_OK;
when An_Exception : Trade_Too_Much_For_Sale =>
ShowMessage
(Text =>
"You dont have that much " & Exception_Message(An_Exception) &
" in ship cargo.",
Title => "Not enough items for sale");
return TCL_OK;
when An_Exception : Trade_No_Money_In_Base =>
ShowMessage
(Text =>
"You can't sell so much " & Exception_Message(An_Exception) &
" because " & Trader & " don't have that much " &
To_String(Money_Name) & " to buy it.",
Title => "Too much items for sale");
return TCL_OK;
when Trade_No_Trader =>
ShowMessage
(Text =>
"You don't have assigned anyone in crew to talk in bases duty.",
Title => "No trader assigned");
return TCL_OK;
end Trade_Item_Command;
-- ****o* TUI/TUI.Search_Trade_Command
-- FUNCTION
-- Show only this items which contains the selected sequence
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SearchTrade
-- SOURCE
function Search_Trade_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Search_Trade_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(Argc);
TypeBox: constant Ttk_ComboBox :=
Get_Widget
(Main_Paned & ".tradeframe.canvas.trade.options.type", Interp);
SearchText: constant String := CArgv.Arg(Argv, 1);
begin
if SearchText'Length = 0 then
return
Show_Trade_Command
(ClientData, Interp, 2, CArgv.Empty & "ShowTrade" & Get(TypeBox));
end if;
return
Show_Trade_Command
(ClientData, Interp, 3,
CArgv.Empty & "ShowTrade" & Get(TypeBox) & SearchText);
end Search_Trade_Command;
-- ****o* TUI/TUI.Show_Trade_Menu_Command
-- FUNCTION
-- Show trade menu with buy/sell options for the selected item
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowTradeMenu itemindex
-- ItemIndex is the index of the item which menu will be show. If index
-- starts with minus means item in base/trader cargo only. Otherwise it is
-- index in the player ship cargo.
-- SOURCE
function Show_Trade_Menu_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Show_Trade_Menu_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argc);
TradeMenu: Tk_Menu := Get_Widget(".trademenu", Interp);
MoneyIndex2: constant Natural :=
FindItem(Player_Ship.Cargo, Money_Index);
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
BaseCargoIndex2, Price: Natural;
ProtoIndex, BaseType: Unbounded_String;
begin
ItemIndex := Integer'Value(CArgv.Arg(Argv, 1));
if Winfo_Get(TradeMenu, "exists") = "0" then
TradeMenu := Create(".trademenu", "-tearoff false");
end if;
Delete(TradeMenu, "0", "end");
BaseType :=
(if BaseIndex > 0 then Sky_Bases(BaseIndex).Base_Type
else To_Unbounded_String("0"));
if ItemIndex > 0 then
ProtoIndex := Player_Ship.Cargo(ItemIndex).ProtoIndex;
BaseCargoIndex2 := Find_Base_Cargo(ProtoIndex);
else
BaseCargoIndex2 := abs (ItemIndex);
ProtoIndex :=
(if BaseIndex = 0 then TraderCargo(BaseCargoIndex2).Proto_Index
else Sky_Bases(BaseIndex).Cargo(BaseCargoIndex2).Proto_Index);
end if;
if ItemIndex > 0 then
if BaseCargoIndex2 > 0 then
Price :=
(if BaseIndex > 0 then
Sky_Bases(BaseIndex).Cargo(BaseCargoIndex2).Price
else TraderCargo(BaseCargoIndex2).Price);
else
Price := Get_Price(BaseType, ProtoIndex);
end if;
else
Price :=
(if BaseIndex > 0 then
Sky_Bases(BaseIndex).Cargo(BaseCargoIndex2).Price
else TraderCargo(BaseCargoIndex2).Price);
end if;
declare
EventIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).EventIndex;
begin
if EventIndex > 0 then
if Events_List(EventIndex).EType = DoublePrice
and then Events_List(EventIndex).ItemIndex = ProtoIndex then
Price := Price * 2;
end if;
end if;
end;
if ItemIndex > 0 then
declare
MaxSellAmount: Integer := Player_Ship.Cargo(ItemIndex).Amount;
MaxPrice: Natural := MaxSellAmount * Price;
Weight: Integer;
begin
Count_Price(MaxPrice, FindMember(Talk), False);
if BaseIndex > 0
and then MaxPrice > Sky_Bases(BaseIndex).Cargo(1).Amount then
MaxSellAmount :=
Natural
(Float'Floor
(Float(MaxSellAmount) *
(Float(Sky_Bases(BaseIndex).Cargo(1).Amount) /
Float(MaxPrice))));
elsif BaseIndex = 0 and then MaxPrice > TraderCargo(1).Amount then
MaxSellAmount :=
Natural
(Float'Floor
(Float(MaxSellAmount) *
(Float(TraderCargo(1).Amount) / Float(MaxPrice))));
end if;
MaxPrice := MaxSellAmount * Price;
if MaxPrice > 0 then
Count_Price(MaxPrice, FindMember(Talk), False);
end if;
Weight :=
FreeCargo
((Items_List(ProtoIndex).Weight * MaxSellAmount) - MaxPrice);
Count_Sell_Amount_loop :
while Weight < 0 loop
MaxSellAmount :=
Integer
(Float'Floor
(Float(MaxSellAmount) *
(Float(MaxPrice + Weight) / Float(MaxPrice))));
exit Count_Sell_Amount_loop when MaxSellAmount < 1;
MaxPrice := MaxSellAmount * Price;
Count_Price(MaxPrice, FindMember(Talk), False);
Weight :=
FreeCargo
((Items_List(ProtoIndex).Weight * MaxSellAmount) -
MaxPrice);
end loop Count_Sell_Amount_loop;
if MaxSellAmount > 0 then
Menu.Add
(TradeMenu, "command",
"-label {Sell selected amount} -command {TradeAmount sell " &
Natural'Image(MaxSellAmount) & Natural'Image(Price) & "}");
Menu.Add
(TradeMenu, "command",
"-label {Sell" & Natural'Image(MaxSellAmount) &
" of them} -command {TradeItem sell" &
Natural'Image(MaxSellAmount) & "}");
end if;
end;
end if;
if BaseCargoIndex2 > 0 and MoneyIndex2 > 0 and
Is_Buyable(BaseType, ProtoIndex) then
declare
MaxBuyAmount: Integer :=
Player_Ship.Cargo(MoneyIndex2).Amount / Price;
MaxPrice: Natural := MaxBuyAmount * Price;
Weight: Integer;
begin
if MaxBuyAmount > 0 then
Count_Price(MaxPrice, FindMember(Talk));
if MaxPrice < (MaxBuyAmount * Price) then
MaxBuyAmount :=
Natural
(Float'Floor
(Float(MaxBuyAmount) *
((Float(MaxBuyAmount) * Float(Price)) /
Float(MaxPrice))));
end if;
if BaseIndex > 0
and then MaxBuyAmount >
Sky_Bases(BaseIndex).Cargo(BaseCargoIndex2).Amount then
MaxBuyAmount :=
Sky_Bases(BaseIndex).Cargo(BaseCargoIndex2).Amount;
elsif BaseIndex = 0
and then MaxBuyAmount >
TraderCargo(BaseCargoIndex2).Amount then
MaxBuyAmount := TraderCargo(BaseCargoIndex2).Amount;
end if;
MaxPrice := MaxBuyAmount * Price;
Count_Price(MaxPrice, FindMember(Talk));
Weight :=
FreeCargo
(MaxPrice - (Items_List(ProtoIndex).Weight * MaxBuyAmount));
Count_Buy_Amount_Loop :
while Weight < 0 loop
MaxBuyAmount :=
MaxBuyAmount + (Weight / Items_List(ProtoIndex).Weight) -
1;
if MaxBuyAmount < 0 then
MaxBuyAmount := 0;
end if;
exit Count_Buy_Amount_Loop when MaxBuyAmount = 0;
MaxPrice := MaxBuyAmount * Price;
Count_Price(MaxPrice, FindMember(Talk));
Weight :=
FreeCargo
(MaxPrice -
(Items_List(ProtoIndex).Weight * MaxBuyAmount));
end loop Count_Buy_Amount_Loop;
if MaxBuyAmount > 0 then
Menu.Add
(TradeMenu, "command",
"-label {Buy selected amount} -command {TradeAmount buy" &
Natural'Image(MaxBuyAmount) & Natural'Image(Price) & "}");
Menu.Add
(TradeMenu, "command",
"-label {Buy" & Natural'Image(MaxBuyAmount) &
" of them} -command {TradeItem buy" &
Natural'Image(MaxBuyAmount) & "}");
end if;
end if;
end;
end if;
Menu.Add
(TradeMenu, "command",
"-label {Show more info about the item} -command ShowTradeItemInfo");
Tk_Popup
(TradeMenu, Winfo_Get(Get_Main_Window(Interp), "pointerx"),
Winfo_Get(Get_Main_Window(Interp), "pointery"));
return TCL_OK;
end Show_Trade_Menu_Command;
-- ****o* TUI/TUI.Trade_Amount_Command
-- FUNCTION
-- Show dialog to enter amount of items to sell or buy
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed. Unused
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command. Unused
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- TradeAmount action baseindex
-- Action which will be taken. Can be buy or sell. BaseIndex is the index
-- of the base from which item will be bought. If zero it mean buying from
-- trader ship.
-- SOURCE
function Trade_Amount_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Trade_Amount_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Interp, Argc);
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
begin
if CArgv.Arg(Argv, 1) = "sell" then
ShowManipulateItem
("Sell " & GetItemName(Player_Ship.Cargo(ItemIndex)),
"TradeItem sell", "sell", ItemIndex,
Natural'Value(CArgv.Arg(Argv, 2)),
Natural'Value(CArgv.Arg(Argv, 3)));
else
if ItemIndex > 0 then
ShowManipulateItem
("Buy " & GetItemName(Player_Ship.Cargo(ItemIndex)),
"TradeItem buy", "buy", ItemIndex,
Natural'Value(CArgv.Arg(Argv, 2)),
Natural'Value(CArgv.Arg(Argv, 3)));
else
if BaseIndex > 0 then
ShowManipulateItem
("Buy " &
To_String
(Items_List
(Sky_Bases(BaseIndex).Cargo(abs (ItemIndex))
.Proto_Index)
.Name),
"TradeItem buy", "buy", abs (ItemIndex),
Natural'Value(CArgv.Arg(Argv, 2)),
Natural'Value(CArgv.Arg(Argv, 3)));
else
ShowManipulateItem
("Buy " &
To_String
(Items_List(TraderCargo(abs (ItemIndex)).Proto_Index)
.Name),
"TradeItem buy", "buy", abs (ItemIndex),
Natural'Value(CArgv.Arg(Argv, 2)),
Natural'Value(CArgv.Arg(Argv, 3)));
end if;
end if;
end if;
return TCL_OK;
end Trade_Amount_Command;
-- ****o* TUI/TUI.Sort_Items_Command
-- FUNCTION
-- Sort the trading list
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SortTradeItems x
-- X is X axis coordinate where the player clicked the mouse button
-- SOURCE
function Sort_Items_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Sort_Items_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(Argc);
Column: constant Positive :=
Get_Column_Number(TradeTable, Natural'Value(CArgv.Arg(Argv, 1)));
type Local_Item_Data is record
Name: Unbounded_String;
IType: Unbounded_String;
Damage: Float;
Price: Natural;
Profit: Integer;
Weight: Positive;
Owned: Natural;
Available: Natural;
Id: Positive;
end record;
BaseIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).BaseIndex;
Indexes_List: Positive_Container.Vector;
BaseCargo: BaseCargo_Container.Vector;
BaseCargoIndex, Price: Natural;
ProtoIndex, BaseType: Unbounded_String;
EventIndex: constant Natural :=
SkyMap(Player_Ship.Sky_X, Player_Ship.Sky_Y).EventIndex;
package Items_Container is new Vectors
(Index_Type => Positive, Element_Type => Local_Item_Data);
Local_Items: Items_Container.Vector;
function "<"(Left, Right: Local_Item_Data) return Boolean is
begin
if Items_Sort_Order = NAMEASC and then Left.Name < Right.Name then
return True;
end if;
if Items_Sort_Order = NAMEDESC and then Left.Name > Right.Name then
return True;
end if;
if Items_Sort_Order = TYPEASC and then Left.IType < Right.IType then
return True;
end if;
if Items_Sort_Order = TYPEDESC and then Left.IType > Right.IType then
return True;
end if;
if Items_Sort_Order = DURABILITYASC
and then Left.Damage < Right.Damage then
return True;
end if;
if Items_Sort_Order = DURABILITYDESC
and then Left.Damage > Right.Damage then
return True;
end if;
if Items_Sort_Order = PRICEASC and then Left.Price < Right.Price then
return True;
end if;
if Items_Sort_Order = PRICEDESC and then Left.Price > Right.Price then
return True;
end if;
if Items_Sort_Order = PROFITASC
and then Left.Profit < Right.Profit then
return True;
end if;
if Items_Sort_Order = PROFITDESC
and then Left.Profit > Right.Profit then
return True;
end if;
if Items_Sort_Order = WEIGHTASC
and then Left.Weight < Right.Weight then
return True;
end if;
if Items_Sort_Order = WEIGHTDESC
and then Left.Weight > Right.Weight then
return True;
end if;
if Items_Sort_Order = OWNEDASC and then Left.Owned < Right.Owned then
return True;
end if;
if Items_Sort_Order = OWNEDDESC and then Left.Owned > Right.Owned then
return True;
end if;
if Items_Sort_Order = AVAILABLEASC
and then Left.Available < Right.Available then
return True;
end if;
if Items_Sort_Order = AVAILABLEDESC
and then Left.Available > Right.Available then
return True;
end if;
return False;
end "<";
package Sort_Items is new Items_Container.Generic_Sorting;
begin
case Column is
when 1 =>
if Items_Sort_Order = NAMEASC then
Items_Sort_Order := NAMEDESC;
else
Items_Sort_Order := NAMEASC;
end if;
when 2 =>
if Items_Sort_Order = TYPEASC then
Items_Sort_Order := TYPEDESC;
else
Items_Sort_Order := TYPEASC;
end if;
when 3 =>
if Items_Sort_Order = DURABILITYASC then
Items_Sort_Order := DURABILITYDESC;
else
Items_Sort_Order := DURABILITYASC;
end if;
when 4 =>
if Items_Sort_Order = PRICEASC then
Items_Sort_Order := PRICEDESC;
else
Items_Sort_Order := PRICEASC;
end if;
when 5 =>
if Items_Sort_Order = PROFITASC then
Items_Sort_Order := PROFITDESC;
else
Items_Sort_Order := PROFITASC;
end if;
when 6 =>
if Items_Sort_Order = WEIGHTASC then
Items_Sort_Order := WEIGHTDESC;
else
Items_Sort_Order := WEIGHTASC;
end if;
when 7 =>
if Items_Sort_Order = OWNEDASC then
Items_Sort_Order := OWNEDDESC;
else
Items_Sort_Order := OWNEDASC;
end if;
when 8 =>
if Items_Sort_Order = AVAILABLEASC then
Items_Sort_Order := AVAILABLEDESC;
else
Items_Sort_Order := AVAILABLEASC;
end if;
when others =>
null;
end case;
if Items_Sort_Order = Default_Items_Sort_Order then
return TCL_OK;
end if;
if BaseIndex > 0 then
BaseCargo := Sky_Bases(BaseIndex).Cargo;
BaseType := Sky_Bases(BaseIndex).Base_Type;
else
BaseCargo := TraderCargo;
BaseType := To_Unbounded_String("0");
end if;
for I in Player_Ship.Cargo.Iterate loop
ProtoIndex := Player_Ship.Cargo(I).ProtoIndex;
BaseCargoIndex :=
Find_Base_Cargo(ProtoIndex, Player_Ship.Cargo(I).Durability);
if BaseCargoIndex > 0 then
Indexes_List.Append(New_Item => BaseCargoIndex);
Price := BaseCargo(BaseCargoIndex).Price;
else
Price := Get_Price(BaseType, ProtoIndex);
end if;
if EventIndex > 0 then
if Events_List(EventIndex).EType = DoublePrice
and then Events_List(EventIndex).ItemIndex = ProtoIndex then
Price := Price * 2;
end if;
end if;
Local_Items.Append
(New_Item =>
(Name => To_Unbounded_String(GetItemName(Player_Ship.Cargo(I))),
IType =>
(if Items_List(ProtoIndex).ShowType = Null_Unbounded_String
then Items_List(ProtoIndex).IType
else Items_List(ProtoIndex).ShowType),
Damage =>
Float(Player_Ship.Cargo(I).Durability) /
Float(Default_Item_Durability),
Price => Price, Profit => Price - Player_Ship.Cargo(I).Price,
Weight => Items_List(ProtoIndex).Weight,
Owned => Player_Ship.Cargo(I).Amount,
Available =>
(if BaseCargoIndex > 0 then BaseCargo(BaseCargoIndex).Amount
else 0),
Id => Inventory_Container.To_Index(I)));
end loop;
Sort_Items.Sort(Local_Items);
Items_Indexes.Clear;
for Item of Local_Items loop
Items_Indexes.Append(Item.Id);
end loop;
Items_Indexes.Append(0);
Local_Items.Clear;
for I in BaseCargo.First_Index .. BaseCargo.Last_Index loop
if Indexes_List.Find_Index(Item => I) = 0 then
ProtoIndex := BaseCargo(I).Proto_Index;
Price := BaseCargo(I).Price;
if EventIndex > 0 then
if Events_List(EventIndex).EType = DoublePrice
and then Events_List(EventIndex).ItemIndex = ProtoIndex then
Price := Price * 2;
end if;
end if;
Local_Items.Append
(New_Item =>
(Name => Items_List(ProtoIndex).Name,
IType =>
(if Items_List(ProtoIndex).ShowType = Null_Unbounded_String
then Items_List(ProtoIndex).IType
else Items_List(ProtoIndex).ShowType),
Damage =>
Float(BaseCargo(I).Durability) /
Float(Default_Item_Durability),
Price => Price, Profit => -(Price),
Weight => Items_List(ProtoIndex).Weight, Owned => 0,
Available => BaseCargo(I).Amount, Id => I));
end if;
end loop;
Sort_Items.Sort(Local_Items);
for Item of Local_Items loop
Items_Indexes.Append(Item.Id);
end loop;
return
Show_Trade_Command
(ClientData, Interp, 2, CArgv.Empty & "ShowTrade" & "All");
end Sort_Items_Command;
procedure AddCommands is
begin
Add_Command("ShowTrade", Show_Trade_Command'Access);
Add_Command("ShowTradeItemInfo", Show_Trade_Item_Info_Command'Access);
Add_Command("TradeItem", Trade_Item_Command'Access);
Add_Command("SearchTrade", Search_Trade_Command'Access);
Add_Command("ShowTradeMenu", Show_Trade_Menu_Command'Access);
Add_Command("TradeAmount", Trade_Amount_Command'Access);
Add_Command("SortTradeItems", Sort_Items_Command'Access);
end AddCommands;
end Trades.UI;
|
src/main/antlr/org/trade/core/query/antlr/Query.g4 | traDE4chor/trade-query-language | 0 | 4497 | /*
* Copyright 2017 <NAME>
*
* 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.
*/
grammar Query;
@header {
package org.trade.core.query.antlr;
}
/*
Grammar of a simple query language for the TraDE Middleware which allows users to reference resources and/or their
properties through a corresponding query string.
Author: <NAME>
Version: 1.0
*/
/*
* Parser Rules
*/
query : data_object_reference ('/' data_element_reference ('/' data_value_selection)?)? ('?' property_selection)? EOF ;
data_object_reference : REFERENCE_NAME ;
data_element_reference : REFERENCE_NAME ;
data_value_selection : 'value' ('[' index ']')? ;
property_selection : 'size' | 'url' ;
index : INDEX | 'first' | 'last';
/*
* Lexer Rules
*/
/*
* Introduce character fragments to allow lower and uppercase (or even mixed) writing of keywords
*/
fragment DIGIT : [0-9] ;
fragment REFERENCE_CHAR : REFERENCE_START_CHAR | DIGIT | '_' | '-' | '[]' | '#' ;
fragment REFERENCE_START_CHAR : [a-zA-Z] ;
REFERENCE_NAME : REFERENCE_START_CHAR REFERENCE_CHAR* ;
INDEX : [1-9] DIGIT* ; |
restar.asm | matialmar7/calculadoraASM | 0 | 81395 | <reponame>matialmar7/calculadoraASM
segment .text
global _restar
_restar:
enter 0,0 ; make room for sub on stack
mov eax, [ebp+8] ; eax = A
sub eax, [ebp+12] ; eax = eax - B
leave
ret |
sbsext/tk2/da.asm | olifink/smsqe | 0 | 246945 | <gh_stars>0
* Direct access file handling V0.9 1984/1985 <NAME> QJUMP
*
* GET #n [\pointer] {,variable} get value(s) from file
* BGET #n [\pointer] {,variable} get unsigned byte(s) from file
* WGET #n [\pointer] {,variable} get unsigned word(s) from file
* LGET #n [\pointer] {,variable} get signed long word(s) from file
* HGET #n {,variable} get values from header
* PUT #n [\pointer] {,value} put values(s) to file
* BPUT #n [\pointer] {,value} put unsigned byte(s) to file
* UPUT #n [\pointer] {,value} as BPUT but untranslated
* WPUT #n [\pointer] {,value} put unsigned word(s) to file
* LPUT #n [\pointer] {,value} put signed long word(s) to file
* HPUT #n {,value} put values to header
* TRUNCATE #n [\pointer] truncate file
* FLUSH #n flush file
* FPOS (#n) function to find current file pointer
*
section exten
*
xdef get
xdef bget
xdef wget
xdef lget
xdef hget
xdef put
xdef bput
xdef uput
xdef wput
xdef lput
xdef hput
xdef truncate
xdef flush
xdef fpos
*
xref ut_chkri check RI stack
xref ut_ckri6 ... for 6 bytes
xref ut_chan get #channel
xref ut_gtli1 get one long integer
xref ut_gtlin get long integers
xref ut_lfloat float d1 onto RI stack
xref ut_retfp return floating point
xref ut_trp3r trap #3 relative
xref ut_fhead get file header
*
include 'dev8_keys_qlv'
include 'dev8_keys_err'
include 'dev8_keys_sbasic'
include 'dev8_keys_qdos_io'
* The HGET and HPUT procedures are not really part of the DA routines but are
* here for convenience
*
hget
bsr.s hda_chan get channel
bne.s hda_rts
jsr ut_fhead get header
bne.s hda_rts ... oops
moveq #20,d1
jsr ut_chkri get space on stack
move.l sb_buffb(a6),a0
lea 14(a6,a0.l),a0 pointer to end of set header values
add.l a6,a1
move.l -(a0),-(a1) extra
move.l -(a0),-(a1) data
bsr.s hg_moveb type
bsr.s hg_moveb access
move.l -(a0),-(a1) length
sub.l a6,a1
move.l a1,sb_arthp(a6) set arithmetic stack pointer
hg_loop
cmp.l a3,a5 another parameter?
ble.s hg_ok
move.w #$0f0f,d0
and.w (a6,a3.l),d0 type?
beq.s hg_skip
moveq #qa.fltli,d0 float it
move.w qa.op,a2
jsr (a2)
move.l a1,sb_arthp(a6)
move.w sb.putp,a2
jsr (a2) assign value
bra.s hg_eloop
hg_skip
addq.l #4,a1
hg_eloop
addq.l #8,a3
bra.s hg_loop
hg_ok
moveq #0,d0
hda_rts
rts
hg_moveb
move.b -(a0),d0
ext.w d0
ext.l d0
move.l d0,-(a1)
rts
hda_chan
moveq #3,d6 default channel 3
jmp ut_chan get channel id
hput
bsr.s hda_chan get channel
bne.s hda_rts
jsr ut_gtlin get long integers
bne.s hda_rts
cmp.w #5,d3 more than 5?
bhi.s hda_bp
move.l sb_buffb(a6),a2
lea 20(a6,a2.l),a4 preset 5
clr.l -(a4)
clr.l -(a4)
clr.l -(a4)
clr.l -(a4)
clr.l -(a4) clear the header
add.l a6,a1
bra.s hp_eloop
hp_loop
move.l (a1)+,(a4)+
hp_eloop
dbra d3,hp_loop
lea 4(a6,a2.l),a1
lea (a1),a4
move.l (a1)+,d0 two of the items are bytes
move.b d0,(a4)+
move.l (a1)+,d0
move.b d0,(a4)+
move.l (a1)+,(a4)+
move.l (a1)+,(a4)+
move.l a2,a1
moveq #iof.shdr,d0
jmp ut_trp3r ... set header
hda_bp
moveq #err.ipar,d0
rts
*
vv_ptr equ $08 position of pointer to vv area on stack
parm_top equ $04 position of stored a5 on stack
chan_id equ $00 position of channel id on stack
*
* get items from a file
*
get
bsr.l chan_set
get_loop
bsr.l ut_ckri6 check for a little bit of room on the ri stack
bsr.l type_set get type of next
bgt.s get_int ... integer
beq.s get_fp ... floating point
tst.b 1(a6,a3.l) is it substring?
beq.l file_bp ... yes
*
moveq #2,d2 get length of string
move.l sb_arthp(a6),a1
bsr.l fstrg_push
bne.l exit_12 oops
move.w (a6,a1.l),d4 save it
blt.s get_lchk ... oops
moveq #0,d1
move.w d4,d1 round up to nearest even word
addq.w #3,d1 (+2)
bclr #0,d1
move.l d1,d5 save rounded value
bsr.l ut_chkri check for room for string
suba.w d5,a1 move stack pointer down
move.w d4,(a6,a1.l) and put length in
move.w d4,d2 fetch characters of string
beq.s get_let ... none
addq.l #2,a1
bsr.l fstrg
subq.l #2,a1 and include string length in return value
bra.s get_lchk
*
get_fp
moveq #6,d2 get six bytes
bsr.l fstrg_push
bne.s get_lchk
and.b #$f,(a6,a1.l) mask out top end rubbish
bra.s get_let
*
get_int
moveq #2,d2 get two bytes
bsr.l fstrg_push push bytes onto a1
*
get_lchk
bne.l exit_12 was there a read error?
get_let
move.l a1,sb_arthp(a6) set stack pointer
move.w sb.putp,a2
jsr (a2) and assign value
addq.l #8,a3 move to next parameter
bra.s get_loop carry on
*
* get a byte (or bytes into a string) and convert to fp if necessary
*
bget
bsr.l chan_set set up channel id etc.
bget_loop
bsr.l ut_ckri6 check for room for 1 fp
bsr.l type_set find type
bge.s bget_type
addq.b #2,d1 was it substring array?
bne.l file_bp ... won't do string
move.w 6(a6,a1.l),d2 length to fetch
move.l (a6,a1.l),a1 and where to put it
add.l sb_datab(a6),a1
bsr.l fstrg fetch it
addq.l #8,a3 move to next parameter
bra.s bget_loop
bget_type
move.b d1,d6 save type flag
moveq #1,d2 get one byte
bsr.l fstrg_push
bne.l exit_12 oops
subq.l #1,a1 and put a zero byte on the stack
clr.b (a6,a1.l)
tst.b d6 was fp required?
bgt.s bget_let ... no
moveq #qa.float,d0 ... yes, float it
move.w qa.op,a2
jsr (a2)
bget_let
move.l a1,sb_arthp(a6) set arithmetic stack pointer
move.w sb.putp,a2
jsr (a2) assign value
addq.l #8,a3 move to next parameter
bra.s bget_loop
*
* get a word and convert to fp if necessary
*
wget
bsr.l chan_set set up channel id etc.
wget_loop
bsr.l ut_ckri6 check for room for 1 fp
bsr.l type_set find type
blt.l file_bp ... string
move.b d1,d6 save type flag
moveq #2,d2 get two bytes
bsr.l fstrg_push
bne.l exit_12 oops
tst.b d6 was fp required?
bgt.s wget_let ... no
subq.l #2,a1
clr.w (a6,a1.l) ... yes, make long
moveq #qa.fltli,d0 and float it
move.w qa.op,a2
jsr (a2)
wget_let
move.l a1,sb_arthp(a6) set arithmetic stack pointer
move.w sb.putp,a2
jsr (a2) assign value
addq.l #8,a3 move to next parameter
bra.s wget_loop
*
* get a long and convert to fp
*
lget
bsr.l chan_set set up channel id etc.
lget_loop
bsr.l ut_ckri6 check for room for 1 fp
bsr.l type_set find type
bne.l file_bp ... not float
moveq #4,d2 get four bytes
bsr.l fstrg_push
bne.l exit_12 oops
bgt.s wget_let ... no
moveq #qa.fltli,d0 ... yes, float it
move.w qa.op,a2
jsr (a2)
move.l a1,sb_arthp(a6) set arithmetic stack pointer
move.w sb.putp,a2
jsr (a2) assign value
addq.l #8,a3 move to next parameter
bra.s lget_loop
*
* put data onto file
*
put
bsr.l chan_set set up the channel id etc.
put_loop
bsr.l type_set find the type
beq.s put_fp floating point
bgt.s put_int integer
*
move.w sb.gtstr,a2 get a string
bsr.l put_on_a1 just one
move.l #'ST ',d2 flag as string
move.w (a6,a1.l),d2 find length
addq.w #2,d2 and put length and string on file
bra.s put_file
put_fp
move.w sb.gtfp,a2 get a floating point
bsr.l put_on_a1 just one
moveq #6,d2 and put 6 bytes on file
bra.s put_file
put_int
move.w sb.gtint,a2 get an integer
bsr.l put_on_a1 just one
moveq #2,d2 and put 2 bytes on file
put_file
bsr.l sstrg put bytes on file
bra.s put_loop carry on
*
* put bytes to file untranslated
*
uput
bsr.l chan_set set up the channel id etc.
lea sustrg,a4
bra.s bput_loop
*
* put bytes to the file
*
bput
bsr.l chan_set set up channel id etc.
lea sstrg,a4
bput_loop
cmpa.l parm_top(sp),a3 end of list?
beq.l exit_pos yes (d0 already set)
moveq #$0f,d1
and.w (a6,a3.l),d1 type
subq.w #1,d1 string?
bne.s bput_byte ... no
move.w sb.gtstr,a2 get a string
bsr.l put_on_a1
move.w (a6,a1.l),d2 ... number to send
addq.l #2,a1
bra.s bput_do
bput_byte
move.w sb.gtint,a2 get an integer
bsr.l put_on_a1 just one
tst.b (a6,a1.l) msbyte must be zero
beq.s bput_file good
moveq #err.ovfl,d0 no, call it overflow
bra.l exit_12
bput_file
addq.l #1,a1 just the lsbyte
moveq #1,d2
bput_do
jsr (a4) onto the file
bra.s bput_loop
*
* put words to the file
*
wput
bsr.l chan_set set up channel id etc.
jsr ut_gtlin get long integers
bne.l exit_12
bra.s wput_le
wput_loop
moveq #2,d2
addq.w #2,a1 lsword only
bsr.l sstrg
addq.l #2,a1 ... next long word
wput_le
dbra d3,wput_loop
bra.s exit_pos
*
* put long words to the file
*
lput
bsr.l chan_set set up channel id etc.
jsr ut_gtlin get long integers
bne.s exit_12
moveq #0,d2
move.w d3,d2
lsl.l #2,d2 number of bytes in longs
bsr.l sstrg onto the file
bra.s exit_pos
*
* truncate
*
truncate
moveq #iof.trnc,d5 truncate
bra.s da_action
*
* flush
*
flush
moveq #iof.flsh,d5 flush
da_action
bsr.l chan_set set up channel id etc
cmp.l parm_top(sp),a3 there should be no other parameters
bne.s file_bp
move.l d5,d0 do action
bsr.s trap4_3 do trap
bra.s exit_12
*
* get file pointer
*
fpos
bsr.s chan_set set up channel id etc
cmp.l parm_top(sp),a3 there should be no other parameters
bne.s file_bp
bsr.l ut_ckri6 make room on stack for return value (fp)
move.l a1,d7 save ri stack pointer
bsr.s get_pos
bsr.l ut_retfp return a floating point
bra.s exit_12
*
get_pos
moveq #iof.posr,d0 position file relative
moveq #0,d1 by no bytes
moveq #0,d3 and return immediately
move.l 4+chan_id(sp),a0 set channel id
trap #3
move.l d7,a1 restore ri stack pointer
tst.l d0 ok?
beq.s pos_ok yes
moveq #err.nc,d2 not complete is quite normal
cmp.l d2,d0
beq.s pos_ok
moveq #err.eof,d2 end of file is still ok
cmp.l d2,d0
bne.s exit_16 no, it is not end of file
pos_ok
bsr.l ut_lfloat float d1 onto stack
moveq #0,d0 set no error
rts
*
exit_pos
move.l vv_ptr(sp),d7 get the pointer to the pointer variable
blt.s exit_12 ... not there
add.l sb_datab(a6),d7 add base of vv area
addq.l #6,d7 pretend this is the ri stack!!
bsr.s get_pos get the position
bra.s exit_12 and exit
*
file_bp
moveq #err.ipar,d0 bad parameter
exit_12
add.w #12,sp remove channel id and top of parameter list
rts
exit_16
addq.l #4,sp
bra.s exit_12
*
* put next item on the a1 stack (a2 set to ca.gt...)
*
put_on_a1
lea 8(a3),a5 get just one item
jsr (a2) call appropriate type
move.l a5,a3 move onto next item
bne.s exit_16 remove return and channel id and saved a5
rts
*
* fetch bytes
*
fstrg_push
suba.w d2,a1 make room on a1 stack
fstrg
moveq #iob.fmul,d0 fetch a known number of bytes
bra.s trap4_3
*
* send bytes untranslated
*
sustrg
moveq #iob.suml,d0 send a known number of bytes
bra.s trap4_3
*
* send bytes
*
sstrg
moveq #iob.smul,d0 send a known number of bytes
*
trap4_3
move.l 4+chan_id(sp),a0 set channel id
bsr.l ut_trp3r trap #3 relative
suba.w d1,a1 restore a1 to original
bne.s exit_16
rts
*
* set up and save channel id and top of parameter list
*
chan_set
moveq #%0111000,d7 save separator on first parameter
cmp.l a3,a5 if there is one!
beq.s chans_1
and.b 1(a6,a3.l),d7 all other info is masked out
chans_1
moveq #3,d6 default channel 3
bsr.l ut_chan get channel id
bne.s chans_out return directly
move.l (sp),a4 get return address
clr.l (sp) no pointer to return
st (sp) ... pointer in vv
move.l a5,-(sp) save top of parameter list
move.l a0,-(sp) and channel id
*
cmp.b #%00110000,d7 was separator '\'
bne.s chans_rts ... no
move.w #$0f0f,d7 mask odd bits
and.w (a6,a3.l),d7 ... in this parameter type
cmp.w #$0202,d7 is it a floating point variable?
bne.s set_fptr ... no
move.l 4(a6,a3.l),vv_ptr(sp) ... yes, set value pointer
set_fptr
bsr.l ut_gtli1 get one long integer
bne.s exit_12 ... oops
addq.l #8,a3 skip this parameter
move.l #iof.posa,d0 set file position
move.l (a6,a1.l),d1
addq.l #4,sb_arthp(a6) (reset ri stack)
moveq #0,d3
move.l chan_id(sp),a0
trap #3 ignore errors
chans_rts
jmp (a4) and return
*
chans_out
addq.l #4,sp remove one return address
rts and return to basic
*
* set up type of next parameter (string array and substring array are permitted)
*
type_set
cmpa.l 4+parm_top(sp),a3 end of parameter list?
blt.s type_var ... no
moveq #0,d0 ... yes, ok
addq.l #4,sp remove return
bra.l exit_pos and exit (setting position)
type_var
move.w #$0f0f,d1 mask out separators
and.w (a6,a3.l),d1 get name type
beq.s type_bp ... null
cmp.w #$0300,d1 ... is it sub-string array?
blt.s type_test ... no
cmp.w #$0301,d1 ... is it string array?
bgt.s type_test ... no
move.l 4(a6,a3.l),a1 ... yes, get value pointer
add.l sb_datab(a6),a1
cmp.w #1,4(a6,a1.l) just one dimension?
beq.s typs_ok ... yes
bra.s type_bp ... no
*
type_test
ror.w #8,d1 get name usage
move.w #%11000101,d2 set mask of acceptable usage
btst d1,d2
beq.s type_bp not permissable
lsr.w #8,d1 get type
typs_ok
subq.b #2,d1 set -ve for string, 0 for fp, +ve for integer
rts
type_bp
addq.l #4,sp remove return
bra.l file_bp and bad parameter
end
|
programs/oeis/044/A044836.asm | karttu/loda | 0 | 87063 | <filename>programs/oeis/044/A044836.asm
; A044836: Positive integers having more base-10 runs of even length than odd.
; 11,22,33,44,55,66,77,88,99,1100,1111,1122,1133,1144,1155,1166,1177,1188,1199,2200,2211,2222,2233,2244,2255,2266,2277,2288,2299,3300,3311,3322,3333,3344,3355,3366,3377,3388,3399,4400
mov $5,$0
add $5,1
mov $10,$0
lpb $5,1
mov $0,$10
sub $5,1
sub $0,$5
mov $3,$0
mov $7,2
lpb $7,1
mov $0,$3
sub $7,1
add $0,$7
pow $2,$8
mul $2,2
mov $4,$7
mov $9,4
mul $9,$0
div $9,40
add $9,2
sub $9,$2
lpb $4,1
sub $4,1
mov $6,$9
lpe
lpe
lpb $3,1
mov $3,0
sub $6,$9
lpe
mov $9,$6
mul $9,990
add $9,11
add $1,$9
lpe
|
cards/bn5/ItemCards/136-F013 Tensuke's Grandson's New Year Gift.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | 10 | 17102 | .include "defaults_item.asm"
table_file_jp equ "exe5-utf8.tbl"
table_file_en equ "bn5-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252424A // BRBJ
game_code_2 equ 0x42524245 // BRBE
game_code_3 equ 0x42524250 // BRBP
card_type equ 0
card_id equ 33
card_no equ "033"
card_sub equ "Item Card 033"
card_sub_x equ 62
card_desc_len equ 3
card_desc_1 equ "Tensuke's"
card_desc_2 equ "Grandson's"
card_desc_3 equ "New Year Gift"
card_name_jp_full equ "匠転助の孫へのお年玉"
card_name_jp_game equ "たくみてんすけのマゴへのお年玉"
card_name_en_full equ "Tensuke's Grandson's New Year Gift"
card_name_en_game equ "Tensuke's Grandson's New Year Gift"
card_game_desc_jp_len equ 2
card_game_desc_jp_1 equ "たくみてんすけのマゴへのお年玉!"
card_game_desc_jp_2 equ "10000Zを手に入れた!"
card_game_desc_jp_3 equ ""
card_game_desc_en_len equ 3
card_game_desc_en_1 equ "Tensuke's grandson's"
card_game_desc_en_2 equ "New Year gift!"
card_game_desc_en_3 equ "Got 10000 Zennys!" |
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_762.asm | ljhsiun2/medusa | 9 | 169420 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x9f02, %rsi
lea addresses_D_ht+0x97e2, %rdi
nop
nop
nop
nop
nop
add %r15, %r15
mov $58, %rcx
rep movsl
nop
nop
nop
sub $6472, %r14
lea addresses_normal_ht+0x12282, %rbp
sub %rbx, %rbx
movb (%rbp), %r14b
nop
xor %rbp, %rbp
lea addresses_UC_ht+0x8782, %rbx
nop
nop
nop
nop
xor %r15, %r15
mov (%rbx), %r14d
nop
nop
sub %rbp, %rbp
lea addresses_D_ht+0x9282, %rbx
cmp %rdi, %rdi
movb $0x61, (%rbx)
nop
nop
cmp $6356, %r15
lea addresses_A_ht+0x17592, %rsi
lea addresses_UC_ht+0x14e22, %rdi
nop
nop
nop
xor %r9, %r9
mov $31, %rcx
rep movsb
nop
nop
nop
inc %rdi
lea addresses_normal_ht+0x2282, %rsi
nop
nop
nop
nop
nop
xor %rcx, %rcx
movb $0x61, (%rsi)
nop
add %rcx, %rcx
lea addresses_normal_ht+0xad9e, %rsi
lea addresses_A_ht+0x7e22, %rdi
nop
nop
nop
and %r14, %r14
mov $9, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_D+0x10182, %rdx
nop
nop
nop
nop
nop
xor %rcx, %rcx
movb (%rdx), %r8b
nop
and $14020, %rbx
// REPMOV
lea addresses_WT+0x12e82, %rsi
lea addresses_WC+0x11282, %rdi
nop
nop
nop
nop
add %r9, %r9
mov $86, %rcx
rep movsl
sub %r9, %r9
// Store
lea addresses_RW+0xda82, %r9
nop
nop
nop
inc %rcx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm1
movups %xmm1, (%r9)
xor %r9, %r9
// Store
lea addresses_PSE+0x1cb02, %rbx
nop
nop
nop
nop
nop
and $28789, %r9
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
vmovntdq %ymm0, (%rbx)
nop
xor $47832, %rdx
// Load
lea addresses_normal+0x1c0d2, %r9
nop
nop
nop
nop
cmp %rbx, %rbx
movups (%r9), %xmm0
vpextrq $0, %xmm0, %rsi
nop
nop
cmp $5729, %r9
// Load
lea addresses_WC+0xbb82, %rdx
nop
nop
nop
nop
nop
xor $62145, %r10
movntdqa (%rdx), %xmm4
vpextrq $0, %xmm4, %rbx
nop
nop
nop
nop
nop
xor %rcx, %rcx
// Load
lea addresses_D+0x9582, %r10
nop
nop
nop
nop
nop
cmp $64005, %rcx
movups (%r10), %xmm4
vpextrq $1, %xmm4, %r8
nop
nop
nop
inc %rcx
// Store
lea addresses_RW+0xa2a2, %rbx
nop
nop
and $26246, %r9
mov $0x5152535455565758, %rdi
movq %rdi, (%rbx)
nop
dec %r8
// Store
lea addresses_A+0x2702, %rbx
nop
nop
nop
nop
dec %rcx
movb $0x51, (%rbx)
inc %rdx
// Faulty Load
lea addresses_PSE+0x1a682, %rcx
clflush (%rcx)
nop
nop
sub %rsi, %rsi
mov (%rcx), %rdx
lea oracles, %rsi
and $0xff, %rdx
shlq $12, %rdx
mov (%rsi,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_PSE', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 8}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_RW', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 5}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC', 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 8}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_RW', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 6}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_PSE', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': True, 'congruent': 3, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 7, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 7}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 6}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
src/test_assertions.adb | kevinrosalesdev/MathArray-FormalVerification | 2 | 11996 | <filename>src/test_assertions.adb
with Ada.Text_IO; use Ada.Text_IO;
package body Test_Assertions is
Max : constant := 50;
Separators : constant String (1 .. 60) := (others => '.');
-----------------
-- Assert_True --
-----------------
procedure Assert_True (Value : Boolean) is
begin
if not Value then
raise Test_Assertion_Error;
end if;
end Assert_True;
procedure Assert_True (Value : Boolean; Message : String) is
begin
Put (Message);
if Message'Length < Max then
Put (Separators (1 .. Max - Message'Length));
end if;
if Value then
Put_Line (" OK");
else
Put_Line (" FAILED (Assert_True)");
end if;
end Assert_True;
------------------
-- Assert_False --
------------------
procedure Assert_False (Value : Boolean) is
begin
if Value then
raise Test_Assertion_Error;
end if;
end Assert_False;
procedure Assert_False (Value : Boolean; Message : String) is
begin
Put (Message);
if Message'Length < Max then
Put (Separators (1 .. Max - Message'Length));
end if;
if not Value then
Put_Line (" OK");
else
Put_Line (" FAILED (Assert_False)");
end if;
end Assert_False;
end Test_Assertions;
|
oeis/015/A015441.asm | neoneye/loda-programs | 11 | 169786 | <filename>oeis/015/A015441.asm
; A015441: Generalized Fibonacci numbers.
; Submitted by <NAME>
; 0,1,1,7,13,55,133,463,1261,4039,11605,35839,105469,320503,953317,2876335,8596237,25854247,77431669,232557151,697147165,2092490071,6275373061,18830313487,56482551853,169464432775,508359743893,1525146340543,4575304803901,13726182847159,41178011670565,123535108753519,370603178776909,1111813831298023,3335432903959477,10006315891747615,30018913315504477,90056808665990167,270170288559017029,810511140554958031,2431532871909060205,7294599715238808391,21883796946693169621,65651395238126019967
mov $1,$0
min $0,1
sub $0,3
pow $0,$1
mov $2,3
pow $2,$1
sub $2,$0
mov $0,$2
div $0,5
|
programs/oeis/340/A340528.asm | neoneye/loda | 22 | 20836 | ; A340528: Radio number of the path graph P_n.
; 0,1,3,5,10,13,20,25,34,41,52,61,74,85,100,113,130,145,164,181,202,221,244,265,290,313,340,365,394,421,452,481,514,545,580,613,650,685,724,761,802,841,884,925,970,1013,1060,1105,1154,1201,1252,1301,1354,1405,1460,1513
mov $2,$0
mul $2,$0
mov $1,$2
lpb $0
sub $0,1
mod $0,2
add $0,1
pow $0,2
lpe
add $1,$0
div $1,2
mov $0,$1
|
test/incbin.asm | bitwiseworks/nasm-os2 | 1 | 179154 | <filename>test/incbin.asm<gh_stars>1-10
db '*** ONCE ***', 0Ah
incbin "incbin.data",32
section more start=0x1000000
db '*** TWELVE ***', 0Ah
times 12 incbin "incbin.data",32
db '<END>', 0Ah
|
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80p_dsub.asm | meesokim/z88dk | 0 | 22649 | <gh_stars>0
SECTION code_fp_math48
PUBLIC cm48_sccz80p_dsub
EXTERN am48_dsub
cm48_sccz80p_dsub:
; sccz80 float primitive
; Subtract two math48 floats.
;
; enter : AC'(BCDEHL') = double right_op
; stack = double left_op, ret
;
; exit : AC'(BCDEHL') = left_op - right_op
;
; uses : AF, BC, DE, HL, AF', BC', DE', HL'
pop af
pop hl ; AC = y
pop de
pop bc
push af
exx
jp am48_dsub
|
tutorials/day-course/courses_solutions.als | atdyer/alloytools.github.io | 9 | 2450 | <filename>tutorials/day-course/courses_solutions.als
/*
* A solution to courses model built in the Static Modeling lecture.
*/
abstract sig Course {
dept: Dept
}
sig Introductory extends Course {}
sig Advanced extends Course {
prereqs: some Course
}
sig Elective in Course {}
abstract sig Student {
major: lone Dept,
taken: set Course,
grades: taken -> one Grade
}
sig Freshman, Sophomore, Junior, Senior extends Student {}
sig Dept {
required: set Course,
listing: set Course
}
abstract sig Grade {}
one sig A, B, C, D, F extends Grade {}
fact defineListing {
listing = ~dept
}
fact prereqsAcyclic {
all c: Course | c not in allPrereqs[c]
}
// sanity check
assert introPrecedesAdvanced {
all c: Advanced | some Introductory & allPrereqs[c]
}
check introPrecedesAdvanced for 6
pred canTake [s: Student, c: Course] {
c.prereqs in s.taken
c !in s.taken
}
fun allPrereqs [cs: set Course] : set Course {
cs.^prereqs
}
pred canGraduate [s: Student] {
s in Senior
some s.major
some s.taken & Elective
all c: s.major.required | some s.grades[c] & (A + B + C)
}
pred simulate {
all d: Dept | some d.listing & Advanced
some s: Student | canGraduate[s]
}
run simulate for 5
fact noRedundantPrereqs {
no prereqs & prereqs.^prereqs
// alternatively . . .
// all c: Advanced | no c': c.prereqs | c' in c.prereqs.^prereqs
}
pred graduateImpliesAllPrereqs {
all s: Student | canGraduate[s] =>
allPrereqs[s.major.required] in s.taken
}
// fails
assert graduatesCorrect {
graduateImpliesAllPrereqs
}
check graduatesCorrect for 6
pred validTaken {
all s: Student | allPrereqs[s.taken] in s.taken
}
// passes
assert graduatesCorrect2 {
validTaken => graduateImpliesAllPrereqs
}
check graduatesCorrect2 for 6
/*
allowing multiple sets of required courses would look something like . . .
sig RequiredSet {
courses: set Course
}
fact canonicalize {
no disj s1, s2: RequiredSet | s1.courses = s2.courses
}
sig Dept {
required: set RequiredSet,
listing: set Course
}
*/
|
src/MultiSorted/Model.agda | cilinder/formaltt | 21 | 13505 | open import Agda.Primitive using (_⊔_)
import Categories.Category as Category
import Categories.Category.Cartesian as Cartesian
import MultiSorted.Interpretation as Interpretation
open import MultiSorted.AlgebraicTheory
open import MultiSorted.Substitution
import MultiSorted.Product as Product
module MultiSorted.Model {o ℓ e ℓt}
{𝓈 ℴ}
{Σ : Signature {𝓈} {ℴ}}
(T : Theory ℓt Σ)
{𝒞 : Category.Category o ℓ e}
{cartesian-𝒞 : Cartesian.Cartesian 𝒞} where
-- Model of a theory
record Is-Model (I : Interpretation.Interpretation Σ cartesian-𝒞) : Set (ℓt ⊔ o ⊔ ℓ ⊔ e) where
open Theory T
open Category.Category 𝒞
open Interpretation.Interpretation I
open HomReasoning
field
model-eq : ∀ (ε : ax) → ⊨ ax-eq (ε)
-- Soundness of semantics
module _ where
open Product.Producted interp-ctx
-- first we show that substitution preserves validity
model-resp-[]s : ∀ {Γ Δ} {A} {u v : Term Γ A} {σ : Δ ⇒s Γ} →
interp-term u ≈ interp-term v → interp-term (u [ σ ]s) ≈ interp-term (v [ σ ]s)
model-resp-[]s {u = u} {v = v} {σ = σ} ξ =
begin
interp-term (u [ σ ]s) ≈⟨ interp-[]s {t = u} ⟩
(interp-term u ∘ interp-subst σ) ≈⟨ ξ ⟩∘⟨refl ⟩
(interp-term v ∘ interp-subst σ) ≈˘⟨ interp-[]s {t = v} ⟩
interp-term (v [ σ ]s) ∎
-- the soundness statement
⊢-⊨ : ∀ {ε : Equation Σ} → ⊢ ε → ⊨ ε
⊢-⊨ eq-refl = Equiv.refl
⊢-⊨ (eq-symm ξ) = ⟺ (⊢-⊨ ξ)
⊢-⊨ (eq-tran ξ θ) = ⊢-⊨ ξ ○ ⊢-⊨ θ
⊢-⊨ (eq-congr ξ) = ∘-resp-≈ʳ (unique λ i → project ○ ⟺ (⊢-⊨ (ξ i)))
⊢-⊨ (eq-axiom ε σ) = model-resp-[]s {u = ax-lhs ε} {v = ax-rhs ε} (model-eq ε)
-- Every theory has the trivial model, whose carrier is the terminal object
Trivial : Is-Model (Interpretation.Trivial Σ cartesian-𝒞)
Trivial =
let open Cartesian.Cartesian cartesian-𝒞 in
record { model-eq = λ ε → !-unique₂ }
|
src/tom/library/sl/ada/allsstrategy.adb | rewriting/tom | 36 | 8234 | <reponame>rewriting/tom
with VisitablePackage, EnvironmentPackage, AbstractStrategyBasicPackage;
use VisitablePackage, EnvironmentPackage, AbstractStrategyBasicPackage;
with Ada.Text_IO; use Ada.Text_IO;
package body AllsStrategy is
----------------------------------------------------------------------------
-- Object implementation
----------------------------------------------------------------------------
overriding
function toString(o: Alls) return String is
begin
return "Alls()";
end;
----------------------------------------------------------------------------
-- Strategy implementation
----------------------------------------------------------------------------
overriding
function visitLight(str:access Alls; any: ObjectPtr; intro: access Introspector'Class) return ObjectPtr is
childs : ObjectPtrArrayPtr := null;
childCount : Integer := getChildCount(intro, any);
begin
for i in 0..childCount-1 loop
declare
oldChild : ObjectPtr := getChildAt(intro, any, i);
newChild : ObjectPtr := visitLight(StrategyPtr(str.arguments(ARG)), oldChild, intro);
begin
if childs /= null then
childs(i) := newChild;
else
childs := getChildren(intro, any);
childs(i) := newChild;
end if;
end;
end loop;
if childs = null then
return any;
else
return setChildren(intro, any, childs);
end if;
end;
overriding
function visit(str: access Alls; intro: access Introspector'Class) return Integer is
any : ObjectPtr := null;
childs: ObjectPtrArrayPtr := null;
childCount : Integer;
begin
setIntrospector(str.env.all, IntrospectorPtr(intro));
any := getSubject(str.env.all);
childCount := getChildCount(intro, any);
for i in 0 .. childCount-1 loop
declare
oldChild : ObjectPtr := getChildAt(intro, any, i);
newChild : ObjectPtr := null;
status : Integer;
begin
down(str.env.all, i+1);
status := visit(StrategyPtr(str.arguments(ARG)), intro);
if status /= EnvironmentPackage.SUCCESS then
upLocal(str.env.all);
return status;
end if;
newChild := getSubject(str.env.all);
if childs /= null then
childs(i) := newChild;
else
childs := getChildren(intro, any);
childs(i) := newChild;
end if;
upLocal(str.env.all);
end;
end loop;
if childs /= null then
setSubject(str.env.all, setChildren(intro, any, childs));
end if;
return EnvironmentPackage.SUCCESS;
end;
----------------------------------------------------------------------------
procedure makeAlls(i : in out Alls; v: StrategyPtr) is
begin
initSubterm(i,v);
end;
function newAlls(v: StrategyPtr) return StrategyPtr is
id : StrategyPtr := new Alls;
begin
makeAlls(Alls(id.all), v);
return id;
end;
----------------------------------------------------------------------------
end AllsStrategy;
|
Task/Bitwise-IO/Ada/bitwise-io-2.ada | LaudateCorpus1/RosettaCodeData | 1 | 15171 | package body Bit_Streams is
procedure Finalize (Stream : in out Bit_Stream) is
begin
if Stream.Write_Count > 0 then
Stream.Output (1) := Stream.Output (1) * 2**(Stream_Element'Size - Stream.Write_Count);
Stream.Channel.Write (Stream.Output);
end if;
end Finalize;
procedure Read (Stream : in out Bit_Stream; Data : out Bit_Array) is
Last : Stream_Element_Offset;
begin
for Index in Data'Range loop
if Stream.Read_Count = 0 then
Stream.Channel.Read (Stream.Input, Last);
Stream.Read_Count := Stream_Element'Size;
end if;
Data (Index) := Bit (Stream.Input (1) / 2**(Stream_Element'Size - 1));
Stream.Input (1) := Stream.Input (1) * 2;
Stream.Read_Count := Stream.Read_Count - 1;
end loop;
end Read;
procedure Write (Stream : in out Bit_Stream; Data : Bit_Array) is
begin
for Index in Data'Range loop
if Stream.Write_Count = Stream_Element'Size then
Stream.Channel.Write (Stream.Output);
Stream.Write_Count := 0;
end if;
Stream.Output (1) := Stream.Output (1) * 2 or Stream_Element (Data (Index));
Stream.Write_Count := Stream.Write_Count + 1;
end loop;
end Write;
end Bit_Streams;
|
source/engine-dos/game-commands.asm | baAlex/Sakurai | 0 | 99430 | ;
; MIT License
;
; Copyright (c) 2020 <NAME>
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
; [game-commands.asm]
; - <NAME> 2020
; http://www.brackeen.com/vga/basics.html
macro OffsetIn reg ; Requires X and Y in EBX, destroys CX
{
mov reg, bx ; X
shr ebx, 16 ; Y
mov cx, bx
shl bx, 8
shl cx, 6
; Combine Y
add reg, bx
add reg, cx
}
;==============================
IterateGameCommands:
; ds:si = Commands table
; es:0x0000 = Destination buffer
; This is one of the two hot-spots of the engine
push eax
push ebx
push di
push cx
push fs
push dx
IterateGameCommands_loop:
mov eax, [si] ; Code, Color, Width, Height, Filename
mov ebx, [si + 4] ; X, Y
cmp al, 0x00 ; CODE_HALT
je near IterateGameCommands_bye
dec al ; CODE_DRAW_BKG 0x01
jz near GameDrawBkg
dec al ; CODE_DRAW_RECTANGLE_BKG 0x02
jz near GameDrawRectBkg
dec al ; CODE_DRAW_SPRITE 0x03
jz near GameDrawSprite
dec al ; CODE_DRAW_RECTANGLE 0x04
jz near GameDrawRect
dec al ; CODE_DRAW_RECTANGLE_PRECISE 0x05
jz near GameDrawRectPrecise
dec al ; CODE_DRAW_TEXT 0x06
jz near GameDrawText
dec al ; CODE_DRAW_H_LINE 0x07
jz near GameDrawHLine
dec al ; CODE_DRAW_V_LINE 0x08
jz near GameDrawVLine
dec al ; CODE_DRAW_PIXEL 0x09
jz near GameDrawPixel
; Next command
IterateGameCommands_continue:
mov byte [si], 0x00 ; Before continue lets clear the slot with CODE_HALT
add si, COMMAND_SIZE
cmp si, (commands_table + COMMANDS_TABLE_SIZE)
jb IterateGameCommands_loop
; Bye!
IterateGameCommands_bye:
pop dx
pop fs
pop cx
pop di
pop ebx
pop eax
ret
;==============================
GameDrawPixel: ; CODE_DRAW_PIXEL
; eax - Color (ah)
; ebx - X, Y (low 16 bits)
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Draw
mov [es:di], ah
; Bye!
jmp near IterateGameCommands_continue
;==============================
GameDrawHLine: ; CODE_DRAW_H_LINE
; eax - Color (ah), Width (first high 8 bits)
; ebx - X, Y (low 16 bits)
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Save width in BL
mov ebx, eax
shr ebx, 16
; Repeat color in the entire EAX register
mov al, ah
shl eax, 8
mov al, ah
shl eax, 8
mov al, ah
; Counter for LOOP
xor ch, ch
mov cl, bl ; Width
; Draw loop
mov bx, 16 ; To avoid an immediate instruction
GameDrawHLine_column:
mov dword [es:di], eax
mov dword [es:di + 4], eax
mov dword [es:di + 8], eax
mov dword [es:di + 12], eax
add di, bx
loop GameDrawHLine_column
; Bye!
jmp near IterateGameCommands_continue
;==============================
GameDrawVLine: ; CODE_DRAW_V_LINE
; eax - Color (ah), Height (first high 8 bits)
; ebx - X, Y (low 16 bits)
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Save height in AH, color in AL
shr eax, 8
shl ah, 3 ; Multiply by 8
; Counter for LOOP
xor ch, ch
mov cl, ah ; Height
; Draw loop
mov bx, 640 ; To avoid an immediate instruction
GameDrawVLine_column:
mov byte [es:di], al
mov byte [es:di + 320], al
add di, bx
loop GameDrawVLine_column
; Bye!
jmp near IterateGameCommands_continue
;==============================
GameDrawBkg: ; CODE_DRAW_BKG
; eax - Unused
; ebx - Unused
push ds
push si
; Set segments/data
mov cx, seg_bkg_data
mov ds, cx
xor si, si
xor di, di
; Draw
mov cx, BKG_DATA_SIZE
call near MemoryCopy ; (ds:si = source, es:di = destination, cx)
; Bye!
pop si
pop ds
jmp near IterateGameCommands_continue
;==============================
GameDrawRectBkg: ; CODE_DRAW_RECTANGLE_BKG
; eax - Width, Height (high 16 bits)
; ebx - X, Y (low 16 bits)
push ds
push si
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Multiply height by 16 so it matches with width behavior
shr eax, 16
shl ah, 4
; Set segments/data
mov cx, seg_bkg_data
mov ds, cx
mov si, di
mov bx, di
; Counter for LOOP
xor ch, ch
mov cl, al ; Width
; Draw loop
GameDrawRectBkg_row:
GameDrawRectBkg_column:
movsd
movsd
movsd
movsd
loop GameDrawRectBkg_column
; Preparations for next step
mov cl, al ; Width
add bx, 320
mov di, bx
mov si, bx
dec ah ; Height
jnz near GameDrawRectBkg_row
; Bye!
pop si
pop ds
jmp near IterateGameCommands_continue
;==============================
GameDrawRect: ; CODE_DRAW_RECTANGLE
; eax - Color (ah), Width, Height (high 16 bits)
; ebx - X, Y (low 16 bits)
push si
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Save width an height in BX
mov ebx, eax
shr ebx, 16
shl bh, 4 ; Multiply height by 16
; Repeat color in the entire EAX register
mov al, ah
shl eax, 8
mov al, ah
shl eax, 8
mov al, ah
; Counter for LOOP
xor ch, ch
mov cl, bl ; Width
mov si, di
; Draw loop
GameDrawRect_row:
GameDrawRect_column:
mov dword [es:di], eax
mov dword [es:di + 4], eax
mov dword [es:di + 8], eax
mov dword [es:di + 12], eax
add di, 16
loop GameDrawRect_column
; Preparations for next step
mov cl, bl ; Width
add si, 320
mov di, si
dec bh ; Height
jnz near GameDrawRect_row
; Bye!
pop si
jmp near IterateGameCommands_continue
;==============================
GameDrawRectPrecise: ; CODE_DRAW_RECTANGLE_PRECISE
; eax - Color (ah), Width, Height (high 16 bits)
; ebx - X, Y (low 16 bits)
push si
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Save width an height in BX
mov ebx, eax
shr ebx, 16
; Counter for LOOP
xor ch, ch
mov cl, bl ; Width
mov si, di
; Draw loop
GameDrawRectPrecise_row:
GameDrawRectPrecise_column:
mov byte [es:di], ah
inc di
loop GameDrawRectPrecise_column
; Preparations for next step
mov cl, bl ; Width
add si, 320
mov di, si
dec bh ; Height
jnz near GameDrawRectPrecise_row
; Bye!
pop si
jmp near IterateGameCommands_continue
;==============================
GameDrawSprite: ; CODE_DRAW_SPRITE
; eax - Slot (ah), Frame, Mode (high 16 bits)
; ebx - X, Y (low 16 bits)
push si
push ds
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
; Load from sprite indirection table: offset in BX, pool in CX
mov cx, seg_data
mov ds, cx
shr ax, 8 ; Slot (ah)
mov si, ax
mov bx, word[sprite_indirection_table + si] ; Slot::Offset
mov cx, word[sprite_indirection_table + si + 2] ; Slot::Where (on what pool)
; Set pool
dec cx
jz near GameDrawSprite_pool_a ; cx == 1
dec cx
jz near GameDrawSprite_pool_b ; cx == 2
jmp near GameDrawSprite_bye ; Wrong pool, return, return!!!
GameDrawSprite_pool_a:
mov dx, seg_pool_a
jmp GameDrawSprite_pool_set
GameDrawSprite_pool_b:
mov dx, seg_pool_b
GameDrawSprite_pool_set:
mov ds, dx
; Read SI and CX from sprite draw-header
mov si, [bx] ; SpriteDrawHeader::data_offset
mov cx, [bx + 2] ; SpriteDrawHeader::frames_number
add si, bx
; Load frame number in AX (currently is on the higher EAX bytes)
shr eax, 16
xor ah, ah
div cl ; Modulo by frames number
shr ax, 8
; Read frame code-offset (table after sprite draw-header) using AX,
; then point BX into the desired frame code
shl ax, 1 ; Multiply by the frame offsets entry size (2)
add bx, 4 ; Sprite draw-header so far (to skip it)
add bx, ax
add bx, [bx]
; Draw!
cmp dx, seg_pool_b ; What pool?
je GameDrawSprite_draw_b
GameDrawSprite_draw_a:
call far seg_pool_a:spr_a_draw
; BX = Absolute offset (in the segment) pointing into a frame code
; DS:SI = Data source, specified in the header (also absolute)
; ES:DI = Destination
jmp near GameDrawSprite_bye
GameDrawSprite_draw_b:
call far seg_pool_b:spr_b_draw
; BX = Absolute offset (in the segment) pointing into a frame code
; DS:SI = Data source, specified in the header (also absolute)
; ES:DI = Destination
GameDrawSprite_bye:
; Bye!
pop ds
pop si
jmp near IterateGameCommands_continue
;==============================
GameDrawText: ; CODE_DRAW_TEXT
; eax - Slot (ah), Text (high 16 bits)
; ebx - X, Y (low 16 bits)
; !!! Mostly a copy of GameDrawSprite !!!
push si
push ds
; Calculate offset in DI
OffsetIn di ; EBX = x, y, Destroys CX
push di ; NL HACK!
; Load from sprite indirection table: offset in BX, pool in CX
mov cx, seg_data
mov ds, cx
shr ax, 8 ; Slot (ah)
mov si, ax
mov bx, word[sprite_indirection_table + si] ; Slot::Offset
mov cx, word[sprite_indirection_table + si + 2] ; Slot::Where (on what pool)
; Set pool
dec cx
jz near GameDrawText_pool_a ; cx == 1
dec cx
jz near GameDrawText_pool_b ; cx == 2
jmp near GameDrawText_bye ; Wrong pool, return, return!!!
GameDrawText_pool_a:
mov dx, seg_pool_a
jmp GameDrawText_pool_set
GameDrawText_pool_b:
mov dx, seg_pool_b
GameDrawText_pool_set:
mov ds, dx
; Read SI and CX from sprite draw-header
mov si, [bx] ; SpriteDrawHeader::data_offset
add si, bx
; !!!!!!
; Use a new segment to read the text!
mov cx, seg_game_data
mov fs, cx
; Text offset currently in high EAX,
; lets move it to CX
shr eax, 16
mov cx, ax
xor ax, ax ; Before the loop
GameDrawText_loop:
xchg bx, cx ; Im out of registers :(
; Read character in AL
mov byte al, [fs:bx]
xchg bx, cx
; Is NULL?
cmp al, 0x00
je near GameDrawText_bye
; Is a new line?
cmp al, 0xA
je near GameDrawText_nl
; Draw
call near GameDrawText_draw_character ; Returns spacing in AX
; Advance to next character
inc cx
add di, ax
jmp near GameDrawText_loop
GameDrawText_nl:
; Add a new line, and advance to next character
inc cx
pop di ; NL HACK!
add di, 3200 ; Line space (HARDCODED!)
push di ; NL HACK!
jmp near GameDrawText_loop
; !!!!!!
GameDrawText_bye:
pop di
pop ds
pop si
jmp near IterateGameCommands_continue
;==============================
GameDrawText_draw_character:
; dx:bx - Sprite-data offset
; ds:si - Frame-data offset
; es:di - Destination
; ax - Frame to draw, Returns text spacing
; Returns spacing in ax
push bx
push di ; Destroyed by spr_a_draw()
push si ; Destroyed by spr_a_draw()
; Read frame code-offset (table after sprite draw-header) using AX,
; then point BX into the desired frame code
shl ax, 1 ; Multiply by the frame offsets entry size (2)
add bx, 4 ; Sprite draw-header so far (to skip it)
add bx, ax
add bx, [bx]
; Draw!
xor ah, ah
cmp dx, seg_pool_b ; What pool?
je GameDrawText_draw_b
GameDrawText_draw_a:
call far seg_pool_a:spr_a_draw
pop si
pop di
pop bx
ret
GameDrawText_draw_b:
call far seg_pool_b:spr_b_draw
pop si
pop di
pop bx
ret
|
src/menus.ads | Kidev/DemoAdaPhysics2D | 5 | 22689 | <reponame>Kidev/DemoAdaPhysics2D<gh_stars>1-10
with HAL.Bitmap; use HAL.Bitmap;
with Ada.Containers.Doubly_Linked_Lists;
with BMP_Fonts; use BMP_Fonts;
with Ada.Strings.Bounded;
package Menus is
-- Actual package
-- Tick freeze when menu is displayed, to prevent mistouches
WaitTicks : constant Natural := 100;
BorderSize : constant Natural := 10;
MaxStrLen : constant Natural := 12;
package BoundedStr is new Ada.Strings.Bounded.Generic_Bounded_Length(MaxStrLen);
use BoundedStr;
type Menu;
type MenuAction is access procedure(This : in out Menu);
type MenuTypes is (Menu_Default, Menu_Static);
-- Holds the position of a menu item
type MenuItemPos is record
X1, X2, Y1, Y2 : Natural := 0;
end record
with
Dynamic_Predicate => MenuItemPos.X2 <= 240
and MenuItemPos.Y2 <= 320;
pragma Pack(MenuItemPos);
-- Holds data about a menu item
type MenuItem is record
Text : Bounded_String;
Pos : MenuItemPos;
Action : MenuAction;
end record;
pragma Pack(MenuItem);
-- Holds the menu items
package MenuItemsList is new Ada.Containers.Doubly_Linked_Lists(MenuItem);
type MenuListAcc is access MenuItemsList.List;
-- Hold all the menu data required, tagged for the lovely dot notation
type Menu is tagged record
Items : MenuListAcc := null;
Background : MenuItemPos;
BackgroundColor : Bitmap_Color;
ForegroundColor : Bitmap_Color;
Font : BMP_Font;
MenuType : MenuTypes;
end record;
pragma Pack(Menu);
-- Contracts ghosts
StoredLen : Integer := 0 with Ghost;
StoredLastPos : MenuItemPos with Ghost;
function StoreAndReturnLen(Len : Integer) return Integer with Ghost;
function CheckOverflow(Pos : MenuItemPos) return Boolean with Ghost;
function GetItemStr(This : Menu; Index : Natural) return String with Ghost;
-- Menu Primitives
-- Init a menu
procedure Init(This : in out Menu; Back, Fore : Bitmap_Color; Font : BMP_Font; MenuType : MenuTypes := Menu_Default)
with
Post => This.Items /= null;
-- Add item to menu
procedure AddItem(This : in out Menu; That : MenuItem)
with
Pre => This.Items /= null
and StoreAndReturnLen(Integer(This.Items.Length)) >= 0
and That.Action /= null,
Post => This.Items /= null
and StoredLen + 1 = Integer(This.Items.Length)
and This.Items.Last_Element.Pos = That.Pos
and This.Items.Last_Element.Action = That.Action
and This.Items.Last_Element.Text = That.Text;
-- Same, but more flexible
procedure AddItem(This : in out Menu; Text : String; Pos : MenuItemPos; Action : MenuAction)
with
Pre => This.Items /= null
and StoreAndReturnLen(Integer(This.Items.Length)) >= 0
and Action /= null,
Post => This.Items /= null
and StoredLen + 1 = Integer(This.Items.Length)
and This.Items.Last_Element.Pos = Pos
and This.Items.Last_Element.Action = Action
and This.Items.Last_Element.Text = Text;
-- Add item to menu, copying the first item
procedure AddItem(This : in out Menu; Text : String; Action : MenuAction)
with
Global => (Proof_In => (StoredLen),
Input => (BorderSize, MaxStrLen)),
Pre => This.Items /= null
and StoreAndReturnLen(Integer(This.Items.Length)) >= 1
and CheckOverflow(This.Items.Last_Element.Pos)
and Action /= null,
Post => This.Items /= null
and StoredLen + 1 = Integer(This.Items.Length)
and This.Items.Last_Element.Action = Action
and This.Items.Last_Element.Text = Text,
Depends => (This => +(Text, Action, BorderSize, MaxStrLen));
-- Displays the menu
procedure Show(This : in out Menu)
with
Pre => This.Items /= null;
-- Wait for user choice
-- Will call the relevant MenuAction with a parameter : This (the menu)
-- It MUST be freed manually in case of a Menu_Default
-- It is freed automatically for a Menu_Static with Desroy = True
procedure Listen(This : in out Menu; Destroy : Boolean := True; WaitFor : Natural := WaitTicks);
-- Cleans the menu
procedure Free(This : in out Menu)
with
Pre => This.Items /= null,
Post => This.Items = null;
-- Update the text of the Index'th menu item (in order at the creation)
procedure ChangeText(This : in out Menu; Index : Natural; Text : String)
with
Pre => This.Items /= null
and Index < Integer(This.Items.Length),
Post => GetItemStr(This, Index) = Text,
Depends => (This => +(Index, Text));
private
procedure DrawRect(Item : MenuItemPos; Fill : Boolean; Color : Bitmap_Color);
procedure DrawText(Item : MenuItemPos; Text : Bounded_String; Font : BMP_Font; Back, Fore : Bitmap_Color);
end Menus;
|
r5asm/test/module3.asm | walter-artica/r5asm | 0 | 86165 | <reponame>walter-artica/r5asm
.code
set R2, 0xFFFFFFC8
set R3, 0xFFFFFFC0
nop
clr R8
cycle:
ldw R4, R3, 0
inc R4, 500
wait:
ldw R5, R3, 0
cmp R5, R4
bb wait
inc R8
stw R8, R2, 0
bt cycle
|
libsrc/_DEVELOPMENT/font/fzx/fonts/dkud4/Font10/_ff_dkud4_Font10.asm | meesokim/z88dk | 0 | 4032 |
SECTION rodata_font_fzx
PUBLIC _ff_dkud4_Font10
_ff_dkud4_Font10:
BINARY "font/fzx/fonts/dkud4/Font10/font10.fzx"
|
arch/z80/src/z180/z180_head.asm | huahang/incubator-nuttx | 51 | 22876 | <reponame>huahang/incubator-nuttx
;**************************************************************************
; arch/z80/src/z180/z180_head.asm
;
; Copyright (C) 2012 <NAME>. All rights reserved.
; Author: <NAME> <<EMAIL>>
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
;
; 1. Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; 2. 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.
; 3. Neither the name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
.title NuttX for the Z180
.module z180_head
;**************************************************************************
; Constants
;**************************************************************************
; Default stack base (needs to be fixed)
.include "asm_mem.h"
;**************************************************************************
; Global symbols used
;**************************************************************************
.globl _nx_start ; OS entry point
.globl _up_vectcommon ; Common interrupt handling logic
.globl _z180_mmu_lowinit ; MMU initialization logic
.globl s__HEAP ; Start of the heap
;**************************************************************************
; Reset entry point
;**************************************************************************
.area _HEADER (ABS)
.org 0x0000
di ; Disable interrupts
im 1 ; Set interrupt mode 1
jr _up_reset ; And boot the system
;**************************************************************************
; Other reset handlers
;**************************************************************************
.org 0x0008 ; RST 1
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #0 ; 0 = Z180_RST1
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0010 ; RST 2
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #1 ; 1 = Z180_RST2
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0018 ; RST 3
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #2 ; 2 = Z180_RST3
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0020 ; RST 4
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #3 ; 3 = Z180_RST4
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0028 ; RST 5
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #4 ; 4 = Z180_RST5
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0030 ; RST 6
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #5 ; 5 = Z180_RST6
jp _up_vectcommon ; Remaining RST handling is common
.org 0x0038 ; Int mode 1 / RST 7
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #6 ; 6 = Z180_RST7
jp _up_vectcommon ; Remaining RST handling is common
;**************************************************************************
; NMI interrupt handler
;**************************************************************************
.org 0x0066
retn
;**************************************************************************
; System start logic
;**************************************************************************
_up_reset:
; Set up the stack pointer at the location determined the Makefile
; and stored in asm_mem.h
ld SP, #CONFIG_STACK_END ; Set stack pointer
; Configure the MMU so that things will lie at the addresses that we
; expect them to
call _z180_mmu_lowinit ; Initialize the MMU
; Performed initialization unique to the SDCC toolchain
call gsinit ; Initialize the data section
; Then start NuttX
call _nx_start ; jump to the OS entry point
; NuttX will never return, but just in case...
_up_halt::
halt ; We should never get here
jp _up_halt
;**************************************************************************
; Ordering of segments for the linker (SDCC only)
;**************************************************************************
.area _HOME
.area _CODE
.area _INITIALIZER
.area _GSINIT
.area _GSFINAL
.area _DATA
.area _INITIALIZED
.area _BSEG
.area _BSS
.area _HEAP
;**************************************************************************
; Global data initialization logic (SDCC only)
;**************************************************************************
.area _GSINIT
gsinit::
ld bc, #l__INITIALIZER
ld a, b
or a, c
jr Z, gsinit_next
ld de, #s__INITIALIZED
ld hl, #s__INITIALIZER
ldir
gsinit_next:
.area _GSFINAL
ret
;**************************************************************************
; The start of the heap (SDCC only). Note that is actually resides in
; the _CODE area (which may be FLASH or ROM)
;**************************************************************************
.area _CODE
_g_heapbase::
.dw #s__HEAP
|
programs/oeis/063/A063144.asm | neoneye/loda | 22 | 104479 | <filename>programs/oeis/063/A063144.asm
; A063144: Dimension of the space of weight 2n cusp forms for Gamma_0( 76 ).
; 8,27,47,67,87,107,127,147,167,187,207,227,247,267,287,307,327,347,367,387,407,427,447,467,487,507,527,547,567,587,607,627,647,667,687,707,727,747,767,787,807,827,847,867,887,907,927,947,967
mul $0,20
trn $0,1
add $0,8
|
agda/FarmCanon.agda | halfaya/MusicTools | 28 | 1039 | <gh_stars>10-100
{-# OPTIONS --erased-cubical --safe #-}
module FarmCanon where
open import Data.List using (List; _∷_; [])
open import Data.Nat using (ℕ)
open import Data.Sign renaming (+ to s+ ; - to s-)
open import Data.Vec using (Vec; _∷_; []; map)
open import Canon using (makeCanon2)
open import Instruments using (pianos)
open import Interval
open import MakeTracks using (makeTrackList)
open import MidiEvent
open import Note
open import Pitch
subject : List Note
subject =
tone qtr (c 5) ∷
tone qtr (d 5) ∷
tone half (e 5) ∷
tone 8th (e 5) ∷
tone 8th (e 5) ∷
tone 8th (d 5) ∷
tone 8th (d 5) ∷
tone half (e 5) ∷
[]
transpositions : Vec Opi 4
transpositions = map (makeSigned s-) (per1 ∷ per5 ∷ per8 ∷ per12 ∷ [])
repeats : ℕ
repeats = 3
delay : Duration
delay = half
canon : Vec (List Note) 4
canon = makeCanon2 subject delay transpositions
tempo : ℕ
tempo = 120
canonTracks : List MidiTrack
canonTracks = makeTrackList pianos tempo canon
|
tests/parsing/Issue146_conditional_dup_crash.asm | fengjixuchui/sjasmplus | 220 | 101449 | <reponame>fengjixuchui/sjasmplus<gh_stars>100-1000
; this is currently (v1.18.2) invalid construction of nested DUP->EDUP inside different conditional blocks
; and will not work, but the sjasmplus does segfault hard on this instead of just reporting error
i1: ifndef SKIP_DUP
dup 3
daa
else
nop
endif
i2: ifndef SKIP_DUP
edup
endif
|
test/Succeed/Issue2978.agda | cruhland/agda | 1,989 | 16932 |
open import Agda.Builtin.Equality
postulate
A : Set
id : A → A
id x = x
mutual
?Y : A → A → A
?Y = _
?X : A → A → A
?X = _
-- This tries to solve ?X x x := ?Y x y, which fails but prunes
-- ?Y x y := ?Z x. Failing ?X := ?Y we then try the other direction
-- without realising that ?Y has been instantiated and (re)solve
-- ?Y x y := ?X x x, leaving ?Z hanging!
-- The `id` call is to make sure we get into `compareAtom`. The
-- corresponding code in `compareTerm` does the right thing.
constr₁ : ∀ x y → id (?X x x) ≡ id (?Y x y)
constr₁ x y = refl
-- We can then solve ?X.
constr₂ : ∀ x y → ?X x y ≡ x
constr₂ x y = refl
-- And check that they really are solved
checkY : ?Y ≡ λ x y → x
checkY = refl
checkX : ?X ≡ λ x y → x
checkX = refl
-- ...but we still have ?Z unsolved.
|
bin/text.scpt | pmsteil/dotfiles | 0 | 4678 | <reponame>pmsteil/dotfiles<filename>bin/text.scpt
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
-- tell application "Messages"
-- #set targetBuddy to "+19403909446"
-- #set targetBuddy to "<EMAIL>"
-- #set targetBuddy to "<EMAIL>"
-- #set targetBuddy to "+449402495631"
-- #set targetBuddy to "+1449408003974"
-- set targetBuddy to "+449408003974"
-- #set targetBuddy to "+1(940) 800-3974"
-- set targetService to id of 1st service whose service type = iMessage
-- repeat
-- set textMessage to "Hi there from macOS!"
-- set theBuddy to buddy targetBuddy of service id targetService
-- send textMessage to theBuddy
-- delay (random number from 1 to 5)
-- end repeat
-- end tell |
workshop/src/parentpackage-childpackage.adb | TNO/Rejuvenation-Ada | 0 | 11652 | <reponame>TNO/Rejuvenation-Ada
with Ada.Calendar;
pragma Unreferenced (Ada.Calendar);
package body ParentPackage.ChildPackage is
procedure ChildDummy is null;
end ParentPackage.ChildPackage;
|
alloy4fun_models/trashltl/models/3/HD72y2tn8ZH8jDPsN.als | Kaixi26/org.alloytools.alloy | 0 | 3908 | <gh_stars>0
open main
pred idHD72y2tn8ZH8jDPsN_prop4 {
some f: File | once f not in Protected implies eventually always f in Trash
}
pred __repair { idHD72y2tn8ZH8jDPsN_prop4 }
check __repair { idHD72y2tn8ZH8jDPsN_prop4 <=> prop4o } |
src/test/ref/library-constructor-3.asm | jbrandwood/kickc | 2 | 240218 | // Demonstrates Library Constructor Functionality
// Multiple #pragma constructor_for() constructors
// Commodore 64 PRG executable file
.file [name="library-constructor-3.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(__start)
.label sym = 4
.label SCREEN = 2
.segment Code
__start: {
// volatile char sym
lda #0
sta.z sym
// char * volatile SCREEN
sta.z SCREEN
sta.z SCREEN+1
// #pragma constructor_for(init_1, print)
jsr init_1
// #pragma constructor_for(init_2, print)
jsr init_2
jsr main
rts
}
init_2: {
// SCREEN = (char*)0x0400
lda #<$400
sta.z SCREEN
lda #>$400
sta.z SCREEN+1
// }
rts
}
init_1: {
// sym = '*'
lda #'*'
sta.z sym
// }
rts
}
main: {
// print()
jsr print
// }
rts
}
print: {
// *SCREEN = sym
lda.z sym
ldy #0
sta (SCREEN),y
// }
rts
}
|
oeis/143/A143667.asm | neoneye/loda-programs | 11 | 28846 | <filename>oeis/143/A143667.asm<gh_stars>10-100
; A143667: Digits of the infinite Fibonacci word A003849 grouped 2 by 2 and interpreted as a binary value.
; 1,0,2,2,1,0,2,2,1,1,0,2,1,1,0,2,1,1,0,2,2,1,0,2,2,1,1,0,2,1,1,0,2,1,1,0,2,2,1,0,2,2,1,0,2,2,1,1,0,2,1,1,0,2,2,1,0,2,2,1,0,2,2,1,1,0,2,1,1,0,2,2,1,0,2,2,1,0,2,2,1,1,0,2,1,1,0,2,1,1,0,2,2,1,0,2,2,1,1,0
mul $0,2
seq $0,270788 ; Unique fixed point of the 3-symbol Fibonacci morphism phi-hat_2.
seq $0,64264 ; a(n) = 19*n mod 30.
div $0,8
mov $2,2
div $2,$0
mov $0,$2
|
List_1/exercise4.asm | dekoperez/SEL0433_microprocessorAplications | 0 | 245936 | <reponame>dekoperez/SEL0433_microprocessorAplications<filename>List_1/exercise4.asm
;*******************************************************************************
; @INSTITUTION
; University of Sao Paulo | Sao Carlos School of Engineering | SEL
;------------------------------------------------------------------------------
; @DISCIPLINE
; Name: SEL0433 | Applications of Microprocessors I
; Professor: <NAME>
; Academic Period: 2017\01
;------------------------------------------------------------------------------
; @DEVELOPMENT
; MCU: Intel 8052
; IDE: MCU 8051 v1.5.7
; Compiler: IDE native assembler
;------------------------------------------------------------------------------
; @WARRANTY
; Copyright (c) 2017 <NAME>
; The software is provided by "as is", without warranty of any kind, express or
; implied, including but not limited to the warranties of merchantability,
; fitness for a particular purpose and noninfringement. In no event shall the
; authors or copyright holders be liable for any claim, damages or other
; liability, whether in an action of contract, tort or otherwise, arising from,
; out of or in connection with the software or the use or other dealings in the
; software.
;------------------------------------------------------------------------------
; @EXERCISE
; List: #1
; Ex. : #4
;------------------------------------------------------------------------------
; @AUTHOR
; Name: <NAME>
; Email: <EMAIL>
; #USP: 8006891
;*******************************************************************************
;*******************************************************************************
; @CONSTANT
; Code's constants
;------------------------------------------------------------------------------
INTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE EQU 20H
INTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE EQU 30H
EXTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE EQU 20H
EXTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE EQU 30H
;*******************************************************************************
;*******************************************************************************
; @CODE
; Main code
;------------------------------------------------------------------------------
ORG 0
MOV R0,#INTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE
MOV R1,#INTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE
MOV DPTR,#DADOS
LCALL COMPARE_RESISTOR
INC DPTR
LCALL COMPARE_RESISTOR
INC DPTR
LCALL COMPARE_RESISTOR
MOV A,@R0
MOV DPTR,#EXTERNAL_RAM_ADDRESS_LOWEST_RESISTANCE
MOVX @DPTR,A
MOV A,@R1
MOV DPTR,#EXTERNAL_RAM_ADDRESS_HIGHEST_RESISTANCE
MOVX @DPTR,A
SJMP $
DADOS:
DB 150D, 220D, 033D
;DB 220D, 047D, 180D
;*******************************************************************************
;*******************************************************************************
; @ROUTINE
; COMPARE_RESISTOR
;------------------------------------------------------------------------------
; @Description
; Compare a 1 byte resistance value stored on program memory with another two
; 1 byte resistance values pointed by R0 and R1 on internal data memory. If
; higher, swap with the value pointed by R0 and if lower, swap with the value
; pointed by R1. Otherwise, do nothing.
;------------------------------------------------------------------------------
; @Precondition
; R0: Must be pointing to address on internal data memory where the lowest
; resistance is stored
; R1: Must be pointing to address on internal data memory where the highest
; resistance is stored
;------------------------------------------------------------------------------
; @Param
; DPTR: The address on program memory where the resistance value is stored
;------------------------------------------------------------------------------
; @Returns
; Void
;------------------------------------------------------------------------------
COMPARE_RESISTOR:
CLR A
MOVC A,@A+DPTR
PUSH ACC
SUBB A,@R1
JNC A_IS_HIGHER
CJNE @R0,#00H,CONTINUE
SJMP A_IS_LOWER
CONTINUE:
CLR C
POP ACC
PUSH ACC
SUBB A,@R0
JC A_IS_LOWER
POP ACC
RET
A_IS_HIGHER:
POP ACC
XCH A,@R1
RET
A_IS_LOWER:
POP ACC
XCH A,@R0
RET
;*******************************************************************************
END
|
regtests/asf-applications-views-tests.adb | My-Colaborations/ada-asf | 12 | 812 | <reponame>My-Colaborations/ada-asf<filename>regtests/asf-applications-views-tests.adb
-----------------------------------------------------------------------
-- asf-applications-views-tests - Unit tests for ASF.Applications.Views
-- Copyright (C) 2009, 2010, 2011, 2012, 2014, 2015, 2018, 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- 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.
-----------------------------------------------------------------------
with Ada.Text_IO;
with ASF.Applications.Main;
with ASF.Applications.Tests;
with ASF.Requests.Mockup;
with ASF.Responses.Mockup;
with ASF.Servlets.Faces;
with ASF.Converters.Dates;
with ASF.Server;
with Ada.Directories;
with Ada.Unchecked_Deallocation;
with Util.Files;
with Util.Beans.Basic;
with Util.Beans.Objects;
with Util.Measures;
package body ASF.Applications.Views.Tests is
use Ada.Strings.Unbounded;
overriding
procedure Set_Up (T : in out Test) is
begin
null;
end Set_Up;
-- Set up performed before each test case
-- ------------------------------
-- Test loading of facelet file
-- ------------------------------
procedure Test_Load_Facelet (T : in out Test) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => ASF.Converters.Dates.Date_Converter'Class,
Name => ASF.Converters.Dates.Date_Converter_Access);
App : aliased Applications.Main.Application;
View_Name : constant String := To_String (T.File);
Result_File : constant String := To_String (T.Result);
Conf : Applications.Config;
App_Factory : Applications.Main.Application_Factory;
Dir : constant String := "regtests/files";
Path : constant String := Util.Tests.Get_Path (Dir);
Faces : aliased ASF.Servlets.Faces.Faces_Servlet;
List : Util.Beans.Basic.Readonly_Bean_Access;
List_Bean : Util.Beans.Objects.Object;
Form : Util.Beans.Basic.Readonly_Bean_Access;
Form_Bean : Util.Beans.Objects.Object;
C : ASF.Converters.Dates.Date_Converter_Access;
Container : ASF.Server.Container;
begin
List := Applications.Tests.Create_Form_List;
List_Bean := Util.Beans.Objects.To_Object (List);
Form := Applications.Tests.Create_Form_Bean;
Form_Bean := Util.Beans.Objects.To_Object (Form);
Conf.Load_Properties ("regtests/view.properties");
Conf.Set ("view.dir", Path);
App.Initialize (Conf, App_Factory);
App.Register_Application ("/");
App.Add_Servlet ("faces", Faces'Unchecked_Access);
App.Add_Mapping ("*.xhtml", "faces");
C := ASF.Converters.Dates.Create_Date_Converter (Date => ASF.Converters.Dates.DEFAULT,
Time => ASF.Converters.Dates.DEFAULT,
Format => ASF.Converters.Dates.TIME,
Locale => "en",
Pattern => "");
App.Add_Converter ("date-default-converter", C.all'Access);
App.Set_Global ("function", "Test_Load_Facelet");
App.Set_Global ("date", "2011-12-03 03:04:05.23");
Container.Register_Application ("/asfunit", App'Unchecked_Access);
Container.Start;
for I in 1 .. 2 loop
declare
S : Util.Measures.Stamp;
Req : ASF.Requests.Mockup.Request;
Reply : aliased ASF.Responses.Mockup.Response;
Content : Unbounded_String;
begin
Req.Set_Method ("GET");
Req.Set_Request_URI ("/asfunit/" & View_Name);
Req.Set_Parameter ("file-name", To_String (T.Name));
Req.Set_Header ("file", To_String (T.Name));
Req.Set_Attribute ("list", List_Bean);
Req.Set_Attribute ("form", Form_Bean);
Container.Service (Req, Reply);
Util.Measures.Report (S, "Pass" & Integer'Image (I) & ": Render view "
& View_Name);
Reply.Read_Content (Content);
Util.Files.Write_File (Result_File, Content);
Util.Tests.Assert_Equal_Files (T => T,
Expect => To_String (T.Expect),
Test => Result_File,
Message => "Restore and render view");
end;
end loop;
Free (C);
end Test_Load_Facelet;
-- ------------------------------
-- Test case name
-- ------------------------------
overriding
function Name (T : Test) return Util.Tests.Message_String is
begin
return Util.Tests.Format ("Test " & To_String (T.Name));
end Name;
-- ------------------------------
-- Perform the test.
-- ------------------------------
overriding
procedure Run_Test (T : in out Test) is
begin
T.Test_Load_Facelet;
end Run_Test;
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
use Ada.Directories;
Result_Dir : constant String := "regtests/result/views";
Dir : constant String := "regtests/files/views";
Expect_Dir : constant String := "regtests/expect/views";
Path : constant String := Util.Tests.Get_Path (Dir);
Expect_Path : constant String := Util.Tests.Get_Path (Expect_Dir);
Result_Path : constant String := Util.Tests.Get_Test_Path (Result_Dir);
Search : Search_Type;
Filter : constant Filter_Type := (others => True);
Ent : Directory_Entry_Type;
begin
if Kind (Path) /= Directory then
Ada.Text_IO.Put_Line ("Cannot read test directory: " & Path);
end if;
Start_Search (Search, Directory => Path, Pattern => "*.xhtml", Filter => Filter);
while More_Entries (Search) loop
Get_Next_Entry (Search, Ent);
declare
Simple : constant String := Simple_Name (Ent);
Tst : Test_Case_Access;
begin
if Simple /= "." and then Simple /= ".."
and then Simple /= ".svn"
then
Tst := new Test;
Tst.Name := To_Unbounded_String (Dir & "/" & Simple);
Tst.File := To_Unbounded_String ("views/" & Simple);
Tst.Expect := To_Unbounded_String (Expect_Path & "/" & Simple);
Tst.Result := To_Unbounded_String (Result_Path & "/" & Simple);
Suite.Add_Test (Tst.all'Access);
end if;
end;
end loop;
end Add_Tests;
end ASF.Applications.Views.Tests;
|
oeis/142/A142423.asm | neoneye/loda-programs | 11 | 242606 | <reponame>neoneye/loda-programs
; A142423: Primes congruent to 11 mod 49.
; Submitted by <NAME>
; 11,109,599,991,1187,1481,1579,1873,2069,2657,3049,3343,3539,3637,3833,3931,4127,4421,4519,4813,5009,5107,5303,6577,6871,7459,7753,7949,8243,8537,8831,8929,9419,9811,10007,10301,10399,10889,10987,12163,12457,12653,13241,13339,13633,13829,14221,15299,15887,16573,17749,18043,19121,19219,19709,20101,20297,20983,21179,21277,21767,22159,22453,22943,23041,23531,23629,24413,25589,25981,26177,26863,27059,27647,27941,28627,28921,29411,29803,30097,30293,30391,30881,31469,31567,32057,32939,33037,33331
mov $1,5
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,49
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,97
|
programs/oeis/327/A327310.asm | jmorken/loda | 1 | 94805 | <gh_stars>1-10
; A327310: a(n) = floor(3*n*r) - 3*floor(n*r), where r = sqrt(8).
; 0,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,0,2,2,1,1,0,2,2,1,1,0,0,2,2,1,1,0
mul $0,6
cal $0,188039 ; Positions of 0 in A188038; complement of A188040.
mul $0,2
mov $1,2
mov $2,$0
add $2,8
mod $2,3
sub $2,2
add $1,$2
|
alloy4fun_models/trashltl/models/7/qoPxFmAxCp4tWzdw2.als | Kaixi26/org.alloytools.alloy | 0 | 4647 | <gh_stars>0
open main
pred idqoPxFmAxCp4tWzdw2_prop8 {
eventually File.link in Trash
}
pred __repair { idqoPxFmAxCp4tWzdw2_prop8 }
check __repair { idqoPxFmAxCp4tWzdw2_prop8 <=> prop8o } |
src/GBA.Display.Objects.ads | 98devin/ada-gba-dev | 7 | 13729 | -- Copyright (c) 2021 <NAME>
-- zlib License -- see LICENSE for details.
with GBA.Memory;
use GBA.Memory;
with GBA.Numerics;
use GBA.Numerics;
with GBA.Display.Tiles;
use GBA.Display.Tiles;
with GBA.Display.Palettes;
use GBA.Display.Palettes;
package GBA.Display.Objects is
type OBJ_ID is range 0 .. 127;
type OBJ_Y_Coordinate is mod 2**8;
type OBJ_X_Coordinate is mod 2**9;
type OBJ_Kind is
( Regular
, Affine
)
with Size => 1;
for OBJ_Kind use
( Regular => 0
, Affine => 1
);
type OBJ_Mode is
( Normal
, Transparent
, Window
)
with Size => 2;
for OBJ_Mode use
( Normal => 0
, Transparent => 1
, Window => 2
);
type OBJ_Shape is
( Square
, Wide
, Tall
)
with Size => 2;
for OBJ_Shape use
( Square => 0
, Wide => 1
, Tall => 2
);
type OBJ_Scale is range 0 .. 3
with Size => 2;
type OBJ_Size is
( Size_8x8
, Size_16x16
, Size_32x32
, Size_64x64
, Size_16x8
, Size_32x8
, Size_32x16
, Size_64x32
, Size_8x16
, Size_8x32
, Size_16x32
, Size_32x64
) with Size => 4;
for OBJ_Size use
( Size_8x8 => 2#0000#
, Size_16x16 => 2#0001#
, Size_32x32 => 2#0010#
, Size_64x64 => 2#0011#
, Size_16x8 => 2#0100#
, Size_32x8 => 2#0101#
, Size_32x16 => 2#0110#
, Size_64x32 => 2#0111#
, Size_8x16 => 2#1000#
, Size_8x32 => 2#1001#
, Size_16x32 => 2#1010#
, Size_32x64 => 2#1011#
);
function As_Size (Shape : OBJ_Shape; Scale : OBJ_Scale) return OBJ_Size
with Inline_Always;
procedure As_Shape_And_Scale (Size : OBJ_Size; Shape : out OBJ_Shape; Scale : out OBJ_Scale)
with Inline_Always;
type OBJ_Affine_Transform_Index is range 0 .. 31
with Size => 5;
function Affine_Transform_Address (Ix : OBJ_Affine_Transform_Index) return Address
with Pure_Function, Inline_Always;
type OBJ_Attributes (Kind : OBJ_Kind := Regular) is
record
Y : OBJ_Y_Coordinate;
X : OBJ_X_Coordinate;
Mode : OBJ_Mode;
Enable_Mosaic : Boolean;
Color_Mode : Palette_Mode;
Shape : OBJ_Shape;
Scale : OBJ_Scale;
Tile_Index : OBJ_Tile_Index;
Priority : Display_Priority;
Palette_Index : Palette_Index_16; -- Unused if Color_Mode is 256
case Kind is
when Regular =>
Disabled : Boolean;
Flip_Horizontal : Boolean;
Flip_Vertical : Boolean;
when Affine =>
Double_Size : Boolean;
Transform_Index : OBJ_Affine_Transform_Index;
end case;
end record
with Size => 48;
for OBJ_Attributes use
record
Y at 0 range 0 .. 7;
Kind at 0 range 8 .. 8;
Disabled at 0 range 9 .. 9;
Double_Size at 0 range 9 .. 9;
Mode at 0 range 10 .. 11;
Enable_Mosaic at 0 range 12 .. 12;
Color_Mode at 0 range 13 .. 13;
Shape at 0 range 14 .. 15;
X at 2 range 0 .. 8;
Transform_Index at 2 range 9 .. 13;
Flip_Horizontal at 2 range 12 .. 12;
Flip_Vertical at 2 range 13 .. 13;
Scale at 2 range 14 .. 15;
Tile_Index at 4 range 0 .. 9;
Priority at 4 range 10 .. 11;
Palette_Index at 4 range 12 .. 15;
end record;
type Volatile_OBJ_Attributes is new OBJ_Attributes
with Volatile;
type OAM_Attributes_Ptr is access all Volatile_OBJ_Attributes
with Storage_Size => 0, Volatile;
function Attributes_Of_Object (ID : OBJ_ID) return OAM_Attributes_Ptr
with Pure_Function, Inline_Always;
function Attributes_Of_Object (ID : OBJ_ID) return OBJ_Attributes
with Inline_Always;
procedure Set_Object_Attributes (ID : OBJ_ID; Attributes : OBJ_Attributes)
with Inline;
type OAM_Entry is limited
record
Attributes : aliased Volatile_OBJ_Attributes;
Transform_Parameter : aliased Affine_Transform_Parameter;
end record
with Size => 64, Volatile;
for OAM_Entry use
record
Attributes at 0 range 0 .. 47;
Transform_Parameter at 6 range 0 .. 15;
end record;
Object_Attribute_Memory : array (0 .. 127) of OAM_Entry
with Import, Volatile_Components, Address => OAM_Address'First;
end GBA.Display.Objects; |
Task/Numerical-integration/Ada/numerical-integration-1.ada | mullikine/RosettaCodeData | 1 | 18500 | <gh_stars>1-10
generic
type Scalar is digits <>;
with function F (X : Scalar) return Scalar;
package Integrate is
function Left_Rectangular (A, B : Scalar; N : Positive) return Scalar;
function Right_Rectangular (A, B : Scalar; N : Positive) return Scalar;
function Midpoint_Rectangular (A, B : Scalar; N : Positive) return Scalar;
function Trapezium (A, B : Scalar; N : Positive) return Scalar;
function Simpsons (A, B : Scalar; N : Positive) return Scalar;
end Integrate;
|
oeis/192/A192370.asm | neoneye/loda-programs | 11 | 84357 | <filename>oeis/192/A192370.asm
; A192370: Sum of all the n-digit numbers whose digits are all even and nonzero: 2,4,6,8.
; Submitted by <NAME>
; 20,880,35520,1422080,56888320,2275553280,91022213120,3640888852480,145635555409920,5825422221639680,233016888886558720,9320675555546234880,372827022222184939520,14913080888888739758080,596523235555554959032320,23860929422222219836129280
add $0,1
mov $1,40
pow $1,$0
mov $2,4
pow $2,$0
sub $1,$2
mov $0,$1
div $0,36
mul $0,20
|
spec/copy-large-mem-forward.spec.asm | c64lib/common | 7 | 173489 | #import "64spec/lib/64spec.asm"
#import "../lib/invoke-global.asm"
sfspec: init_spec()
describe("copyLargeMemForward")
it("copies 7 bytes forward non overlapping"); {
c64lib_pushParamW(dataToBeMoved)
c64lib_pushParamW(targetLocation)
c64lib_pushParamW(7)
jsr copyLargeMemForward
assert_bytes_equal 7: targetLocation: dataToBeMoved
}
it("copies 260 bytes forward non overlapping"); {
c64lib_pushParamW(largeDataToBeMoved)
c64lib_pushParamW(largeTargetLocation)
c64lib_pushParamW(260)
jsr copyLargeMemForward
assert_bytes_equal 19: largeTargetLocation: largeDataToBeMoved
}
finish_spec()
* = * "Data"
copyLargeMemForward:
#import "../lib/sub/copy-large-mem-forward.asm"
dataToBeMoved: .text "foo bar"
targetLocation: .text " "
largeDataToBeMoved: .fill 260, 127.5 + sin(toRadians(i*360/256))
largeTargetLocation: .fill 260, 0
|
src/perception.adb | Kurinkitos/Twizy-Security | 1 | 27005 | --with Spark.Float_Arithmetic_Lemmas;
with Mathutil;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
with Ada.Text_IO;
package body perception with SPARK_Mode is
--use Spark.Float_Arithmetic_Lemmas;
function breakingDistance (s : in Speed) return Distance
is
Dist : Distance;
begin
pragma Assert(BreakConstant > 0.0);
Dist := Distance(S) * Distance(2);
return abs (Dist / BreakConstant);
end breakingDistance;
function GetDangerZone(S : in Speed; SteeringAngle : in Steering_Angle; Obj_Type : in C_type) return DangerZone
is
-- These values chage when test for real values
BreakingDist : Distance := BreakingDistance(S);
LidarAngle : Lidar_Angle := 45.0;
BreakingDistScale : constant Distance := 1.0;
begin
if Obj_Type /= UNKNOWN_UNMOVABLE then
if (BreakingDist >= Distance'Last / BreakingDistScale) then
BreakingDist := Distance'Last;
else
pragma Assume(BreakingDist * BreakingDistScale < Distance'Last);
pragma Assume(BreakingDist * BreakingDistScale > 0.0);
BreakingDist := BreakingDist * BreakingDistScale; -- Change this constant later
end if;
LidarAngle := 60.0;
end if;
return (ScopeAngle => LidarAngle, Radius => BreakingDist, SteeringAngleOffset => SteeringAngle);
end GetDangerZone;
function PointInDangerZone(P : in LocalPoint; DZ : in DangerZone) return Boolean
is
Ang : Lidar_Angle := 0.0;
pragma Assume(P.X * P.X + P.Y * P.Y > 0.0);
pragma Assume(P.X * P.X + P.Y * P.Y < 6000.0);
Dist2 : constant Distance := Distance(P.X * P.X + P.Y * P.Y);
pragma Assume(Dist2 > 0.0);
Dist : constant Distance := Mathutil.Sqrt(Dist2);
begin
if Dist > DZ.Radius or P.Y < 0.0 then -- outside radius or behind us
return False;
else
if P.X /= 0.0 and P.Y /= 0.0 then
Ang := Lidar_Angle(Mathutil.ArcTan(P.X, P.Y));
elsif P.Y = 0.0 then
pragma Assume(P.X / P.X = 1.0 or P.X / P.X = -1.0);
Ang := 90.0 * Lidar_Angle(P.X / P.X);
end if;
end if;
return (abs Ang) <= DZ.ScopeAngle;
end PointInDangerZone;
function GetDZEdge(DZ : DangerZone; Left : Boolean) return Line
is
Q : LocalPoint := (Mathutil.Cos(DZ.ScopeAngle) * DZ.Radius, Mathutil.Sin(DZ.ScopeAngle) * DZ.Radius, 0.0);
begin
if (Left) then
Q.X := (-Q.X);
end if;
return (P => (0.0, 0.0, 0.0), Q => Q);
end GetDZEdge;
function GetOrientation(P1 : LocalPoint; P2 : LocalPoint; P3 : LocalPoint) return Orientation
is
Val : constant Cartesian_Coordinate := (P2.Y - P1.Y) * (P3.X - P2.X) -
(P3.Y - P2.Y) * (P2.X - P1.X);
begin
if Val = 0.0 then
return CL;
elsif Val < 0.0 then
return CCW;
else
return CW;
end if;
end GetOrientation;
-- https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/
function IsIntersecting(L1 : Line; L2 : Line) return Boolean
is
O1 : constant Orientation := GetOrientation(L1.P, L1.Q, L2.P);
O2 : constant Orientation := GetOrientation(L1.P, L1.Q, L2.Q);
O3 : constant Orientation := GetOrientation(L2.P, L2.Q, L1.P);
O4 : constant Orientation := GetOrientation(L2.P, L2.Q, L1.Q);
begin
-- general case
if O1 /= O2 and then O3 /= O4 then
return True;
end if;
-- we ignore the special case with colinear orientations since
-- that case is covered by the point in dz (we have a point on
-- the edge
return False;
end IsIntersecting;
function PerceptionCheck(Obstacle : in Perception_Obstacle_ada; Pose : in Pose_Ada; S : in Speed) return Boolean
is
DZ : constant DangerZone := GetDangerZone(S, 0.0, Obstacle.The_C_Type);
GX : constant FloatingNumber := FloatingNumber(Obstacle.Position.X);
GY : constant FloatingNumber := FloatingNumber(Obstacle.Position.Y);
X : constant FloatingNumber := FloatingNumber(Obstacle.Length) / 2.0;
Y : constant FloatingNumber := FloatingNumber(Obstacle.Width) / 2.0;
Stw : constant FloatingNumber := Mathutil.Sin_r(FloatingNumber(Obstacle.Theta));
Ctw : constant FloatingNumber := Mathutil.Cos_r(FloatingNumber(Obstacle.Theta));
-- these points are in the "world" coordinate system, whatever that means
P1w : constant Point := ( X * Ctw - Y * Stw + GX, X * Stw + Y * Ctw + GY, 0.0); -- top left
P2w : constant Point := ( X * Ctw - (-Y) * Stw + GX, X * Stw + (-Y) * Ctw + GY, 0.0); -- top right
P3w : constant Point := ((-X) * Ctw - (-Y) * Stw + GX, (-X) * Stw + (-Y) * Ctw + GY, 0.0); -- bot right
P4w : constant Point := ((-X) * Ctw - Y * Stw + GX, (-X) * Stw + Y * Ctw + GY, 0.0); -- bot left
XT : constant FloatingNumber := FloatingNumber(Pose.Position.X);
YT : constant FloatingNumber := FloatingNumber(Pose.Position.Y);
-- translated to the cars coordinate system
P1t : constant Point := (P1w.X - XT, P1w.Y - YT, 0.0); -- top left
P2t : constant Point := (P2w.X - XT, P2w.Y - YT, 0.0); -- top right
P3t : constant Point := (P3w.X - XT, P3w.Y - YT, 0.0); -- bot right
P4t : constant Point := (P4w.X - XT, P4w.Y - YT, 0.0); -- bot left
PI : constant FloatingNumber := 3.14159265;
St : constant FloatingNumber := Mathutil.Sin_r(-FloatingNumber(Pose.Heading) + PI/2.0);
Ct : constant FloatingNumber := Mathutil.Cos_r(-FloatingNumber(Pose.Heading) + PI/2.0);
-- these points are in the car's local coordinate system
-- to be checked against the dangerZone
P1 : constant Point := ( P1t.X * Ct - P1t.Y * St, P1t.X * St + P1t.Y * Ct, 0.0); -- top left
P2 : constant Point := ( P2t.X * Ct - P2t.Y * St, P2t.X * St + P2t.Y * Ct, 0.0); -- top right
P3 : constant Point := ( P3t.X * Ct - P3t.Y * St, P3t.X * St + P3t.Y * Ct, 0.0); -- bot right
P4 : constant Point := ( P4t.X * Ct - P4t.Y * St, P4t.X * St + P4t.Y * Ct, 0.0); -- bot left
-- Our lines to check for intersection with the dangerzone
L1 : constant Line := (P1, P2);
L2 : constant Line := (P2, P3);
L3 : constant Line := (P3, P4);
L4 : constant Line := (P4, P1);
-- DEBUG STUFF
-- procedure Print_Point(N : String; P : Point) is
-- begin
-- Ada.Text_IO.Put(N);
-- Put(Float(P.X), Exp => 0);
-- Ada.Text_IO.Put(",");
-- Put(Float(P.Y), Exp => 0);
-- Ada.Text_IO.New_Line(1);
-- end Print_Point;
begin
-- Put(Float(GX)); Ada.Text_IO.New_Line(1);
-- Put(Float(GY)); Ada.Text_IO.New_Line(1);
-- Ada.Text_IO.Put("XT,XY: "); Put(Float(XT)); Ada.Text_IO.Put(","); Put(Float(YT)); Ada.Text_IO.New_Line(1);
-- Ada.Text_IO.Put_Line("Points: ");
-- Print_Point("1: ", P1);
-- Print_Point("2: ", P2);
-- Print_Point("3: ", P3);
-- Print_Point("4: ", P4);
-- Ada.Text_IO.Put("");
if PointInDangerZone(P1, DZ) or
PointInDangerZone(P2, DZ) or
PointInDangerZone(P3, DZ) or
PointInDangerZone(P4, DZ) then
-- Ada.Text_IO.Put_Line("Unsafe, point in DZ");
return False;
end if;
-- one optimization is to find the 2 closest lines, but that might be overkill
if IsIntersecting(L1, GetDZEdge(DZ, False)) or
IsIntersecting(L1, GetDZEdge(DZ, True)) or
IsIntersecting(L2, GetDZEdge(DZ, False)) or
IsIntersecting(L2, GetDZEdge(DZ, True)) or
IsIntersecting(L3, GetDZEdge(DZ, False)) or
IsIntersecting(L3, GetDZEdge(DZ, True)) or
IsIntersecting(L4, GetDZEdge(DZ, False)) or
IsIntersecting(L4, GetDZEdge(DZ, True)) then
-- Ada.Text_IO.Put_Line("Unsafe, line crossing DZ");
return False;
end if;
return True;
end PerceptionCheck;
end;
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_380.asm | ljhsiun2/medusa | 9 | 242912 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1eb6e, %rsi
lea addresses_WT_ht+0x16882, %rdi
nop
and %r10, %r10
mov $2, %rcx
rep movsl
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_normal_ht+0x87ce, %rsi
lea addresses_UC_ht+0x5e6e, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add %rbx, %rbx
mov $119, %rcx
rep movsl
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x7436, %rdi
nop
and $15092, %r9
movb $0x61, (%rdi)
nop
nop
cmp $1678, %r10
lea addresses_UC_ht+0x886e, %rcx
nop
nop
nop
nop
nop
inc %rsi
movb (%rcx), %r9b
nop
nop
and %r10, %r10
lea addresses_normal_ht+0x943e, %rcx
nop
nop
nop
nop
xor %r11, %r11
mov $0x6162636465666768, %rdi
movq %rdi, (%rcx)
nop
xor %r10, %r10
lea addresses_WT_ht+0x1dcf2, %r11
nop
nop
nop
nop
nop
and %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
vmovups %ymm0, (%r11)
nop
nop
nop
nop
add $994, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %rax
push %rcx
push %rdi
// Faulty Load
lea addresses_A+0x19c6e, %rcx
nop
nop
add %r10, %r10
mov (%rcx), %edi
lea oracles, %r13
and $0xff, %rdi
shlq $12, %rdi
mov (%r13,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, '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>
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': True, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}}
{'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
*/
|
oeis/017/A017196.asm | neoneye/loda-programs | 11 | 164671 | ; A017196: a(n) = (9*n + 2)^12.
; 4096,3138428376721,4096000000000000,353814783205469041,9065737908494995456,116191483108948578241,951166013805414055936,5688009063105712890625,26963771415920784510976,106890007738661124410161,367666387654882241806336,1126825030131969720661201,3138428376721000000000000,8064241715186276625588961,19342813113834066795298816,43716643078717303412870881,93806788798424099682390016,192300484323376406494140625,378552550483148382977130496,718709255220793060317103921,1320859596446125189798629376
mul $0,9
add $0,2
pow $0,12
|
software/pcx86/bdsrc/cmd/var.asm | fatman2021/basicdos | 0 | 167486 | <gh_stars>0
;
; BASIC-DOS Memory Management Functions
;
; @author <NAME> <<EMAIL>>
; @copyright (c) 2020-2021 <NAME>
; @license MIT <https://basicdos.com/LICENSE.txt>
;
; This file is part of PCjs, a computer emulation software project at pcjs.org
;
include cmd.inc
CODE SEGMENT
EXTNEAR <memError>
EXTBYTE <PREDEF_VARS,PREDEF_ZERO>
ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocBlock
;
; Allocates a block of memory for the given block chain. All chains begin
; with a BLKDEF, and all blocks begin with a BLKHDR:
;
; BLK_NEXT (segment of next block in chain)
; BLK_SIZE (size of block, in bytes)
; BLK_FREE (offset of next free byte in block)
;
; Inputs:
; SI = offset of block chain head
; CX = size of block, in bytes (if calling allocBlockSize)
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte in new block
;
; Modifies:
; AX, DI, ES
;
DEFPROC allocBlock
mov cx,[si].BDEF_SIZE
DEFLBL allocBlockSize,near
push bx
push cx
mov bx,cx
add bx,15
xchg cx,ax
mov cl,4
shr bx,cl
xchg cx,ax
mov ah,DOS_MEM_ALLOC
int 21h
jc ab8
mov es,ax
sub di,di
sub ax,ax
stosw ; set BLK_NEXT
mov ax,cx
stosw ; set BLK_SIZE
mov al,[si].BDEF_HDR
cbw
stosw ; set BLK_FREE
mov al,[si].BDEF_SIG
stosw ; set BLK_SIG/BLK_PAD
sub ax,ax
sub cx,di
shr cx,1
rep stosw ; zero out the rest of the block
jnc ab2
stosb
;
; Block is initialized, append to the header chain now.
;
ab2: push ds
lea di,[si].BDEF_NEXT ; DS:DI -> first segment in chain
ab3: mov cx,[di] ; at the end yet?
jcxz ab4 ; yes
mov ds,cx
sub di,di
jmp ab3
ab4: mov [di],es ; chain updated
mov di,es:[BLK_FREE] ; ES:DI -> first available byte
pop ds
clc
jmp short ab9
ab8: call memError
ab9: pop cx
pop bx
ret
ENDPROC allocBlock
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeBlock
;
; Frees a block of memory for the given block chain.
;
; Inputs:
; ES = segment of block
; SI = offset of block chain head
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeBlock
push ax
push ds ; DS:SI -> first segment in chain
mov ax,es
fb1: mov cx,[si]
ASSERT NZ,<test cx,cx>
jcxz fb9 ; ended without match, free anyway?
cmp cx,ax ; find a match yet?
je fb2 ; yes
mov ds,cx
sub si,si
jmp fb1
fb2: mov ax,es:[BLK_NEXT]
mov [si],ax
fb9: mov ah,DOS_MEM_FREE ; free segment in ES
int 21h
pop ds
pop ax
ret
ENDPROC freeBlock
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeAllBlocks
;
; Frees all blocks of memory for the given block chain.
;
; Inputs:
; SI = offset of block chain head
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeAllBlocks
clc
push es
fa1: mov cx,[si]
jcxz fa9 ; end of chain
mov es,cx
call freeBlock ; ES = segment of block to free
jnc fa1
fa9: pop es
ret
ENDPROC freeAllBlocks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocCode
;
; Inputs:
; BX -> CMDHEAP
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte, CX = length
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC allocCode
lea si,[bx].CBLKDEF
DEFLBL allocCodeBlock,near
call allocBlock
jc ac9
;
; ES:[BLK_SIZE] is the absolute limit for generated code, but we also maintain
; ES:[CBLK_REFS] as the bottom of the block's LBLREF table, and that's the real
; limit that the code generator must be mindful of.
;
; Initialize the block's LBLREF table; it's empty when CBLK_REFS = BLK_SIZE.
;
mov es:[CBLK_REFS],cx
ac9: ret
ENDPROC allocCode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; shrinkCode
;
; Inputs:
; ES:DI -> next unused byte
;
; Outputs:
; If successful, code block in ES is shrunk
;
; Modifies:
; AX
;
DEFPROC shrinkCode
push bx
push cx
mov es:[BLK_FREE],di
mov bx,di
add bx,15
mov cl,4
shr bx,cl
mov ah,DOS_MEM_REALLOC
int 21h
jc sc9
mov es:[BLK_SIZE],di
sc9: pop cx
pop bx
ret
ENDPROC shrinkCode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeCode
;
; Inputs:
; ES -> code block
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC freeCode
mov si,ds:[PSP_HEAP]
lea si,[si].CBLKDEF
jmp freeBlock
ENDPROC freeCode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeAllCode
;
; Frees all code blocks and resets the CBLK chain.
;
; Inputs:
; None
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeAllCode
mov si,ds:[PSP_HEAP]
lea si,[si].CBLKDEF
jmp freeAllBlocks
ENDPROC freeAllCode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocFunc
;
; Inputs:
; None
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte, CX = length
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC allocFunc
mov si,ds:[PSP_HEAP]
lea si,[si].FBLKDEF
jmp allocCodeBlock
ENDPROC allocFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeFunc
;
; Inputs:
; ES -> code block
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC freeFunc
mov si,ds:[PSP_HEAP]
lea si,[si].FBLKDEF
jmp freeBlock
ENDPROC freeFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocText
;
; Inputs:
; CX = text block size (in bytes)
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte, CX = length
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC allocText
mov si,ds:[PSP_HEAP]
lea si,[si].TBLKDEF
jmp allocBlockSize
ENDPROC allocText
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeAllText
;
; Frees all text blocks and resets the TBLK chain.
;
; Inputs:
; None
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeAllText
mov si,ds:[PSP_HEAP]
lea si,[si].TBLKDEF
jmp freeAllBlocks
ENDPROC freeAllText
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocVars
;
; Allocates a var block if one is not already allocated.
;
; Inputs:
; BX -> CMDHEAP
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte, CX = length
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC allocVars
lea si,[bx].VBLKDEF
cmp [si].BDEF_NEXT,0
jne al9
jmp allocBlock
al9: ret
ENDPROC allocVars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocTempVars
;
; Allocates a temp var block and makes it active, returning previous chain.
;
; Inputs:
; None
;
; Outputs:
; If carry clear, DX = segment of previous block chain
;
; Modifies:
; AX, CX, DX, SI
;
DEFPROC allocTempVars
push di
push es
mov si,ds:[PSP_HEAP]
lea si,[si].VBLKDEF
sub dx,dx
xchg [si].BDEF_NEXT,dx
call allocBlock
pop es
pop di
ret
ENDPROC allocTempVars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; updateTempVars
;
; Adds the specified block(s) to the var block chain.
;
; Inputs:
; DX = segment of block(s) to restore
;
; Outputs:
; None
;
; Modifies:
; SI
;
DEFPROC updateTempVars
push es
mov si,ds:[PSP_HEAP] ; we know there's only one block
mov es,[si].VBLKDEF.BDEF_NEXT
mov es:[BLK_NEXT],dx ; so we can simply update its BLK_NEXT
pop es
ret
ENDPROC updateTempVars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeTempVars
;
; Frees the first (temp) var block.
;
; Inputs:
; None
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeTempVars
push es
mov si,ds:[PSP_HEAP]
lea si,[si].VBLKDEF
mov es,[si].BDEF_NEXT
call freeBlock
pop es
ret
ENDPROC freeTempVars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeAllVars
;
; Free all FBLKs and VBLKs.
;
; Inputs:
; None
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeAllVars
call freeStrSpace
mov si,ds:[PSP_HEAP]
lea si,[si].FBLKDEF
call freeAllBlocks
mov si,ds:[PSP_HEAP]
lea si,[si].VBLKDEF
call freeAllBlocks
ret
ENDPROC freeAllVars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; allocStrSpace
;
; Allocates an SBLK and adds it to the SBLK chain.
;
; Inputs:
; None
;
; Outputs:
; If successful, carry clear, ES:DI -> first available byte, CX = length
;
; Modifies:
; AX, CX, SI, DI, ES
;
DEFPROC allocStrSpace
mov si,ds:[PSP_HEAP]
lea si,[si].SBLKDEF
jmp allocBlock
ENDPROC allocStrSpace
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; freeStrSpace
;
; Frees all SBLKs and resets the SBLK chain.
;
; Inputs:
; None
;
; Outputs:
; Carry clear if successful, set if error
;
; Modifies:
; CX, SI
;
DEFPROC freeStrSpace
mov si,ds:[PSP_HEAP]
lea si,[si].SBLKDEF
jmp freeAllBlocks
ENDPROC freeStrSpace
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; addVar
;
; Variables start with a byte length (the length of the name), followed by
; the name of the variable, followed by the variable data. The name length
; is limited to VAR_NAMELEN.
;
; This function must also reserve the total space required for the var data.
; That's 2 bytes for VAR_PARM, 4 bytes for VAR_LONG and VAR_STR, and
; 2 + parm count * 2 + 4 for VAR_FUNC.
;
; Inputs:
; AH = var type (VAR_*)
; AL = parm count (if AH = VAR_FUNC)
; CX = length of name
; DS:SI -> variable name
;
; Outputs:
; If carry clear, AH = var type, DX:SI -> var data
;
; Modifies:
; AX, CX, DX, SI
;
DEFPROC addVar
push bx
push di
push es
ASSERT C,<cmp cx,256> ; validate size (and that CH is zero)
mov bx,ax ; save var type
mov di,si ; save var name
call findVar
jnc av1x
mov al,bh ; AL = var type
mov si,di ; restore var name to SI
mov di,ds:[PSP_HEAP]
mov es,[di].VBLKDEF.BDEF_NEXT
ASSERT STRUCT,es:[0],VBLK
mov di,es:[BLK_FREE]
DPRINTF 'b',<"adding variable %.*ls\r\n">,cx,si,ds
sub dx,dx
cmp cx,VAR_NAMELEN
jbe av1
mov cx,VAR_NAMELEN
av1: push di
add di,cx
inc dx
inc dx
cmp al,VAR_LONG
jb av3
inc dx
inc dx
cmp al,VAR_DOUBLE
jb av3
ja av2
add dx,dx
jmp short av3
av1x: jmp short av9
av2: ASSERT Z,<cmp al,VAR_FUNC>
mov dl,bl ; DX = parm count
add dx,dx ; DX = DX * 2
add dx,6 ; DX += return type + code ptr
av3: add di,dx
inc di ; one for the length byte
cmp es:[BLK_SIZE],di ; enough room?
pop di
jb av9 ; no (carry set)
;
; Build the new variable at ES:DI, with combined length and type in the
; first byte, the variable name in the following bytes, and zero-initialized
; data in the remaining bytes.
;
or al,cl
stosb
av4: lodsb ; rep movsb would be nice here
cmp al,'a' ; but we upper-case the var name now
jb av5
sub al,20h
av5: stosb
loop av4
mov al,cl ; AL = 0
mov cx,dx ; CX = size of var data
mov dx,di ; DX = offset of var data
rep stosb
mov es:[BLK_FREE],di
cmp es:[BLK_SIZE],di
ASSERT AE
je av8
stosb ; ensure there's always a zero after
av8: mov si,dx
mov dx,es ; DX:SI -> var data
xchg ax,bx ; restore AH, AL
av9: pop es
pop di
pop bx
ret
ENDPROC addVar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; findVar
;
; Inputs:
; CX = length of name
; DS:SI -> variable name
;
; Outputs:
; If carry clear, AH = var type, DX:SI -> var data
; If carry set, AH = VAR_LONG, DX:SI -> zero constant
;
; Modifies:
; AX, DX, SI
;
DEFPROC findVar
push es
push di
push cs
pop es
mov di,offset PREDEF_VARS
jmp short fv1
fv0: mov di,ds:[PSP_HEAP]
mov es,[di].VBLKDEF.BDEF_NEXT
ASSERT STRUCT,es:[0],VBLK
mov di,size VBLK ; ES:DI -> first var in block
fv1: mov al,es:[di]
inc di
cmp al,VAR_DEAD ; end of variables in the block?
je fv1 ; no, dead byte
ja fv2 ; no, existing variable
mov ax,cs ; TODO: integrate PREDEF_VARS and
mov dx,es ; and the rest of the var blocks better
cmp ax,dx
je fv0
stc
mov dx,cs
mov si,offset PREDEF_ZERO ; DX:SI -> zero constant
lods byte ptr cs:[si]
mov ah,al
jmp short fv9
fv2: mov ah,al
and ah,VAR_TYPE
and al,VAR_NAMELEN
cmp al,cl ; do the name lengths match?
jne fv6 ; no
push ax
push cx
push si
push di
fv3: lodsb ; TODO: rep cmpsb would be nice here
cmp al,'a' ; especially since it doesn't use AL
jb fv4 ; but tokens are not upper-cased first
sub al,20h
fv4: scasb
jne fv5
loop fv3
mov dx,di ; DX -> variable data
fv5: pop di
pop si
pop cx
pop ax
je fv8 ; match!
fv6: mov dl,al
mov dh,0
add di,dx ; DI -> past var name
call getVarLen
add di,ax
jmp fv1 ; keep looking
fv8: mov si,dx
mov dx,es ; DX:SI -> var data
fv9: pop di
pop es
ret
ENDPROC findVar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; getVar
;
; Load AX with the var data at DX:SI and advance SI.
;
; Inputs:
; DX:SI -> var data
;
; Outputs:
; AX = data
;
; Modifies:
; SI
;
DEFPROC getVar
push ds
mov ds,dx
lodsw
pop ds
ret
ENDPROC getVar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; getVarLen
;
; Inputs:
; AH = var type
; ES:DI -> var data
;
; Outputs:
; AX = length of var data
;
; Modifies:
; AX
;
DEFPROC getVarLen
push cx
sub cx,cx
cmp ah,VAR_PARM
jb gvl9
mov cx,2
je gvl9 ; VAR_PARM is always 2 bytes
cmp ah,VAR_FUNC
jae gvl1
add cx,2 ; other values are at least 4 bytes
cmp ah,VAR_DOUBLE
jb gvl9
add cx,4 ; VAR_DOUBLE is 8 bytes
jmp short gvl9
gvl1: add cx,4 ; VAR_FUNC also has 4-byte addr
mov al,es:[di+1] ; AL = VAR_FUNC or VAR_ARRAY length
cbw
add ax,ax
add cx,ax
gvl9: xchg ax,cx ; AX = length of var data
pop cx
ret
ENDPROC getVarLen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; removeVar
;
; Inputs:
; CX = length of name
; DS:SI -> variable name
;
; Outputs:
; If carry clear, variable removed (or does not exist)
; If carry set, variable predefined (cannot be removed)
;
; Modifies:
; AX, DX
;
DEFPROC removeVar
DPRINTF 'b',<"removing variable %.*ls\r\n">,cx,si,ds
push si
call findVar ; does var exist?
cmc
jnc rv9 ; exit if not
push di ; AH = var type, DX:SI -> var data
mov di,cs
cmp di,dx ; predefined variable?
stc
je rv8 ; yes
push es
push cx
mov es,dx
mov di,si ; ES:DI -> var data
mov dh,ah ; DH = var type
call getVarLen ; AX = length of var data at ES:DI
inc cx ; CX = total length of name
sub di,cx ; ES:DI -> name name
add cx,ax ; CX = total length of name + data
cmp dh,VAR_FUNC
jne rv1
push cx
push es
push di
add di,cx
mov es,es:[di-2]
call freeFunc ; ES = function segment
ASSERT NC
pop di
pop es
pop cx
rv1: mov al,VAR_DEAD
rep stosb
pop cx
pop es
rv8: pop di
rv9: pop si
ret
ENDPROC removeVar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; setVar
;
; Store AX in the var data at DX:SI and advance SI.
;
; Inputs:
; AX = data
; DX:SI -> var data
;
; Outputs:
; None
;
; Modifies:
; SI
;
DEFPROC setVar
push ds
mov ds,dx
mov [si],ax
add si,2
pop ds
ret
ENDPROC setVar
CODE ENDS
end
|
.emacs.d/elpa/wisi-3.0.1/wisitoken-parse-packrat.adb | caqg/linux-home | 0 | 7270 | <filename>.emacs.d/elpa/wisi-3.0.1/wisitoken-parse-packrat.adb
-- Abstract :
--
-- See spec.
--
-- Copyright (C) 2018 Free Software Foundation, Inc.
--
-- This library is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 3, or (at your option) any later
-- version. This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- As a special exception under Section 7 of GPL version 3, you are granted
-- additional permissions described in the GCC Runtime Library Exception,
-- version 3.1, as published by the Free Software Foundation.
pragma License (Modified_GPL);
package body WisiToken.Parse.Packrat is
overriding procedure Execute_Actions (Parser : in out Packrat.Parser)
is
Descriptor : WisiToken.Descriptor renames Parser.Trace.Descriptor.all;
procedure Process_Node
(Tree : in out Syntax_Trees.Tree;
Node : in Syntax_Trees.Valid_Node_Index)
is
use all type Syntax_Trees.Node_Label;
begin
if Tree.Label (Node) /= Nonterm then
return;
end if;
declare
use all type Syntax_Trees.Semantic_Action;
Tree_Children : constant Syntax_Trees.Valid_Node_Index_Array := Tree.Children (Node);
begin
Parser.User_Data.Reduce (Tree, Node, Tree_Children);
if Tree.Action (Node) /= null then
Tree.Action (Node) (Parser.User_Data.all, Tree, Node, Tree_Children);
end if;
end;
end Process_Node;
begin
if Trace_Action > Outline then
Parser.Trace.Put_Line ("root node: " & Parser.Tree.Image (Parser.Tree.Root, Descriptor));
end if;
Parser.Tree.Process_Tree (Process_Node'Access);
end Execute_Actions;
end WisiToken.Parse.Packrat;
|
P3/bubble_sort.adb | MC-DeltaT/Programming-Languages | 0 | 7589 | with Ada.Text_IO;
with Ada.Integer_Text_IO;
procedure Bubble_Sort is
type Int_Array is array (Positive range <>) of Integer;
procedure Do_Bubble_Sort(A: in out Int_Array) is
Did_Swap: Boolean;
Tmp: Positive;
begin
loop
Did_Swap := false;
for I in Integer range (A'First + 1) .. A'Last loop
if A(I) < A(I - 1) then
Tmp := A(I - 1);
A(I - 1) := A(I);
A(I) := Tmp;
Did_Swap := true;
end if;
end loop;
exit when not Did_Swap;
end loop;
end Do_Bubble_Sort;
A: Int_Array (1..10) := (7, 6, 3, 5, 9, 4, 8, 10, 1, 2);
-- A: Int_Array (1..10) := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-- A: Int_Array (1..10) := (10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
-- A: Int_Array (1..1) := (others => 42);
-- A: Int_Array (1..0);
begin
Do_Bubble_Sort(A);
for I in A'Range loop
Ada.Integer_Text_IO.Put(A(I), 0);
if I /= A'Last then
Ada.Text_IO.Put(", ");
end if;
end loop;
Ada.Text_IO.New_Line;
end Bubble_Sort;
|
src/pads.asm | munshkr/nes-snake | 0 | 169118 | <reponame>munshkr/nes-snake
;
; NES controller reading code
; Copyright 2009-2011 <NAME>
; Copyright 2021 munshkr
;
; Copying and distribution of this file, with or without
; modification, are permitted in any medium without royalty provided
; the copyright notice and this notice are preserved in all source
; code copies. This file is offered as-is, without any warranty.
;
;
; 2011-07: <NAME> added labels for the local variables and
; copious comments and made USE_DAS a compile-time option
; 2021-01: munshkr added some changes:
; - migrated to asm6 syntax
; - removed autorepeat support to simplify.
;
JOY1 .equ $4016
JOY2 .equ $4017
read_pads:
; store the current keypress state to detect key-down later
lda cur_keys
sta lastFrameKeys
lda cur_keys+1
sta lastFrameKeys+1
; Read the joypads twice in case DMC DMA caused a clock glitch.
jsr read_pads_once
lda thisRead
sta firstRead
lda thisRead+1
sta firstRead+1
jsr read_pads_once
; For each player, make sure the reads agree, then find newly
; pressed keys.
ldx #1
@fixupKeys:
; If the player's keys read out the same way both times, update.
; Otherwise, keep the last frame's keypresses.
lda thisRead,x
cmp firstRead,x
bne @dontUpdateGlitch
sta cur_keys,x
@dontUpdateGlitch:
lda lastFrameKeys,x ; A = keys that were down last frame
eor #$FF ; A = keys that were up last frame
and cur_keys,x ; A = keys down now and up last frame
sta new_keys,x
dex
bpl @fixupKeys
rts
read_pads_once:
; Bits from the controllers are shifted into thisRead and
; thisRead+1. In addition, thisRead+1 serves as the loop counter:
; once the $01 gets shifted left eight times, the 1 bit will
; end up in carry, terminating the loop.
lda #$01
sta thisRead+1
; Write 1 then 0 to JOY1 to send a latch signal, telling the
; controllers to copy button states into a shift register
sta JOY1
lsr a
sta JOY1
@loop:
; On NES and AV Famicom, button presses always show up in D0.
; On the original Famicom, presses on the hardwired controllers
; show up in D0 and presses on plug-in controllers show up in D1.
; D2-D7 consist of data from the Zapper, Power Pad, Vs. System
; DIP switches, and bus capacitance; ignore them.
lda JOY1 ; read player 1's controller
and #%00000011 ; ignore D2-D7
cmp #1 ; CLC if A=0, SEC if A>=1
rol thisRead ; put one bit in the register
lda JOY2 ; read player 2's controller the same way
and #$03
cmp #1
rol thisRead+1
bcc @loop ; once $01 has been shifted 8 times, we're done
rts
|
MProkaron/Platform/CortexR/rmp_platform_crx_asm.asm | EDI-Systems/M5P1_MuProkaron | 139 | 174003 | <reponame>EDI-Systems/M5P1_MuProkaron
;/*****************************************************************************
;Filename : rmp_platform_crx_asm.s
;Author : pry
;Date : 10/04/2012
;Description : The assembly part of the RMP RTOS. This is for Cortex-R4/5/7/8.
;*****************************************************************************/
;/* The ARM Cortex-R Architecture *********************************************
; Sys/User FIQ Supervisor Abort IRQ Undefined
; R0 R0 R0 R0 R0 R0
; R1 R1 R1 R1 R1 R1
; R2 R2 R2 R2 R2 R2
; R3 R3 R3 R3 R3 R3
; R4 R4 R4 R4 R4 R4
; R5 R5 R5 R5 R5 R5
; R6 R6 R6 R6 R6 R6
; R7 R7 R7 R7 R7 R7
; R8 R8_F R8 R8 R8 R8
; R9 R9_F R9 R9 R9 R9
; R10 R10_F R10 R10 R10 R10
; R11 R11_F R11 R11 R11 R11
; R12 R12_F R12 R12 R12 R12
; SP SP_F SP_S SP_A SP_I SP_U
; LR LR_F LR_S LR_A LR_I LR_U
; PC PC PC PC PC PC
;---------------------------------------------------------------
; CPSR CPSR CPSR CPSR CPSR CPSR
; SPSR_F SPSR_S SPSR_A SPSR_I SPSR_U
; 11111/10000 10001 10011 10111 10010 11011
;---------------------------------------------------------------
;R0-R7 : General purpose registers that are accessible
;R8-R12 : General purpose regsisters that are not accessible by 16-bit thumb
;R13 : SP, Stack pointer
;R14 : LR, Link register
;R15 : PC, Program counter
;CPSR : Program status word
;SPSR : Banked program status word
;The ARM Cortex-R4/5/7/8 also include a single-accuracy FPU.
;*****************************************************************************/
;/* Begin Header *************************************************************/
.text
.arm
;/* End Header ***************************************************************/
;/* Begin Exports ************************************************************/
;Disable all interrupts
.global RMP_Disable_Int
;Enable all interrupts
.global RMP_Enable_Int
;Mask/unmask some interrupts
.global RMP_Mask_Int
;Get the MSB
.global RMP_MSB_Get
;Start the first thread
.global _RMP_Start
;The PendSV trigger
.global _RMP_Yield
;The system pending service routine
.global ssiInterrupt ;PendSV_Handler
;The systick timer routine
.global rtiNotification ;SysTick_Handler
;Other unused error handlers
.global phantomInterrupt
;/* End Exports **************************************************************/
;/* Begin Imports ************************************************************/
;The real task switch handling function
.global _RMP_Get_High_Rdy
;The real systick handler function
.global _RMP_Tick_Handler
;The PID of the current thread
.global RMP_Cur_Thd
;The stack address of current thread
.global RMP_Cur_SP
;Save and load extra contexts, such as FPU, peripherals and MPU
.global RMP_Save_Ctx
.global RMP_Load_Ctx
;/* End Imports **************************************************************/
;/* Begin Function:RMP_Disable_Int ********************************************
;Description : The function for disabling all interrupts. Does not allow nesting.
; We never mask FIQs on Cortex-R because they are not allowed to
; perform any non-transparent operations anyway.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
RMP_Disable_Int .asmfunc
;Disable all interrupts (I is primask,F is Faultmask.)
CPSID I
BX LR
.endasmfunc
;/* End Function:RMP_Disable_Int *********************************************/
;/* Begin Function:RMP_Enable_Int *********************************************
;Description : The function for enabling all interrupts. Does not allow nesting.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
RMP_Enable_Int .asmfunc
;Enable all interrupts.
CPSIE I
BX LR
.endasmfunc
;/* End Function:RMP_Enable_Int **********************************************/
;/* Begin Function:RMP_Mask_Int ***********************************************
;Description : The function for masking & unmasking interrupts. This is dummy on
; Cortex-R.
;Input : rmp_ptr_t R0 - The new BASEPRI to set.
;Output : None.
;Return : None.
;*****************************************************************************/
RMP_Mask_Int .asmfunc
;Mask some interrupts.
;MSR BASEPRI,R0
;BX LR
.endasmfunc
;/* End Function:RMP_Mask_Int ************************************************/
;/* Begin Function:RMP_MSB_Get ************************************************
;Description : Get the MSB of the word.
;Input : rmp_ptr_t R0 - The value.
;Output : None.
;Return : rmp_ptr_t R0 - The MSB position.
;*****************************************************************************/
RMP_MSB_Get .asmfunc
CLZ R1,R0
MOVS R0,#31
SUBS R0,R0,R1
BX LR
.endasmfunc
;/* End Function:RMP_MSB_Get *************************************************/
;/* Begin Function:_RMP_Yield *************************************************
;Description : Trigger a yield to another thread.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
_RMP_Yield .asmfunc
PUSH {R0-R1}
LDR R0,SSI1_Addr ;The SSI interrupt register address
MOVS R1,#0x7500 ;The key needed to trigger such interrupt
STR R1,[R0] ;Trigger the software interrupt
ISB ;Instruction barrier
POP {R0-R1}
BX LR
.endasmfunc
SSI1_Addr .word 0xFFFFFFB0
;/* End Function:_RMP_Yield **************************************************/
;/* Begin Function:_RMP_Start *************************************************
;Description : Jump to the user function and will never return from it.
; Because the CCS startup code put us into the system state already,
; there's no need to use interrupt return semantics - just branch to it.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
_RMP_Start .asmfunc
;Should never reach here
SUBS R1,R1,#64 ;This is how we push our registers so move forward
MOVS SP,R1 ;Set the stack pointer
BLX R0 ;Branch to our target
Loop:
B Loop ;Capture faults
.endasmfunc
;/* End Function:_RMP_Start **************************************************/
;/* Begin Function:PendSV_Handler *********************************************
;Description : The PendSV interrupt routine. In fact, it will call a C function
; directly. The reason why the interrupt routine must be an assembly
; function is that the compiler may deal with the stack in a different
; way when different optimization level is chosen. An assembly function
; can make way around this problem.
; However, if your compiler support inline assembly functions, this
; can also be written in C.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
ssiInterrupt .asmfunc
.endasmfunc
PendSV_Handler .asmfunc
SUBS LR,LR,#0x04 ;Correct the LR value first - the LR is always a word behind
SRSDB SP!,#0x1F ;Save LR at SVC(PC at SYS) and SPSR at SVC(CPSR at SYS)
CPS #0x1F ;Switch to SYS mode
PUSH {R0-R12,LR} ;Spill all registers to stack
LDR R0,SSIF_Addr ;Clear the software interrupt flag
MOV R1,#0x0F
STR R1,[R0]
BL RMP_Save_Ctx ;Save extra context
LDR R1,RMP_Cur_SP_Addr ;Save The SP to control block.
STR SP,[R1]
BL _RMP_Get_High_Rdy ;Get the highest ready task.
LDR R1,RMP_Cur_SP_Addr ;Load the SP.
LDR SP,[R1]
BL RMP_Load_Ctx ;Load extra context
POP {R0-R12,LR}
RFEIA SP!
.endasmfunc
SSIF_Addr .word 0xFFFFFFF8
;/* End Function:PendSV_Handler **********************************************/
;/* Begin Function:SysTick_Handler ********************************************
;Description : The SysTick interrupt routine. In fact, it will call a C function
; directly. The reason why the interrupt routine must be an assembly
; function is that the compiler may deal with the stack in a different
; way when different optimization level is chosen. An assembly function
; can make way around this problem.
; However, if your compiler support inline assembly functions, this
; can also be written in C.
; In the TI library, this was called by a high-level C function, thus the
; SRSDB and RFEIA are not needed.
;Input : None.
;Output : None.
;Return : None.
;*****************************************************************************/
rtiNotification .asmfunc
.endasmfunc
SysTick_Handler .asmfunc
;SRSDB SP!,#0x1F ;Save LR at SVC(PC at SYS) and SPSR at SVC(CPSR at SYS)
PUSH {R0-R3,LR}
MOVS R0,#0x01 ;We are not using tickless.
BL _RMP_Tick_Handler
POP {R0-R3,PC}
;RFEIA SP!
.endasmfunc
;/* End Function:SysTick_Handler *********************************************/
RMP_Cur_SP_Addr .word RMP_Cur_SP
phantomInterrupt .asmfunc
B phantomInterrupt
.endasmfunc
;/* End Of File **************************************************************/
;/* Copyright (C) <NAME>. All rights reserved **********************/
|
examples/platformer/src/game_assets.ads | Fabien-Chouteau/GESTE | 13 | 19455 | with GESTE;
with GESTE.Maths_Types;
with GESTE_Config;
pragma Style_Checks (Off);
package Game_Assets is
Palette : aliased GESTE.Palette_Type := (
0 => 391,
1 => 59147,
2 => 22089,
3 => 58727,
4 => 52303,
5 => 4907,
6 => 41834,
7 => 39694,
8 => 16847,
9 => 35372,
10 => 17208,
11 => 14856,
12 => 21228,
13 => 29681,
14 => 63423,
15 => 42326,
16 => 57613,
17 => 11414,
18 => 65535,
19 => 46486,
20 => 0);
type Object_Kind is (Rectangle_Obj, Point_Obj,
Ellipse_Obj, Polygon_Obj, Tile_Obj, Text_Obj);
type String_Access is access all String;
type Object
(Kind : Object_Kind := Rectangle_Obj)
is record
Name : String_Access;
Id : Natural;
X : GESTE.Maths_Types.Value;
Y : GESTE.Maths_Types.Value;
Width : GESTE.Maths_Types.Value;
Height : GESTE.Maths_Types.Value;
Str : String_Access;
Tile_Id : GESTE_Config.Tile_Index;
end record;
type Object_Array is array (Natural range <>)
of Object;
end Game_Assets;
|
programs/oeis/031/A031913.asm | neoneye/loda | 22 | 85288 | ; A031913: a(n) = prime(9*n - 6).
; 5,37,73,113,167,223,269,317,379,433,487,557,607,659,727,787,853,911,977,1033,1093,1163,1229,1291,1367,1439,1489,1559,1613,1693,1753,1831,1901,1987,2039,2111,2179,2267,2333,2383,2447,2543,2621,2687,2731,2801,2879,2957,3037,3119,3203,3271,3343,3413,3499,3557,3623,3697,3769,3851,3919,4003,4073,4139,4229,4283,4373,4457,4523,4621,4679,4783,4861,4937,4999,5077,5153,5233,5323,5413,5477,5531,5641,5693,5783,5849,5903,6029,6091,6173,6257,6317,6373,6473,6569,6659,6719,6803,6871,6961
mul $0,9
seq $0,215848 ; Primes > 3.
|
src/asf-contexts-faces.adb | Letractively/ada-asf | 0 | 14562 | -----------------------------------------------------------------------
-- asf-contexts.faces -- Faces Contexts
-- Copyright (C) 2009, 2010, 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- 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.
-----------------------------------------------------------------------
with EL.Variables;
with Ada.Task_Attributes;
with Ada.Unchecked_Deallocation;
with ASF.Converters;
with ASF.Contexts.Flash;
with ASF.Contexts.Exceptions.Iterate;
with ASF.Applications.Main;
with ASF.Applications.Messages.Utils;
package body ASF.Contexts.Faces is
package Task_Context is new Ada.Task_Attributes
(Faces_Context_Access, null);
-- ------------------------------
-- Get the response writer to write the response stream.
-- ------------------------------
function Get_Response_Writer (Context : Faces_Context)
return ASF.Contexts.Writer.Response_Writer_Access is
begin
return Context.Writer;
end Get_Response_Writer;
-- ------------------------------
-- Set the response writer to write to the response stream.
-- ------------------------------
procedure Set_Response_Writer (Context : in out Faces_Context;
Writer : in ASF.Contexts.Writer.Response_Writer_Access) is
begin
Context.Writer := Writer;
end Set_Response_Writer;
-- ------------------------------
-- Get the EL context for evaluating expressions.
-- ------------------------------
function Get_ELContext (Context : in Faces_Context)
return EL.Contexts.ELContext_Access is
begin
return Context.Context;
end Get_ELContext;
-- ------------------------------
-- Set the EL context for evaluating expressions.
-- ------------------------------
procedure Set_ELContext (Context : in out Faces_Context;
ELContext : in EL.Contexts.ELContext_Access) is
begin
Context.Context := ELContext;
end Set_ELContext;
-- ------------------------------
-- Set the attribute having given name with the value.
-- ------------------------------
procedure Set_Attribute (Context : in out Faces_Context;
Name : in String;
Value : in EL.Objects.Object) is
use EL.Variables;
Mapper : constant access Variable_Mapper'Class := Context.Context.Get_Variable_Mapper;
begin
Mapper.Bind (Name, Value);
end Set_Attribute;
-- ------------------------------
-- Set the attribute having given name with the value.
-- ------------------------------
procedure Set_Attribute (Context : in out Faces_Context;
Name : in Unbounded_String;
Value : in EL.Objects.Object) is
begin
Context.Set_Attribute (To_String (Name), Value);
end Set_Attribute;
-- ------------------------------
-- Get the attribute with the given name.
-- ------------------------------
function Get_Attribute (Context : in Faces_Context;
Name : in String) return EL.Objects.Object is
begin
return Context.Get_Attribute (To_Unbounded_String (Name));
end Get_Attribute;
-- ------------------------------
-- Get the attribute with the given name.
-- ------------------------------
function Get_Attribute (Context : in Faces_Context;
Name : in Unbounded_String) return EL.Objects.Object is
EL_Context : constant EL.Contexts.ELContext_Access := Context.Get_ELContext;
Resolver : constant EL.Contexts.ELResolver_Access := EL_Context.Get_Resolver;
begin
return Resolver.Get_Value (Context => EL_Context.all,
Base => null,
Name => Name);
end Get_Attribute;
-- ------------------------------
-- Get the bean attribute with the given name.
-- Returns null if the attribute does not exist or is not a bean.
-- ------------------------------
function Get_Bean (Context : in Faces_Context;
Name : in String)
return Util.Beans.Basic.Readonly_Bean_Access is
Value : constant EL.Objects.Object := Context.Get_Attribute (Name);
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class := EL.Objects.To_Bean (Value);
begin
if Bean /= null then
return Bean.all'Unchecked_Access;
else
return null;
end if;
end Get_Bean;
-- ------------------------------
-- Get a request parameter
-- ------------------------------
function Get_Parameter (Context : Faces_Context;
Name : String) return String is
begin
return Context.Request.Get_Parameter (Name);
end Get_Parameter;
-- ------------------------------
-- Get the session associated with the current faces context.
-- ------------------------------
function Get_Session (Context : in Faces_Context;
Create : in Boolean := False) return ASF.Sessions.Session is
begin
return Context.Request.Get_Session (Create);
end Get_Session;
-- ------------------------------
-- Get the request
-- ------------------------------
function Get_Request (Context : Faces_Context)
return ASF.Requests.Request_Access is
begin
return Context.Request;
end Get_Request;
-- ------------------------------
-- Set the request
-- ------------------------------
procedure Set_Request (Context : in out Faces_Context;
Request : in ASF.Requests.Request_Access) is
begin
Context.Request := Request;
end Set_Request;
-- ------------------------------
-- Get the response
-- ------------------------------
function Get_Response (Context : Faces_Context) return ASF.Responses.Response_Access is
begin
return Context.Response;
end Get_Response;
-- ------------------------------
-- Set the response
-- ------------------------------
procedure Set_Response (Context : in out Faces_Context;
Response : in ASF.Responses.Response_Access) is
begin
Context.Response := Response;
end Set_Response;
-- ------------------------------
-- Signal the JavaServer faces implementation that, as soon as the
-- current phase of the request processing lifecycle has been completed,
-- control should be passed to the <b>Render Response</b> phase,
-- bypassing any phases that have not been executed yet.
-- ------------------------------
procedure Render_Response (Context : in out Faces_Context) is
begin
Context.Render_Response := True;
end Render_Response;
-- ------------------------------
-- Check whether the <b>Render_Response</b> phase must be processed immediately.
-- ------------------------------
function Get_Render_Response (Context : in Faces_Context) return Boolean is
begin
return Context.Render_Response;
end Get_Render_Response;
-- ------------------------------
-- Signal the JavaServer Faces implementation that the HTTP response
-- for this request has already been generated (such as an HTTP redirect),
-- and that the request processing lifecycle should be terminated as soon
-- as the current phase is completed.
-- ------------------------------
procedure Response_Completed (Context : in out Faces_Context) is
begin
Context.Response_Completed := True;
end Response_Completed;
-- ------------------------------
-- Check whether the response has been completed.
-- ------------------------------
function Get_Response_Completed (Context : in Faces_Context) return Boolean is
begin
return Context.Response_Completed;
end Get_Response_Completed;
-- ------------------------------
-- Get the flash context allowing to add flash attributes.
-- ------------------------------
function Get_Flash (Context : in Faces_Context) return Flash_Context_Access is
begin
return Context.Flash;
end Get_Flash;
-- ------------------------------
-- Set the flash context.
-- ------------------------------
procedure Set_Flash (Context : in out Faces_Context;
Flash : in Flash_Context_Access) is
begin
Context.Flash := Flash;
end Set_Flash;
-- ------------------------------
-- Append the message to the list of messages associated with the specified
-- client identifier. If <b>Client_Id</b> is empty, the message is global
-- (or not associated with a component)
-- ------------------------------
procedure Add_Message (Context : in out Faces_Context;
Client_Id : in String;
Message : in ASF.Applications.Messages.Message) is
procedure Append_Message (Key : in Unbounded_String;
List : in out Vectors.Vector);
-- ------------------------------
-- Append the message to the list.
-- ------------------------------
procedure Append_Message (Key : in Unbounded_String;
List : in out Vectors.Vector) is
pragma Unreferenced (Key);
begin
List.Append (Message);
end Append_Message;
Id : constant Unbounded_String := To_Unbounded_String (Client_Id);
Severity : constant ASF.Applications.Messages.Severity := Get_Severity (Message);
Pos : Message_Maps.Cursor;
Inserted : Boolean;
begin
-- Insert or get the messages associated with the client identifier.
Context.Messages.Insert (Key => Id,
Position => Pos,
Inserted => Inserted);
-- Append the message in that list.
Context.Messages.Update_Element (Position => Pos,
Process => Append_Message'Access);
if Context.Max_Severity < Severity then
Context.Max_Severity := Severity;
end if;
end Add_Message;
-- ------------------------------
-- Append the message to the list of messages associated with the specified
-- client identifier. If <b>Client_Id</b> is empty, the message is global
-- (or not associated with a component)
-- ------------------------------
procedure Add_Message (Context : in out Faces_Context;
Client_Id : in String;
Message : in String;
Severity : in Applications.Messages.Severity
:= Applications.Messages.ERROR) is
Msg : ASF.Applications.Messages.Message;
begin
ASF.Applications.Messages.Set_Severity (Msg, Severity);
ASF.Applications.Messages.Set_Summary (Msg, Message);
Context.Add_Message (Client_Id, Msg);
end Add_Message;
-- ------------------------------
-- Append the messages defined in <b>Messages</b> to the current list of messages
-- in the faces context.
-- ------------------------------
procedure Add_Messages (Context : in out Faces_Context;
Client_Id : in String;
Messages : in ASF.Applications.Messages.Vectors.Vector) is
Iter : constant ASF.Applications.Messages.Vectors.Cursor := Messages.First;
Id : constant Unbounded_String := To_Unbounded_String (Client_Id);
procedure Append_Message (Key : in Unbounded_String;
List : in out Vectors.Vector);
-- ------------------------------
-- Append the message to the list.
-- ------------------------------
procedure Append_Message (Key : in Unbounded_String;
List : in out Vectors.Vector) is
pragma Unreferenced (Key);
begin
ASF.Applications.Messages.Utils.Copy (List, Iter);
end Append_Message;
Pos : Message_Maps.Cursor;
Inserted : Boolean;
begin
if not ASF.Applications.Messages.Vectors.Has_Element (Iter) then
return;
end if;
-- Insert or get the messages associated with the client identifier.
Context.Messages.Insert (Key => Id,
Position => Pos,
Inserted => Inserted);
-- Append the message in that list.
Context.Messages.Update_Element (Position => Pos,
Process => Append_Message'Access);
end Add_Messages;
-- ------------------------------
-- Get an iterator for the messages associated with the specified client
-- identifier. If the <b>Client_Id</b> ie empty, an iterator for the
-- global messages is returned.
-- ------------------------------
function Get_Messages (Context : in Faces_Context;
Client_Id : in String)
return ASF.Applications.Messages.Vectors.Cursor is
Iter : Vectors.Cursor;
procedure Get_Iterator (Key : in Unbounded_String;
List : in Vectors.Vector);
-- ------------------------------
-- Get an iterator for the messages
-- ------------------------------
procedure Get_Iterator (Key : in Unbounded_String;
List : in Vectors.Vector) is
pragma Unreferenced (Key);
begin
Iter := List.First;
end Get_Iterator;
Id : constant Unbounded_String := To_Unbounded_String (Client_Id);
Pos : constant Message_Maps.Cursor := Context.Messages.Find (Id);
begin
if Message_Maps.Has_Element (Pos) then
Message_Maps.Query_Element (Position => Pos,
Process => Get_Iterator'Access);
end if;
return Iter;
end Get_Messages;
-- ------------------------------
-- Returns the maximum severity level recorded for any message that has been queued.
-- Returns NONE if no message has been queued.
-- ------------------------------
function Get_Maximum_Severity (Context : in Faces_Context)
return ASF.Applications.Messages.Severity is
begin
return Context.Max_Severity;
end Get_Maximum_Severity;
-- ------------------------------
-- Get a converter from a name.
-- Returns the converter object or null if there is no converter.
-- ------------------------------
function Get_Converter (Context : in Faces_Context;
Name : in EL.Objects.Object)
return access ASF.Converters.Converter'Class is
begin
return Context.Application.Find (Name);
end Get_Converter;
-- ------------------------------
-- Get the application associated with this faces context.
-- ------------------------------
function Get_Application (Context : in Faces_Context)
return Application_Access is
begin
return Context.Application;
end Get_Application;
-- ------------------------------
-- Get the current lifecycle phase.
-- ------------------------------
function Get_Current_Phase (Context : in Faces_Context) return ASF.Events.Phases.Phase_Type is
begin
return Context.Phase;
end Get_Current_Phase;
-- ------------------------------
-- Set the current lifecycle phase. This operation is called by the lifecycle manager
-- each time the lifecycle phase changes.
-- ------------------------------
procedure Set_Current_Phase (Context : in out Faces_Context;
Phase : in ASF.Events.Phases.Phase_Type) is
begin
Context.Phase := Phase;
end Set_Current_Phase;
-- ------------------------------
-- Get the locale defined by the view root component.
-- Returns the NULL_LOCALE if there is no view root component.
-- ------------------------------
function Get_Locale (Context : in Faces_Context) return Util.Locales.Locale is
begin
return Context.Locale;
end Get_Locale;
-- ------------------------------
-- Set the locale that must be used when rendering the view components.
-- ------------------------------
procedure Set_Locale (Context : in out Faces_Context;
Locale : in Util.Locales.Locale) is
begin
Context.Locale := Locale;
end Set_Locale;
-- ------------------------------
-- Get the component view root.
-- ------------------------------
function Get_View_Root (Context : in Faces_Context)
return ASF.Components.Root.UIViewRoot is
begin
return Context.Root;
end Get_View_Root;
-- ------------------------------
-- Get the component view root.
-- ------------------------------
procedure Set_View_Root (Context : in out Faces_Context;
View : in ASF.Components.Root.UIViewRoot) is
begin
Context.Root := View;
end Set_View_Root;
-- ------------------------------
-- Create an identifier for a component.
-- ------------------------------
procedure Create_Unique_Id (Context : in out Faces_Context;
Id : out Natural) is
begin
ASF.Components.Root.Create_Unique_Id (Context.Root, Id);
end Create_Unique_Id;
-- ------------------------------
-- Set the exception handler that will receive unexpected exceptions and process them.
-- ------------------------------
procedure Set_Exception_Handler (Context : in out Faces_Context;
Handler : in Exceptions.Exception_Handler_Access) is
begin
Context.Except_Handler := Handler;
end Set_Exception_Handler;
-- ------------------------------
-- Get the exception handler.
-- ------------------------------
function Get_Exception_Handler (Context : in Faces_Context)
return Exceptions.Exception_Handler_Access is
begin
return Context.Except_Handler;
end Get_Exception_Handler;
-- ------------------------------
-- Queue an exception event to the exception handler associated with the context.
-- The exception event will be processed at the end of the current ASF phase.
-- ------------------------------
procedure Queue_Exception (Context : in out Faces_Context;
Ex : in Ada.Exceptions.Exception_Occurrence) is
begin
if Context.Except_Queue = null then
Context.Except_Queue := new ASF.Contexts.Exceptions.Exception_Queue;
end if;
Context.Except_Queue.Queue_Exception (Ex);
end Queue_Exception;
-- ------------------------------
-- Iterate over the exceptions that have been queued and execute the <b>Process</b>
-- procedure. When the procedure returns True in <b>Remove</b, the exception event
-- is removed from the queue. The procedure can update the faces context to add some
-- error message or redirect to an error page.
--
-- The application exception handler uses this procedure to process the exceptions.
-- The exception handler is called after each ASF phase.
-- ------------------------------
procedure Iterate_Exception (Context : in out Faces_Context'Class;
Process : not null access
procedure (Event : in Events.Exceptions.Exception_Event'Class;
Remove : out Boolean;
Context : in out Faces_Context'Class)) is
begin
if Context.Except_Queue /= null then
ASF.Contexts.Exceptions.Iterate (Context.Except_Queue.all, Context, Process);
end if;
end Iterate_Exception;
-- ------------------------------
-- Returns True if the current request is an AJAX request.
-- ------------------------------
function Is_Ajax_Request (Context : in Faces_Context'Class) return Boolean is
begin
return Context.Ajax;
end Is_Ajax_Request;
-- ------------------------------
-- Set the Ajax request status.
-- ------------------------------
procedure Set_Ajax_Request (Context : in out Faces_Context'Class;
Status : in Boolean) is
begin
Context.Ajax := Status;
end Set_Ajax_Request;
-- ------------------------------
-- Get the current faces context. The faces context is saved
-- in a per-thread/task attribute.
-- ------------------------------
function Current return Faces_Context_Access is
begin
return Task_Context.Value;
end Current;
-- ------------------------------
-- Set the current faces context in the per-thread/task attribute.
-- ------------------------------
procedure Set_Current (Context : in Faces_Context_Access;
Application : in Application_Access) is
begin
Context.Application := Application;
Task_Context.Set_Value (Context);
end Set_Current;
-- ------------------------------
-- Restore the previous faces context.
-- ------------------------------
procedure Restore (Context : in Faces_Context_Access) is
begin
Task_Context.Set_Value (Context);
end Restore;
-- ------------------------------
-- Release any storage held by this context.
-- ------------------------------
overriding
procedure Finalize (Context : in out Faces_Context) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => ASF.Contexts.Exceptions.Exception_Queue,
Name => Exception_Queue_Access);
begin
if Context.Except_Queue /= null then
Free (Context.Except_Queue);
end if;
end Finalize;
end ASF.Contexts.Faces;
|
test/Succeed/Issue1332.agda | cruhland/agda | 1,989 | 7969 | {-# OPTIONS --show-implicit #-}
-- {-# OPTIONS -v tc:10 #-}
-- {-# OPTIONS -v tc.with:40 #-}
-- Andreas, 2014-11-26
-- Reported by twanvl
data Unit : Set where
unit : Unit
module Mod₁ (t : Unit) where
postulate Thing : Set
module Mod₂ (u : Unit) where
open Mod₁ unit
record Foo : Set where
field
foo : Thing → Thing
bar : Thing → Thing
bar a with foo a
... | x = x
-- checkInternal stumbles over
-- (λ u₁ → Thing) {u} : Setω
-- which is an internal representation of Thing, to be precise
-- Mod₂._.Thing u which expands to Mod₁.Thing unit
-- More complete transcript:
-- checking internal Thing : Setω
-- reduction on defined ident. in anonymous module
-- x = Issue1332.Mod₂._.Thing
-- v = Def Issue1332.Mod₁.Thing [Apply []r(Con Issue1332.Unit.unit(inductive)[] [])]
-- elimView of Thing
-- v = Def Issue1332.Mod₂._.Thing [Apply []r{Var 1 []}]
-- reduction on defined ident. in anonymous module
-- x = Issue1332.Mod₂._.Thing
-- v = Def Issue1332.Mod₁.Thing [Apply []r(Con Issue1332.Unit.unit(inductive)[] [])]
-- elimView (projections reduced) of Thing
-- reduction on defined ident. in anonymous module
-- x = Issue1332.Mod₂._.Thing
-- v = Lam (ArgInfo {argInfoHiding = NotHidden, argInfoRelevance = Relevant, argInfoColors = []}) (Abs "u" Def Issue1332.Mod₁.Thing [Apply []r(Con Issue1332.Unit.unit(inductive)[] [])])
-- checking spine
-- (
-- λ u₁ → Thing
-- :
-- (u₁ : Thing) → Set
-- )
-- [$ {u}]
-- :
-- Setω
-- /home/abel/agda/test/bugs/Issue1332.agda:23,5-24,16
-- Expected a visible argument, but found a hidden argument
-- when checking that the type (a : Thing) → Thing → Thing of the
-- generated with function is well-formed
|
test/Succeed/NewUnifierTooRestrictive.agda | KDr2/agda | 0 | 3333 | -- 2016-01-05, Jesper: In some cases, the new unifier is still too restrictive
-- when --cubical-compatible is enabled because it doesn't do generalization of datatype
-- indices. This should be fixed in the future.
-- 2016-06-23, Jesper: Now fixed.
{-# OPTIONS --cubical-compatible #-}
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
refl : x ≡ x
data Bar : Set₁ where
bar : Bar
baz : (A : Set) → Bar
data Foo : Bar → Set₁ where
foo : Foo bar
test : foo ≡ foo → Set₁
test refl = Set
|
libsrc/_DEVELOPMENT/font/fzx/fonts/utz/KickDrop/_ff_utz_KickDrop.asm | meesokim/z88dk | 0 | 96780 | <reponame>meesokim/z88dk<gh_stars>0
SECTION rodata_font_fzx
PUBLIC _ff_utz_KickDrop
_ff_utz_KickDrop:
BINARY "font/fzx/fonts/utz/KickDrop/kickdrop.fzx"
|
oslab6/obj/user/badsegment.asm | jasha64/OperatingSystems-lab | 0 | 17302 |
obj/user/badsegment.debug: 文件格式 elf32-i386
Disassembly of section .text:
00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
// See if we were started with arguments on the stack
cmpl $USTACKTOP, %esp
800020: 81 fc 00 e0 bf ee cmp $0xeebfe000,%esp
jne args_exist
800026: 75 04 jne 80002c <args_exist>
// If not, push dummy argc/argv arguments.
// This happens when we are loaded by the kernel,
// because the kernel does not know about passing arguments.
pushl $0
800028: 6a 00 push $0x0
pushl $0
80002a: 6a 00 push $0x0
0080002c <args_exist>:
args_exist:
call libmain
80002c: e8 0d 00 00 00 call 80003e <libmain>
1: jmp 1b
800031: eb fe jmp 800031 <args_exist+0x5>
00800033 <umain>:
#include <inc/lib.h>
void
umain(int argc, char **argv)
{
800033: 55 push %ebp
800034: 89 e5 mov %esp,%ebp
// Try to load the kernel's TSS selector into the DS register.
asm volatile("movw $0x28,%ax; movw %ax,%ds");
800036: 66 b8 28 00 mov $0x28,%ax
80003a: 8e d8 mov %eax,%ds
}
80003c: 5d pop %ebp
80003d: c3 ret
0080003e <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";
void
libmain(int argc, char **argv)
{
80003e: 55 push %ebp
80003f: 89 e5 mov %esp,%ebp
800041: 56 push %esi
800042: 53 push %ebx
800043: 8b 5d 08 mov 0x8(%ebp),%ebx
800046: 8b 75 0c mov 0xc(%ebp),%esi
// set thisenv to point at our Env structure in envs[].
// LAB 3: Your code here.
envid_t envid = sys_getenvid();
800049: e8 c6 00 00 00 call 800114 <sys_getenvid>
thisenv = envs + ENVX(envid);
80004e: 25 ff 03 00 00 and $0x3ff,%eax
800053: 6b c0 7c imul $0x7c,%eax,%eax
800056: 05 00 00 c0 ee add $0xeec00000,%eax
80005b: a3 04 20 80 00 mov %eax,0x802004
// save the name of the program so that panic() can use it
if (argc > 0)
800060: 85 db test %ebx,%ebx
800062: 7e 07 jle 80006b <libmain+0x2d>
binaryname = argv[0];
800064: 8b 06 mov (%esi),%eax
800066: a3 00 20 80 00 mov %eax,0x802000
// call user main routine
umain(argc, argv);
80006b: 83 ec 08 sub $0x8,%esp
80006e: 56 push %esi
80006f: 53 push %ebx
800070: e8 be ff ff ff call 800033 <umain>
// exit gracefully
exit();
800075: e8 0a 00 00 00 call 800084 <exit>
}
80007a: 83 c4 10 add $0x10,%esp
80007d: 8d 65 f8 lea -0x8(%ebp),%esp
800080: 5b pop %ebx
800081: 5e pop %esi
800082: 5d pop %ebp
800083: c3 ret
00800084 <exit>:
#include <inc/lib.h>
void
exit(void)
{
800084: 55 push %ebp
800085: 89 e5 mov %esp,%ebp
800087: 83 ec 14 sub $0x14,%esp
// close_all();
sys_env_destroy(0);
80008a: 6a 00 push $0x0
80008c: e8 42 00 00 00 call 8000d3 <sys_env_destroy>
}
800091: 83 c4 10 add $0x10,%esp
800094: c9 leave
800095: c3 ret
00800096 <sys_cputs>:
return ret;
}
void
sys_cputs(const char *s, size_t len)
{
800096: 55 push %ebp
800097: 89 e5 mov %esp,%ebp
800099: 57 push %edi
80009a: 56 push %esi
80009b: 53 push %ebx
asm volatile("int %1\n" //执行int T_SYSCALL指令
80009c: b8 00 00 00 00 mov $0x0,%eax
8000a1: 8b 55 08 mov 0x8(%ebp),%edx
8000a4: 8b 4d 0c mov 0xc(%ebp),%ecx
8000a7: 89 c3 mov %eax,%ebx
8000a9: 89 c7 mov %eax,%edi
8000ab: 89 c6 mov %eax,%esi
8000ad: cd 30 int $0x30
syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
8000af: 5b pop %ebx
8000b0: 5e pop %esi
8000b1: 5f pop %edi
8000b2: 5d pop %ebp
8000b3: c3 ret
008000b4 <sys_cgetc>:
int
sys_cgetc(void)
{
8000b4: 55 push %ebp
8000b5: 89 e5 mov %esp,%ebp
8000b7: 57 push %edi
8000b8: 56 push %esi
8000b9: 53 push %ebx
asm volatile("int %1\n" //执行int T_SYSCALL指令
8000ba: ba 00 00 00 00 mov $0x0,%edx
8000bf: b8 01 00 00 00 mov $0x1,%eax
8000c4: 89 d1 mov %edx,%ecx
8000c6: 89 d3 mov %edx,%ebx
8000c8: 89 d7 mov %edx,%edi
8000ca: 89 d6 mov %edx,%esi
8000cc: cd 30 int $0x30
return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
8000ce: 5b pop %ebx
8000cf: 5e pop %esi
8000d0: 5f pop %edi
8000d1: 5d pop %ebp
8000d2: c3 ret
008000d3 <sys_env_destroy>:
int
sys_env_destroy(envid_t envid)
{
8000d3: 55 push %ebp
8000d4: 89 e5 mov %esp,%ebp
8000d6: 57 push %edi
8000d7: 56 push %esi
8000d8: 53 push %ebx
8000d9: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
8000dc: b9 00 00 00 00 mov $0x0,%ecx
8000e1: 8b 55 08 mov 0x8(%ebp),%edx
8000e4: b8 03 00 00 00 mov $0x3,%eax
8000e9: 89 cb mov %ecx,%ebx
8000eb: 89 cf mov %ecx,%edi
8000ed: 89 ce mov %ecx,%esi
8000ef: cd 30 int $0x30
if(check && ret > 0)
8000f1: 85 c0 test %eax,%eax
8000f3: 7f 08 jg 8000fd <sys_env_destroy+0x2a>
return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
8000f5: 8d 65 f4 lea -0xc(%ebp),%esp
8000f8: 5b pop %ebx
8000f9: 5e pop %esi
8000fa: 5f pop %edi
8000fb: 5d pop %ebp
8000fc: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
8000fd: 83 ec 0c sub $0xc,%esp
800100: 50 push %eax
800101: 6a 03 push $0x3
800103: 68 ca 0f 80 00 push $0x800fca
800108: 6a 23 push $0x23
80010a: 68 e7 0f 80 00 push $0x800fe7
80010f: e8 2f 02 00 00 call 800343 <_panic>
00800114 <sys_getenvid>:
envid_t
sys_getenvid(void)
{
800114: 55 push %ebp
800115: 89 e5 mov %esp,%ebp
800117: 57 push %edi
800118: 56 push %esi
800119: 53 push %ebx
asm volatile("int %1\n" //执行int T_SYSCALL指令
80011a: ba 00 00 00 00 mov $0x0,%edx
80011f: b8 02 00 00 00 mov $0x2,%eax
800124: 89 d1 mov %edx,%ecx
800126: 89 d3 mov %edx,%ebx
800128: 89 d7 mov %edx,%edi
80012a: 89 d6 mov %edx,%esi
80012c: cd 30 int $0x30
return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
80012e: 5b pop %ebx
80012f: 5e pop %esi
800130: 5f pop %edi
800131: 5d pop %ebp
800132: c3 ret
00800133 <sys_yield>:
void
sys_yield(void)
{
800133: 55 push %ebp
800134: 89 e5 mov %esp,%ebp
800136: 57 push %edi
800137: 56 push %esi
800138: 53 push %ebx
asm volatile("int %1\n" //执行int T_SYSCALL指令
800139: ba 00 00 00 00 mov $0x0,%edx
80013e: b8 0b 00 00 00 mov $0xb,%eax
800143: 89 d1 mov %edx,%ecx
800145: 89 d3 mov %edx,%ebx
800147: 89 d7 mov %edx,%edi
800149: 89 d6 mov %edx,%esi
80014b: cd 30 int $0x30
syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
80014d: 5b pop %ebx
80014e: 5e pop %esi
80014f: 5f pop %edi
800150: 5d pop %ebp
800151: c3 ret
00800152 <sys_page_alloc>:
int
sys_page_alloc(envid_t envid, void *va, int perm)
{
800152: 55 push %ebp
800153: 89 e5 mov %esp,%ebp
800155: 57 push %edi
800156: 56 push %esi
800157: 53 push %ebx
800158: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
80015b: be 00 00 00 00 mov $0x0,%esi
800160: 8b 55 08 mov 0x8(%ebp),%edx
800163: 8b 4d 0c mov 0xc(%ebp),%ecx
800166: b8 04 00 00 00 mov $0x4,%eax
80016b: 8b 5d 10 mov 0x10(%ebp),%ebx
80016e: 89 f7 mov %esi,%edi
800170: cd 30 int $0x30
if(check && ret > 0)
800172: 85 c0 test %eax,%eax
800174: 7f 08 jg 80017e <sys_page_alloc+0x2c>
return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
800176: 8d 65 f4 lea -0xc(%ebp),%esp
800179: 5b pop %ebx
80017a: 5e pop %esi
80017b: 5f pop %edi
80017c: 5d pop %ebp
80017d: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
80017e: 83 ec 0c sub $0xc,%esp
800181: 50 push %eax
800182: 6a 04 push $0x4
800184: 68 ca 0f 80 00 push $0x800fca
800189: 6a 23 push $0x23
80018b: 68 e7 0f 80 00 push $0x800fe7
800190: e8 ae 01 00 00 call 800343 <_panic>
00800195 <sys_page_map>:
int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
800195: 55 push %ebp
800196: 89 e5 mov %esp,%ebp
800198: 57 push %edi
800199: 56 push %esi
80019a: 53 push %ebx
80019b: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
80019e: 8b 55 08 mov 0x8(%ebp),%edx
8001a1: 8b 4d 0c mov 0xc(%ebp),%ecx
8001a4: b8 05 00 00 00 mov $0x5,%eax
8001a9: 8b 5d 10 mov 0x10(%ebp),%ebx
8001ac: 8b 7d 14 mov 0x14(%ebp),%edi
8001af: 8b 75 18 mov 0x18(%ebp),%esi
8001b2: cd 30 int $0x30
if(check && ret > 0)
8001b4: 85 c0 test %eax,%eax
8001b6: 7f 08 jg 8001c0 <sys_page_map+0x2b>
return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
8001b8: 8d 65 f4 lea -0xc(%ebp),%esp
8001bb: 5b pop %ebx
8001bc: 5e pop %esi
8001bd: 5f pop %edi
8001be: 5d pop %ebp
8001bf: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
8001c0: 83 ec 0c sub $0xc,%esp
8001c3: 50 push %eax
8001c4: 6a 05 push $0x5
8001c6: 68 ca 0f 80 00 push $0x800fca
8001cb: 6a 23 push $0x23
8001cd: 68 e7 0f 80 00 push $0x800fe7
8001d2: e8 6c 01 00 00 call 800343 <_panic>
008001d7 <sys_page_unmap>:
int
sys_page_unmap(envid_t envid, void *va)
{
8001d7: 55 push %ebp
8001d8: 89 e5 mov %esp,%ebp
8001da: 57 push %edi
8001db: 56 push %esi
8001dc: 53 push %ebx
8001dd: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
8001e0: bb 00 00 00 00 mov $0x0,%ebx
8001e5: 8b 55 08 mov 0x8(%ebp),%edx
8001e8: 8b 4d 0c mov 0xc(%ebp),%ecx
8001eb: b8 06 00 00 00 mov $0x6,%eax
8001f0: 89 df mov %ebx,%edi
8001f2: 89 de mov %ebx,%esi
8001f4: cd 30 int $0x30
if(check && ret > 0)
8001f6: 85 c0 test %eax,%eax
8001f8: 7f 08 jg 800202 <sys_page_unmap+0x2b>
return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
8001fa: 8d 65 f4 lea -0xc(%ebp),%esp
8001fd: 5b pop %ebx
8001fe: 5e pop %esi
8001ff: 5f pop %edi
800200: 5d pop %ebp
800201: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
800202: 83 ec 0c sub $0xc,%esp
800205: 50 push %eax
800206: 6a 06 push $0x6
800208: 68 ca 0f 80 00 push $0x800fca
80020d: 6a 23 push $0x23
80020f: 68 e7 0f 80 00 push $0x800fe7
800214: e8 2a 01 00 00 call 800343 <_panic>
00800219 <sys_env_set_status>:
// sys_exofork is inlined in lib.h
int
sys_env_set_status(envid_t envid, int status)
{
800219: 55 push %ebp
80021a: 89 e5 mov %esp,%ebp
80021c: 57 push %edi
80021d: 56 push %esi
80021e: 53 push %ebx
80021f: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
800222: bb 00 00 00 00 mov $0x0,%ebx
800227: 8b 55 08 mov 0x8(%ebp),%edx
80022a: 8b 4d 0c mov 0xc(%ebp),%ecx
80022d: b8 08 00 00 00 mov $0x8,%eax
800232: 89 df mov %ebx,%edi
800234: 89 de mov %ebx,%esi
800236: cd 30 int $0x30
if(check && ret > 0)
800238: 85 c0 test %eax,%eax
80023a: 7f 08 jg 800244 <sys_env_set_status+0x2b>
return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
80023c: 8d 65 f4 lea -0xc(%ebp),%esp
80023f: 5b pop %ebx
800240: 5e pop %esi
800241: 5f pop %edi
800242: 5d pop %ebp
800243: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
800244: 83 ec 0c sub $0xc,%esp
800247: 50 push %eax
800248: 6a 08 push $0x8
80024a: 68 ca 0f 80 00 push $0x800fca
80024f: 6a 23 push $0x23
800251: 68 e7 0f 80 00 push $0x800fe7
800256: e8 e8 00 00 00 call 800343 <_panic>
0080025b <sys_env_set_trapframe>:
int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
80025b: 55 push %ebp
80025c: 89 e5 mov %esp,%ebp
80025e: 57 push %edi
80025f: 56 push %esi
800260: 53 push %ebx
800261: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
800264: bb 00 00 00 00 mov $0x0,%ebx
800269: 8b 55 08 mov 0x8(%ebp),%edx
80026c: 8b 4d 0c mov 0xc(%ebp),%ecx
80026f: b8 09 00 00 00 mov $0x9,%eax
800274: 89 df mov %ebx,%edi
800276: 89 de mov %ebx,%esi
800278: cd 30 int $0x30
if(check && ret > 0)
80027a: 85 c0 test %eax,%eax
80027c: 7f 08 jg 800286 <sys_env_set_trapframe+0x2b>
return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
80027e: 8d 65 f4 lea -0xc(%ebp),%esp
800281: 5b pop %ebx
800282: 5e pop %esi
800283: 5f pop %edi
800284: 5d pop %ebp
800285: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
800286: 83 ec 0c sub $0xc,%esp
800289: 50 push %eax
80028a: 6a 09 push $0x9
80028c: 68 ca 0f 80 00 push $0x800fca
800291: 6a 23 push $0x23
800293: 68 e7 0f 80 00 push $0x800fe7
800298: e8 a6 00 00 00 call 800343 <_panic>
0080029d <sys_env_set_pgfault_upcall>:
int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
80029d: 55 push %ebp
80029e: 89 e5 mov %esp,%ebp
8002a0: 57 push %edi
8002a1: 56 push %esi
8002a2: 53 push %ebx
8002a3: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
8002a6: bb 00 00 00 00 mov $0x0,%ebx
8002ab: 8b 55 08 mov 0x8(%ebp),%edx
8002ae: 8b 4d 0c mov 0xc(%ebp),%ecx
8002b1: b8 0a 00 00 00 mov $0xa,%eax
8002b6: 89 df mov %ebx,%edi
8002b8: 89 de mov %ebx,%esi
8002ba: cd 30 int $0x30
if(check && ret > 0)
8002bc: 85 c0 test %eax,%eax
8002be: 7f 08 jg 8002c8 <sys_env_set_pgfault_upcall+0x2b>
return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
8002c0: 8d 65 f4 lea -0xc(%ebp),%esp
8002c3: 5b pop %ebx
8002c4: 5e pop %esi
8002c5: 5f pop %edi
8002c6: 5d pop %ebp
8002c7: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
8002c8: 83 ec 0c sub $0xc,%esp
8002cb: 50 push %eax
8002cc: 6a 0a push $0xa
8002ce: 68 ca 0f 80 00 push $0x800fca
8002d3: 6a 23 push $0x23
8002d5: 68 e7 0f 80 00 push $0x800fe7
8002da: e8 64 00 00 00 call 800343 <_panic>
008002df <sys_ipc_try_send>:
int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
8002df: 55 push %ebp
8002e0: 89 e5 mov %esp,%ebp
8002e2: 57 push %edi
8002e3: 56 push %esi
8002e4: 53 push %ebx
asm volatile("int %1\n" //执行int T_SYSCALL指令
8002e5: 8b 55 08 mov 0x8(%ebp),%edx
8002e8: 8b 4d 0c mov 0xc(%ebp),%ecx
8002eb: b8 0c 00 00 00 mov $0xc,%eax
8002f0: be 00 00 00 00 mov $0x0,%esi
8002f5: 8b 5d 10 mov 0x10(%ebp),%ebx
8002f8: 8b 7d 14 mov 0x14(%ebp),%edi
8002fb: cd 30 int $0x30
return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
8002fd: 5b pop %ebx
8002fe: 5e pop %esi
8002ff: 5f pop %edi
800300: 5d pop %ebp
800301: c3 ret
00800302 <sys_ipc_recv>:
int
sys_ipc_recv(void *dstva)
{
800302: 55 push %ebp
800303: 89 e5 mov %esp,%ebp
800305: 57 push %edi
800306: 56 push %esi
800307: 53 push %ebx
800308: 83 ec 0c sub $0xc,%esp
asm volatile("int %1\n" //执行int T_SYSCALL指令
80030b: b9 00 00 00 00 mov $0x0,%ecx
800310: 8b 55 08 mov 0x8(%ebp),%edx
800313: b8 0d 00 00 00 mov $0xd,%eax
800318: 89 cb mov %ecx,%ebx
80031a: 89 cf mov %ecx,%edi
80031c: 89 ce mov %ecx,%esi
80031e: cd 30 int $0x30
if(check && ret > 0)
800320: 85 c0 test %eax,%eax
800322: 7f 08 jg 80032c <sys_ipc_recv+0x2a>
return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
800324: 8d 65 f4 lea -0xc(%ebp),%esp
800327: 5b pop %ebx
800328: 5e pop %esi
800329: 5f pop %edi
80032a: 5d pop %ebp
80032b: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
80032c: 83 ec 0c sub $0xc,%esp
80032f: 50 push %eax
800330: 6a 0d push $0xd
800332: 68 ca 0f 80 00 push $0x800fca
800337: 6a 23 push $0x23
800339: 68 e7 0f 80 00 push $0x800fe7
80033e: e8 00 00 00 00 call 800343 <_panic>
00800343 <_panic>:
* It prints "panic: <message>", then causes a breakpoint exception,
* which causes JOS to enter the JOS kernel monitor.
*/
void
_panic(const char *file, int line, const char *fmt, ...)
{
800343: 55 push %ebp
800344: 89 e5 mov %esp,%ebp
800346: 56 push %esi
800347: 53 push %ebx
va_list ap;
va_start(ap, fmt);
800348: 8d 5d 14 lea 0x14(%ebp),%ebx
// Print the panic message
cprintf("[%08x] user panic in %s at %s:%d: ",
80034b: 8b 35 00 20 80 00 mov 0x802000,%esi
800351: e8 be fd ff ff call 800114 <sys_getenvid>
800356: 83 ec 0c sub $0xc,%esp
800359: ff 75 0c pushl 0xc(%ebp)
80035c: ff 75 08 pushl 0x8(%ebp)
80035f: 56 push %esi
800360: 50 push %eax
800361: 68 f8 0f 80 00 push $0x800ff8
800366: e8 b3 00 00 00 call 80041e <cprintf>
sys_getenvid(), binaryname, file, line);
vcprintf(fmt, ap);
80036b: 83 c4 18 add $0x18,%esp
80036e: 53 push %ebx
80036f: ff 75 10 pushl 0x10(%ebp)
800372: e8 56 00 00 00 call 8003cd <vcprintf>
cprintf("\n");
800377: c7 04 24 1b 10 80 00 movl $0x80101b,(%esp)
80037e: e8 9b 00 00 00 call 80041e <cprintf>
800383: 83 c4 10 add $0x10,%esp
// Cause a breakpoint exception
while (1)
asm volatile("int3");
800386: cc int3
800387: eb fd jmp 800386 <_panic+0x43>
00800389 <putch>:
};
static void
putch(int ch, struct printbuf *b)
{
800389: 55 push %ebp
80038a: 89 e5 mov %esp,%ebp
80038c: 53 push %ebx
80038d: 83 ec 04 sub $0x4,%esp
800390: 8b 5d 0c mov 0xc(%ebp),%ebx
b->buf[b->idx++] = ch;
800393: 8b 13 mov (%ebx),%edx
800395: 8d 42 01 lea 0x1(%edx),%eax
800398: 89 03 mov %eax,(%ebx)
80039a: 8b 4d 08 mov 0x8(%ebp),%ecx
80039d: 88 4c 13 08 mov %cl,0x8(%ebx,%edx,1)
if (b->idx == 256-1) {
8003a1: 3d ff 00 00 00 cmp $0xff,%eax
8003a6: 74 09 je 8003b1 <putch+0x28>
sys_cputs(b->buf, b->idx);
b->idx = 0;
}
b->cnt++;
8003a8: 83 43 04 01 addl $0x1,0x4(%ebx)
}
8003ac: 8b 5d fc mov -0x4(%ebp),%ebx
8003af: c9 leave
8003b0: c3 ret
sys_cputs(b->buf, b->idx);
8003b1: 83 ec 08 sub $0x8,%esp
8003b4: 68 ff 00 00 00 push $0xff
8003b9: 8d 43 08 lea 0x8(%ebx),%eax
8003bc: 50 push %eax
8003bd: e8 d4 fc ff ff call 800096 <sys_cputs>
b->idx = 0;
8003c2: c7 03 00 00 00 00 movl $0x0,(%ebx)
8003c8: 83 c4 10 add $0x10,%esp
8003cb: eb db jmp 8003a8 <putch+0x1f>
008003cd <vcprintf>:
int
vcprintf(const char *fmt, va_list ap)
{
8003cd: 55 push %ebp
8003ce: 89 e5 mov %esp,%ebp
8003d0: 81 ec 18 01 00 00 sub $0x118,%esp
struct printbuf b;
b.idx = 0;
8003d6: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp)
8003dd: 00 00 00
b.cnt = 0;
8003e0: c7 85 f4 fe ff ff 00 movl $0x0,-0x10c(%ebp)
8003e7: 00 00 00
vprintfmt((void*)putch, &b, fmt, ap);
8003ea: ff 75 0c pushl 0xc(%ebp)
8003ed: ff 75 08 pushl 0x8(%ebp)
8003f0: 8d 85 f0 fe ff ff lea -0x110(%ebp),%eax
8003f6: 50 push %eax
8003f7: 68 89 03 80 00 push $0x800389
8003fc: e8 1a 01 00 00 call 80051b <vprintfmt>
sys_cputs(b.buf, b.idx);
800401: 83 c4 08 add $0x8,%esp
800404: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80040a: 8d 85 f8 fe ff ff lea -0x108(%ebp),%eax
800410: 50 push %eax
800411: e8 80 fc ff ff call 800096 <sys_cputs>
return b.cnt;
}
800416: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80041c: c9 leave
80041d: c3 ret
0080041e <cprintf>:
int
cprintf(const char *fmt, ...)
{
80041e: 55 push %ebp
80041f: 89 e5 mov %esp,%ebp
800421: 83 ec 10 sub $0x10,%esp
va_list ap;
int cnt;
va_start(ap, fmt);
800424: 8d 45 0c lea 0xc(%ebp),%eax
cnt = vcprintf(fmt, ap);
800427: 50 push %eax
800428: ff 75 08 pushl 0x8(%ebp)
80042b: e8 9d ff ff ff call 8003cd <vcprintf>
va_end(ap);
return cnt;
}
800430: c9 leave
800431: c3 ret
00800432 <printnum>:
* using specified putch function and associated pointer putdat.
*/
static void
printnum(void (*putch)(int, void*), void *putdat,
unsigned long long num, unsigned base, int width, int padc)
{
800432: 55 push %ebp
800433: 89 e5 mov %esp,%ebp
800435: 57 push %edi
800436: 56 push %esi
800437: 53 push %ebx
800438: 83 ec 1c sub $0x1c,%esp
80043b: 89 c7 mov %eax,%edi
80043d: 89 d6 mov %edx,%esi
80043f: 8b 45 08 mov 0x8(%ebp),%eax
800442: 8b 55 0c mov 0xc(%ebp),%edx
800445: 89 45 d8 mov %eax,-0x28(%ebp)
800448: 89 55 dc mov %edx,-0x24(%ebp)
// first recursively print all preceding (more significant) digits
if (num >= base) {
80044b: 8b 4d 10 mov 0x10(%ebp),%ecx
80044e: bb 00 00 00 00 mov $0x0,%ebx
800453: 89 4d e0 mov %ecx,-0x20(%ebp)
800456: 89 5d e4 mov %ebx,-0x1c(%ebp)
800459: 39 d3 cmp %edx,%ebx
80045b: 72 05 jb 800462 <printnum+0x30>
80045d: 39 45 10 cmp %eax,0x10(%ebp)
800460: 77 7a ja 8004dc <printnum+0xaa>
printnum(putch, putdat, num / base, base, width - 1, padc);
800462: 83 ec 0c sub $0xc,%esp
800465: ff 75 18 pushl 0x18(%ebp)
800468: 8b 45 14 mov 0x14(%ebp),%eax
80046b: 8d 58 ff lea -0x1(%eax),%ebx
80046e: 53 push %ebx
80046f: ff 75 10 pushl 0x10(%ebp)
800472: 83 ec 08 sub $0x8,%esp
800475: ff 75 e4 pushl -0x1c(%ebp)
800478: ff 75 e0 pushl -0x20(%ebp)
80047b: ff 75 dc pushl -0x24(%ebp)
80047e: ff 75 d8 pushl -0x28(%ebp)
800481: e8 fa 08 00 00 call 800d80 <__udivdi3>
800486: 83 c4 18 add $0x18,%esp
800489: 52 push %edx
80048a: 50 push %eax
80048b: 89 f2 mov %esi,%edx
80048d: 89 f8 mov %edi,%eax
80048f: e8 9e ff ff ff call 800432 <printnum>
800494: 83 c4 20 add $0x20,%esp
800497: eb 13 jmp 8004ac <printnum+0x7a>
} else {
// print any needed pad characters before first digit
while (--width > 0)
putch(padc, putdat);
800499: 83 ec 08 sub $0x8,%esp
80049c: 56 push %esi
80049d: ff 75 18 pushl 0x18(%ebp)
8004a0: ff d7 call *%edi
8004a2: 83 c4 10 add $0x10,%esp
while (--width > 0)
8004a5: 83 eb 01 sub $0x1,%ebx
8004a8: 85 db test %ebx,%ebx
8004aa: 7f ed jg 800499 <printnum+0x67>
}
// then print this (the least significant) digit
putch("0123456789abcdef"[num % base], putdat);
8004ac: 83 ec 08 sub $0x8,%esp
8004af: 56 push %esi
8004b0: 83 ec 04 sub $0x4,%esp
8004b3: ff 75 e4 pushl -0x1c(%ebp)
8004b6: ff 75 e0 pushl -0x20(%ebp)
8004b9: ff 75 dc pushl -0x24(%ebp)
8004bc: ff 75 d8 pushl -0x28(%ebp)
8004bf: e8 dc 09 00 00 call 800ea0 <__umoddi3>
8004c4: 83 c4 14 add $0x14,%esp
8004c7: 0f be 80 1d 10 80 00 movsbl 0x80101d(%eax),%eax
8004ce: 50 push %eax
8004cf: ff d7 call *%edi
}
8004d1: 83 c4 10 add $0x10,%esp
8004d4: 8d 65 f4 lea -0xc(%ebp),%esp
8004d7: 5b pop %ebx
8004d8: 5e pop %esi
8004d9: 5f pop %edi
8004da: 5d pop %ebp
8004db: c3 ret
8004dc: 8b 5d 14 mov 0x14(%ebp),%ebx
8004df: eb c4 jmp 8004a5 <printnum+0x73>
008004e1 <sprintputch>:
int cnt;
};
static void
sprintputch(int ch, struct sprintbuf *b)
{
8004e1: 55 push %ebp
8004e2: 89 e5 mov %esp,%ebp
8004e4: 8b 45 0c mov 0xc(%ebp),%eax
b->cnt++;
8004e7: 83 40 08 01 addl $0x1,0x8(%eax)
if (b->buf < b->ebuf)
8004eb: 8b 10 mov (%eax),%edx
8004ed: 3b 50 04 cmp 0x4(%eax),%edx
8004f0: 73 0a jae 8004fc <sprintputch+0x1b>
*b->buf++ = ch;
8004f2: 8d 4a 01 lea 0x1(%edx),%ecx
8004f5: 89 08 mov %ecx,(%eax)
8004f7: 8b 45 08 mov 0x8(%ebp),%eax
8004fa: 88 02 mov %al,(%edx)
}
8004fc: 5d pop %ebp
8004fd: c3 ret
008004fe <printfmt>:
{
8004fe: 55 push %ebp
8004ff: 89 e5 mov %esp,%ebp
800501: 83 ec 08 sub $0x8,%esp
va_start(ap, fmt);
800504: 8d 45 14 lea 0x14(%ebp),%eax
vprintfmt(putch, putdat, fmt, ap);
800507: 50 push %eax
800508: ff 75 10 pushl 0x10(%ebp)
80050b: ff 75 0c pushl 0xc(%ebp)
80050e: ff 75 08 pushl 0x8(%ebp)
800511: e8 05 00 00 00 call 80051b <vprintfmt>
}
800516: 83 c4 10 add $0x10,%esp
800519: c9 leave
80051a: c3 ret
0080051b <vprintfmt>:
{
80051b: 55 push %ebp
80051c: 89 e5 mov %esp,%ebp
80051e: 57 push %edi
80051f: 56 push %esi
800520: 53 push %ebx
800521: 83 ec 2c sub $0x2c,%esp
800524: 8b 75 08 mov 0x8(%ebp),%esi
800527: 8b 5d 0c mov 0xc(%ebp),%ebx
80052a: 8b 7d 10 mov 0x10(%ebp),%edi
80052d: e9 c1 03 00 00 jmp 8008f3 <vprintfmt+0x3d8>
padc = ' ';
800532: c6 45 d4 20 movb $0x20,-0x2c(%ebp)
altflag = 0;
800536: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp)
precision = -1;
80053d: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp)
width = -1;
800544: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp)
lflag = 0;
80054b: b9 00 00 00 00 mov $0x0,%ecx
switch (ch = *(unsigned char *) fmt++) {
800550: 8d 47 01 lea 0x1(%edi),%eax
800553: 89 45 e4 mov %eax,-0x1c(%ebp)
800556: 0f b6 17 movzbl (%edi),%edx
800559: 8d 42 dd lea -0x23(%edx),%eax
80055c: 3c 55 cmp $0x55,%al
80055e: 0f 87 12 04 00 00 ja 800976 <vprintfmt+0x45b>
800564: 0f b6 c0 movzbl %al,%eax
800567: ff 24 85 60 11 80 00 jmp *0x801160(,%eax,4)
80056e: 8b 7d e4 mov -0x1c(%ebp),%edi
padc = '-';
800571: c6 45 d4 2d movb $0x2d,-0x2c(%ebp)
800575: eb d9 jmp 800550 <vprintfmt+0x35>
switch (ch = *(unsigned char *) fmt++) {
800577: 8b 7d e4 mov -0x1c(%ebp),%edi
padc = '0';
80057a: c6 45 d4 30 movb $0x30,-0x2c(%ebp)
80057e: eb d0 jmp 800550 <vprintfmt+0x35>
switch (ch = *(unsigned char *) fmt++) {
800580: 0f b6 d2 movzbl %dl,%edx
800583: 8b 7d e4 mov -0x1c(%ebp),%edi
for (precision = 0; ; ++fmt) {
800586: b8 00 00 00 00 mov $0x0,%eax
80058b: 89 4d e4 mov %ecx,-0x1c(%ebp)
precision = precision * 10 + ch - '0';
80058e: 8d 04 80 lea (%eax,%eax,4),%eax
800591: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
ch = *fmt;
800595: 0f be 17 movsbl (%edi),%edx
if (ch < '0' || ch > '9')
800598: 8d 4a d0 lea -0x30(%edx),%ecx
80059b: 83 f9 09 cmp $0x9,%ecx
80059e: 77 55 ja 8005f5 <vprintfmt+0xda>
for (precision = 0; ; ++fmt) {
8005a0: 83 c7 01 add $0x1,%edi
precision = precision * 10 + ch - '0';
8005a3: eb e9 jmp 80058e <vprintfmt+0x73>
precision = va_arg(ap, int);
8005a5: 8b 45 14 mov 0x14(%ebp),%eax
8005a8: 8b 00 mov (%eax),%eax
8005aa: 89 45 d0 mov %eax,-0x30(%ebp)
8005ad: 8b 45 14 mov 0x14(%ebp),%eax
8005b0: 8d 40 04 lea 0x4(%eax),%eax
8005b3: 89 45 14 mov %eax,0x14(%ebp)
switch (ch = *(unsigned char *) fmt++) {
8005b6: 8b 7d e4 mov -0x1c(%ebp),%edi
if (width < 0)
8005b9: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
8005bd: 79 91 jns 800550 <vprintfmt+0x35>
width = precision, precision = -1;
8005bf: 8b 45 d0 mov -0x30(%ebp),%eax
8005c2: 89 45 e0 mov %eax,-0x20(%ebp)
8005c5: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp)
8005cc: eb 82 jmp 800550 <vprintfmt+0x35>
8005ce: 8b 45 e0 mov -0x20(%ebp),%eax
8005d1: 85 c0 test %eax,%eax
8005d3: ba 00 00 00 00 mov $0x0,%edx
8005d8: 0f 49 d0 cmovns %eax,%edx
8005db: 89 55 e0 mov %edx,-0x20(%ebp)
switch (ch = *(unsigned char *) fmt++) {
8005de: 8b 7d e4 mov -0x1c(%ebp),%edi
8005e1: e9 6a ff ff ff jmp 800550 <vprintfmt+0x35>
8005e6: 8b 7d e4 mov -0x1c(%ebp),%edi
altflag = 1;
8005e9: c7 45 d8 01 00 00 00 movl $0x1,-0x28(%ebp)
goto reswitch;
8005f0: e9 5b ff ff ff jmp 800550 <vprintfmt+0x35>
8005f5: 8b 4d e4 mov -0x1c(%ebp),%ecx
8005f8: 89 45 d0 mov %eax,-0x30(%ebp)
8005fb: eb bc jmp 8005b9 <vprintfmt+0x9e>
lflag++;
8005fd: 83 c1 01 add $0x1,%ecx
switch (ch = *(unsigned char *) fmt++) {
800600: 8b 7d e4 mov -0x1c(%ebp),%edi
goto reswitch;
800603: e9 48 ff ff ff jmp 800550 <vprintfmt+0x35>
putch(va_arg(ap, int), putdat);
800608: 8b 45 14 mov 0x14(%ebp),%eax
80060b: 8d 78 04 lea 0x4(%eax),%edi
80060e: 83 ec 08 sub $0x8,%esp
800611: 53 push %ebx
800612: ff 30 pushl (%eax)
800614: ff d6 call *%esi
break;
800616: 83 c4 10 add $0x10,%esp
putch(va_arg(ap, int), putdat);
800619: 89 7d 14 mov %edi,0x14(%ebp)
break;
80061c: e9 cf 02 00 00 jmp 8008f0 <vprintfmt+0x3d5>
err = va_arg(ap, int);
800621: 8b 45 14 mov 0x14(%ebp),%eax
800624: 8d 78 04 lea 0x4(%eax),%edi
800627: 8b 00 mov (%eax),%eax
800629: 99 cltd
80062a: 31 d0 xor %edx,%eax
80062c: 29 d0 sub %edx,%eax
if (err >= MAXERROR || (p = error_string[err]) == NULL)
80062e: 83 f8 0f cmp $0xf,%eax
800631: 7f 23 jg 800656 <vprintfmt+0x13b>
800633: 8b 14 85 c0 12 80 00 mov 0x8012c0(,%eax,4),%edx
80063a: 85 d2 test %edx,%edx
80063c: 74 18 je 800656 <vprintfmt+0x13b>
printfmt(putch, putdat, "%s", p);
80063e: 52 push %edx
80063f: 68 3e 10 80 00 push $0x80103e
800644: 53 push %ebx
800645: 56 push %esi
800646: e8 b3 fe ff ff call 8004fe <printfmt>
80064b: 83 c4 10 add $0x10,%esp
err = va_arg(ap, int);
80064e: 89 7d 14 mov %edi,0x14(%ebp)
800651: e9 9a 02 00 00 jmp 8008f0 <vprintfmt+0x3d5>
printfmt(putch, putdat, "error %d", err);
800656: 50 push %eax
800657: 68 35 10 80 00 push $0x801035
80065c: 53 push %ebx
80065d: 56 push %esi
80065e: e8 9b fe ff ff call 8004fe <printfmt>
800663: 83 c4 10 add $0x10,%esp
err = va_arg(ap, int);
800666: 89 7d 14 mov %edi,0x14(%ebp)
printfmt(putch, putdat, "error %d", err);
800669: e9 82 02 00 00 jmp 8008f0 <vprintfmt+0x3d5>
if ((p = va_arg(ap, char *)) == NULL)
80066e: 8b 45 14 mov 0x14(%ebp),%eax
800671: 83 c0 04 add $0x4,%eax
800674: 89 45 cc mov %eax,-0x34(%ebp)
800677: 8b 45 14 mov 0x14(%ebp),%eax
80067a: 8b 38 mov (%eax),%edi
p = "(null)";
80067c: 85 ff test %edi,%edi
80067e: b8 2e 10 80 00 mov $0x80102e,%eax
800683: 0f 44 f8 cmove %eax,%edi
if (width > 0 && padc != '-')
800686: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
80068a: 0f 8e bd 00 00 00 jle 80074d <vprintfmt+0x232>
800690: 80 7d d4 2d cmpb $0x2d,-0x2c(%ebp)
800694: 75 0e jne 8006a4 <vprintfmt+0x189>
800696: 89 75 08 mov %esi,0x8(%ebp)
800699: 8b 75 d0 mov -0x30(%ebp),%esi
80069c: 89 5d 0c mov %ebx,0xc(%ebp)
80069f: 8b 5d e0 mov -0x20(%ebp),%ebx
8006a2: eb 6d jmp 800711 <vprintfmt+0x1f6>
for (width -= strnlen(p, precision); width > 0; width--)
8006a4: 83 ec 08 sub $0x8,%esp
8006a7: ff 75 d0 pushl -0x30(%ebp)
8006aa: 57 push %edi
8006ab: e8 6e 03 00 00 call 800a1e <strnlen>
8006b0: 8b 4d e0 mov -0x20(%ebp),%ecx
8006b3: 29 c1 sub %eax,%ecx
8006b5: 89 4d c8 mov %ecx,-0x38(%ebp)
8006b8: 83 c4 10 add $0x10,%esp
putch(padc, putdat);
8006bb: 0f be 45 d4 movsbl -0x2c(%ebp),%eax
8006bf: 89 45 e0 mov %eax,-0x20(%ebp)
8006c2: 89 7d d4 mov %edi,-0x2c(%ebp)
8006c5: 89 cf mov %ecx,%edi
for (width -= strnlen(p, precision); width > 0; width--)
8006c7: eb 0f jmp 8006d8 <vprintfmt+0x1bd>
putch(padc, putdat);
8006c9: 83 ec 08 sub $0x8,%esp
8006cc: 53 push %ebx
8006cd: ff 75 e0 pushl -0x20(%ebp)
8006d0: ff d6 call *%esi
for (width -= strnlen(p, precision); width > 0; width--)
8006d2: 83 ef 01 sub $0x1,%edi
8006d5: 83 c4 10 add $0x10,%esp
8006d8: 85 ff test %edi,%edi
8006da: 7f ed jg 8006c9 <vprintfmt+0x1ae>
8006dc: 8b 7d d4 mov -0x2c(%ebp),%edi
8006df: 8b 4d c8 mov -0x38(%ebp),%ecx
8006e2: 85 c9 test %ecx,%ecx
8006e4: b8 00 00 00 00 mov $0x0,%eax
8006e9: 0f 49 c1 cmovns %ecx,%eax
8006ec: 29 c1 sub %eax,%ecx
8006ee: 89 75 08 mov %esi,0x8(%ebp)
8006f1: 8b 75 d0 mov -0x30(%ebp),%esi
8006f4: 89 5d 0c mov %ebx,0xc(%ebp)
8006f7: 89 cb mov %ecx,%ebx
8006f9: eb 16 jmp 800711 <vprintfmt+0x1f6>
if (altflag && (ch < ' ' || ch > '~'))
8006fb: 83 7d d8 00 cmpl $0x0,-0x28(%ebp)
8006ff: 75 31 jne 800732 <vprintfmt+0x217>
putch(ch, putdat);
800701: 83 ec 08 sub $0x8,%esp
800704: ff 75 0c pushl 0xc(%ebp)
800707: 50 push %eax
800708: ff 55 08 call *0x8(%ebp)
80070b: 83 c4 10 add $0x10,%esp
for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
80070e: 83 eb 01 sub $0x1,%ebx
800711: 83 c7 01 add $0x1,%edi
800714: 0f b6 57 ff movzbl -0x1(%edi),%edx
800718: 0f be c2 movsbl %dl,%eax
80071b: 85 c0 test %eax,%eax
80071d: 74 59 je 800778 <vprintfmt+0x25d>
80071f: 85 f6 test %esi,%esi
800721: 78 d8 js 8006fb <vprintfmt+0x1e0>
800723: 83 ee 01 sub $0x1,%esi
800726: 79 d3 jns 8006fb <vprintfmt+0x1e0>
800728: 89 df mov %ebx,%edi
80072a: 8b 75 08 mov 0x8(%ebp),%esi
80072d: 8b 5d 0c mov 0xc(%ebp),%ebx
800730: eb 37 jmp 800769 <vprintfmt+0x24e>
if (altflag && (ch < ' ' || ch > '~'))
800732: 0f be d2 movsbl %dl,%edx
800735: 83 ea 20 sub $0x20,%edx
800738: 83 fa 5e cmp $0x5e,%edx
80073b: 76 c4 jbe 800701 <vprintfmt+0x1e6>
putch('?', putdat);
80073d: 83 ec 08 sub $0x8,%esp
800740: ff 75 0c pushl 0xc(%ebp)
800743: 6a 3f push $0x3f
800745: ff 55 08 call *0x8(%ebp)
800748: 83 c4 10 add $0x10,%esp
80074b: eb c1 jmp 80070e <vprintfmt+0x1f3>
80074d: 89 75 08 mov %esi,0x8(%ebp)
800750: 8b 75 d0 mov -0x30(%ebp),%esi
800753: 89 5d 0c mov %ebx,0xc(%ebp)
800756: 8b 5d e0 mov -0x20(%ebp),%ebx
800759: eb b6 jmp 800711 <vprintfmt+0x1f6>
putch(' ', putdat);
80075b: 83 ec 08 sub $0x8,%esp
80075e: 53 push %ebx
80075f: 6a 20 push $0x20
800761: ff d6 call *%esi
for (; width > 0; width--)
800763: 83 ef 01 sub $0x1,%edi
800766: 83 c4 10 add $0x10,%esp
800769: 85 ff test %edi,%edi
80076b: 7f ee jg 80075b <vprintfmt+0x240>
if ((p = va_arg(ap, char *)) == NULL)
80076d: 8b 45 cc mov -0x34(%ebp),%eax
800770: 89 45 14 mov %eax,0x14(%ebp)
800773: e9 78 01 00 00 jmp 8008f0 <vprintfmt+0x3d5>
800778: 89 df mov %ebx,%edi
80077a: 8b 75 08 mov 0x8(%ebp),%esi
80077d: 8b 5d 0c mov 0xc(%ebp),%ebx
800780: eb e7 jmp 800769 <vprintfmt+0x24e>
if (lflag >= 2)
800782: 83 f9 01 cmp $0x1,%ecx
800785: 7e 3f jle 8007c6 <vprintfmt+0x2ab>
return va_arg(*ap, long long);
800787: 8b 45 14 mov 0x14(%ebp),%eax
80078a: 8b 50 04 mov 0x4(%eax),%edx
80078d: 8b 00 mov (%eax),%eax
80078f: 89 45 d8 mov %eax,-0x28(%ebp)
800792: 89 55 dc mov %edx,-0x24(%ebp)
800795: 8b 45 14 mov 0x14(%ebp),%eax
800798: 8d 40 08 lea 0x8(%eax),%eax
80079b: 89 45 14 mov %eax,0x14(%ebp)
if ((long long) num < 0) {
80079e: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
8007a2: 79 5c jns 800800 <vprintfmt+0x2e5>
putch('-', putdat);
8007a4: 83 ec 08 sub $0x8,%esp
8007a7: 53 push %ebx
8007a8: 6a 2d push $0x2d
8007aa: ff d6 call *%esi
num = -(long long) num;
8007ac: 8b 55 d8 mov -0x28(%ebp),%edx
8007af: 8b 4d dc mov -0x24(%ebp),%ecx
8007b2: f7 da neg %edx
8007b4: 83 d1 00 adc $0x0,%ecx
8007b7: f7 d9 neg %ecx
8007b9: 83 c4 10 add $0x10,%esp
base = 10;
8007bc: b8 0a 00 00 00 mov $0xa,%eax
8007c1: e9 10 01 00 00 jmp 8008d6 <vprintfmt+0x3bb>
else if (lflag)
8007c6: 85 c9 test %ecx,%ecx
8007c8: 75 1b jne 8007e5 <vprintfmt+0x2ca>
return va_arg(*ap, int);
8007ca: 8b 45 14 mov 0x14(%ebp),%eax
8007cd: 8b 00 mov (%eax),%eax
8007cf: 89 45 d8 mov %eax,-0x28(%ebp)
8007d2: 89 c1 mov %eax,%ecx
8007d4: c1 f9 1f sar $0x1f,%ecx
8007d7: 89 4d dc mov %ecx,-0x24(%ebp)
8007da: 8b 45 14 mov 0x14(%ebp),%eax
8007dd: 8d 40 04 lea 0x4(%eax),%eax
8007e0: 89 45 14 mov %eax,0x14(%ebp)
8007e3: eb b9 jmp 80079e <vprintfmt+0x283>
return va_arg(*ap, long);
8007e5: 8b 45 14 mov 0x14(%ebp),%eax
8007e8: 8b 00 mov (%eax),%eax
8007ea: 89 45 d8 mov %eax,-0x28(%ebp)
8007ed: 89 c1 mov %eax,%ecx
8007ef: c1 f9 1f sar $0x1f,%ecx
8007f2: 89 4d dc mov %ecx,-0x24(%ebp)
8007f5: 8b 45 14 mov 0x14(%ebp),%eax
8007f8: 8d 40 04 lea 0x4(%eax),%eax
8007fb: 89 45 14 mov %eax,0x14(%ebp)
8007fe: eb 9e jmp 80079e <vprintfmt+0x283>
num = getint(&ap, lflag);
800800: 8b 55 d8 mov -0x28(%ebp),%edx
800803: 8b 4d dc mov -0x24(%ebp),%ecx
base = 10;
800806: b8 0a 00 00 00 mov $0xa,%eax
80080b: e9 c6 00 00 00 jmp 8008d6 <vprintfmt+0x3bb>
if (lflag >= 2)
800810: 83 f9 01 cmp $0x1,%ecx
800813: 7e 18 jle 80082d <vprintfmt+0x312>
return va_arg(*ap, unsigned long long);
800815: 8b 45 14 mov 0x14(%ebp),%eax
800818: 8b 10 mov (%eax),%edx
80081a: 8b 48 04 mov 0x4(%eax),%ecx
80081d: 8d 40 08 lea 0x8(%eax),%eax
800820: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
800823: b8 0a 00 00 00 mov $0xa,%eax
800828: e9 a9 00 00 00 jmp 8008d6 <vprintfmt+0x3bb>
else if (lflag)
80082d: 85 c9 test %ecx,%ecx
80082f: 75 1a jne 80084b <vprintfmt+0x330>
return va_arg(*ap, unsigned int);
800831: 8b 45 14 mov 0x14(%ebp),%eax
800834: 8b 10 mov (%eax),%edx
800836: b9 00 00 00 00 mov $0x0,%ecx
80083b: 8d 40 04 lea 0x4(%eax),%eax
80083e: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
800841: b8 0a 00 00 00 mov $0xa,%eax
800846: e9 8b 00 00 00 jmp 8008d6 <vprintfmt+0x3bb>
return va_arg(*ap, unsigned long);
80084b: 8b 45 14 mov 0x14(%ebp),%eax
80084e: 8b 10 mov (%eax),%edx
800850: b9 00 00 00 00 mov $0x0,%ecx
800855: 8d 40 04 lea 0x4(%eax),%eax
800858: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
80085b: b8 0a 00 00 00 mov $0xa,%eax
800860: eb 74 jmp 8008d6 <vprintfmt+0x3bb>
if (lflag >= 2)
800862: 83 f9 01 cmp $0x1,%ecx
800865: 7e 15 jle 80087c <vprintfmt+0x361>
return va_arg(*ap, unsigned long long);
800867: 8b 45 14 mov 0x14(%ebp),%eax
80086a: 8b 10 mov (%eax),%edx
80086c: 8b 48 04 mov 0x4(%eax),%ecx
80086f: 8d 40 08 lea 0x8(%eax),%eax
800872: 89 45 14 mov %eax,0x14(%ebp)
base = 8;
800875: b8 08 00 00 00 mov $0x8,%eax
80087a: eb 5a jmp 8008d6 <vprintfmt+0x3bb>
else if (lflag)
80087c: 85 c9 test %ecx,%ecx
80087e: 75 17 jne 800897 <vprintfmt+0x37c>
return va_arg(*ap, unsigned int);
800880: 8b 45 14 mov 0x14(%ebp),%eax
800883: 8b 10 mov (%eax),%edx
800885: b9 00 00 00 00 mov $0x0,%ecx
80088a: 8d 40 04 lea 0x4(%eax),%eax
80088d: 89 45 14 mov %eax,0x14(%ebp)
base = 8;
800890: b8 08 00 00 00 mov $0x8,%eax
800895: eb 3f jmp 8008d6 <vprintfmt+0x3bb>
return va_arg(*ap, unsigned long);
800897: 8b 45 14 mov 0x14(%ebp),%eax
80089a: 8b 10 mov (%eax),%edx
80089c: b9 00 00 00 00 mov $0x0,%ecx
8008a1: 8d 40 04 lea 0x4(%eax),%eax
8008a4: 89 45 14 mov %eax,0x14(%ebp)
base = 8;
8008a7: b8 08 00 00 00 mov $0x8,%eax
8008ac: eb 28 jmp 8008d6 <vprintfmt+0x3bb>
putch('0', putdat);
8008ae: 83 ec 08 sub $0x8,%esp
8008b1: 53 push %ebx
8008b2: 6a 30 push $0x30
8008b4: ff d6 call *%esi
putch('x', putdat);
8008b6: 83 c4 08 add $0x8,%esp
8008b9: 53 push %ebx
8008ba: 6a 78 push $0x78
8008bc: ff d6 call *%esi
num = (unsigned long long)
8008be: 8b 45 14 mov 0x14(%ebp),%eax
8008c1: 8b 10 mov (%eax),%edx
8008c3: b9 00 00 00 00 mov $0x0,%ecx
goto number;
8008c8: 83 c4 10 add $0x10,%esp
(uintptr_t) va_arg(ap, void *);
8008cb: 8d 40 04 lea 0x4(%eax),%eax
8008ce: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
8008d1: b8 10 00 00 00 mov $0x10,%eax
printnum(putch, putdat, num, base, width, padc);
8008d6: 83 ec 0c sub $0xc,%esp
8008d9: 0f be 7d d4 movsbl -0x2c(%ebp),%edi
8008dd: 57 push %edi
8008de: ff 75 e0 pushl -0x20(%ebp)
8008e1: 50 push %eax
8008e2: 51 push %ecx
8008e3: 52 push %edx
8008e4: 89 da mov %ebx,%edx
8008e6: 89 f0 mov %esi,%eax
8008e8: e8 45 fb ff ff call 800432 <printnum>
break;
8008ed: 83 c4 20 add $0x20,%esp
err = va_arg(ap, int);
8008f0: 8b 7d e4 mov -0x1c(%ebp),%edi
while ((ch = *(unsigned char *) fmt++) != '%') { //先将非格式化字符输出到控制台。
8008f3: 83 c7 01 add $0x1,%edi
8008f6: 0f b6 47 ff movzbl -0x1(%edi),%eax
8008fa: 83 f8 25 cmp $0x25,%eax
8008fd: 0f 84 2f fc ff ff je 800532 <vprintfmt+0x17>
if (ch == '\0') //如果没有格式化字符直接返回
800903: 85 c0 test %eax,%eax
800905: 0f 84 8b 00 00 00 je 800996 <vprintfmt+0x47b>
putch(ch, putdat);
80090b: 83 ec 08 sub $0x8,%esp
80090e: 53 push %ebx
80090f: 50 push %eax
800910: ff d6 call *%esi
800912: 83 c4 10 add $0x10,%esp
800915: eb dc jmp 8008f3 <vprintfmt+0x3d8>
if (lflag >= 2)
800917: 83 f9 01 cmp $0x1,%ecx
80091a: 7e 15 jle 800931 <vprintfmt+0x416>
return va_arg(*ap, unsigned long long);
80091c: 8b 45 14 mov 0x14(%ebp),%eax
80091f: 8b 10 mov (%eax),%edx
800921: 8b 48 04 mov 0x4(%eax),%ecx
800924: 8d 40 08 lea 0x8(%eax),%eax
800927: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
80092a: b8 10 00 00 00 mov $0x10,%eax
80092f: eb a5 jmp 8008d6 <vprintfmt+0x3bb>
else if (lflag)
800931: 85 c9 test %ecx,%ecx
800933: 75 17 jne 80094c <vprintfmt+0x431>
return va_arg(*ap, unsigned int);
800935: 8b 45 14 mov 0x14(%ebp),%eax
800938: 8b 10 mov (%eax),%edx
80093a: b9 00 00 00 00 mov $0x0,%ecx
80093f: 8d 40 04 lea 0x4(%eax),%eax
800942: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
800945: b8 10 00 00 00 mov $0x10,%eax
80094a: eb 8a jmp 8008d6 <vprintfmt+0x3bb>
return va_arg(*ap, unsigned long);
80094c: 8b 45 14 mov 0x14(%ebp),%eax
80094f: 8b 10 mov (%eax),%edx
800951: b9 00 00 00 00 mov $0x0,%ecx
800956: 8d 40 04 lea 0x4(%eax),%eax
800959: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
80095c: b8 10 00 00 00 mov $0x10,%eax
800961: e9 70 ff ff ff jmp 8008d6 <vprintfmt+0x3bb>
putch(ch, putdat);
800966: 83 ec 08 sub $0x8,%esp
800969: 53 push %ebx
80096a: 6a 25 push $0x25
80096c: ff d6 call *%esi
break;
80096e: 83 c4 10 add $0x10,%esp
800971: e9 7a ff ff ff jmp 8008f0 <vprintfmt+0x3d5>
putch('%', putdat);
800976: 83 ec 08 sub $0x8,%esp
800979: 53 push %ebx
80097a: 6a 25 push $0x25
80097c: ff d6 call *%esi
for (fmt--; fmt[-1] != '%'; fmt--)
80097e: 83 c4 10 add $0x10,%esp
800981: 89 f8 mov %edi,%eax
800983: eb 03 jmp 800988 <vprintfmt+0x46d>
800985: 83 e8 01 sub $0x1,%eax
800988: 80 78 ff 25 cmpb $0x25,-0x1(%eax)
80098c: 75 f7 jne 800985 <vprintfmt+0x46a>
80098e: 89 45 e4 mov %eax,-0x1c(%ebp)
800991: e9 5a ff ff ff jmp 8008f0 <vprintfmt+0x3d5>
}
800996: 8d 65 f4 lea -0xc(%ebp),%esp
800999: 5b pop %ebx
80099a: 5e pop %esi
80099b: 5f pop %edi
80099c: 5d pop %ebp
80099d: c3 ret
0080099e <vsnprintf>:
int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
80099e: 55 push %ebp
80099f: 89 e5 mov %esp,%ebp
8009a1: 83 ec 18 sub $0x18,%esp
8009a4: 8b 45 08 mov 0x8(%ebp),%eax
8009a7: 8b 55 0c mov 0xc(%ebp),%edx
struct sprintbuf b = {buf, buf+n-1, 0};
8009aa: 89 45 ec mov %eax,-0x14(%ebp)
8009ad: 8d 4c 10 ff lea -0x1(%eax,%edx,1),%ecx
8009b1: 89 4d f0 mov %ecx,-0x10(%ebp)
8009b4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if (buf == NULL || n < 1)
8009bb: 85 c0 test %eax,%eax
8009bd: 74 26 je 8009e5 <vsnprintf+0x47>
8009bf: 85 d2 test %edx,%edx
8009c1: 7e 22 jle 8009e5 <vsnprintf+0x47>
return -E_INVAL;
// print the string to the buffer
vprintfmt((void*)sprintputch, &b, fmt, ap);
8009c3: ff 75 14 pushl 0x14(%ebp)
8009c6: ff 75 10 pushl 0x10(%ebp)
8009c9: 8d 45 ec lea -0x14(%ebp),%eax
8009cc: 50 push %eax
8009cd: 68 e1 04 80 00 push $0x8004e1
8009d2: e8 44 fb ff ff call 80051b <vprintfmt>
// null terminate the buffer
*b.buf = '\0';
8009d7: 8b 45 ec mov -0x14(%ebp),%eax
8009da: c6 00 00 movb $0x0,(%eax)
return b.cnt;
8009dd: 8b 45 f4 mov -0xc(%ebp),%eax
8009e0: 83 c4 10 add $0x10,%esp
}
8009e3: c9 leave
8009e4: c3 ret
return -E_INVAL;
8009e5: b8 fd ff ff ff mov $0xfffffffd,%eax
8009ea: eb f7 jmp 8009e3 <vsnprintf+0x45>
008009ec <snprintf>:
int
snprintf(char *buf, int n, const char *fmt, ...)
{
8009ec: 55 push %ebp
8009ed: 89 e5 mov %esp,%ebp
8009ef: 83 ec 08 sub $0x8,%esp
va_list ap;
int rc;
va_start(ap, fmt);
8009f2: 8d 45 14 lea 0x14(%ebp),%eax
rc = vsnprintf(buf, n, fmt, ap);
8009f5: 50 push %eax
8009f6: ff 75 10 pushl 0x10(%ebp)
8009f9: ff 75 0c pushl 0xc(%ebp)
8009fc: ff 75 08 pushl 0x8(%ebp)
8009ff: e8 9a ff ff ff call 80099e <vsnprintf>
va_end(ap);
return rc;
}
800a04: c9 leave
800a05: c3 ret
00800a06 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1
int
strlen(const char *s)
{
800a06: 55 push %ebp
800a07: 89 e5 mov %esp,%ebp
800a09: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for (n = 0; *s != '\0'; s++)
800a0c: b8 00 00 00 00 mov $0x0,%eax
800a11: eb 03 jmp 800a16 <strlen+0x10>
n++;
800a13: 83 c0 01 add $0x1,%eax
for (n = 0; *s != '\0'; s++)
800a16: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
800a1a: 75 f7 jne 800a13 <strlen+0xd>
return n;
}
800a1c: 5d pop %ebp
800a1d: c3 ret
00800a1e <strnlen>:
int
strnlen(const char *s, size_t size)
{
800a1e: 55 push %ebp
800a1f: 89 e5 mov %esp,%ebp
800a21: 8b 4d 08 mov 0x8(%ebp),%ecx
800a24: 8b 55 0c mov 0xc(%ebp),%edx
int n;
for (n = 0; size > 0 && *s != '\0'; s++, size--)
800a27: b8 00 00 00 00 mov $0x0,%eax
800a2c: eb 03 jmp 800a31 <strnlen+0x13>
n++;
800a2e: 83 c0 01 add $0x1,%eax
for (n = 0; size > 0 && *s != '\0'; s++, size--)
800a31: 39 d0 cmp %edx,%eax
800a33: 74 06 je 800a3b <strnlen+0x1d>
800a35: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
800a39: 75 f3 jne 800a2e <strnlen+0x10>
return n;
}
800a3b: 5d pop %ebp
800a3c: c3 ret
00800a3d <strcpy>:
char *
strcpy(char *dst, const char *src)
{
800a3d: 55 push %ebp
800a3e: 89 e5 mov %esp,%ebp
800a40: 53 push %ebx
800a41: 8b 45 08 mov 0x8(%ebp),%eax
800a44: 8b 4d 0c mov 0xc(%ebp),%ecx
char *ret;
ret = dst;
while ((*dst++ = *src++) != '\0')
800a47: 89 c2 mov %eax,%edx
800a49: 83 c1 01 add $0x1,%ecx
800a4c: 83 c2 01 add $0x1,%edx
800a4f: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
800a53: 88 5a ff mov %bl,-0x1(%edx)
800a56: 84 db test %bl,%bl
800a58: 75 ef jne 800a49 <strcpy+0xc>
/* do nothing */;
return ret;
}
800a5a: 5b pop %ebx
800a5b: 5d pop %ebp
800a5c: c3 ret
00800a5d <strcat>:
char *
strcat(char *dst, const char *src)
{
800a5d: 55 push %ebp
800a5e: 89 e5 mov %esp,%ebp
800a60: 53 push %ebx
800a61: 8b 5d 08 mov 0x8(%ebp),%ebx
int len = strlen(dst);
800a64: 53 push %ebx
800a65: e8 9c ff ff ff call 800a06 <strlen>
800a6a: 83 c4 04 add $0x4,%esp
strcpy(dst + len, src);
800a6d: ff 75 0c pushl 0xc(%ebp)
800a70: 01 d8 add %ebx,%eax
800a72: 50 push %eax
800a73: e8 c5 ff ff ff call 800a3d <strcpy>
return dst;
}
800a78: 89 d8 mov %ebx,%eax
800a7a: 8b 5d fc mov -0x4(%ebp),%ebx
800a7d: c9 leave
800a7e: c3 ret
00800a7f <strncpy>:
char *
strncpy(char *dst, const char *src, size_t size) {
800a7f: 55 push %ebp
800a80: 89 e5 mov %esp,%ebp
800a82: 56 push %esi
800a83: 53 push %ebx
800a84: 8b 75 08 mov 0x8(%ebp),%esi
800a87: 8b 4d 0c mov 0xc(%ebp),%ecx
800a8a: 89 f3 mov %esi,%ebx
800a8c: 03 5d 10 add 0x10(%ebp),%ebx
size_t i;
char *ret;
ret = dst;
for (i = 0; i < size; i++) {
800a8f: 89 f2 mov %esi,%edx
800a91: eb 0f jmp 800aa2 <strncpy+0x23>
*dst++ = *src;
800a93: 83 c2 01 add $0x1,%edx
800a96: 0f b6 01 movzbl (%ecx),%eax
800a99: 88 42 ff mov %al,-0x1(%edx)
// If strlen(src) < size, null-pad 'dst' out to 'size' chars
if (*src != '\0')
src++;
800a9c: 80 39 01 cmpb $0x1,(%ecx)
800a9f: 83 d9 ff sbb $0xffffffff,%ecx
for (i = 0; i < size; i++) {
800aa2: 39 da cmp %ebx,%edx
800aa4: 75 ed jne 800a93 <strncpy+0x14>
}
return ret;
}
800aa6: 89 f0 mov %esi,%eax
800aa8: 5b pop %ebx
800aa9: 5e pop %esi
800aaa: 5d pop %ebp
800aab: c3 ret
00800aac <strlcpy>:
size_t
strlcpy(char *dst, const char *src, size_t size)
{
800aac: 55 push %ebp
800aad: 89 e5 mov %esp,%ebp
800aaf: 56 push %esi
800ab0: 53 push %ebx
800ab1: 8b 75 08 mov 0x8(%ebp),%esi
800ab4: 8b 55 0c mov 0xc(%ebp),%edx
800ab7: 8b 4d 10 mov 0x10(%ebp),%ecx
800aba: 89 f0 mov %esi,%eax
800abc: 8d 5c 0e ff lea -0x1(%esi,%ecx,1),%ebx
char *dst_in;
dst_in = dst;
if (size > 0) {
800ac0: 85 c9 test %ecx,%ecx
800ac2: 75 0b jne 800acf <strlcpy+0x23>
800ac4: eb 17 jmp 800add <strlcpy+0x31>
while (--size > 0 && *src != '\0')
*dst++ = *src++;
800ac6: 83 c2 01 add $0x1,%edx
800ac9: 83 c0 01 add $0x1,%eax
800acc: 88 48 ff mov %cl,-0x1(%eax)
while (--size > 0 && *src != '\0')
800acf: 39 d8 cmp %ebx,%eax
800ad1: 74 07 je 800ada <strlcpy+0x2e>
800ad3: 0f b6 0a movzbl (%edx),%ecx
800ad6: 84 c9 test %cl,%cl
800ad8: 75 ec jne 800ac6 <strlcpy+0x1a>
*dst = '\0';
800ada: c6 00 00 movb $0x0,(%eax)
}
return dst - dst_in;
800add: 29 f0 sub %esi,%eax
}
800adf: 5b pop %ebx
800ae0: 5e pop %esi
800ae1: 5d pop %ebp
800ae2: c3 ret
00800ae3 <strcmp>:
int
strcmp(const char *p, const char *q)
{
800ae3: 55 push %ebp
800ae4: 89 e5 mov %esp,%ebp
800ae6: 8b 4d 08 mov 0x8(%ebp),%ecx
800ae9: 8b 55 0c mov 0xc(%ebp),%edx
while (*p && *p == *q)
800aec: eb 06 jmp 800af4 <strcmp+0x11>
p++, q++;
800aee: 83 c1 01 add $0x1,%ecx
800af1: 83 c2 01 add $0x1,%edx
while (*p && *p == *q)
800af4: 0f b6 01 movzbl (%ecx),%eax
800af7: 84 c0 test %al,%al
800af9: 74 04 je 800aff <strcmp+0x1c>
800afb: 3a 02 cmp (%edx),%al
800afd: 74 ef je 800aee <strcmp+0xb>
return (int) ((unsigned char) *p - (unsigned char) *q);
800aff: 0f b6 c0 movzbl %al,%eax
800b02: 0f b6 12 movzbl (%edx),%edx
800b05: 29 d0 sub %edx,%eax
}
800b07: 5d pop %ebp
800b08: c3 ret
00800b09 <strncmp>:
int
strncmp(const char *p, const char *q, size_t n)
{
800b09: 55 push %ebp
800b0a: 89 e5 mov %esp,%ebp
800b0c: 53 push %ebx
800b0d: 8b 45 08 mov 0x8(%ebp),%eax
800b10: 8b 55 0c mov 0xc(%ebp),%edx
800b13: 89 c3 mov %eax,%ebx
800b15: 03 5d 10 add 0x10(%ebp),%ebx
while (n > 0 && *p && *p == *q)
800b18: eb 06 jmp 800b20 <strncmp+0x17>
n--, p++, q++;
800b1a: 83 c0 01 add $0x1,%eax
800b1d: 83 c2 01 add $0x1,%edx
while (n > 0 && *p && *p == *q)
800b20: 39 d8 cmp %ebx,%eax
800b22: 74 16 je 800b3a <strncmp+0x31>
800b24: 0f b6 08 movzbl (%eax),%ecx
800b27: 84 c9 test %cl,%cl
800b29: 74 04 je 800b2f <strncmp+0x26>
800b2b: 3a 0a cmp (%edx),%cl
800b2d: 74 eb je 800b1a <strncmp+0x11>
if (n == 0)
return 0;
else
return (int) ((unsigned char) *p - (unsigned char) *q);
800b2f: 0f b6 00 movzbl (%eax),%eax
800b32: 0f b6 12 movzbl (%edx),%edx
800b35: 29 d0 sub %edx,%eax
}
800b37: 5b pop %ebx
800b38: 5d pop %ebp
800b39: c3 ret
return 0;
800b3a: b8 00 00 00 00 mov $0x0,%eax
800b3f: eb f6 jmp 800b37 <strncmp+0x2e>
00800b41 <strchr>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
800b41: 55 push %ebp
800b42: 89 e5 mov %esp,%ebp
800b44: 8b 45 08 mov 0x8(%ebp),%eax
800b47: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
800b4b: 0f b6 10 movzbl (%eax),%edx
800b4e: 84 d2 test %dl,%dl
800b50: 74 09 je 800b5b <strchr+0x1a>
if (*s == c)
800b52: 38 ca cmp %cl,%dl
800b54: 74 0a je 800b60 <strchr+0x1f>
for (; *s; s++)
800b56: 83 c0 01 add $0x1,%eax
800b59: eb f0 jmp 800b4b <strchr+0xa>
return (char *) s;
return 0;
800b5b: b8 00 00 00 00 mov $0x0,%eax
}
800b60: 5d pop %ebp
800b61: c3 ret
00800b62 <strfind>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
800b62: 55 push %ebp
800b63: 89 e5 mov %esp,%ebp
800b65: 8b 45 08 mov 0x8(%ebp),%eax
800b68: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
800b6c: eb 03 jmp 800b71 <strfind+0xf>
800b6e: 83 c0 01 add $0x1,%eax
800b71: 0f b6 10 movzbl (%eax),%edx
if (*s == c)
800b74: 38 ca cmp %cl,%dl
800b76: 74 04 je 800b7c <strfind+0x1a>
800b78: 84 d2 test %dl,%dl
800b7a: 75 f2 jne 800b6e <strfind+0xc>
break;
return (char *) s;
}
800b7c: 5d pop %ebp
800b7d: c3 ret
00800b7e <memset>:
#if ASM
void *
memset(void *v, int c, size_t n)
{
800b7e: 55 push %ebp
800b7f: 89 e5 mov %esp,%ebp
800b81: 57 push %edi
800b82: 56 push %esi
800b83: 53 push %ebx
800b84: 8b 7d 08 mov 0x8(%ebp),%edi
800b87: 8b 4d 10 mov 0x10(%ebp),%ecx
char *p;
if (n == 0)
800b8a: 85 c9 test %ecx,%ecx
800b8c: 74 13 je 800ba1 <memset+0x23>
return v;
if ((int)v%4 == 0 && n%4 == 0) {
800b8e: f7 c7 03 00 00 00 test $0x3,%edi
800b94: 75 05 jne 800b9b <memset+0x1d>
800b96: f6 c1 03 test $0x3,%cl
800b99: 74 0d je 800ba8 <memset+0x2a>
c = (c<<24)|(c<<16)|(c<<8)|c;
asm volatile("cld; rep stosl\n"
:: "D" (v), "a" (c), "c" (n/4)
: "cc", "memory");
} else
asm volatile("cld; rep stosb\n"
800b9b: 8b 45 0c mov 0xc(%ebp),%eax
800b9e: fc cld
800b9f: f3 aa rep stos %al,%es:(%edi)
:: "D" (v), "a" (c), "c" (n)
: "cc", "memory");
return v;
}
800ba1: 89 f8 mov %edi,%eax
800ba3: 5b pop %ebx
800ba4: 5e pop %esi
800ba5: 5f pop %edi
800ba6: 5d pop %ebp
800ba7: c3 ret
c &= 0xFF;
800ba8: 0f b6 55 0c movzbl 0xc(%ebp),%edx
c = (c<<24)|(c<<16)|(c<<8)|c;
800bac: 89 d3 mov %edx,%ebx
800bae: c1 e3 08 shl $0x8,%ebx
800bb1: 89 d0 mov %edx,%eax
800bb3: c1 e0 18 shl $0x18,%eax
800bb6: 89 d6 mov %edx,%esi
800bb8: c1 e6 10 shl $0x10,%esi
800bbb: 09 f0 or %esi,%eax
800bbd: 09 c2 or %eax,%edx
800bbf: 09 da or %ebx,%edx
:: "D" (v), "a" (c), "c" (n/4)
800bc1: c1 e9 02 shr $0x2,%ecx
asm volatile("cld; rep stosl\n"
800bc4: 89 d0 mov %edx,%eax
800bc6: fc cld
800bc7: f3 ab rep stos %eax,%es:(%edi)
800bc9: eb d6 jmp 800ba1 <memset+0x23>
00800bcb <memmove>:
void *
memmove(void *dst, const void *src, size_t n)
{
800bcb: 55 push %ebp
800bcc: 89 e5 mov %esp,%ebp
800bce: 57 push %edi
800bcf: 56 push %esi
800bd0: 8b 45 08 mov 0x8(%ebp),%eax
800bd3: 8b 75 0c mov 0xc(%ebp),%esi
800bd6: 8b 4d 10 mov 0x10(%ebp),%ecx
const char *s;
char *d;
s = src;
d = dst;
if (s < d && s + n > d) {
800bd9: 39 c6 cmp %eax,%esi
800bdb: 73 35 jae 800c12 <memmove+0x47>
800bdd: 8d 14 0e lea (%esi,%ecx,1),%edx
800be0: 39 c2 cmp %eax,%edx
800be2: 76 2e jbe 800c12 <memmove+0x47>
s += n;
d += n;
800be4: 8d 3c 08 lea (%eax,%ecx,1),%edi
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800be7: 89 d6 mov %edx,%esi
800be9: 09 fe or %edi,%esi
800beb: f7 c6 03 00 00 00 test $0x3,%esi
800bf1: 74 0c je 800bff <memmove+0x34>
asm volatile("std; rep movsl\n"
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
else
asm volatile("std; rep movsb\n"
:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
800bf3: 83 ef 01 sub $0x1,%edi
800bf6: 8d 72 ff lea -0x1(%edx),%esi
asm volatile("std; rep movsb\n"
800bf9: fd std
800bfa: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
// Some versions of GCC rely on DF being clear
asm volatile("cld" ::: "cc");
800bfc: fc cld
800bfd: eb 21 jmp 800c20 <memmove+0x55>
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800bff: f6 c1 03 test $0x3,%cl
800c02: 75 ef jne 800bf3 <memmove+0x28>
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
800c04: 83 ef 04 sub $0x4,%edi
800c07: 8d 72 fc lea -0x4(%edx),%esi
800c0a: c1 e9 02 shr $0x2,%ecx
asm volatile("std; rep movsl\n"
800c0d: fd std
800c0e: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
800c10: eb ea jmp 800bfc <memmove+0x31>
} else {
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800c12: 89 f2 mov %esi,%edx
800c14: 09 c2 or %eax,%edx
800c16: f6 c2 03 test $0x3,%dl
800c19: 74 09 je 800c24 <memmove+0x59>
asm volatile("cld; rep movsl\n"
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
else
asm volatile("cld; rep movsb\n"
800c1b: 89 c7 mov %eax,%edi
800c1d: fc cld
800c1e: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
}
return dst;
}
800c20: 5e pop %esi
800c21: 5f pop %edi
800c22: 5d pop %ebp
800c23: c3 ret
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800c24: f6 c1 03 test $0x3,%cl
800c27: 75 f2 jne 800c1b <memmove+0x50>
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
800c29: c1 e9 02 shr $0x2,%ecx
asm volatile("cld; rep movsl\n"
800c2c: 89 c7 mov %eax,%edi
800c2e: fc cld
800c2f: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
800c31: eb ed jmp 800c20 <memmove+0x55>
00800c33 <memcpy>:
}
#endif
void *
memcpy(void *dst, const void *src, size_t n)
{
800c33: 55 push %ebp
800c34: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
800c36: ff 75 10 pushl 0x10(%ebp)
800c39: ff 75 0c pushl 0xc(%ebp)
800c3c: ff 75 08 pushl 0x8(%ebp)
800c3f: e8 87 ff ff ff call 800bcb <memmove>
}
800c44: c9 leave
800c45: c3 ret
00800c46 <memcmp>:
int
memcmp(const void *v1, const void *v2, size_t n)
{
800c46: 55 push %ebp
800c47: 89 e5 mov %esp,%ebp
800c49: 56 push %esi
800c4a: 53 push %ebx
800c4b: 8b 45 08 mov 0x8(%ebp),%eax
800c4e: 8b 55 0c mov 0xc(%ebp),%edx
800c51: 89 c6 mov %eax,%esi
800c53: 03 75 10 add 0x10(%ebp),%esi
const uint8_t *s1 = (const uint8_t *) v1;
const uint8_t *s2 = (const uint8_t *) v2;
while (n-- > 0) {
800c56: 39 f0 cmp %esi,%eax
800c58: 74 1c je 800c76 <memcmp+0x30>
if (*s1 != *s2)
800c5a: 0f b6 08 movzbl (%eax),%ecx
800c5d: 0f b6 1a movzbl (%edx),%ebx
800c60: 38 d9 cmp %bl,%cl
800c62: 75 08 jne 800c6c <memcmp+0x26>
return (int) *s1 - (int) *s2;
s1++, s2++;
800c64: 83 c0 01 add $0x1,%eax
800c67: 83 c2 01 add $0x1,%edx
800c6a: eb ea jmp 800c56 <memcmp+0x10>
return (int) *s1 - (int) *s2;
800c6c: 0f b6 c1 movzbl %cl,%eax
800c6f: 0f b6 db movzbl %bl,%ebx
800c72: 29 d8 sub %ebx,%eax
800c74: eb 05 jmp 800c7b <memcmp+0x35>
}
return 0;
800c76: b8 00 00 00 00 mov $0x0,%eax
}
800c7b: 5b pop %ebx
800c7c: 5e pop %esi
800c7d: 5d pop %ebp
800c7e: c3 ret
00800c7f <memfind>:
void *
memfind(const void *s, int c, size_t n)
{
800c7f: 55 push %ebp
800c80: 89 e5 mov %esp,%ebp
800c82: 8b 45 08 mov 0x8(%ebp),%eax
800c85: 8b 4d 0c mov 0xc(%ebp),%ecx
const void *ends = (const char *) s + n;
800c88: 89 c2 mov %eax,%edx
800c8a: 03 55 10 add 0x10(%ebp),%edx
for (; s < ends; s++)
800c8d: 39 d0 cmp %edx,%eax
800c8f: 73 09 jae 800c9a <memfind+0x1b>
if (*(const unsigned char *) s == (unsigned char) c)
800c91: 38 08 cmp %cl,(%eax)
800c93: 74 05 je 800c9a <memfind+0x1b>
for (; s < ends; s++)
800c95: 83 c0 01 add $0x1,%eax
800c98: eb f3 jmp 800c8d <memfind+0xe>
break;
return (void *) s;
}
800c9a: 5d pop %ebp
800c9b: c3 ret
00800c9c <strtol>:
long
strtol(const char *s, char **endptr, int base)
{
800c9c: 55 push %ebp
800c9d: 89 e5 mov %esp,%ebp
800c9f: 57 push %edi
800ca0: 56 push %esi
800ca1: 53 push %ebx
800ca2: 8b 4d 08 mov 0x8(%ebp),%ecx
800ca5: 8b 5d 10 mov 0x10(%ebp),%ebx
int neg = 0;
long val = 0;
// gobble initial whitespace
while (*s == ' ' || *s == '\t')
800ca8: eb 03 jmp 800cad <strtol+0x11>
s++;
800caa: 83 c1 01 add $0x1,%ecx
while (*s == ' ' || *s == '\t')
800cad: 0f b6 01 movzbl (%ecx),%eax
800cb0: 3c 20 cmp $0x20,%al
800cb2: 74 f6 je 800caa <strtol+0xe>
800cb4: 3c 09 cmp $0x9,%al
800cb6: 74 f2 je 800caa <strtol+0xe>
// plus/minus sign
if (*s == '+')
800cb8: 3c 2b cmp $0x2b,%al
800cba: 74 2e je 800cea <strtol+0x4e>
int neg = 0;
800cbc: bf 00 00 00 00 mov $0x0,%edi
s++;
else if (*s == '-')
800cc1: 3c 2d cmp $0x2d,%al
800cc3: 74 2f je 800cf4 <strtol+0x58>
s++, neg = 1;
// hex or octal base prefix
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
800cc5: f7 c3 ef ff ff ff test $0xffffffef,%ebx
800ccb: 75 05 jne 800cd2 <strtol+0x36>
800ccd: 80 39 30 cmpb $0x30,(%ecx)
800cd0: 74 2c je 800cfe <strtol+0x62>
s += 2, base = 16;
else if (base == 0 && s[0] == '0')
800cd2: 85 db test %ebx,%ebx
800cd4: 75 0a jne 800ce0 <strtol+0x44>
s++, base = 8;
else if (base == 0)
base = 10;
800cd6: bb 0a 00 00 00 mov $0xa,%ebx
else if (base == 0 && s[0] == '0')
800cdb: 80 39 30 cmpb $0x30,(%ecx)
800cde: 74 28 je 800d08 <strtol+0x6c>
base = 10;
800ce0: b8 00 00 00 00 mov $0x0,%eax
800ce5: 89 5d 10 mov %ebx,0x10(%ebp)
800ce8: eb 50 jmp 800d3a <strtol+0x9e>
s++;
800cea: 83 c1 01 add $0x1,%ecx
int neg = 0;
800ced: bf 00 00 00 00 mov $0x0,%edi
800cf2: eb d1 jmp 800cc5 <strtol+0x29>
s++, neg = 1;
800cf4: 83 c1 01 add $0x1,%ecx
800cf7: bf 01 00 00 00 mov $0x1,%edi
800cfc: eb c7 jmp 800cc5 <strtol+0x29>
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
800cfe: 80 79 01 78 cmpb $0x78,0x1(%ecx)
800d02: 74 0e je 800d12 <strtol+0x76>
else if (base == 0 && s[0] == '0')
800d04: 85 db test %ebx,%ebx
800d06: 75 d8 jne 800ce0 <strtol+0x44>
s++, base = 8;
800d08: 83 c1 01 add $0x1,%ecx
800d0b: bb 08 00 00 00 mov $0x8,%ebx
800d10: eb ce jmp 800ce0 <strtol+0x44>
s += 2, base = 16;
800d12: 83 c1 02 add $0x2,%ecx
800d15: bb 10 00 00 00 mov $0x10,%ebx
800d1a: eb c4 jmp 800ce0 <strtol+0x44>
while (1) {
int dig;
if (*s >= '0' && *s <= '9')
dig = *s - '0';
else if (*s >= 'a' && *s <= 'z')
800d1c: 8d 72 9f lea -0x61(%edx),%esi
800d1f: 89 f3 mov %esi,%ebx
800d21: 80 fb 19 cmp $0x19,%bl
800d24: 77 29 ja 800d4f <strtol+0xb3>
dig = *s - 'a' + 10;
800d26: 0f be d2 movsbl %dl,%edx
800d29: 83 ea 57 sub $0x57,%edx
else if (*s >= 'A' && *s <= 'Z')
dig = *s - 'A' + 10;
else
break;
if (dig >= base)
800d2c: 3b 55 10 cmp 0x10(%ebp),%edx
800d2f: 7d 30 jge 800d61 <strtol+0xc5>
break;
s++, val = (val * base) + dig;
800d31: 83 c1 01 add $0x1,%ecx
800d34: 0f af 45 10 imul 0x10(%ebp),%eax
800d38: 01 d0 add %edx,%eax
if (*s >= '0' && *s <= '9')
800d3a: 0f b6 11 movzbl (%ecx),%edx
800d3d: 8d 72 d0 lea -0x30(%edx),%esi
800d40: 89 f3 mov %esi,%ebx
800d42: 80 fb 09 cmp $0x9,%bl
800d45: 77 d5 ja 800d1c <strtol+0x80>
dig = *s - '0';
800d47: 0f be d2 movsbl %dl,%edx
800d4a: 83 ea 30 sub $0x30,%edx
800d4d: eb dd jmp 800d2c <strtol+0x90>
else if (*s >= 'A' && *s <= 'Z')
800d4f: 8d 72 bf lea -0x41(%edx),%esi
800d52: 89 f3 mov %esi,%ebx
800d54: 80 fb 19 cmp $0x19,%bl
800d57: 77 08 ja 800d61 <strtol+0xc5>
dig = *s - 'A' + 10;
800d59: 0f be d2 movsbl %dl,%edx
800d5c: 83 ea 37 sub $0x37,%edx
800d5f: eb cb jmp 800d2c <strtol+0x90>
// we don't properly detect overflow!
}
if (endptr)
800d61: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
800d65: 74 05 je 800d6c <strtol+0xd0>
*endptr = (char *) s;
800d67: 8b 75 0c mov 0xc(%ebp),%esi
800d6a: 89 0e mov %ecx,(%esi)
return (neg ? -val : val);
800d6c: 89 c2 mov %eax,%edx
800d6e: f7 da neg %edx
800d70: 85 ff test %edi,%edi
800d72: 0f 45 c2 cmovne %edx,%eax
}
800d75: 5b pop %ebx
800d76: 5e pop %esi
800d77: 5f pop %edi
800d78: 5d pop %ebp
800d79: c3 ret
800d7a: 66 90 xchg %ax,%ax
800d7c: 66 90 xchg %ax,%ax
800d7e: 66 90 xchg %ax,%ax
00800d80 <__udivdi3>:
800d80: 55 push %ebp
800d81: 57 push %edi
800d82: 56 push %esi
800d83: 53 push %ebx
800d84: 83 ec 1c sub $0x1c,%esp
800d87: 8b 54 24 3c mov 0x3c(%esp),%edx
800d8b: 8b 6c 24 30 mov 0x30(%esp),%ebp
800d8f: 8b 74 24 34 mov 0x34(%esp),%esi
800d93: 8b 5c 24 38 mov 0x38(%esp),%ebx
800d97: 85 d2 test %edx,%edx
800d99: 75 35 jne 800dd0 <__udivdi3+0x50>
800d9b: 39 f3 cmp %esi,%ebx
800d9d: 0f 87 bd 00 00 00 ja 800e60 <__udivdi3+0xe0>
800da3: 85 db test %ebx,%ebx
800da5: 89 d9 mov %ebx,%ecx
800da7: 75 0b jne 800db4 <__udivdi3+0x34>
800da9: b8 01 00 00 00 mov $0x1,%eax
800dae: 31 d2 xor %edx,%edx
800db0: f7 f3 div %ebx
800db2: 89 c1 mov %eax,%ecx
800db4: 31 d2 xor %edx,%edx
800db6: 89 f0 mov %esi,%eax
800db8: f7 f1 div %ecx
800dba: 89 c6 mov %eax,%esi
800dbc: 89 e8 mov %ebp,%eax
800dbe: 89 f7 mov %esi,%edi
800dc0: f7 f1 div %ecx
800dc2: 89 fa mov %edi,%edx
800dc4: 83 c4 1c add $0x1c,%esp
800dc7: 5b pop %ebx
800dc8: 5e pop %esi
800dc9: 5f pop %edi
800dca: 5d pop %ebp
800dcb: c3 ret
800dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
800dd0: 39 f2 cmp %esi,%edx
800dd2: 77 7c ja 800e50 <__udivdi3+0xd0>
800dd4: 0f bd fa bsr %edx,%edi
800dd7: 83 f7 1f xor $0x1f,%edi
800dda: 0f 84 98 00 00 00 je 800e78 <__udivdi3+0xf8>
800de0: 89 f9 mov %edi,%ecx
800de2: b8 20 00 00 00 mov $0x20,%eax
800de7: 29 f8 sub %edi,%eax
800de9: d3 e2 shl %cl,%edx
800deb: 89 54 24 08 mov %edx,0x8(%esp)
800def: 89 c1 mov %eax,%ecx
800df1: 89 da mov %ebx,%edx
800df3: d3 ea shr %cl,%edx
800df5: 8b 4c 24 08 mov 0x8(%esp),%ecx
800df9: 09 d1 or %edx,%ecx
800dfb: 89 f2 mov %esi,%edx
800dfd: 89 4c 24 08 mov %ecx,0x8(%esp)
800e01: 89 f9 mov %edi,%ecx
800e03: d3 e3 shl %cl,%ebx
800e05: 89 c1 mov %eax,%ecx
800e07: d3 ea shr %cl,%edx
800e09: 89 f9 mov %edi,%ecx
800e0b: 89 5c 24 0c mov %ebx,0xc(%esp)
800e0f: d3 e6 shl %cl,%esi
800e11: 89 eb mov %ebp,%ebx
800e13: 89 c1 mov %eax,%ecx
800e15: d3 eb shr %cl,%ebx
800e17: 09 de or %ebx,%esi
800e19: 89 f0 mov %esi,%eax
800e1b: f7 74 24 08 divl 0x8(%esp)
800e1f: 89 d6 mov %edx,%esi
800e21: 89 c3 mov %eax,%ebx
800e23: f7 64 24 0c mull 0xc(%esp)
800e27: 39 d6 cmp %edx,%esi
800e29: 72 0c jb 800e37 <__udivdi3+0xb7>
800e2b: 89 f9 mov %edi,%ecx
800e2d: d3 e5 shl %cl,%ebp
800e2f: 39 c5 cmp %eax,%ebp
800e31: 73 5d jae 800e90 <__udivdi3+0x110>
800e33: 39 d6 cmp %edx,%esi
800e35: 75 59 jne 800e90 <__udivdi3+0x110>
800e37: 8d 43 ff lea -0x1(%ebx),%eax
800e3a: 31 ff xor %edi,%edi
800e3c: 89 fa mov %edi,%edx
800e3e: 83 c4 1c add $0x1c,%esp
800e41: 5b pop %ebx
800e42: 5e pop %esi
800e43: 5f pop %edi
800e44: 5d pop %ebp
800e45: c3 ret
800e46: 8d 76 00 lea 0x0(%esi),%esi
800e49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
800e50: 31 ff xor %edi,%edi
800e52: 31 c0 xor %eax,%eax
800e54: 89 fa mov %edi,%edx
800e56: 83 c4 1c add $0x1c,%esp
800e59: 5b pop %ebx
800e5a: 5e pop %esi
800e5b: 5f pop %edi
800e5c: 5d pop %ebp
800e5d: c3 ret
800e5e: 66 90 xchg %ax,%ax
800e60: 31 ff xor %edi,%edi
800e62: 89 e8 mov %ebp,%eax
800e64: 89 f2 mov %esi,%edx
800e66: f7 f3 div %ebx
800e68: 89 fa mov %edi,%edx
800e6a: 83 c4 1c add $0x1c,%esp
800e6d: 5b pop %ebx
800e6e: 5e pop %esi
800e6f: 5f pop %edi
800e70: 5d pop %ebp
800e71: c3 ret
800e72: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
800e78: 39 f2 cmp %esi,%edx
800e7a: 72 06 jb 800e82 <__udivdi3+0x102>
800e7c: 31 c0 xor %eax,%eax
800e7e: 39 eb cmp %ebp,%ebx
800e80: 77 d2 ja 800e54 <__udivdi3+0xd4>
800e82: b8 01 00 00 00 mov $0x1,%eax
800e87: eb cb jmp 800e54 <__udivdi3+0xd4>
800e89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
800e90: 89 d8 mov %ebx,%eax
800e92: 31 ff xor %edi,%edi
800e94: eb be jmp 800e54 <__udivdi3+0xd4>
800e96: 66 90 xchg %ax,%ax
800e98: 66 90 xchg %ax,%ax
800e9a: 66 90 xchg %ax,%ax
800e9c: 66 90 xchg %ax,%ax
800e9e: 66 90 xchg %ax,%ax
00800ea0 <__umoddi3>:
800ea0: 55 push %ebp
800ea1: 57 push %edi
800ea2: 56 push %esi
800ea3: 53 push %ebx
800ea4: 83 ec 1c sub $0x1c,%esp
800ea7: 8b 6c 24 3c mov 0x3c(%esp),%ebp
800eab: 8b 74 24 30 mov 0x30(%esp),%esi
800eaf: 8b 5c 24 34 mov 0x34(%esp),%ebx
800eb3: 8b 7c 24 38 mov 0x38(%esp),%edi
800eb7: 85 ed test %ebp,%ebp
800eb9: 89 f0 mov %esi,%eax
800ebb: 89 da mov %ebx,%edx
800ebd: 75 19 jne 800ed8 <__umoddi3+0x38>
800ebf: 39 df cmp %ebx,%edi
800ec1: 0f 86 b1 00 00 00 jbe 800f78 <__umoddi3+0xd8>
800ec7: f7 f7 div %edi
800ec9: 89 d0 mov %edx,%eax
800ecb: 31 d2 xor %edx,%edx
800ecd: 83 c4 1c add $0x1c,%esp
800ed0: 5b pop %ebx
800ed1: 5e pop %esi
800ed2: 5f pop %edi
800ed3: 5d pop %ebp
800ed4: c3 ret
800ed5: 8d 76 00 lea 0x0(%esi),%esi
800ed8: 39 dd cmp %ebx,%ebp
800eda: 77 f1 ja 800ecd <__umoddi3+0x2d>
800edc: 0f bd cd bsr %ebp,%ecx
800edf: 83 f1 1f xor $0x1f,%ecx
800ee2: 89 4c 24 04 mov %ecx,0x4(%esp)
800ee6: 0f 84 b4 00 00 00 je 800fa0 <__umoddi3+0x100>
800eec: b8 20 00 00 00 mov $0x20,%eax
800ef1: 89 c2 mov %eax,%edx
800ef3: 8b 44 24 04 mov 0x4(%esp),%eax
800ef7: 29 c2 sub %eax,%edx
800ef9: 89 c1 mov %eax,%ecx
800efb: 89 f8 mov %edi,%eax
800efd: d3 e5 shl %cl,%ebp
800eff: 89 d1 mov %edx,%ecx
800f01: 89 54 24 0c mov %edx,0xc(%esp)
800f05: d3 e8 shr %cl,%eax
800f07: 09 c5 or %eax,%ebp
800f09: 8b 44 24 04 mov 0x4(%esp),%eax
800f0d: 89 c1 mov %eax,%ecx
800f0f: d3 e7 shl %cl,%edi
800f11: 89 d1 mov %edx,%ecx
800f13: 89 7c 24 08 mov %edi,0x8(%esp)
800f17: 89 df mov %ebx,%edi
800f19: d3 ef shr %cl,%edi
800f1b: 89 c1 mov %eax,%ecx
800f1d: 89 f0 mov %esi,%eax
800f1f: d3 e3 shl %cl,%ebx
800f21: 89 d1 mov %edx,%ecx
800f23: 89 fa mov %edi,%edx
800f25: d3 e8 shr %cl,%eax
800f27: 0f b6 4c 24 04 movzbl 0x4(%esp),%ecx
800f2c: 09 d8 or %ebx,%eax
800f2e: f7 f5 div %ebp
800f30: d3 e6 shl %cl,%esi
800f32: 89 d1 mov %edx,%ecx
800f34: f7 64 24 08 mull 0x8(%esp)
800f38: 39 d1 cmp %edx,%ecx
800f3a: 89 c3 mov %eax,%ebx
800f3c: 89 d7 mov %edx,%edi
800f3e: 72 06 jb 800f46 <__umoddi3+0xa6>
800f40: 75 0e jne 800f50 <__umoddi3+0xb0>
800f42: 39 c6 cmp %eax,%esi
800f44: 73 0a jae 800f50 <__umoddi3+0xb0>
800f46: 2b 44 24 08 sub 0x8(%esp),%eax
800f4a: 19 ea sbb %ebp,%edx
800f4c: 89 d7 mov %edx,%edi
800f4e: 89 c3 mov %eax,%ebx
800f50: 89 ca mov %ecx,%edx
800f52: 0f b6 4c 24 0c movzbl 0xc(%esp),%ecx
800f57: 29 de sub %ebx,%esi
800f59: 19 fa sbb %edi,%edx
800f5b: 8b 5c 24 04 mov 0x4(%esp),%ebx
800f5f: 89 d0 mov %edx,%eax
800f61: d3 e0 shl %cl,%eax
800f63: 89 d9 mov %ebx,%ecx
800f65: d3 ee shr %cl,%esi
800f67: d3 ea shr %cl,%edx
800f69: 09 f0 or %esi,%eax
800f6b: 83 c4 1c add $0x1c,%esp
800f6e: 5b pop %ebx
800f6f: 5e pop %esi
800f70: 5f pop %edi
800f71: 5d pop %ebp
800f72: c3 ret
800f73: 90 nop
800f74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
800f78: 85 ff test %edi,%edi
800f7a: 89 f9 mov %edi,%ecx
800f7c: 75 0b jne 800f89 <__umoddi3+0xe9>
800f7e: b8 01 00 00 00 mov $0x1,%eax
800f83: 31 d2 xor %edx,%edx
800f85: f7 f7 div %edi
800f87: 89 c1 mov %eax,%ecx
800f89: 89 d8 mov %ebx,%eax
800f8b: 31 d2 xor %edx,%edx
800f8d: f7 f1 div %ecx
800f8f: 89 f0 mov %esi,%eax
800f91: f7 f1 div %ecx
800f93: e9 31 ff ff ff jmp 800ec9 <__umoddi3+0x29>
800f98: 90 nop
800f99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
800fa0: 39 dd cmp %ebx,%ebp
800fa2: 72 08 jb 800fac <__umoddi3+0x10c>
800fa4: 39 f7 cmp %esi,%edi
800fa6: 0f 87 21 ff ff ff ja 800ecd <__umoddi3+0x2d>
800fac: 89 da mov %ebx,%edx
800fae: 89 f0 mov %esi,%eax
800fb0: 29 f8 sub %edi,%eax
800fb2: 19 ea sbb %ebp,%edx
800fb4: e9 14 ff ff ff jmp 800ecd <__umoddi3+0x2d>
|
.emacs.d/elpa/ada-ref-man-2012.5/progs/arm_syn.ads | caqg/linux-home | 0 | 6095 | <reponame>caqg/linux-home
package ARM_Syntax is
--
-- Ada reference manual formatter (ARM_Form).
--
-- This package contains the database to collect the syntax summary and
-- cross-reference.
--
-- ---------------------------------------
-- Copyright 2000, 2006, 2011
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: <EMAIL>
--
-- ARM_Form is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License version 3
-- as published by the Free Software Foundation.
--
-- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
-- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
-- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
-- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
-- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
-- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-- DAMAGES.
--
-- A copy of the GNU General Public License is available in the file
-- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
-- Otherwise, see <http://www.gnu.org/licenses/>.
--
-- If the GPLv3 license is not satisfactory for your needs, a commercial
-- use license is available for this tool. Contact Randy at AXE Consultants
-- for more information.
--
-- ---------------------------------------
-- ---------------------------------------
--
-- Edit History:
--
-- 5/17/00 - RLB - Created package.
-- 5/26/00 - RLB - Added a Tabset parameter.
-- 6/22/06 - RLB - Added additional information to improve the links
-- and to be able to use the Ada 83 format for the
-- cross-reference table.
-- 10/13/06 - RLB - Added Defined flag to cross-references to eliminate
-- junk errors from not-quite-non-terminals.
-- 10/18/11 - RLB - Changed to GPLv3 license.
procedure Create;
-- Initialize the syntax database.
procedure Destroy;
-- Destroy the syntax database.
procedure Insert_Rule (
For_Clause : in String;
Rule : in String;
Tabset : in String := "");
-- Add a rule for the syntax summary. The rule appears in For_Clause.
-- Tabset provides any needed tab settings.
subtype Target_Type is String (1..5);
procedure Add_Non_Terminal (
NT_Name : in String;
For_Clause : in String;
Link_Target : out ARM_Syntax.Target_Type);
-- Add a non-terminal to the syntax list. Returns a new Link_Target
-- for the Non-Terminal.
procedure Add_Xref (
Name : in String;
Used_In : in String;
Clause : in String;
Defined : in Boolean);
-- Add a cross-reference entry.
-- The item referenced is Name, and it is referenced in the production
-- for Used_In, in Clause. It is a defined non-terminal if Defined
-- is True (thus it can be linked).
function Non_Terminal_Clause (NT_Name : in String) return String;
-- Return the clause where NT_Name is declared.
-- Returns "" if NT_Name is not a declared Non_Terminal.
function Non_Terminal_Link_Target (NT_Name : in String) return Target_Type;
-- Return the link target for NT_Name.
-- Returns " " if NT_Name is not a declared Non_Terminal.
generic
with procedure Format_Text (Text : in String;
Text_Name : in String);
procedure Report;
-- Output the fully formatted syntax summary to the
-- "Format_Text" routine. "Format_Text" allows all commands
-- for the full formatter. (Text_Name is an identifying name
-- for error messages).
generic
with procedure Format_Text (Text : in String;
Text_Name : in String);
procedure XRef;
-- Output the fully formatted syntax cross-reference to the
-- "Format_Text" routine. "Format_Text" allows all commands
-- for the full formatter. (Text_Name is an identifying name
-- for error messages).
end ARM_Syntax;
|
Data/Either/Equiv/Id.agda | Lolirofle/stuff-in-agda | 6 | 11727 | <reponame>Lolirofle/stuff-in-agda<gh_stars>1-10
module Data.Either.Equiv.Id where
import Lvl
open import Data
open import Data.Either as Either
open import Data.Either.Equiv
open import Relator.Equals
open import Relator.Equals.Proofs.Equiv
open import Structure.Setoid
open import Structure.Function.Domain
open import Type
private variable ℓ ℓₑ ℓₑ₁ ℓₑ₂ : Lvl.Level
private variable A B : Type{ℓ}
module _ ⦃ equiv-A : Equiv{ℓₑ₁}(A) ⦄ ⦃ equiv-B : Equiv{ℓₑ₂}(B) ⦄ where
instance
Left-injectivity : Injective(Left{A = A}{B = B})
Injective.proof Left-injectivity [≡]-intro = [≡]-intro
instance
Right-injectivity : Injective(Right{A = A}{B = B})
Injective.proof Right-injectivity [≡]-intro = [≡]-intro
instance
Either-Id-extensionality : Extensionality{A = A}{B = B} [≡]-equiv
Either-Id-extensionality = intro \()
|
source/league/ucd/matreshka-internals-unicode-ucd-core_00ab.ads | svn2github/matreshka | 24 | 26939 | <filename>source/league/ucd/matreshka-internals-unicode-ucd-core_00ab.ads
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- 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. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_00AB is
pragma Preelaborate;
Group_00AB : aliased constant Core_Second_Stage
:= (16#01# .. 16#06# => -- AB01 .. AB06
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#09# .. 16#0E# => -- AB09 .. AB0E
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#11# .. 16#16# => -- AB11 .. AB16
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#20# .. 16#26# => -- AB20 .. AB26
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#28# .. 16#2E# => -- AB28 .. AB2E
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#30# .. 16#5A# => -- AB30 .. AB5A
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#5B# => -- AB5B
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base => True,
others => False)),
16#5C# .. 16#5F# => -- AB5C .. AB5F
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#64# .. 16#65# => -- AB64 .. AB65
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#C0# .. 16#E2# => -- ABC0 .. ABE2
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#E3# .. 16#E4# => -- ABE3 .. ABE4
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#E5# => -- ABE5
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E6# .. 16#E7# => -- ABE6 .. ABE7
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#E8# => -- ABE8
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E9# .. 16#EA# => -- ABE9 .. ABEA
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#EB# => -- ABEB
(Other_Punctuation, Neutral,
Other, Other, S_Term, Break_After,
(STerm
| Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#EC# => -- ABEC
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Diacritic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#ED# => -- ABED
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#F0# .. 16#F9# => -- ABF0 .. ABF9
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
others =>
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_00AB;
|
src/Categories/Category/Extensive.agda | sergey-goncharov/agda-categories | 0 | 16595 | <filename>src/Categories/Category/Extensive.agda
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Extensive where
-- https://ncatlab.org/nlab/show/extensive+category
open import Level
open import Categories.Category.Core
open import Categories.Diagram.Pullback
open import Categories.Category.Cocartesian
open import Categories.Object.Coproduct
open import Categories.Morphism
record Extensive {o ℓ e : Level} (𝒞 : Category o ℓ e) : Set (suc (o ⊔ ℓ ⊔ e)) where
open Category 𝒞
open Pullback
field
cocartesian : Cocartesian 𝒞
module CC = Cocartesian cocartesian
open CC using (_+_; i₁; i₂; ¡)
field
pullback₁ : {A B C : Obj} (f : A ⇒ B + C) → Pullback 𝒞 f i₁
pullback₂ : {A B C : Obj} (f : A ⇒ B + C) → Pullback 𝒞 f i₂
pullback-of-cp-is-cp : {A B C : Obj} (f : A ⇒ _+_ B C) → IsCoproduct 𝒞 (p₁ (pullback₁ f)) (p₁ (pullback₂ f))
pullback₁-is-mono : ∀ {A B : Obj} → Mono 𝒞 (i₁ {A = A}{B = B})
pullback₂-is-mono : ∀ {A B : Obj} → Mono 𝒞 (i₂ {A = A}{B = B})
disjoint : ∀ {A B : Obj} → IsPullback 𝒞 ¡ ¡ (i₁ {A = A}{B = B}) i₂
|
Source/Levels/L1304.asm | AbePralle/FGB | 0 | 718 | ; L1304.asm
; Generated 05.08.2001 by mlevel
; Modified 05.08.2001 by <NAME>
INCLUDE "Source/Defs.inc"
INCLUDE "Source/Levels.inc"
;---------------------------------------------------------------------
SECTION "Level1304Gfx",ROMX
;---------------------------------------------------------------------
backinside_bg:
INCBIN "Data/Cinema/CharSelect/backinside.bg"
;---------------------------------------------------------------------
SECTION "Level1304Section",ROMX
;---------------------------------------------------------------------
L1304_Contents::
DW L1304_Load
DW L1304_Init
DW L1304_Check
DW L1304_Map
;---------------------------------------------------------------------
; Load
;---------------------------------------------------------------------
L1304_Load:
DW ((L1304_LoadFinished - L1304_Load2)) ;size
L1304_Load2:
ld a,BANK(backinside_bg)
ld hl,backinside_bg
call LoadCinemaBG
ld a,15
call SetupFadeFromStandard
call WaitFade
ld de,((.returnToShip-L1304_Load2)+levelCheckRAM)
call SetDialogForward
call SetDialogSkip
ld a,150
call Delay
.returnToShip
call ClearDialogSkipForward
ld a,15
call SetupFadeToStandard
call WaitFade
ld a,EXIT_D
ld [hero0_enterLevelFacing],a
ld [hero1_enterLevelFacing],a
ld hl,$1300
ld a,l
ld [curLevelIndex],a
ld a,h
ld [curLevelIndex+1],a
ld a,1
ld [timeToChangeLevel],a
ret
L1304_LoadFinished:
;---------------------------------------------------------------------
; Map
;---------------------------------------------------------------------
L1304_Map:
;---------------------------------------------------------------------
; Init
;---------------------------------------------------------------------
L1304_Init:
DW ((L1304_InitFinished - L1304_Init2)) ;size
L1304_Init2:
ret
L1304_InitFinished:
;---------------------------------------------------------------------
; Check
;---------------------------------------------------------------------
L1304_Check:
DW ((L1304_CheckFinished - L1304_Check2)) ;size
L1304_Check2:
ret
L1304_CheckFinished:
PRINT "1304 Script Sizes (Load/Init/Check) (of $500): "
PRINT (L1304_LoadFinished - L1304_Load2)
PRINT " / "
PRINT (L1304_InitFinished - L1304_Init2)
PRINT " / "
PRINT (L1304_CheckFinished - L1304_Check2)
PRINT "\n"
|
programs/oeis/068/A068061.asm | neoneye/loda | 22 | 165868 | <gh_stars>10-100
; A068061: Palindromic numbers j that are not of the form k + reverse(k) for any k.
; 1,3,5,7,9,111,131,151,171,191,212,232,252,272,292,313,333,353,373,393,414,434,454,474,494,515,535,555,575,595,616,636,656,676,696,717,737,757,777,797,818,838,858,878,898,919,939,959,979,999,10101,10301,10501,10701,10901,11111,11311,11511,11711,11911,12121,12321,12521,12721,12921,13131,13331,13531,13731,13931,14141,14341,14541,14741,14941,15151,15351,15551,15751,15951,16161,16361,16561,16761,16961,17171,17371,17571,17771,17971,18181,18381,18581,18781,18981,19191,19391,19591,19791,19991
mul $0,2
seq $0,56525 ; Palindromes with odd number of digits.
|
target/cos_117/disasm/iop_overlay1/D4ERR.asm | jrrk2/cray-sim | 49 | 14279 | <gh_stars>10-100
0x0000 (0x000000) 0x2119- f:00020 d: 281 | A = OR[281]
0x0001 (0x000002) 0x2901- f:00024 d: 257 | OR[257] = A
0x0002 (0x000004) 0x2118- f:00020 d: 280 | A = OR[280]
0x0003 (0x000006) 0x2900- f:00024 d: 256 | OR[256] = A
0x0004 (0x000008) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0005 (0x00000A) 0x291B- f:00024 d: 283 | OR[283] = A
0x0006 (0x00000C) 0x291A- f:00024 d: 282 | OR[282] = A
0x0007 (0x00000E) 0x2922- f:00024 d: 290 | OR[290] = A
0x0008 (0x000010) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x0009 (0x000012) 0x2905- f:00024 d: 261 | OR[261] = A
0x000A (0x000014) 0x2100- f:00020 d: 256 | A = OR[256]
0x000B (0x000016) 0x5800- f:00054 d: 0 | B = A
0x000C (0x000018) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x000D (0x00001A) 0x8002- f:00100 d: 2 | P = P + 2 (0x000F), C = 0
0x000E (0x00001C) 0x7008- f:00070 d: 8 | P = P + 8 (0x0016)
0x000F (0x00001E) 0x4600- f:00043 d: 0 | C = 1, IOB = BZ
0x0010 (0x000020) 0x8202- f:00101 d: 2 | P = P + 2 (0x0012), C = 1
0x0011 (0x000022) 0x7005- f:00070 d: 5 | P = P + 5 (0x0016)
0x0012 (0x000024) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0013 (0x000026) 0x2920- f:00024 d: 288 | OR[288] = A
0x0014 (0x000028) 0x7E03-0x04BD f:00077 d: 3 | R = OR[3]+1213 (0x04BD)
0x0016 (0x00002C) 0x2101- f:00020 d: 257 | A = OR[257]
0x0017 (0x00002E) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x0018 (0x000030) 0x2908- f:00024 d: 264 | OR[264] = A
0x0019 (0x000032) 0x3108- f:00030 d: 264 | A = (OR[264])
0x001A (0x000034) 0x1A00-0xF7FF f:00015 d: 0 | A = A & 63487 (0xF7FF)
0x001C (0x000038) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x001D (0x00003A) 0x2101- f:00020 d: 257 | A = OR[257]
0x001E (0x00003C) 0x141E- f:00012 d: 30 | A = A + 30 (0x001E)
0x001F (0x00003E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0020 (0x000040) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0021 (0x000042) 0x2907- f:00024 d: 263 | OR[263] = A
0x0022 (0x000044) 0x3101- f:00030 d: 257 | A = (OR[257])
0x0023 (0x000046) 0x291D- f:00024 d: 285 | OR[285] = A
0x0024 (0x000048) 0x211D- f:00020 d: 285 | A = OR[285]
0x0025 (0x00004A) 0x127F- f:00011 d: 127 | A = A & 127 (0x007F)
0x0026 (0x00004C) 0x291D- f:00024 d: 285 | OR[285] = A
0x0027 (0x00004E) 0x211D- f:00020 d: 285 | A = OR[285]
0x0028 (0x000050) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004)
0x0029 (0x000052) 0x8402- f:00102 d: 2 | P = P + 2 (0x002B), A = 0
0x002A (0x000054) 0x700E- f:00070 d: 14 | P = P + 14 (0x0038)
0x002B (0x000056) 0x2101- f:00020 d: 257 | A = OR[257]
0x002C (0x000058) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x002D (0x00005A) 0x2908- f:00024 d: 264 | OR[264] = A
0x002E (0x00005C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x002F (0x00005E) 0x0E03- f:00007 d: 3 | A = A << 3 (0x0003)
0x0030 (0x000060) 0x0A05- f:00005 d: 5 | A = A < 5 (0x0005)
0x0031 (0x000062) 0x141F- f:00012 d: 31 | A = A + 31 (0x001F)
0x0032 (0x000064) 0x0C08- f:00006 d: 8 | A = A >> 8 (0x0008)
0x0033 (0x000066) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0034 (0x000068) 0x7E03-0x0443 f:00077 d: 3 | R = OR[3]+1091 (0x0443)
0x0036 (0x00006C) 0x7A03-0x0288 f:00075 d: 3 | P = OR[3]+648 (0x0288)
0x0038 (0x000070) 0x211D- f:00020 d: 285 | A = OR[285]
0x0039 (0x000072) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040)
0x003A (0x000074) 0x8402- f:00102 d: 2 | P = P + 2 (0x003C), A = 0
0x003B (0x000076) 0x7014- f:00070 d: 20 | P = P + 20 (0x004F)
0x003C (0x000078) 0x2101- f:00020 d: 257 | A = OR[257]
0x003D (0x00007A) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x003E (0x00007C) 0x2908- f:00024 d: 264 | OR[264] = A
0x003F (0x00007E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0040 (0x000080) 0x13FF- f:00011 d: 511 | A = A & 511 (0x01FF)
0x0041 (0x000082) 0x2926- f:00024 d: 294 | OR[294] = A
0x0042 (0x000084) 0x2101- f:00020 d: 257 | A = OR[257]
0x0043 (0x000086) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x0044 (0x000088) 0x2908- f:00024 d: 264 | OR[264] = A
0x0045 (0x00008A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0046 (0x00008C) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x0047 (0x00008E) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F)
0x0048 (0x000090) 0x2925- f:00024 d: 293 | OR[293] = A
0x0049 (0x000092) 0x2101- f:00020 d: 257 | A = OR[257]
0x004A (0x000094) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x004B (0x000096) 0x2908- f:00024 d: 264 | OR[264] = A
0x004C (0x000098) 0x3108- f:00030 d: 264 | A = (OR[264])
0x004D (0x00009A) 0x2924- f:00024 d: 292 | OR[292] = A
0x004E (0x00009C) 0x709F- f:00070 d: 159 | P = P + 159 (0x00ED)
0x004F (0x00009E) 0x2101- f:00020 d: 257 | A = OR[257]
0x0050 (0x0000A0) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x0051 (0x0000A2) 0x291A- f:00024 d: 282 | OR[282] = A
0x0052 (0x0000A4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0053 (0x0000A6) 0x2913- f:00024 d: 275 | OR[275] = A
0x0054 (0x0000A8) 0x2914- f:00024 d: 276 | OR[276] = A
0x0055 (0x0000AA) 0x211A- f:00020 d: 282 | A = OR[282]
0x0056 (0x0000AC) 0x8413- f:00102 d: 19 | P = P + 19 (0x0069), A = 0
0x0057 (0x0000AE) 0x2113- f:00020 d: 275 | A = OR[275]
0x0058 (0x0000B0) 0x2714- f:00023 d: 276 | A = A - OR[276]
0x0059 (0x0000B2) 0x8610- f:00103 d: 16 | P = P + 16 (0x0069), A # 0
0x005A (0x0000B4) 0x311A- f:00030 d: 282 | A = (OR[282])
0x005B (0x0000B6) 0x291A- f:00024 d: 282 | OR[282] = A
0x005C (0x0000B8) 0x8602- f:00103 d: 2 | P = P + 2 (0x005E), A # 0
0x005D (0x0000BA) 0x700B- f:00070 d: 11 | P = P + 11 (0x0068)
0x005E (0x0000BC) 0x211A- f:00020 d: 282 | A = OR[282]
0x005F (0x0000BE) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0060 (0x0000C0) 0x2908- f:00024 d: 264 | OR[264] = A
0x0061 (0x0000C2) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0062 (0x0000C4) 0x2913- f:00024 d: 275 | OR[275] = A
0x0063 (0x0000C6) 0x211A- f:00020 d: 282 | A = OR[282]
0x0064 (0x0000C8) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x0065 (0x0000CA) 0x2908- f:00024 d: 264 | OR[264] = A
0x0066 (0x0000CC) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0067 (0x0000CE) 0x2914- f:00024 d: 276 | OR[276] = A
0x0068 (0x0000D0) 0x7213- f:00071 d: 19 | P = P - 19 (0x0055)
0x0069 (0x0000D2) 0x211A- f:00020 d: 282 | A = OR[282]
0x006A (0x0000D4) 0xB434- f:00132 d: 52 | R = OR[52], A = 0
0x006B (0x0000D6) 0x0028- f:00000 d: 40 | PASS | **** non-standard encoding with D:0x0028 ****
0x006C (0x0000D8) 0x211A- f:00020 d: 282 | A = OR[282]
0x006D (0x0000DA) 0x1416- f:00012 d: 22 | A = A + 22 (0x0016)
0x006E (0x0000DC) 0x2908- f:00024 d: 264 | OR[264] = A
0x006F (0x0000DE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0070 (0x0000E0) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0071 (0x0000E2) 0x291C- f:00024 d: 284 | OR[284] = A
0x0072 (0x0000E4) 0x2101- f:00020 d: 257 | A = OR[257]
0x0073 (0x0000E6) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0074 (0x0000E8) 0x2908- f:00024 d: 264 | OR[264] = A
0x0075 (0x0000EA) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0076 (0x0000EC) 0x291E- f:00024 d: 286 | OR[286] = A
0x0077 (0x0000EE) 0x211A- f:00020 d: 282 | A = OR[282]
0x0078 (0x0000F0) 0x1419- f:00012 d: 25 | A = A + 25 (0x0019)
0x0079 (0x0000F2) 0x2908- f:00024 d: 264 | OR[264] = A
0x007A (0x0000F4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x007B (0x0000F6) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x007C (0x0000F8) 0x2926- f:00024 d: 294 | OR[294] = A
0x007D (0x0000FA) 0x211A- f:00020 d: 282 | A = OR[282]
0x007E (0x0000FC) 0x1418- f:00012 d: 24 | A = A + 24 (0x0018)
0x007F (0x0000FE) 0x2908- f:00024 d: 264 | OR[264] = A
0x0080 (0x000100) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0081 (0x000102) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F)
0x0082 (0x000104) 0x2925- f:00024 d: 293 | OR[293] = A
0x0083 (0x000106) 0x211A- f:00020 d: 282 | A = OR[282]
0x0084 (0x000108) 0x1418- f:00012 d: 24 | A = A + 24 (0x0018)
0x0085 (0x00010A) 0x2908- f:00024 d: 264 | OR[264] = A
0x0086 (0x00010C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0087 (0x00010E) 0x0805- f:00004 d: 5 | A = A > 5 (0x0005)
0x0088 (0x000110) 0x2924- f:00024 d: 292 | OR[292] = A
0x0089 (0x000112) 0x2101- f:00020 d: 257 | A = OR[257]
0x008A (0x000114) 0x1430- f:00012 d: 48 | A = A + 48 (0x0030)
0x008B (0x000116) 0x2908- f:00024 d: 264 | OR[264] = A
0x008C (0x000118) 0x3108- f:00030 d: 264 | A = (OR[264])
0x008D (0x00011A) 0x13FF- f:00011 d: 511 | A = A & 511 (0x01FF)
0x008E (0x00011C) 0x2917- f:00024 d: 279 | OR[279] = A
0x008F (0x00011E) 0x2101- f:00020 d: 257 | A = OR[257]
0x0090 (0x000120) 0x1430- f:00012 d: 48 | A = A + 48 (0x0030)
0x0091 (0x000122) 0x2908- f:00024 d: 264 | OR[264] = A
0x0092 (0x000124) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0093 (0x000126) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x0094 (0x000128) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F)
0x0095 (0x00012A) 0x2916- f:00024 d: 278 | OR[278] = A
0x0096 (0x00012C) 0x2101- f:00020 d: 257 | A = OR[257]
0x0097 (0x00012E) 0x142F- f:00012 d: 47 | A = A + 47 (0x002F)
0x0098 (0x000130) 0x2908- f:00024 d: 264 | OR[264] = A
0x0099 (0x000132) 0x3108- f:00030 d: 264 | A = (OR[264])
0x009A (0x000134) 0x2915- f:00024 d: 277 | OR[277] = A
0x009B (0x000136) 0x2126- f:00020 d: 294 | A = OR[294]
0x009C (0x000138) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x009D (0x00013A) 0x2926- f:00024 d: 294 | OR[294] = A
0x009E (0x00013C) 0x2126- f:00020 d: 294 | A = OR[294]
0x009F (0x00013E) 0x2717- f:00023 d: 279 | A = A - OR[279]
0x00A0 (0x000140) 0x8010- f:00100 d: 16 | P = P + 16 (0x00B0), C = 0
0x00A1 (0x000142) 0x2126- f:00020 d: 294 | A = OR[294]
0x00A2 (0x000144) 0x2717- f:00023 d: 279 | A = A - OR[279]
0x00A3 (0x000146) 0x2926- f:00024 d: 294 | OR[294] = A
0x00A4 (0x000148) 0x2D25- f:00026 d: 293 | OR[293] = OR[293] + 1
0x00A5 (0x00014A) 0x2716- f:00023 d: 278 | A = A - OR[278]
0x00A6 (0x00014C) 0x8402- f:00102 d: 2 | P = P + 2 (0x00A8), A = 0
0x00A7 (0x00014E) 0x7008- f:00070 d: 8 | P = P + 8 (0x00AF)
0x00A8 (0x000150) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00A9 (0x000152) 0x2925- f:00024 d: 293 | OR[293] = A
0x00AA (0x000154) 0x2D24- f:00026 d: 292 | OR[292] = OR[292] + 1
0x00AB (0x000156) 0x4200- f:00041 d: 0 | C = 1, io 0000 (IOR) = BZ
0x00AC (0x000158) 0x2715- f:00023 d: 277 | A = A - OR[277]
0x00AD (0x00015A) 0xB234- f:00131 d: 52 | R = OR[52], C = 1
0x00AE (0x00015C) 0x0028- f:00000 d: 40 | PASS | **** non-standard encoding with D:0x0028 ****
0x00AF (0x00015E) 0x7211- f:00071 d: 17 | P = P - 17 (0x009E)
0x00B0 (0x000160) 0x2101- f:00020 d: 257 | A = OR[257]
0x00B1 (0x000162) 0x1432- f:00012 d: 50 | A = A + 50 (0x0032)
0x00B2 (0x000164) 0x2908- f:00024 d: 264 | OR[264] = A
0x00B3 (0x000166) 0x3108- f:00030 d: 264 | A = (OR[264])
0x00B4 (0x000168) 0x2B26- f:00025 d: 294 | OR[294] = A + OR[294]
0x00B5 (0x00016A) 0x4200- f:00041 d: 0 | C = 1, io 0000 (IOR) = BZ
0x00B6 (0x00016C) 0x2717- f:00023 d: 279 | A = A - OR[279]
0x00B7 (0x00016E) 0x8004- f:00100 d: 4 | P = P + 4 (0x00BB), C = 0
0x00B8 (0x000170) 0x2126- f:00020 d: 294 | A = OR[294]
0x00B9 (0x000172) 0x2717- f:00023 d: 279 | A = A - OR[279]
0x00BA (0x000174) 0x2926- f:00024 d: 294 | OR[294] = A
0x00BB (0x000176) 0x211D- f:00020 d: 285 | A = OR[285]
0x00BC (0x000178) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x00BD (0x00017A) 0x8402- f:00102 d: 2 | P = P + 2 (0x00BF), A = 0
0x00BE (0x00017C) 0x7022- f:00070 d: 34 | P = P + 34 (0x00E0)
0x00BF (0x00017E) 0x2101- f:00020 d: 257 | A = OR[257]
0x00C0 (0x000180) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x00C1 (0x000182) 0x2908- f:00024 d: 264 | OR[264] = A
0x00C2 (0x000184) 0x3108- f:00030 d: 264 | A = (OR[264])
0x00C3 (0x000186) 0x2914- f:00024 d: 276 | OR[276] = A
0x00C4 (0x000188) 0x2126- f:00020 d: 294 | A = OR[294]
0x00C5 (0x00018A) 0x8602- f:00103 d: 2 | P = P + 2 (0x00C7), A # 0
0x00C6 (0x00018C) 0x2117- f:00020 d: 279 | A = OR[279]
0x00C7 (0x00018E) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x00C8 (0x000190) 0x2915- f:00024 d: 277 | OR[277] = A
0x00C9 (0x000192) 0x2114- f:00020 d: 276 | A = OR[276]
0x00CA (0x000194) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x00CB (0x000196) 0x2908- f:00024 d: 264 | OR[264] = A
0x00CC (0x000198) 0x2115- f:00020 d: 277 | A = OR[277]
0x00CD (0x00019A) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x00CE (0x00019C) 0x8402- f:00102 d: 2 | P = P + 2 (0x00D0), A = 0
0x00CF (0x00019E) 0x7011- f:00070 d: 17 | P = P + 17 (0x00E0)
0x00D0 (0x0001A0) 0x2113- f:00020 d: 275 | A = OR[275]
0x00D1 (0x0001A2) 0x8402- f:00102 d: 2 | P = P + 2 (0x00D3), A = 0
0x00D2 (0x0001A4) 0x7003- f:00070 d: 3 | P = P + 3 (0x00D5)
0x00D3 (0x0001A6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00D4 (0x0001A8) 0x291A- f:00024 d: 282 | OR[282] = A
0x00D5 (0x0001AA) 0x2114- f:00020 d: 276 | A = OR[276]
0x00D6 (0x0001AC) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x00D7 (0x0001AE) 0x2926- f:00024 d: 294 | OR[294] = A
0x00D8 (0x0001B0) 0x2114- f:00020 d: 276 | A = OR[276]
0x00D9 (0x0001B2) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x00DA (0x0001B4) 0x1207- f:00011 d: 7 | A = A & 7 (0x0007)
0x00DB (0x0001B6) 0x2925- f:00024 d: 293 | OR[293] = A
0x00DC (0x0001B8) 0x100D- f:00010 d: 13 | A = 13 (0x000D)
0x00DD (0x0001BA) 0x2905- f:00024 d: 261 | OR[261] = A
0x00DE (0x0001BC) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x00DF (0x0001BE) 0x2922- f:00024 d: 290 | OR[290] = A
0x00E0 (0x0001C0) 0x2101- f:00020 d: 257 | A = OR[257]
0x00E1 (0x0001C2) 0x1429- f:00012 d: 41 | A = A + 41 (0x0029)
0x00E2 (0x0001C4) 0x2908- f:00024 d: 264 | OR[264] = A
0x00E3 (0x0001C6) 0x3108- f:00030 d: 264 | A = (OR[264])
0x00E4 (0x0001C8) 0x080C- f:00004 d: 12 | A = A > 12 (0x000C)
0x00E5 (0x0001CA) 0x292E- f:00024 d: 302 | OR[302] = A
0x00E6 (0x0001CC) 0x2101- f:00020 d: 257 | A = OR[257]
0x00E7 (0x0001CE) 0x1429- f:00012 d: 41 | A = A + 41 (0x0029)
0x00E8 (0x0001D0) 0x2908- f:00024 d: 264 | OR[264] = A
0x00E9 (0x0001D2) 0x3108- f:00030 d: 264 | A = (OR[264])
0x00EA (0x0001D4) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x00EB (0x0001D6) 0x1207- f:00011 d: 7 | A = A & 7 (0x0007)
0x00EC (0x0001D8) 0x292F- f:00024 d: 303 | OR[303] = A
0x00ED (0x0001DA) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x00EE (0x0001DC) 0x2930- f:00024 d: 304 | OR[304] = A
0x00EF (0x0001DE) 0x1040- f:00010 d: 64 | A = 64 (0x0040)
0x00F0 (0x0001E0) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F)
0x00F1 (0x0001E2) 0x2931- f:00024 d: 305 | OR[305] = A
0x00F2 (0x0001E4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00F3 (0x0001E6) 0x2932- f:00024 d: 306 | OR[306] = A
0x00F4 (0x0001E8) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00F5 (0x0001EA) 0x2933- f:00024 d: 307 | OR[307] = A
0x00F6 (0x0001EC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00F7 (0x0001EE) 0x2934- f:00024 d: 308 | OR[308] = A
0x00F8 (0x0001F0) 0x1102- f:00010 d: 258 | A = 258 (0x0102)
0x00F9 (0x0001F2) 0x2935- f:00024 d: 309 | OR[309] = A
0x00FA (0x0001F4) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x00FB (0x0001F6) 0x5800- f:00054 d: 0 | B = A
0x00FC (0x0001F8) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00FD (0x0001FA) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00FE (0x0001FC) 0x8602- f:00103 d: 2 | P = P + 2 (0x0100), A # 0
0x00FF (0x0001FE) 0x700B- f:00070 d: 11 | P = P + 11 (0x010A)
0x0100 (0x000200) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x0101 (0x000202) 0x2930- f:00024 d: 304 | OR[304] = A
0x0102 (0x000204) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x0103 (0x000206) 0x2931- f:00024 d: 305 | OR[305] = A
0x0104 (0x000208) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0105 (0x00020A) 0x5800- f:00054 d: 0 | B = A
0x0106 (0x00020C) 0x1800-0x3118 f:00014 d: 0 | A = 12568 (0x3118)
0x0108 (0x000210) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0109 (0x000212) 0x721C- f:00071 d: 28 | P = P - 28 (0x00ED)
0x010A (0x000214) 0x2102- f:00020 d: 258 | A = OR[258]
0x010B (0x000216) 0x290E- f:00024 d: 270 | OR[270] = A
0x010C (0x000218) 0x1040- f:00010 d: 64 | A = 64 (0x0040)
0x010D (0x00021A) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F)
0x010E (0x00021C) 0x290D- f:00024 d: 269 | OR[269] = A
0x010F (0x00021E) 0x210D- f:00020 d: 269 | A = OR[269]
0x0110 (0x000220) 0x8406- f:00102 d: 6 | P = P + 6 (0x0116), A = 0
0x0111 (0x000222) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0112 (0x000224) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0113 (0x000226) 0x2F0D- f:00027 d: 269 | OR[269] = OR[269] - 1
0x0114 (0x000228) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0115 (0x00022A) 0x7206- f:00071 d: 6 | P = P - 6 (0x010F)
0x0116 (0x00022C) 0x2102- f:00020 d: 258 | A = OR[258]
0x0117 (0x00022E) 0x142D- f:00012 d: 45 | A = A + 45 (0x002D)
0x0118 (0x000230) 0x2908- f:00024 d: 264 | OR[264] = A
0x0119 (0x000232) 0x2107- f:00020 d: 263 | A = OR[263]
0x011A (0x000234) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x011B (0x000236) 0x7E03-0x04EA f:00077 d: 3 | R = OR[3]+1258 (0x04EA)
0x011D (0x00023A) 0x2102- f:00020 d: 258 | A = OR[258]
0x011E (0x00023C) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x011F (0x00023E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0120 (0x000240) 0x2127- f:00020 d: 295 | A = OR[295]
0x0121 (0x000242) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0122 (0x000244) 0x2102- f:00020 d: 258 | A = OR[258]
0x0123 (0x000246) 0x1405- f:00012 d: 5 | A = A + 5 (0x0005)
0x0124 (0x000248) 0x2908- f:00024 d: 264 | OR[264] = A
0x0125 (0x00024A) 0x2128- f:00020 d: 296 | A = OR[296]
0x0126 (0x00024C) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0127 (0x00024E) 0x2102- f:00020 d: 258 | A = OR[258]
0x0128 (0x000250) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x0129 (0x000252) 0x2908- f:00024 d: 264 | OR[264] = A
0x012A (0x000254) 0x2127- f:00020 d: 295 | A = OR[295]
0x012B (0x000256) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x012C (0x000258) 0x2102- f:00020 d: 258 | A = OR[258]
0x012D (0x00025A) 0x142B- f:00012 d: 43 | A = A + 43 (0x002B)
0x012E (0x00025C) 0x2908- f:00024 d: 264 | OR[264] = A
0x012F (0x00025E) 0x2128- f:00020 d: 296 | A = OR[296]
0x0130 (0x000260) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0131 (0x000262) 0x211D- f:00020 d: 285 | A = OR[285]
0x0132 (0x000264) 0x2906- f:00024 d: 262 | OR[262] = A
0x0133 (0x000266) 0x2107- f:00020 d: 263 | A = OR[263]
0x0134 (0x000268) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006)
0x0135 (0x00026A) 0x8405- f:00102 d: 5 | P = P + 5 (0x013A), A = 0
0x0136 (0x00026C) 0x2107- f:00020 d: 263 | A = OR[263]
0x0137 (0x00026E) 0x1607- f:00013 d: 7 | A = A - 7 (0x0007)
0x0138 (0x000270) 0x8402- f:00102 d: 2 | P = P + 2 (0x013A), A = 0
0x0139 (0x000272) 0x702F- f:00070 d: 47 | P = P + 47 (0x0168)
0x013A (0x000274) 0x2101- f:00020 d: 257 | A = OR[257]
0x013B (0x000276) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028)
0x013C (0x000278) 0x2908- f:00024 d: 264 | OR[264] = A
0x013D (0x00027A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x013E (0x00027C) 0x2913- f:00024 d: 275 | OR[275] = A
0x013F (0x00027E) 0x2101- f:00020 d: 257 | A = OR[257]
0x0140 (0x000280) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x0141 (0x000282) 0x2908- f:00024 d: 264 | OR[264] = A
0x0142 (0x000284) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0143 (0x000286) 0x2914- f:00024 d: 276 | OR[276] = A
0x0144 (0x000288) 0x2102- f:00020 d: 258 | A = OR[258]
0x0145 (0x00028A) 0x1429- f:00012 d: 41 | A = A + 41 (0x0029)
0x0146 (0x00028C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0147 (0x00028E) 0x2113- f:00020 d: 275 | A = OR[275]
0x0148 (0x000290) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0149 (0x000292) 0x2102- f:00020 d: 258 | A = OR[258]
0x014A (0x000294) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028)
0x014B (0x000296) 0x2908- f:00024 d: 264 | OR[264] = A
0x014C (0x000298) 0x2114- f:00020 d: 276 | A = OR[276]
0x014D (0x00029A) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x014E (0x00029C) 0x2107- f:00020 d: 263 | A = OR[263]
0x014F (0x00029E) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006)
0x0150 (0x0002A0) 0x8402- f:00102 d: 2 | P = P + 2 (0x0152), A = 0
0x0151 (0x0002A2) 0x7008- f:00070 d: 8 | P = P + 8 (0x0159)
0x0152 (0x0002A4) 0x2101- f:00020 d: 257 | A = OR[257]
0x0153 (0x0002A6) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x0154 (0x0002A8) 0x2908- f:00024 d: 264 | OR[264] = A
0x0155 (0x0002AA) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0156 (0x0002AC) 0x080F- f:00004 d: 15 | A = A > 15 (0x000F)
0x0157 (0x0002AE) 0x2915- f:00024 d: 277 | OR[277] = A
0x0158 (0x0002B0) 0x7008- f:00070 d: 8 | P = P + 8 (0x0160)
0x0159 (0x0002B2) 0x2101- f:00020 d: 257 | A = OR[257]
0x015A (0x0002B4) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x015B (0x0002B6) 0x2908- f:00024 d: 264 | OR[264] = A
0x015C (0x0002B8) 0x3108- f:00030 d: 264 | A = (OR[264])
0x015D (0x0002BA) 0x080D- f:00004 d: 13 | A = A > 13 (0x000D)
0x015E (0x0002BC) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x015F (0x0002BE) 0x2915- f:00024 d: 277 | OR[277] = A
0x0160 (0x0002C0) 0x2115- f:00020 d: 277 | A = OR[277]
0x0161 (0x0002C2) 0x8402- f:00102 d: 2 | P = P + 2 (0x0163), A = 0
0x0162 (0x0002C4) 0x7004- f:00070 d: 4 | P = P + 4 (0x0166)
0x0163 (0x0002C6) 0x1004- f:00010 d: 4 | A = 4 (0x0004)
0x0164 (0x0002C8) 0x2906- f:00024 d: 262 | OR[262] = A
0x0165 (0x0002CA) 0x7003- f:00070 d: 3 | P = P + 3 (0x0168)
0x0166 (0x0002CC) 0x1080- f:00010 d: 128 | A = 128 (0x0080)
0x0167 (0x0002CE) 0x2906- f:00024 d: 262 | OR[262] = A
0x0168 (0x0002D0) 0x2106- f:00020 d: 262 | A = OR[262]
0x0169 (0x0002D2) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x016A (0x0002D4) 0x2906- f:00024 d: 262 | OR[262] = A
0x016B (0x0002D6) 0x2102- f:00020 d: 258 | A = OR[258]
0x016C (0x0002D8) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x016D (0x0002DA) 0x2908- f:00024 d: 264 | OR[264] = A
0x016E (0x0002DC) 0x3108- f:00030 d: 264 | A = (OR[264])
0x016F (0x0002DE) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x0170 (0x0002E0) 0x2506- f:00022 d: 262 | A = A + OR[262]
0x0171 (0x0002E2) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x0172 (0x0002E4) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0173 (0x0002E6) 0x2100- f:00020 d: 256 | A = OR[256]
0x0174 (0x0002E8) 0x5800- f:00054 d: 0 | B = A
0x0175 (0x0002EA) 0xE000- f:00160 d: 0 | IOB , fn000
0x0176 (0x0002EC) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0177 (0x0002EE) 0x2920- f:00024 d: 288 | OR[288] = A
0x0178 (0x0002F0) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0179 (0x0002F2) 0x292A- f:00024 d: 298 | OR[298] = A
0x017A (0x0002F4) 0x2102- f:00020 d: 258 | A = OR[258]
0x017B (0x0002F6) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006)
0x017C (0x0002F8) 0x292B- f:00024 d: 299 | OR[299] = A
0x017D (0x0002FA) 0x2101- f:00020 d: 257 | A = OR[257]
0x017E (0x0002FC) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007)
0x017F (0x0002FE) 0x2908- f:00024 d: 264 | OR[264] = A
0x0180 (0x000300) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0181 (0x000302) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x0182 (0x000304) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F)
0x0183 (0x000306) 0x1603- f:00013 d: 3 | A = A - 3 (0x0003)
0x0184 (0x000308) 0x8402- f:00102 d: 2 | P = P + 2 (0x0186), A = 0
0x0185 (0x00030A) 0x7004- f:00070 d: 4 | P = P + 4 (0x0189)
0x0186 (0x00030C) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x0187 (0x00030E) 0x292C- f:00024 d: 300 | OR[300] = A
0x0188 (0x000310) 0x7003- f:00070 d: 3 | P = P + 3 (0x018B)
0x0189 (0x000312) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x018A (0x000314) 0x292C- f:00024 d: 300 | OR[300] = A
0x018B (0x000316) 0x212A- f:00020 d: 298 | A = OR[298]
0x018C (0x000318) 0x272C- f:00023 d: 300 | A = A - OR[300]
0x018D (0x00031A) 0x8411- f:00102 d: 17 | P = P + 17 (0x019E), A = 0
0x018E (0x00031C) 0x212A- f:00020 d: 298 | A = OR[298]
0x018F (0x00031E) 0x1C00-0x7000 f:00016 d: 0 | A = A + 28672 (0x7000)
0x0191 (0x000322) 0xE200- f:00161 d: 0 | IOB , fn001
0x0192 (0x000324) 0x7E03-0x04BD f:00077 d: 3 | R = OR[3]+1213 (0x04BD)
0x0194 (0x000328) 0x8402- f:00102 d: 2 | P = P + 2 (0x0196), A = 0
0x0195 (0x00032A) 0x7003- f:00070 d: 3 | P = P + 3 (0x0198)
0x0196 (0x00032C) 0xF600- f:00173 d: 0 | IOB , fn013
0x0197 (0x00032E) 0x7003- f:00070 d: 3 | P = P + 3 (0x019A)
0x0198 (0x000330) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x019A (0x000334) 0x392B- f:00034 d: 299 | (OR[299]) = A
0x019B (0x000336) 0x2D2B- f:00026 d: 299 | OR[299] = OR[299] + 1
0x019C (0x000338) 0x2D2A- f:00026 d: 298 | OR[298] = OR[298] + 1
0x019D (0x00033A) 0x7212- f:00071 d: 18 | P = P - 18 (0x018B)
0x019E (0x00033C) 0x2102- f:00020 d: 258 | A = OR[258]
0x019F (0x00033E) 0x1440- f:00012 d: 64 | A = A + 64 (0x0040)
0x01A0 (0x000340) 0x2903- f:00024 d: 259 | OR[259] = A
0x01A1 (0x000342) 0x211D- f:00020 d: 285 | A = OR[285]
0x01A2 (0x000344) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020)
0x01A3 (0x000346) 0x8402- f:00102 d: 2 | P = P + 2 (0x01A5), A = 0
0x01A4 (0x000348) 0x7007- f:00070 d: 7 | P = P + 7 (0x01AB)
0x01A5 (0x00034A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01A6 (0x00034C) 0x2904- f:00024 d: 260 | OR[260] = A
0x01A7 (0x00034E) 0x1800-0x005B f:00014 d: 0 | A = 91 (0x005B)
0x01A9 (0x000352) 0x2929- f:00024 d: 297 | OR[297] = A
0x01AA (0x000354) 0x7041- f:00070 d: 65 | P = P + 65 (0x01EB)
0x01AB (0x000356) 0x211D- f:00020 d: 285 | A = OR[285]
0x01AC (0x000358) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008)
0x01AD (0x00035A) 0x8402- f:00102 d: 2 | P = P + 2 (0x01AF), A = 0
0x01AE (0x00035C) 0x7007- f:00070 d: 7 | P = P + 7 (0x01B5)
0x01AF (0x00035E) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x01B0 (0x000360) 0x2904- f:00024 d: 260 | OR[260] = A
0x01B1 (0x000362) 0x1800-0x005A f:00014 d: 0 | A = 90 (0x005A)
0x01B3 (0x000366) 0x2929- f:00024 d: 297 | OR[297] = A
0x01B4 (0x000368) 0x7037- f:00070 d: 55 | P = P + 55 (0x01EB)
0x01B5 (0x00036A) 0x211D- f:00020 d: 285 | A = OR[285]
0x01B6 (0x00036C) 0x1610- f:00013 d: 16 | A = A - 16 (0x0010)
0x01B7 (0x00036E) 0x8404- f:00102 d: 4 | P = P + 4 (0x01BB), A = 0
0x01B8 (0x000370) 0x211D- f:00020 d: 285 | A = OR[285]
0x01B9 (0x000372) 0x8402- f:00102 d: 2 | P = P + 2 (0x01BB), A = 0
0x01BA (0x000374) 0x7011- f:00070 d: 17 | P = P + 17 (0x01CB)
0x01BB (0x000376) 0x211C- f:00020 d: 284 | A = OR[284]
0x01BC (0x000378) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x01BD (0x00037A) 0x2908- f:00024 d: 264 | OR[264] = A
0x01BE (0x00037C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01BF (0x00037E) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x01C0 (0x000380) 0x8402- f:00102 d: 2 | P = P + 2 (0x01C2), A = 0
0x01C1 (0x000382) 0x7004- f:00070 d: 4 | P = P + 4 (0x01C5)
0x01C2 (0x000384) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x01C3 (0x000386) 0x2904- f:00024 d: 260 | OR[260] = A
0x01C4 (0x000388) 0x7003- f:00070 d: 3 | P = P + 3 (0x01C7)
0x01C5 (0x00038A) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x01C6 (0x00038C) 0x2904- f:00024 d: 260 | OR[260] = A
0x01C7 (0x00038E) 0x1800-0x0055 f:00014 d: 0 | A = 85 (0x0055)
0x01C9 (0x000392) 0x2929- f:00024 d: 297 | OR[297] = A
0x01CA (0x000394) 0x7021- f:00070 d: 33 | P = P + 33 (0x01EB)
0x01CB (0x000396) 0x211D- f:00020 d: 285 | A = OR[285]
0x01CC (0x000398) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x01CD (0x00039A) 0x8402- f:00102 d: 2 | P = P + 2 (0x01CF), A = 0
0x01CE (0x00039C) 0x7007- f:00070 d: 7 | P = P + 7 (0x01D5)
0x01CF (0x00039E) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x01D0 (0x0003A0) 0x2904- f:00024 d: 260 | OR[260] = A
0x01D1 (0x0003A2) 0x1800-0x0055 f:00014 d: 0 | A = 85 (0x0055)
0x01D3 (0x0003A6) 0x2929- f:00024 d: 297 | OR[297] = A
0x01D4 (0x0003A8) 0x7017- f:00070 d: 23 | P = P + 23 (0x01EB)
0x01D5 (0x0003AA) 0x211D- f:00020 d: 285 | A = OR[285]
0x01D6 (0x0003AC) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x01D7 (0x0003AE) 0x8402- f:00102 d: 2 | P = P + 2 (0x01D9), A = 0
0x01D8 (0x0003B0) 0x7007- f:00070 d: 7 | P = P + 7 (0x01DF)
0x01D9 (0x0003B2) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x01DA (0x0003B4) 0x2904- f:00024 d: 260 | OR[260] = A
0x01DB (0x0003B6) 0x1800-0x0055 f:00014 d: 0 | A = 85 (0x0055)
0x01DD (0x0003BA) 0x2929- f:00024 d: 297 | OR[297] = A
0x01DE (0x0003BC) 0x700D- f:00070 d: 13 | P = P + 13 (0x01EB)
0x01DF (0x0003BE) 0x211D- f:00020 d: 285 | A = OR[285]
0x01E0 (0x0003C0) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040)
0x01E1 (0x0003C2) 0x8402- f:00102 d: 2 | P = P + 2 (0x01E3), A = 0
0x01E2 (0x0003C4) 0x7007- f:00070 d: 7 | P = P + 7 (0x01E9)
0x01E3 (0x0003C6) 0x1004- f:00010 d: 4 | A = 4 (0x0004)
0x01E4 (0x0003C8) 0x2904- f:00024 d: 260 | OR[260] = A
0x01E5 (0x0003CA) 0x1800-0x0059 f:00014 d: 0 | A = 89 (0x0059)
0x01E7 (0x0003CE) 0x2929- f:00024 d: 297 | OR[297] = A
0x01E8 (0x0003D0) 0x7003- f:00070 d: 3 | P = P + 3 (0x01EB)
0x01E9 (0x0003D2) 0x7C34- f:00076 d: 52 | R = OR[52]
0x01EA (0x0003D4) 0x0028- f:00000 d: 40 | PASS | **** non-standard encoding with D:0x0028 ****
0x01EB (0x0003D6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01EC (0x0003D8) 0x2913- f:00024 d: 275 | OR[275] = A
0x01ED (0x0003DA) 0x2104- f:00020 d: 260 | A = OR[260]
0x01EE (0x0003DC) 0x2914- f:00024 d: 276 | OR[276] = A
0x01EF (0x0003DE) 0x2114- f:00020 d: 276 | A = OR[276]
0x01F0 (0x0003E0) 0x8405- f:00102 d: 5 | P = P + 5 (0x01F5), A = 0
0x01F1 (0x0003E2) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x01F2 (0x0003E4) 0x2B13- f:00025 d: 275 | OR[275] = A + OR[275]
0x01F3 (0x0003E6) 0x2F14- f:00027 d: 276 | OR[276] = OR[276] - 1
0x01F4 (0x0003E8) 0x7205- f:00071 d: 5 | P = P - 5 (0x01EF)
0x01F5 (0x0003EA) 0x2113- f:00020 d: 275 | A = OR[275]
0x01F6 (0x0003EC) 0x2403- f:00022 d: 3 | A = A + OR[3]
0x01F7 (0x0003EE) 0x1C00-0x05CE f:00016 d: 0 | A = A + 1486 (0x05CE)
0x01F9 (0x0003F2) 0x2913- f:00024 d: 275 | OR[275] = A
0x01FA (0x0003F4) 0x2113- f:00020 d: 275 | A = OR[275]
0x01FB (0x0003F6) 0x290D- f:00024 d: 269 | OR[269] = A
0x01FC (0x0003F8) 0x2103- f:00020 d: 259 | A = OR[259]
0x01FD (0x0003FA) 0x290E- f:00024 d: 270 | OR[270] = A
0x01FE (0x0003FC) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x01FF (0x0003FE) 0x290F- f:00024 d: 271 | OR[271] = A
0x0200 (0x000400) 0x7006- f:00070 d: 6 | P = P + 6 (0x0206)
0x0201 (0x000402) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0202 (0x000404) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0203 (0x000406) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0204 (0x000408) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0205 (0x00040A) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x0206 (0x00040C) 0x210F- f:00020 d: 271 | A = OR[271]
0x0207 (0x00040E) 0x8E06- f:00107 d: 6 | P = P - 6 (0x0201), A # 0
0x0208 (0x000410) 0x211A- f:00020 d: 282 | A = OR[282]
0x0209 (0x000412) 0x8602- f:00103 d: 2 | P = P + 2 (0x020B), A # 0
0x020A (0x000414) 0x7025- f:00070 d: 37 | P = P + 37 (0x022F)
0x020B (0x000416) 0x211A- f:00020 d: 282 | A = OR[282]
0x020C (0x000418) 0x140D- f:00012 d: 13 | A = A + 13 (0x000D)
0x020D (0x00041A) 0x2908- f:00024 d: 264 | OR[264] = A
0x020E (0x00041C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x020F (0x00041E) 0x080F- f:00004 d: 15 | A = A > 15 (0x000F)
0x0210 (0x000420) 0x292A- f:00024 d: 298 | OR[298] = A
0x0211 (0x000422) 0x211A- f:00020 d: 282 | A = OR[282]
0x0212 (0x000424) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012)
0x0213 (0x000426) 0x2908- f:00024 d: 264 | OR[264] = A
0x0214 (0x000428) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0215 (0x00042A) 0x0806- f:00004 d: 6 | A = A > 6 (0x0006)
0x0216 (0x00042C) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0217 (0x00042E) 0x292B- f:00024 d: 299 | OR[299] = A
0x0218 (0x000430) 0x212A- f:00020 d: 298 | A = OR[298]
0x0219 (0x000432) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x021A (0x000434) 0x8402- f:00102 d: 2 | P = P + 2 (0x021C), A = 0
0x021B (0x000436) 0x7014- f:00070 d: 20 | P = P + 20 (0x022F)
0x021C (0x000438) 0x212B- f:00020 d: 299 | A = OR[299]
0x021D (0x00043A) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x021E (0x00043C) 0x8402- f:00102 d: 2 | P = P + 2 (0x0220), A = 0
0x021F (0x00043E) 0x7010- f:00070 d: 16 | P = P + 16 (0x022F)
0x0220 (0x000440) 0x2107- f:00020 d: 263 | A = OR[263]
0x0221 (0x000442) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x0222 (0x000444) 0x8402- f:00102 d: 2 | P = P + 2 (0x0224), A = 0
0x0223 (0x000446) 0x700A- f:00070 d: 10 | P = P + 10 (0x022D)
0x0224 (0x000448) 0x2128- f:00020 d: 296 | A = OR[296]
0x0225 (0x00044A) 0x13E0- f:00011 d: 480 | A = A & 480 (0x01E0)
0x0226 (0x00044C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0227 (0x00044E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0228 (0x000450) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x0229 (0x000452) 0x8602- f:00103 d: 2 | P = P + 2 (0x022B), A # 0
0x022A (0x000454) 0x7003- f:00070 d: 3 | P = P + 3 (0x022D)
0x022B (0x000456) 0x7E03-0x057C f:00077 d: 3 | R = OR[3]+1404 (0x057C)
0x022D (0x00045A) 0x100D- f:00010 d: 13 | A = 13 (0x000D)
0x022E (0x00045C) 0x2905- f:00024 d: 261 | OR[261] = A
0x022F (0x00045E) 0x2129- f:00020 d: 297 | A = OR[297]
0x0230 (0x000460) 0x1E00-0x0055 f:00017 d: 0 | A = A - 85 (0x0055)
0x0232 (0x000464) 0x8402- f:00102 d: 2 | P = P + 2 (0x0234), A = 0
0x0233 (0x000466) 0x700A- f:00070 d: 10 | P = P + 10 (0x023D)
0x0234 (0x000468) 0x211E- f:00020 d: 286 | A = OR[286]
0x0235 (0x00046A) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0236 (0x00046C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0237 (0x00046E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0238 (0x000470) 0x8603- f:00103 d: 3 | P = P + 3 (0x023B), A # 0
0x0239 (0x000472) 0x1005- f:00010 d: 5 | A = 5 (0x0005)
0x023A (0x000474) 0x2904- f:00024 d: 260 | OR[260] = A
0x023B (0x000476) 0x2104- f:00020 d: 260 | A = OR[260]
0x023C (0x000478) 0x3903- f:00034 d: 259 | (OR[259]) = A
0x023D (0x00047A) 0x2105- f:00020 d: 261 | A = OR[261]
0x023E (0x00047C) 0x160D- f:00013 d: 13 | A = A - 13 (0x000D)
0x023F (0x00047E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0241), A = 0
0x0240 (0x000480) 0x7015- f:00070 d: 21 | P = P + 21 (0x0255)
0x0241 (0x000482) 0x2103- f:00020 d: 259 | A = OR[259]
0x0242 (0x000484) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0243 (0x000486) 0x290D- f:00024 d: 269 | OR[269] = A
0x0244 (0x000488) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0245 (0x00048A) 0x290E- f:00024 d: 270 | OR[270] = A
0x0246 (0x00048C) 0x210E- f:00020 d: 270 | A = OR[270]
0x0247 (0x00048E) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0248 (0x000490) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0249 (0x000492) 0x290F- f:00024 d: 271 | OR[271] = A
0x024A (0x000494) 0x210F- f:00020 d: 271 | A = OR[271]
0x024B (0x000496) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x024C (0x000498) 0x290F- f:00024 d: 271 | OR[271] = A
0x024D (0x00049A) 0x210E- f:00020 d: 270 | A = OR[270]
0x024E (0x00049C) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x024F (0x00049E) 0x250F- f:00022 d: 271 | A = A + OR[271]
0x0250 (0x0004A0) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x0251 (0x0004A2) 0x290E- f:00024 d: 270 | OR[270] = A
0x0252 (0x0004A4) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x0253 (0x0004A6) 0x210F- f:00020 d: 271 | A = OR[271]
0x0254 (0x0004A8) 0x7012- f:00070 d: 18 | P = P + 18 (0x0266)
0x0255 (0x0004AA) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0256 (0x0004AC) 0x2930- f:00024 d: 304 | OR[304] = A
0x0257 (0x0004AE) 0x2129- f:00020 d: 297 | A = OR[297]
0x0258 (0x0004B0) 0x2931- f:00024 d: 305 | OR[305] = A
0x0259 (0x0004B2) 0x2124- f:00020 d: 292 | A = OR[292]
0x025A (0x0004B4) 0x2932- f:00024 d: 306 | OR[306] = A
0x025B (0x0004B6) 0x2125- f:00020 d: 293 | A = OR[293]
0x025C (0x0004B8) 0x2933- f:00024 d: 307 | OR[307] = A
0x025D (0x0004BA) 0x2126- f:00020 d: 294 | A = OR[294]
0x025E (0x0004BC) 0x2934- f:00024 d: 308 | OR[308] = A
0x025F (0x0004BE) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0260 (0x0004C0) 0x2935- f:00024 d: 309 | OR[309] = A
0x0261 (0x0004C2) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0262 (0x0004C4) 0x5800- f:00054 d: 0 | B = A
0x0263 (0x0004C6) 0x1800-0x3118 f:00014 d: 0 | A = 12568 (0x3118)
0x0265 (0x0004CA) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0266 (0x0004CC) 0x211A- f:00020 d: 282 | A = OR[282]
0x0267 (0x0004CE) 0x8602- f:00103 d: 2 | P = P + 2 (0x0269), A # 0
0x0268 (0x0004D0) 0x700C- f:00070 d: 12 | P = P + 12 (0x0274)
0x0269 (0x0004D2) 0x2105- f:00020 d: 261 | A = OR[261]
0x026A (0x0004D4) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x026B (0x0004D6) 0x2905- f:00024 d: 261 | OR[261] = A
0x026C (0x0004D8) 0x211A- f:00020 d: 282 | A = OR[282]
0x026D (0x0004DA) 0x1416- f:00012 d: 22 | A = A + 22 (0x0016)
0x026E (0x0004DC) 0x2908- f:00024 d: 264 | OR[264] = A
0x026F (0x0004DE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0270 (0x0004E0) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x0272 (0x0004E4) 0x2505- f:00022 d: 261 | A = A + OR[261]
0x0273 (0x0004E6) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0274 (0x0004E8) 0x2105- f:00020 d: 261 | A = OR[261]
0x0275 (0x0004EA) 0x160D- f:00013 d: 13 | A = A - 13 (0x000D)
0x0276 (0x0004EC) 0x84A5- f:00102 d: 165 | P = P + 165 (0x031B), A = 0
0x0277 (0x0004EE) 0x2105- f:00020 d: 261 | A = OR[261]
0x0278 (0x0004F0) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C)
0x0279 (0x0004F2) 0x84A2- f:00102 d: 162 | P = P + 162 (0x031B), A = 0
0x027A (0x0004F4) 0x2104- f:00020 d: 260 | A = OR[260]
0x027B (0x0004F6) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002)
0x027C (0x0004F8) 0x8429- f:00102 d: 41 | P = P + 41 (0x02A5), A = 0
0x027D (0x0004FA) 0x2104- f:00020 d: 260 | A = OR[260]
0x027E (0x0004FC) 0x1603- f:00013 d: 3 | A = A - 3 (0x0003)
0x027F (0x0004FE) 0x8426- f:00102 d: 38 | P = P + 38 (0x02A5), A = 0
0x0280 (0x000500) 0x7E03-0x0428 f:00077 d: 3 | R = OR[3]+1064 (0x0428)
0x0282 (0x000504) 0x2100- f:00020 d: 256 | A = OR[256]
0x0283 (0x000506) 0x5800- f:00054 d: 0 | B = A
0x0284 (0x000508) 0xE000- f:00160 d: 0 | IOB , fn000
0x0285 (0x00050A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0286 (0x00050C) 0x3901- f:00034 d: 257 | (OR[257]) = A
0x0287 (0x00050E) 0x2101- f:00020 d: 257 | A = OR[257]
0x0288 (0x000510) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x0289 (0x000512) 0x2908- f:00024 d: 264 | OR[264] = A
0x028A (0x000514) 0x3108- f:00030 d: 264 | A = (OR[264])
0x028B (0x000516) 0x1A00-0xFFC0 f:00015 d: 0 | A = A & 65472 (0xFFC0)
0x028D (0x00051A) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x028E (0x00051C) 0x211B- f:00020 d: 283 | A = OR[283]
0x028F (0x00051E) 0x8602- f:00103 d: 2 | P = P + 2 (0x0291), A # 0
0x0290 (0x000520) 0x7008- f:00070 d: 8 | P = P + 8 (0x0298)
0x0291 (0x000522) 0x3101- f:00030 d: 257 | A = (OR[257])
0x0292 (0x000524) 0x0E09- f:00007 d: 9 | A = A << 9 (0x0009)
0x0293 (0x000526) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x0294 (0x000528) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0295 (0x00052A) 0x0C0A- f:00006 d: 10 | A = A >> 10 (0x000A)
0x0296 (0x00052C) 0x3901- f:00034 d: 257 | (OR[257]) = A
0x0297 (0x00052E) 0x7008- f:00070 d: 8 | P = P + 8 (0x029F)
0x0298 (0x000530) 0x0400- f:00002 d: 0 | I = 0
0x0299 (0x000532) 0x0000- f:00000 d: 0 | PASS
0x029A (0x000534) 0x2101- f:00020 d: 257 | A = OR[257]
0x029B (0x000536) 0x2897- f:00024 d: 151 | OR[151] = A
0x029C (0x000538) 0x7E00-0x1947 f:00077 d: 0 | R = OR[0]+6471 (0x1947)
0x029E (0x00053C) 0x0600- f:00003 d: 0 | I = 1
0x029F (0x00053E) 0x102A- f:00010 d: 42 | A = 42 (0x002A)
0x02A0 (0x000540) 0x2930- f:00024 d: 304 | OR[304] = A
0x02A1 (0x000542) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x02A2 (0x000544) 0x5800- f:00054 d: 0 | B = A
0x02A3 (0x000546) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02A4 (0x000548) 0x7C09- f:00076 d: 9 | R = OR[9]
0x02A5 (0x00054A) 0x211E- f:00020 d: 286 | A = OR[286]
0x02A6 (0x00054C) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x02A7 (0x00054E) 0x2908- f:00024 d: 264 | OR[264] = A
0x02A8 (0x000550) 0x3108- f:00030 d: 264 | A = (OR[264])
0x02A9 (0x000552) 0x0E01- f:00007 d: 1 | A = A << 1 (0x0001)
0x02AA (0x000554) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x02AB (0x000556) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000)
0x02AC (0x000558) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x02AD (0x00055A) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02AE (0x00055C) 0x211A- f:00020 d: 282 | A = OR[282]
0x02AF (0x00055E) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x02B0 (0x000560) 0x2908- f:00024 d: 264 | OR[264] = A
0x02B1 (0x000562) 0x3108- f:00030 d: 264 | A = (OR[264])
0x02B2 (0x000564) 0x292A- f:00024 d: 298 | OR[298] = A
0x02B3 (0x000566) 0x2D2A- f:00026 d: 298 | OR[298] = OR[298] + 1
0x02B4 (0x000568) 0x211A- f:00020 d: 282 | A = OR[282]
0x02B5 (0x00056A) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x02B6 (0x00056C) 0x2908- f:00024 d: 264 | OR[264] = A
0x02B7 (0x00056E) 0x212A- f:00020 d: 298 | A = OR[298]
0x02B8 (0x000570) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02B9 (0x000572) 0x211C- f:00020 d: 284 | A = OR[284]
0x02BA (0x000574) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x02BB (0x000576) 0x8402- f:00102 d: 2 | P = P + 2 (0x02BD), A = 0
0x02BC (0x000578) 0x7008- f:00070 d: 8 | P = P + 8 (0x02C4)
0x02BD (0x00057A) 0x211A- f:00020 d: 282 | A = OR[282]
0x02BE (0x00057C) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x02BF (0x00057E) 0x2908- f:00024 d: 264 | OR[264] = A
0x02C0 (0x000580) 0x3108- f:00030 d: 264 | A = (OR[264])
0x02C1 (0x000582) 0x272A- f:00023 d: 298 | A = A - OR[298]
0x02C2 (0x000584) 0xBC03-0x044F f:00136 d: 3 | R = OR[3]+1103 (0x044F), A = 0
0x02C4 (0x000588) 0x0400- f:00002 d: 0 | I = 0
0x02C5 (0x00058A) 0x0000- f:00000 d: 0 | PASS
0x02C6 (0x00058C) 0x211C- f:00020 d: 284 | A = OR[284]
0x02C7 (0x00058E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x02C8 (0x000590) 0x2908- f:00024 d: 264 | OR[264] = A
0x02C9 (0x000592) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02CA (0x000594) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x02CB (0x000596) 0x8602- f:00103 d: 2 | P = P + 2 (0x02CD), A # 0
0x02CC (0x000598) 0x7035- f:00070 d: 53 | P = P + 53 (0x0301)
0x02CD (0x00059A) 0x211A- f:00020 d: 282 | A = OR[282]
0x02CE (0x00059C) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A)
0x02CF (0x00059E) 0x2908- f:00024 d: 264 | OR[264] = A
0x02D0 (0x0005A0) 0x212A- f:00020 d: 298 | A = OR[298]
0x02D1 (0x0005A2) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02D2 (0x0005A4) 0x211E- f:00020 d: 286 | A = OR[286]
0x02D3 (0x0005A6) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x02D4 (0x0005A8) 0x2908- f:00024 d: 264 | OR[264] = A
0x02D5 (0x0005AA) 0x212A- f:00020 d: 298 | A = OR[298]
0x02D6 (0x0005AC) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02D7 (0x0005AE) 0x211E- f:00020 d: 286 | A = OR[286]
0x02D8 (0x0005B0) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x02D9 (0x0005B2) 0x2908- f:00024 d: 264 | OR[264] = A
0x02DA (0x0005B4) 0x211A- f:00020 d: 282 | A = OR[282]
0x02DB (0x0005B6) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02DC (0x0005B8) 0x211E- f:00020 d: 286 | A = OR[286]
0x02DD (0x0005BA) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x02DE (0x0005BC) 0x2908- f:00024 d: 264 | OR[264] = A
0x02DF (0x0005BE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x02E0 (0x0005C0) 0x0A02- f:00005 d: 2 | A = A < 2 (0x0002)
0x02E1 (0x0005C2) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x02E2 (0x0005C4) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x02E3 (0x0005C6) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02E4 (0x0005C8) 0x20B0- f:00020 d: 176 | A = OR[176]
0x02E5 (0x0005CA) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x02E6 (0x0005CC) 0x2819- f:00024 d: 25 | OR[25] = A
0x02E7 (0x0005CE) 0x211C- f:00020 d: 284 | A = OR[284]
0x02E8 (0x0005D0) 0x1611- f:00013 d: 17 | A = A - 17 (0x0011)
0x02E9 (0x0005D2) 0x8602- f:00103 d: 2 | P = P + 2 (0x02EB), A # 0
0x02EA (0x0005D4) 0x7013- f:00070 d: 19 | P = P + 19 (0x02FD)
0x02EB (0x0005D6) 0x212E- f:00020 d: 302 | A = OR[302]
0x02EC (0x0005D8) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x02ED (0x0005DA) 0x8602- f:00103 d: 2 | P = P + 2 (0x02EF), A # 0
0x02EE (0x0005DC) 0x700F- f:00070 d: 15 | P = P + 15 (0x02FD)
0x02EF (0x0005DE) 0x212F- f:00020 d: 303 | A = OR[303]
0x02F0 (0x0005E0) 0x2647- f:00023 d: 71 | A = A - OR[71]
0x02F1 (0x0005E2) 0x8402- f:00102 d: 2 | P = P + 2 (0x02F3), A = 0
0x02F2 (0x0005E4) 0x700B- f:00070 d: 11 | P = P + 11 (0x02FD)
0x02F3 (0x0005E6) 0x212E- f:00020 d: 302 | A = OR[302]
0x02F4 (0x0005E8) 0x8402- f:00102 d: 2 | P = P + 2 (0x02F6), A = 0
0x02F5 (0x0005EA) 0x7005- f:00070 d: 5 | P = P + 5 (0x02FA)
0x02F6 (0x0005EC) 0x20B0- f:00020 d: 176 | A = OR[176]
0x02F7 (0x0005EE) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x02F8 (0x0005F0) 0x2819- f:00024 d: 25 | OR[25] = A
0x02F9 (0x0005F2) 0x7004- f:00070 d: 4 | P = P + 4 (0x02FD)
0x02FA (0x0005F4) 0x20B0- f:00020 d: 176 | A = OR[176]
0x02FB (0x0005F6) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x02FC (0x0005F8) 0x2819- f:00024 d: 25 | OR[25] = A
0x02FD (0x0005FA) 0x211E- f:00020 d: 286 | A = OR[286]
0x02FE (0x0005FC) 0x281D- f:00024 d: 29 | OR[29] = A
0x02FF (0x0005FE) 0x7E00-0x1D75 f:00077 d: 0 | R = OR[0]+7541 (0x1D75)
0x0301 (0x000602) 0x2101- f:00020 d: 257 | A = OR[257]
0x0302 (0x000604) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A)
0x0303 (0x000606) 0x2908- f:00024 d: 264 | OR[264] = A
0x0304 (0x000608) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0305 (0x00060A) 0x271E- f:00023 d: 286 | A = A - OR[286]
0x0306 (0x00060C) 0x8402- f:00102 d: 2 | P = P + 2 (0x0308), A = 0
0x0307 (0x00060E) 0x7007- f:00070 d: 7 | P = P + 7 (0x030E)
0x0308 (0x000610) 0x2101- f:00020 d: 257 | A = OR[257]
0x0309 (0x000612) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x030A (0x000614) 0x2908- f:00024 d: 264 | OR[264] = A
0x030B (0x000616) 0x3108- f:00030 d: 264 | A = (OR[264])
0x030C (0x000618) 0x291E- f:00024 d: 286 | OR[286] = A
0x030D (0x00061A) 0x7003- f:00070 d: 3 | P = P + 3 (0x0310)
0x030E (0x00061C) 0x1006- f:00010 d: 6 | A = 6 (0x0006)
0x030F (0x00061E) 0x2B1E- f:00025 d: 286 | OR[286] = A + OR[286]
0x0310 (0x000620) 0x2101- f:00020 d: 257 | A = OR[257]
0x0311 (0x000622) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0312 (0x000624) 0x2908- f:00024 d: 264 | OR[264] = A
0x0313 (0x000626) 0x211E- f:00020 d: 286 | A = OR[286]
0x0314 (0x000628) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0315 (0x00062A) 0x0600- f:00003 d: 0 | I = 1
0x0316 (0x00062C) 0x2105- f:00020 d: 261 | A = OR[261]
0x0317 (0x00062E) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C)
0x0318 (0x000630) 0xBE03-0x0428 f:00137 d: 3 | R = OR[3]+1064 (0x0428), A # 0
0x031A (0x000634) 0x7298- f:00071 d: 152 | P = P - 152 (0x0282)
0x031B (0x000636) 0x2103- f:00020 d: 259 | A = OR[259]
0x031C (0x000638) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x031D (0x00063A) 0x290D- f:00024 d: 269 | OR[269] = A
0x031E (0x00063C) 0x310D- f:00030 d: 269 | A = (OR[269])
0x031F (0x00063E) 0x290E- f:00024 d: 270 | OR[270] = A
0x0320 (0x000640) 0x210E- f:00020 d: 270 | A = OR[270]
0x0321 (0x000642) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0322 (0x000644) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x0323 (0x000646) 0x290F- f:00024 d: 271 | OR[271] = A
0x0324 (0x000648) 0x210F- f:00020 d: 271 | A = OR[271]
0x0325 (0x00064A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0326 (0x00064C) 0x290F- f:00024 d: 271 | OR[271] = A
0x0327 (0x00064E) 0x210E- f:00020 d: 270 | A = OR[270]
0x0328 (0x000650) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x0329 (0x000652) 0x250F- f:00022 d: 271 | A = A + OR[271]
0x032A (0x000654) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x032B (0x000656) 0x290E- f:00024 d: 270 | OR[270] = A
0x032C (0x000658) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x032D (0x00065A) 0x210F- f:00020 d: 271 | A = OR[271]
0x032E (0x00065C) 0x7E03-0x0492 f:00077 d: 3 | R = OR[3]+1170 (0x0492)
0x0330 (0x000660) 0x211A- f:00020 d: 282 | A = OR[282]
0x0331 (0x000662) 0x8CB1- f:00106 d: 177 | P = P - 177 (0x0280), A = 0
0x0332 (0x000664) 0x211A- f:00020 d: 282 | A = OR[282]
0x0333 (0x000666) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0334 (0x000668) 0x2908- f:00024 d: 264 | OR[264] = A
0x0335 (0x00066A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0336 (0x00066C) 0x292A- f:00024 d: 298 | OR[298] = A
0x0337 (0x00066E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0338 (0x000670) 0x2122- f:00020 d: 290 | A = OR[290]
0x0339 (0x000672) 0x8402- f:00102 d: 2 | P = P + 2 (0x033B), A = 0
0x033A (0x000674) 0x2F13- f:00027 d: 275 | OR[275] = OR[275] - 1
0x033B (0x000676) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x033C (0x000678) 0x2914- f:00024 d: 276 | OR[276] = A
0x033D (0x00067A) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x033E (0x00067C) 0x1609- f:00013 d: 9 | A = A - 9 (0x0009)
0x033F (0x00067E) 0x5800- f:00054 d: 0 | B = A
0x0340 (0x000680) 0x2113- f:00020 d: 275 | A = OR[275]
0x0341 (0x000682) 0x4800- f:00044 d: 0 | A = A > B
0x0342 (0x000684) 0x290D- f:00024 d: 269 | OR[269] = A
0x0343 (0x000686) 0x1009- f:00010 d: 9 | A = 9 (0x0009)
0x0344 (0x000688) 0x5800- f:00054 d: 0 | B = A
0x0345 (0x00068A) 0x2113- f:00020 d: 275 | A = OR[275]
0x0346 (0x00068C) 0x4A00- f:00045 d: 0 | A = A < B
0x0347 (0x00068E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0348 (0x000690) 0x2114- f:00020 d: 276 | A = OR[276]
0x0349 (0x000692) 0x4A00- f:00045 d: 0 | A = A < B
0x034A (0x000694) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x034B (0x000696) 0x2914- f:00024 d: 276 | OR[276] = A
0x034C (0x000698) 0x211A- f:00020 d: 282 | A = OR[282]
0x034D (0x00069A) 0x141A- f:00012 d: 26 | A = A + 26 (0x001A)
0x034E (0x00069C) 0x2908- f:00024 d: 264 | OR[264] = A
0x034F (0x00069E) 0x2114- f:00020 d: 276 | A = OR[276]
0x0350 (0x0006A0) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0351 (0x0006A2) 0x211A- f:00020 d: 282 | A = OR[282]
0x0352 (0x0006A4) 0x141B- f:00012 d: 27 | A = A + 27 (0x001B)
0x0353 (0x0006A6) 0x2908- f:00024 d: 264 | OR[264] = A
0x0354 (0x0006A8) 0x2113- f:00020 d: 275 | A = OR[275]
0x0355 (0x0006AA) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0356 (0x0006AC) 0x211A- f:00020 d: 282 | A = OR[282]
0x0357 (0x0006AE) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x0358 (0x0006B0) 0x2908- f:00024 d: 264 | OR[264] = A
0x0359 (0x0006B2) 0x3108- f:00030 d: 264 | A = (OR[264])
0x035A (0x0006B4) 0x292B- f:00024 d: 299 | OR[299] = A
0x035B (0x0006B6) 0x211A- f:00020 d: 282 | A = OR[282]
0x035C (0x0006B8) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A)
0x035D (0x0006BA) 0x2908- f:00024 d: 264 | OR[264] = A
0x035E (0x0006BC) 0x3108- f:00030 d: 264 | A = (OR[264])
0x035F (0x0006BE) 0x2923- f:00024 d: 291 | OR[291] = A
0x0360 (0x0006C0) 0x211C- f:00020 d: 284 | A = OR[284]
0x0361 (0x0006C2) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0362 (0x0006C4) 0x2908- f:00024 d: 264 | OR[264] = A
0x0363 (0x0006C6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0364 (0x0006C8) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x0365 (0x0006CA) 0x8402- f:00102 d: 2 | P = P + 2 (0x0367), A = 0
0x0366 (0x0006CC) 0x7074- f:00070 d: 116 | P = P + 116 (0x03DA)
0x0367 (0x0006CE) 0x211A- f:00020 d: 282 | A = OR[282]
0x0368 (0x0006D0) 0x141F- f:00012 d: 31 | A = A + 31 (0x001F)
0x0369 (0x0006D2) 0x2908- f:00024 d: 264 | OR[264] = A
0x036A (0x0006D4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x036B (0x0006D6) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x036C (0x0006D8) 0x292C- f:00024 d: 300 | OR[300] = A
0x036D (0x0006DA) 0x212F- f:00020 d: 303 | A = OR[303]
0x036E (0x0006DC) 0x2647- f:00023 d: 71 | A = A - OR[71]
0x036F (0x0006DE) 0x863D- f:00103 d: 61 | P = P + 61 (0x03AC), A # 0
0x0370 (0x0006E0) 0x212C- f:00020 d: 300 | A = OR[300]
0x0371 (0x0006E2) 0x8602- f:00103 d: 2 | P = P + 2 (0x0373), A # 0
0x0372 (0x0006E4) 0x703A- f:00070 d: 58 | P = P + 58 (0x03AC)
0x0373 (0x0006E6) 0x212B- f:00020 d: 299 | A = OR[299]
0x0374 (0x0006E8) 0x2723- f:00023 d: 291 | A = A - OR[291]
0x0375 (0x0006EA) 0x8003- f:00100 d: 3 | P = P + 3 (0x0378), C = 0
0x0376 (0x0006EC) 0x8402- f:00102 d: 2 | P = P + 2 (0x0378), A = 0
0x0377 (0x0006EE) 0x7002- f:00070 d: 2 | P = P + 2 (0x0379)
0x0378 (0x0006F0) 0x7034- f:00070 d: 52 | P = P + 52 (0x03AC)
0x0379 (0x0006F2) 0x2101- f:00020 d: 257 | A = OR[257]
0x037A (0x0006F4) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x037B (0x0006F6) 0x290D- f:00024 d: 269 | OR[269] = A
0x037C (0x0006F8) 0x310D- f:00030 d: 269 | A = (OR[269])
0x037D (0x0006FA) 0x290E- f:00024 d: 270 | OR[270] = A
0x037E (0x0006FC) 0x210E- f:00020 d: 270 | A = OR[270]
0x037F (0x0006FE) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0380 (0x000700) 0x272C- f:00023 d: 300 | A = A - OR[300]
0x0381 (0x000702) 0x290F- f:00024 d: 271 | OR[271] = A
0x0382 (0x000704) 0x210F- f:00020 d: 271 | A = OR[271]
0x0383 (0x000706) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0384 (0x000708) 0x290F- f:00024 d: 271 | OR[271] = A
0x0385 (0x00070A) 0x210E- f:00020 d: 270 | A = OR[270]
0x0386 (0x00070C) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x0387 (0x00070E) 0x250F- f:00022 d: 271 | A = A + OR[271]
0x0388 (0x000710) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x0389 (0x000712) 0x290E- f:00024 d: 270 | OR[270] = A
0x038A (0x000714) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x038B (0x000716) 0x210F- f:00020 d: 271 | A = OR[271]
0x038C (0x000718) 0x2101- f:00020 d: 257 | A = OR[257]
0x038D (0x00071A) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F)
0x038E (0x00071C) 0x2908- f:00024 d: 264 | OR[264] = A
0x038F (0x00071E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0390 (0x000720) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0391 (0x000722) 0x291F- f:00024 d: 287 | OR[287] = A
0x0392 (0x000724) 0x2101- f:00020 d: 257 | A = OR[257]
0x0393 (0x000726) 0x140E- f:00012 d: 14 | A = A + 14 (0x000E)
0x0394 (0x000728) 0x2908- f:00024 d: 264 | OR[264] = A
0x0395 (0x00072A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0396 (0x00072C) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0397 (0x00072E) 0x2921- f:00024 d: 289 | OR[289] = A
0x0398 (0x000730) 0x211F- f:00020 d: 287 | A = OR[287]
0x0399 (0x000732) 0x252C- f:00022 d: 300 | A = A + OR[300]
0x039A (0x000734) 0x291F- f:00024 d: 287 | OR[287] = A
0x039B (0x000736) 0x4200- f:00041 d: 0 | C = 1, io 0000 (IOR) = BZ
0x039C (0x000738) 0x2721- f:00023 d: 289 | A = A - OR[289]
0x039D (0x00073A) 0x8004- f:00100 d: 4 | P = P + 4 (0x03A1), C = 0
0x039E (0x00073C) 0x211F- f:00020 d: 287 | A = OR[287]
0x039F (0x00073E) 0x2721- f:00023 d: 289 | A = A - OR[289]
0x03A0 (0x000740) 0x291F- f:00024 d: 287 | OR[287] = A
0x03A1 (0x000742) 0x211F- f:00020 d: 287 | A = OR[287]
0x03A2 (0x000744) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x03A3 (0x000746) 0x291F- f:00024 d: 287 | OR[287] = A
0x03A4 (0x000748) 0x2101- f:00020 d: 257 | A = OR[257]
0x03A5 (0x00074A) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F)
0x03A6 (0x00074C) 0x2908- f:00024 d: 264 | OR[264] = A
0x03A7 (0x00074E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x03A8 (0x000750) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x03AA (0x000754) 0x251F- f:00022 d: 287 | A = A + OR[287]
0x03AB (0x000756) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x03AC (0x000758) 0x2123- f:00020 d: 291 | A = OR[291]
0x03AD (0x00075A) 0x272A- f:00023 d: 298 | A = A - OR[298]
0x03AE (0x00075C) 0x8003- f:00100 d: 3 | P = P + 3 (0x03B1), C = 0
0x03AF (0x00075E) 0x8402- f:00102 d: 2 | P = P + 2 (0x03B1), A = 0
0x03B0 (0x000760) 0x7002- f:00070 d: 2 | P = P + 2 (0x03B2)
0x03B1 (0x000762) 0x7027- f:00070 d: 39 | P = P + 39 (0x03D8)
0x03B2 (0x000764) 0x2101- f:00020 d: 257 | A = OR[257]
0x03B3 (0x000766) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A)
0x03B4 (0x000768) 0x2908- f:00024 d: 264 | OR[264] = A
0x03B5 (0x00076A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x03B6 (0x00076C) 0x2917- f:00024 d: 279 | OR[279] = A
0x03B7 (0x00076E) 0x2123- f:00020 d: 291 | A = OR[291]
0x03B8 (0x000770) 0x272A- f:00023 d: 298 | A = A - OR[298]
0x03B9 (0x000772) 0x2916- f:00024 d: 278 | OR[278] = A
0x03BA (0x000774) 0x2116- f:00020 d: 278 | A = OR[278]
0x03BB (0x000776) 0x8418- f:00102 d: 24 | P = P + 24 (0x03D3), A = 0
0x03BC (0x000778) 0x211E- f:00020 d: 286 | A = OR[286]
0x03BD (0x00077A) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x03BE (0x00077C) 0x2908- f:00024 d: 264 | OR[264] = A
0x03BF (0x00077E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x03C0 (0x000780) 0x0E01- f:00007 d: 1 | A = A << 1 (0x0001)
0x03C1 (0x000782) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x03C2 (0x000784) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000)
0x03C3 (0x000786) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x03C4 (0x000788) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x03C5 (0x00078A) 0x211E- f:00020 d: 286 | A = OR[286]
0x03C6 (0x00078C) 0x2717- f:00023 d: 279 | A = A - OR[279]
0x03C7 (0x00078E) 0x8402- f:00102 d: 2 | P = P + 2 (0x03C9), A = 0
0x03C8 (0x000790) 0x7007- f:00070 d: 7 | P = P + 7 (0x03CF)
0x03C9 (0x000792) 0x2101- f:00020 d: 257 | A = OR[257]
0x03CA (0x000794) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x03CB (0x000796) 0x2908- f:00024 d: 264 | OR[264] = A
0x03CC (0x000798) 0x3108- f:00030 d: 264 | A = (OR[264])
0x03CD (0x00079A) 0x291E- f:00024 d: 286 | OR[286] = A
0x03CE (0x00079C) 0x7003- f:00070 d: 3 | P = P + 3 (0x03D1)
0x03CF (0x00079E) 0x1006- f:00010 d: 6 | A = 6 (0x0006)
0x03D0 (0x0007A0) 0x2B1E- f:00025 d: 286 | OR[286] = A + OR[286]
0x03D1 (0x0007A2) 0x2F16- f:00027 d: 278 | OR[278] = OR[278] - 1
0x03D2 (0x0007A4) 0x7218- f:00071 d: 24 | P = P - 24 (0x03BA)
0x03D3 (0x0007A6) 0x2101- f:00020 d: 257 | A = OR[257]
0x03D4 (0x0007A8) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x03D5 (0x0007AA) 0x2908- f:00024 d: 264 | OR[264] = A
0x03D6 (0x0007AC) 0x211E- f:00020 d: 286 | A = OR[286]
0x03D7 (0x0007AE) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x03D8 (0x0007B0) 0x7A03-0x0418 f:00075 d: 3 | P = OR[3]+1048 (0x0418)
0x03DA (0x0007B4) 0x2105- f:00020 d: 261 | A = OR[261]
0x03DB (0x0007B6) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C)
0x03DC (0x0007B8) 0x8402- f:00102 d: 2 | P = P + 2 (0x03DE), A = 0
0x03DD (0x0007BA) 0x701A- f:00070 d: 26 | P = P + 26 (0x03F7)
0x03DE (0x0007BC) 0x7E03-0x0428 f:00077 d: 3 | R = OR[3]+1064 (0x0428)
0x03E0 (0x0007C0) 0x212A- f:00020 d: 298 | A = OR[298]
0x03E1 (0x0007C2) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x03E2 (0x0007C4) 0x2923- f:00024 d: 291 | OR[291] = A
0x03E3 (0x0007C6) 0x211A- f:00020 d: 282 | A = OR[282]
0x03E4 (0x0007C8) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x03E5 (0x0007CA) 0x2908- f:00024 d: 264 | OR[264] = A
0x03E6 (0x0007CC) 0x2123- f:00020 d: 291 | A = OR[291]
0x03E7 (0x0007CE) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x03E8 (0x0007D0) 0x212F- f:00020 d: 303 | A = OR[303]
0x03E9 (0x0007D2) 0x2647- f:00023 d: 71 | A = A - OR[71]
0x03EA (0x0007D4) 0x8602- f:00103 d: 2 | P = P + 2 (0x03EC), A # 0
0x03EB (0x0007D6) 0x7009- f:00070 d: 9 | P = P + 9 (0x03F4)
0x03EC (0x0007D8) 0x211A- f:00020 d: 282 | A = OR[282]
0x03ED (0x0007DA) 0x1411- f:00012 d: 17 | A = A + 17 (0x0011)
0x03EE (0x0007DC) 0x2908- f:00024 d: 264 | OR[264] = A
0x03EF (0x0007DE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x03F0 (0x0007E0) 0x0807- f:00004 d: 7 | A = A > 7 (0x0007)
0x03F1 (0x0007E2) 0x1203- f:00011 d: 3 | A = A & 3 (0x0003)
0x03F2 (0x0007E4) 0xBE03-0x0521 f:00137 d: 3 | R = OR[3]+1313 (0x0521), A # 0
0x03F4 (0x0007E8) 0x734F- f:00071 d: 335 | P = P - 335 (0x02A5)
0x03F5 (0x0007EA) 0x7A03-0x0418 f:00075 d: 3 | P = OR[3]+1048 (0x0418)
0x03F7 (0x0007EE) 0x212F- f:00020 d: 303 | A = OR[303]
0x03F8 (0x0007F0) 0x2647- f:00023 d: 71 | A = A - OR[71]
0x03F9 (0x0007F2) 0x8403- f:00102 d: 3 | P = P + 3 (0x03FC), A = 0
0x03FA (0x0007F4) 0x7A03-0x0418 f:00075 d: 3 | P = OR[3]+1048 (0x0418)
0x03FC (0x0007F8) 0x211A- f:00020 d: 282 | A = OR[282]
0x03FD (0x0007FA) 0x141F- f:00012 d: 31 | A = A + 31 (0x001F)
0x03FE (0x0007FC) 0x2908- f:00024 d: 264 | OR[264] = A
0x03FF (0x0007FE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0400 (0x000800) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0401 (0x000802) 0x8602- f:00103 d: 2 | P = P + 2 (0x0403), A # 0
0x0402 (0x000804) 0x7010- f:00070 d: 16 | P = P + 16 (0x0412)
0x0403 (0x000806) 0x211A- f:00020 d: 282 | A = OR[282]
0x0404 (0x000808) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x0405 (0x00080A) 0x2908- f:00024 d: 264 | OR[264] = A
0x0406 (0x00080C) 0x212A- f:00020 d: 298 | A = OR[298]
0x0407 (0x00080E) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0408 (0x000810) 0x2101- f:00020 d: 257 | A = OR[257]
0x0409 (0x000812) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x040A (0x000814) 0x2908- f:00024 d: 264 | OR[264] = A
0x040B (0x000816) 0x3108- f:00030 d: 264 | A = (OR[264])
0x040C (0x000818) 0x0E04- f:00007 d: 4 | A = A << 4 (0x0004)
0x040D (0x00081A) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x040E (0x00081C) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x040F (0x00081E) 0x0C05- f:00006 d: 5 | A = A >> 5 (0x0005)
0x0410 (0x000820) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0411 (0x000822) 0x7391- f:00071 d: 401 | P = P - 401 (0x0280)
0x0412 (0x000824) 0x7410- f:00072 d: 16 | R = P + 16 (0x0422)
0x0413 (0x000826) 0x212F- f:00020 d: 303 | A = OR[303]
0x0414 (0x000828) 0x2647- f:00023 d: 71 | A = A - OR[71]
0x0415 (0x00082A) 0x8602- f:00103 d: 2 | P = P + 2 (0x0417), A # 0
0x0416 (0x00082C) 0x700A- f:00070 d: 10 | P = P + 10 (0x0420)
0x0417 (0x00082E) 0x211A- f:00020 d: 282 | A = OR[282]
0x0418 (0x000830) 0x1411- f:00012 d: 17 | A = A + 17 (0x0011)
0x0419 (0x000832) 0x2908- f:00024 d: 264 | OR[264] = A
0x041A (0x000834) 0x3108- f:00030 d: 264 | A = (OR[264])
0x041B (0x000836) 0x0807- f:00004 d: 7 | A = A > 7 (0x0007)
0x041C (0x000838) 0x1203- f:00011 d: 3 | A = A & 3 (0x0003)
0x041D (0x00083A) 0x8403- f:00102 d: 3 | P = P + 3 (0x0420), A = 0
0x041E (0x00083C) 0x74FD- f:00072 d: 253 | R = P + 253 (0x051B)
0x041F (0x00083E) 0x7002- f:00070 d: 2 | P = P + 2 (0x0421)
0x0420 (0x000840) 0x7429- f:00072 d: 41 | R = P + 41 (0x0449)
0x0421 (0x000842) 0x739F- f:00071 d: 415 | P = P - 415 (0x0282)
0x0422 (0x000844) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0423 (0x000846) 0x2930- f:00024 d: 304 | OR[304] = A
0x0424 (0x000848) 0x1800-0x0056 f:00014 d: 0 | A = 86 (0x0056)
0x0426 (0x00084C) 0x2931- f:00024 d: 305 | OR[305] = A
0x0427 (0x00084E) 0x211A- f:00020 d: 282 | A = OR[282]
0x0428 (0x000850) 0x2932- f:00024 d: 306 | OR[306] = A
0x0429 (0x000852) 0x2124- f:00020 d: 292 | A = OR[292]
0x042A (0x000854) 0x2933- f:00024 d: 307 | OR[307] = A
0x042B (0x000856) 0x2125- f:00020 d: 293 | A = OR[293]
0x042C (0x000858) 0x2934- f:00024 d: 308 | OR[308] = A
0x042D (0x00085A) 0x2126- f:00020 d: 294 | A = OR[294]
0x042E (0x00085C) 0x2935- f:00024 d: 309 | OR[309] = A
0x042F (0x00085E) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0430 (0x000860) 0x5800- f:00054 d: 0 | B = A
0x0431 (0x000862) 0x1800-0x3118 f:00014 d: 0 | A = 12568 (0x3118)
0x0433 (0x000866) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0434 (0x000868) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x0435 (0x00086A) 0x2930- f:00024 d: 304 | OR[304] = A
0x0436 (0x00086C) 0x2102- f:00020 d: 258 | A = OR[258]
0x0437 (0x00086E) 0x2931- f:00024 d: 305 | OR[305] = A
0x0438 (0x000870) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0439 (0x000872) 0x5800- f:00054 d: 0 | B = A
0x043A (0x000874) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x043B (0x000876) 0x7C09- f:00076 d: 9 | R = OR[9]
0x043C (0x000878) 0x0200- f:00001 d: 0 | EXIT
0x043D (0x00087A) 0x2100- f:00020 d: 256 | A = OR[256]
0x043E (0x00087C) 0x5800- f:00054 d: 0 | B = A
0x043F (0x00087E) 0xE000- f:00160 d: 0 | IOB , fn000
0x0440 (0x000880) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0441 (0x000882) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x0442 (0x000884) 0x1800-0xC000 f:00014 d: 0 | A = 49152 (0xC000)
0x0444 (0x000888) 0xE200- f:00161 d: 0 | IOB , fn001
0x0445 (0x00088A) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0446 (0x00088C) 0x2920- f:00024 d: 288 | OR[288] = A
0x0447 (0x00088E) 0x7470- f:00072 d: 112 | R = P + 112 (0x04B7)
0x0448 (0x000890) 0x0200- f:00001 d: 0 | EXIT
0x0449 (0x000892) 0x0400- f:00002 d: 0 | I = 0
0x044A (0x000894) 0x0000- f:00000 d: 0 | PASS
0x044B (0x000896) 0x2101- f:00020 d: 257 | A = OR[257]
0x044C (0x000898) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x044D (0x00089A) 0x2819- f:00024 d: 25 | OR[25] = A
0x044E (0x00089C) 0x7E00-0x1D57 f:00077 d: 0 | R = OR[0]+7511 (0x1D57)
0x0450 (0x0008A0) 0x211A- f:00020 d: 282 | A = OR[282]
0x0451 (0x0008A2) 0x2896- f:00024 d: 150 | OR[150] = A
0x0452 (0x0008A4) 0x211A- f:00020 d: 282 | A = OR[282]
0x0453 (0x0008A6) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0454 (0x0008A8) 0x2908- f:00024 d: 264 | OR[264] = A
0x0455 (0x0008AA) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0456 (0x0008AC) 0x2913- f:00024 d: 275 | OR[275] = A
0x0457 (0x0008AE) 0x211A- f:00020 d: 282 | A = OR[282]
0x0458 (0x0008B0) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0459 (0x0008B2) 0x2908- f:00024 d: 264 | OR[264] = A
0x045A (0x0008B4) 0x1005- f:00010 d: 5 | A = 5 (0x0005)
0x045B (0x0008B6) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x045C (0x0008B8) 0x211C- f:00020 d: 284 | A = OR[284]
0x045D (0x0008BA) 0x1210- f:00011 d: 16 | A = A & 16 (0x0010)
0x045E (0x0008BC) 0x8602- f:00103 d: 2 | P = P + 2 (0x0460), A # 0
0x045F (0x0008BE) 0x700A- f:00070 d: 10 | P = P + 10 (0x0469)
0x0460 (0x0008C0) 0x20AF- f:00020 d: 175 | A = OR[175]
0x0461 (0x0008C2) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x0462 (0x0008C4) 0x2819- f:00024 d: 25 | OR[25] = A
0x0463 (0x0008C6) 0x211A- f:00020 d: 282 | A = OR[282]
0x0464 (0x0008C8) 0x281D- f:00024 d: 29 | OR[29] = A
0x0465 (0x0008CA) 0x7E00-0x1D75 f:00077 d: 0 | R = OR[0]+7541 (0x1D75)
0x0467 (0x0008CE) 0x0200- f:00001 d: 0 | EXIT
0x0468 (0x0008D0) 0x701B- f:00070 d: 27 | P = P + 27 (0x0483)
0x0469 (0x0008D2) 0x211C- f:00020 d: 284 | A = OR[284]
0x046A (0x0008D4) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006)
0x046B (0x0008D6) 0x8402- f:00102 d: 2 | P = P + 2 (0x046D), A = 0
0x046C (0x0008D8) 0x700A- f:00070 d: 10 | P = P + 10 (0x0476)
0x046D (0x0008DA) 0x2113- f:00020 d: 275 | A = OR[275]
0x046E (0x0008DC) 0x1605- f:00013 d: 5 | A = A - 5 (0x0005)
0x046F (0x0008DE) 0x8402- f:00102 d: 2 | P = P + 2 (0x0471), A = 0
0x0470 (0x0008E0) 0x7003- f:00070 d: 3 | P = P + 3 (0x0473)
0x0471 (0x0008E2) 0x7E00-0x19E9 f:00077 d: 0 | R = OR[0]+6633 (0x19E9)
0x0473 (0x0008E6) 0x7E00-0x19DD f:00077 d: 0 | R = OR[0]+6621 (0x19DD)
0x0475 (0x0008EA) 0x700E- f:00070 d: 14 | P = P + 14 (0x0483)
0x0476 (0x0008EC) 0x211C- f:00020 d: 284 | A = OR[284]
0x0477 (0x0008EE) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C)
0x0478 (0x0008F0) 0x8402- f:00102 d: 2 | P = P + 2 (0x047A), A = 0
0x0479 (0x0008F2) 0x7008- f:00070 d: 8 | P = P + 8 (0x0481)
0x047A (0x0008F4) 0x2113- f:00020 d: 275 | A = OR[275]
0x047B (0x0008F6) 0x1605- f:00013 d: 5 | A = A - 5 (0x0005)
0x047C (0x0008F8) 0x8602- f:00103 d: 2 | P = P + 2 (0x047E), A # 0
0x047D (0x0008FA) 0x7003- f:00070 d: 3 | P = P + 3 (0x0480)
0x047E (0x0008FC) 0x7E00-0x19DD f:00077 d: 0 | R = OR[0]+6621 (0x19DD)
0x0480 (0x000900) 0x7003- f:00070 d: 3 | P = P + 3 (0x0483)
0x0481 (0x000902) 0x7E00-0x19DD f:00077 d: 0 | R = OR[0]+6621 (0x19DD)
0x0483 (0x000906) 0x1017- f:00010 d: 23 | A = 23 (0x0017)
0x0484 (0x000908) 0x2930- f:00024 d: 304 | OR[304] = A
0x0485 (0x00090A) 0x211A- f:00020 d: 282 | A = OR[282]
0x0486 (0x00090C) 0x2931- f:00024 d: 305 | OR[305] = A
0x0487 (0x00090E) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0488 (0x000910) 0x5800- f:00054 d: 0 | B = A
0x0489 (0x000912) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x048A (0x000914) 0x7C09- f:00076 d: 9 | R = OR[9]
0x048B (0x000916) 0x0200- f:00001 d: 0 | EXIT
0x048C (0x000918) 0x2100- f:00020 d: 256 | A = OR[256]
0x048D (0x00091A) 0x5800- f:00054 d: 0 | B = A
0x048E (0x00091C) 0xE000- f:00160 d: 0 | IOB , fn000
0x048F (0x00091E) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0490 (0x000920) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x0491 (0x000922) 0x1800-0xB000 f:00014 d: 0 | A = 45056 (0xB000)
0x0493 (0x000926) 0xE200- f:00161 d: 0 | IOB , fn001
0x0494 (0x000928) 0x2101- f:00020 d: 257 | A = OR[257]
0x0495 (0x00092A) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x0496 (0x00092C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0497 (0x00092E) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x0499 (0x000932) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x049A (0x000934) 0x2101- f:00020 d: 257 | A = OR[257]
0x049B (0x000936) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x049C (0x000938) 0x2908- f:00024 d: 264 | OR[264] = A
0x049D (0x00093A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x049E (0x00093C) 0x0E03- f:00007 d: 3 | A = A << 3 (0x0003)
0x049F (0x00093E) 0x0A05- f:00005 d: 5 | A = A < 5 (0x0005)
0x04A0 (0x000940) 0x141F- f:00012 d: 31 | A = A + 31 (0x001F)
0x04A1 (0x000942) 0x0C08- f:00006 d: 8 | A = A >> 8 (0x0008)
0x04A2 (0x000944) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x04A3 (0x000946) 0x2101- f:00020 d: 257 | A = OR[257]
0x04A4 (0x000948) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x04A5 (0x00094A) 0x2908- f:00024 d: 264 | OR[264] = A
0x04A6 (0x00094C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x04A7 (0x00094E) 0x1A00-0xFDFF f:00015 d: 0 | A = A & 65023 (0xFDFF)
0x04A9 (0x000952) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x04AA (0x000954) 0x1014- f:00010 d: 20 | A = 20 (0x0014)
0x04AB (0x000956) 0x2920- f:00024 d: 288 | OR[288] = A
0x04AC (0x000958) 0x740B- f:00072 d: 11 | R = P + 11 (0x04B7)
0x04AD (0x00095A) 0x0200- f:00001 d: 0 | EXIT
0x04AE (0x00095C) 0x1800-0x1000 f:00014 d: 0 | A = 4096 (0x1000)
0x04B0 (0x000960) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x04B1 (0x000962) 0x8205- f:00101 d: 5 | P = P + 5 (0x04B6), C = 1
0x04B2 (0x000964) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x04B3 (0x000966) 0x8602- f:00103 d: 2 | P = P + 2 (0x04B5), A # 0
0x04B4 (0x000968) 0x0200- f:00001 d: 0 | EXIT
0x04B5 (0x00096A) 0x7205- f:00071 d: 5 | P = P - 5 (0x04B0)
0x04B6 (0x00096C) 0x0200- f:00001 d: 0 | EXIT
0x04B7 (0x00096E) 0x0400- f:00002 d: 0 | I = 0
0x04B8 (0x000970) 0x0000- f:00000 d: 0 | PASS
0x04B9 (0x000972) 0x2101- f:00020 d: 257 | A = OR[257]
0x04BA (0x000974) 0x1424- f:00012 d: 36 | A = A + 36 (0x0024)
0x04BB (0x000976) 0x281D- f:00024 d: 29 | OR[29] = A
0x04BC (0x000978) 0x2120- f:00020 d: 288 | A = OR[288]
0x04BD (0x00097A) 0x281C- f:00024 d: 28 | OR[28] = A
0x04BE (0x00097C) 0x7E00-0x1E02 f:00077 d: 0 | R = OR[0]+7682 (0x1E02)
0x04C0 (0x000980) 0xEE00- f:00167 d: 0 | IOB , fn007
0x04C1 (0x000982) 0x3101- f:00030 d: 257 | A = (OR[257])
0x04C2 (0x000984) 0x0E08- f:00007 d: 8 | A = A << 8 (0x0008)
0x04C3 (0x000986) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x04C4 (0x000988) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x04C5 (0x00098A) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x04C6 (0x00098C) 0x3901- f:00034 d: 257 | (OR[257]) = A
0x04C7 (0x00098E) 0x2101- f:00020 d: 257 | A = OR[257]
0x04C8 (0x000990) 0x1418- f:00012 d: 24 | A = A + 24 (0x0018)
0x04C9 (0x000992) 0x2913- f:00024 d: 275 | OR[275] = A
0x04CA (0x000994) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x04CB (0x000996) 0x2930- f:00024 d: 304 | OR[304] = A
0x04CC (0x000998) 0x2113- f:00020 d: 275 | A = OR[275]
0x04CD (0x00099A) 0x2931- f:00024 d: 305 | OR[305] = A
0x04CE (0x00099C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x04CF (0x00099E) 0x2932- f:00024 d: 306 | OR[306] = A
0x04D0 (0x0009A0) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x04D1 (0x0009A2) 0x5800- f:00054 d: 0 | B = A
0x04D2 (0x0009A4) 0x1800-0x3118 f:00014 d: 0 | A = 12568 (0x3118)
0x04D4 (0x0009A8) 0x7C09- f:00076 d: 9 | R = OR[9]
0x04D5 (0x0009AA) 0x2006- f:00020 d: 6 | A = OR[6]
0x04D6 (0x0009AC) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x04D7 (0x0009AE) 0x2908- f:00024 d: 264 | OR[264] = A
0x04D8 (0x0009B0) 0x3108- f:00030 d: 264 | A = (OR[264])
0x04D9 (0x0009B2) 0x3101- f:00030 d: 257 | A = (OR[257])
0x04DA (0x0009B4) 0x1A00-0xFEFF f:00015 d: 0 | A = A & 65279 (0xFEFF)
0x04DC (0x0009B8) 0x3901- f:00034 d: 257 | (OR[257]) = A
0x04DD (0x0009BA) 0x2100- f:00020 d: 256 | A = OR[256]
0x04DE (0x0009BC) 0x5800- f:00054 d: 0 | B = A
0x04DF (0x0009BE) 0x2006- f:00020 d: 6 | A = OR[6]
0x04E0 (0x0009C0) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C)
0x04E1 (0x0009C2) 0x2908- f:00024 d: 264 | OR[264] = A
0x04E2 (0x0009C4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x04E3 (0x0009C6) 0x0200- f:00001 d: 0 | EXIT
0x04E4 (0x0009C8) 0x211D- f:00020 d: 285 | A = OR[285]
0x04E5 (0x0009CA) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040)
0x04E6 (0x0009CC) 0x8405- f:00102 d: 5 | P = P + 5 (0x04EB), A = 0
0x04E7 (0x0009CE) 0x211D- f:00020 d: 285 | A = OR[285]
0x04E8 (0x0009D0) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020)
0x04E9 (0x0009D2) 0x8402- f:00102 d: 2 | P = P + 2 (0x04EB), A = 0
0x04EA (0x0009D4) 0x7010- f:00070 d: 16 | P = P + 16 (0x04FA)
0x04EB (0x0009D6) 0x2107- f:00020 d: 263 | A = OR[263]
0x04EC (0x0009D8) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008)
0x04ED (0x0009DA) 0x8602- f:00103 d: 2 | P = P + 2 (0x04EF), A # 0
0x04EE (0x0009DC) 0x700C- f:00070 d: 12 | P = P + 12 (0x04FA)
0x04EF (0x0009DE) 0x2101- f:00020 d: 257 | A = OR[257]
0x04F0 (0x0009E0) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028)
0x04F1 (0x0009E2) 0x2908- f:00024 d: 264 | OR[264] = A
0x04F2 (0x0009E4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x04F3 (0x0009E6) 0x2927- f:00024 d: 295 | OR[295] = A
0x04F4 (0x0009E8) 0x2101- f:00020 d: 257 | A = OR[257]
0x04F5 (0x0009EA) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x04F6 (0x0009EC) 0x2908- f:00024 d: 264 | OR[264] = A
0x04F7 (0x0009EE) 0x3108- f:00030 d: 264 | A = (OR[264])
0x04F8 (0x0009F0) 0x2928- f:00024 d: 296 | OR[296] = A
0x04F9 (0x0009F2) 0x0200- f:00001 d: 0 | EXIT
0x04FA (0x0009F4) 0x2100- f:00020 d: 256 | A = OR[256]
0x04FB (0x0009F6) 0x5800- f:00054 d: 0 | B = A
0x04FC (0x0009F8) 0x0400- f:00002 d: 0 | I = 0
0x04FD (0x0009FA) 0x0000- f:00000 d: 0 | PASS
0x04FE (0x0009FC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x04FF (0x0009FE) 0xFE00- f:00177 d: 0 | IOB , fn017
0x0500 (0x000A00) 0x7652- f:00073 d: 82 | R = P - 82 (0x04AE)
0x0501 (0x000A02) 0x8602- f:00103 d: 2 | P = P + 2 (0x0503), A # 0
0x0502 (0x000A04) 0x7003- f:00070 d: 3 | P = P + 3 (0x0505)
0x0503 (0x000A06) 0xF400- f:00172 d: 0 | IOB , fn012
0x0504 (0x000A08) 0x7003- f:00070 d: 3 | P = P + 3 (0x0507)
0x0505 (0x000A0A) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x0507 (0x000A0E) 0x2927- f:00024 d: 295 | OR[295] = A
0x0508 (0x000A10) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0509 (0x000A12) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x050A (0x000A14) 0xE000- f:00160 d: 0 | IOB , fn000
0x050B (0x000A16) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x050C (0x000A18) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x050D (0x000A1A) 0x1800-0x8000 f:00014 d: 0 | A = 32768 (0x8000)
0x050F (0x000A1E) 0xE200- f:00161 d: 0 | IOB , fn001
0x0510 (0x000A20) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0511 (0x000A22) 0x2920- f:00024 d: 288 | OR[288] = A
0x0512 (0x000A24) 0x765B- f:00073 d: 91 | R = P - 91 (0x04B7)
0x0513 (0x000A26) 0x8402- f:00102 d: 2 | P = P + 2 (0x0515), A = 0
0x0514 (0x000A28) 0x7003- f:00070 d: 3 | P = P + 3 (0x0517)
0x0515 (0x000A2A) 0xF600- f:00173 d: 0 | IOB , fn013
0x0516 (0x000A2C) 0x7003- f:00070 d: 3 | P = P + 3 (0x0519)
0x0517 (0x000A2E) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x0519 (0x000A32) 0x2928- f:00024 d: 296 | OR[296] = A
0x051A (0x000A34) 0x0200- f:00001 d: 0 | EXIT
0x051B (0x000A36) 0x211C- f:00020 d: 284 | A = OR[284]
0x051C (0x000A38) 0x1210- f:00011 d: 16 | A = A & 16 (0x0010)
0x051D (0x000A3A) 0x2908- f:00024 d: 264 | OR[264] = A
0x051E (0x000A3C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x051F (0x000A3E) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x0520 (0x000A40) 0x8402- f:00102 d: 2 | P = P + 2 (0x0522), A = 0
0x0521 (0x000A42) 0x0200- f:00001 d: 0 | EXIT
0x0522 (0x000A44) 0x1800-0x0C98 f:00014 d: 0 | A = 3224 (0x0C98)
0x0524 (0x000A48) 0x291B- f:00024 d: 283 | OR[283] = A
0x0525 (0x000A4A) 0x211B- f:00020 d: 283 | A = OR[283]
0x0526 (0x000A4C) 0x290E- f:00024 d: 270 | OR[270] = A
0x0527 (0x000A4E) 0x1008- f:00010 d: 8 | A = 8 (0x0008)
0x0528 (0x000A50) 0x290D- f:00024 d: 269 | OR[269] = A
0x0529 (0x000A52) 0x210D- f:00020 d: 269 | A = OR[269]
0x052A (0x000A54) 0x8406- f:00102 d: 6 | P = P + 6 (0x0530), A = 0
0x052B (0x000A56) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x052C (0x000A58) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x052D (0x000A5A) 0x2F0D- f:00027 d: 269 | OR[269] = OR[269] - 1
0x052E (0x000A5C) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x052F (0x000A5E) 0x7206- f:00071 d: 6 | P = P - 6 (0x0529)
0x0530 (0x000A60) 0x211A- f:00020 d: 282 | A = OR[282]
0x0531 (0x000A62) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x0532 (0x000A64) 0x290D- f:00024 d: 269 | OR[269] = A
0x0533 (0x000A66) 0x211B- f:00020 d: 283 | A = OR[283]
0x0534 (0x000A68) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x0535 (0x000A6A) 0x290E- f:00024 d: 270 | OR[270] = A
0x0536 (0x000A6C) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x0537 (0x000A6E) 0x290F- f:00024 d: 271 | OR[271] = A
0x0538 (0x000A70) 0x7006- f:00070 d: 6 | P = P + 6 (0x053E)
0x0539 (0x000A72) 0x310D- f:00030 d: 269 | A = (OR[269])
0x053A (0x000A74) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x053B (0x000A76) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x053C (0x000A78) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x053D (0x000A7A) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x053E (0x000A7C) 0x210F- f:00020 d: 271 | A = OR[271]
0x053F (0x000A7E) 0x8E06- f:00107 d: 6 | P = P - 6 (0x0539), A # 0
0x0540 (0x000A80) 0x211B- f:00020 d: 283 | A = OR[283]
0x0541 (0x000A82) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x0542 (0x000A84) 0x2908- f:00024 d: 264 | OR[264] = A
0x0543 (0x000A86) 0x211A- f:00020 d: 282 | A = OR[282]
0x0544 (0x000A88) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0545 (0x000A8A) 0x211B- f:00020 d: 283 | A = OR[283]
0x0546 (0x000A8C) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0547 (0x000A8E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0548 (0x000A90) 0x2123- f:00020 d: 291 | A = OR[291]
0x0549 (0x000A92) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x054A (0x000A94) 0x2101- f:00020 d: 257 | A = OR[257]
0x054B (0x000A96) 0x141A- f:00012 d: 26 | A = A + 26 (0x001A)
0x054C (0x000A98) 0x2908- f:00024 d: 264 | OR[264] = A
0x054D (0x000A9A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x054E (0x000A9C) 0x2913- f:00024 d: 275 | OR[275] = A
0x054F (0x000A9E) 0x2101- f:00020 d: 257 | A = OR[257]
0x0550 (0x000AA0) 0x141B- f:00012 d: 27 | A = A + 27 (0x001B)
0x0551 (0x000AA2) 0x2908- f:00024 d: 264 | OR[264] = A
0x0552 (0x000AA4) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0553 (0x000AA6) 0x2914- f:00024 d: 276 | OR[276] = A
0x0554 (0x000AA8) 0x211B- f:00020 d: 283 | A = OR[283]
0x0555 (0x000AAA) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C)
0x0556 (0x000AAC) 0x2908- f:00024 d: 264 | OR[264] = A
0x0557 (0x000AAE) 0x2113- f:00020 d: 275 | A = OR[275]
0x0558 (0x000AB0) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0559 (0x000AB2) 0x211B- f:00020 d: 283 | A = OR[283]
0x055A (0x000AB4) 0x141D- f:00012 d: 29 | A = A + 29 (0x001D)
0x055B (0x000AB6) 0x2908- f:00024 d: 264 | OR[264] = A
0x055C (0x000AB8) 0x2114- f:00020 d: 276 | A = OR[276]
0x055D (0x000ABA) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x055E (0x000ABC) 0x211B- f:00020 d: 283 | A = OR[283]
0x055F (0x000ABE) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0560 (0x000AC0) 0x2908- f:00024 d: 264 | OR[264] = A
0x0561 (0x000AC2) 0x1006- f:00010 d: 6 | A = 6 (0x0006)
0x0562 (0x000AC4) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0563 (0x000AC6) 0x211B- f:00020 d: 283 | A = OR[283]
0x0564 (0x000AC8) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x0565 (0x000ACA) 0x2908- f:00024 d: 264 | OR[264] = A
0x0566 (0x000ACC) 0x1057- f:00010 d: 87 | A = 87 (0x0057)
0x0567 (0x000ACE) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0568 (0x000AD0) 0x0400- f:00002 d: 0 | I = 0
0x0569 (0x000AD2) 0x0000- f:00000 d: 0 | PASS
0x056A (0x000AD4) 0x211B- f:00020 d: 283 | A = OR[283]
0x056B (0x000AD6) 0x2896- f:00024 d: 150 | OR[150] = A
0x056C (0x000AD8) 0x7E00-0x19E9 f:00077 d: 0 | R = OR[0]+6633 (0x19E9)
0x056E (0x000ADC) 0x7E00-0x19C5 f:00077 d: 0 | R = OR[0]+6597 (0x19C5)
0x0570 (0x000AE0) 0x212F- f:00020 d: 303 | A = OR[303]
0x0571 (0x000AE2) 0x281E- f:00024 d: 30 | OR[30] = A
0x0572 (0x000AE4) 0x7E00-0x0685 f:00077 d: 0 | R = OR[0]+1669 (0x0685)
0x0574 (0x000AE8) 0x0600- f:00003 d: 0 | I = 1
0x0575 (0x000AEA) 0x0200- f:00001 d: 0 | EXIT
0x0576 (0x000AEC) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x0577 (0x000AEE) 0x2930- f:00024 d: 304 | OR[304] = A
0x0578 (0x000AF0) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x0579 (0x000AF2) 0x2931- f:00024 d: 305 | OR[305] = A
0x057A (0x000AF4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x057B (0x000AF6) 0x2932- f:00024 d: 306 | OR[306] = A
0x057C (0x000AF8) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x057D (0x000AFA) 0x2933- f:00024 d: 307 | OR[307] = A
0x057E (0x000AFC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x057F (0x000AFE) 0x2934- f:00024 d: 308 | OR[308] = A
0x0580 (0x000B00) 0x112A- f:00010 d: 298 | A = 298 (0x012A)
0x0581 (0x000B02) 0x2935- f:00024 d: 309 | OR[309] = A
0x0582 (0x000B04) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x0583 (0x000B06) 0x5800- f:00054 d: 0 | B = A
0x0584 (0x000B08) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0585 (0x000B0A) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0586 (0x000B0C) 0x8602- f:00103 d: 2 | P = P + 2 (0x0588), A # 0
0x0587 (0x000B0E) 0x700B- f:00070 d: 11 | P = P + 11 (0x0592)
0x0588 (0x000B10) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x0589 (0x000B12) 0x2930- f:00024 d: 304 | OR[304] = A
0x058A (0x000B14) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x058B (0x000B16) 0x2931- f:00024 d: 305 | OR[305] = A
0x058C (0x000B18) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x058D (0x000B1A) 0x5800- f:00054 d: 0 | B = A
0x058E (0x000B1C) 0x1800-0x3118 f:00014 d: 0 | A = 12568 (0x3118)
0x0590 (0x000B20) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0591 (0x000B22) 0x721B- f:00071 d: 27 | P = P - 27 (0x0576)
0x0592 (0x000B24) 0x2100- f:00020 d: 256 | A = OR[256]
0x0593 (0x000B26) 0x5800- f:00054 d: 0 | B = A
0x0594 (0x000B28) 0x1014- f:00010 d: 20 | A = 20 (0x0014)
0x0595 (0x000B2A) 0x2920- f:00024 d: 288 | OR[288] = A
0x0596 (0x000B2C) 0x2125- f:00020 d: 293 | A = OR[293]
0x0597 (0x000B2E) 0x0A08- f:00005 d: 8 | A = A < 8 (0x0008)
0x0598 (0x000B30) 0x2526- f:00022 d: 294 | A = A + OR[294]
0x0599 (0x000B32) 0x292B- f:00024 d: 299 | OR[299] = A
0x059A (0x000B34) 0xE000- f:00160 d: 0 | IOB , fn000
0x059B (0x000B36) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x059C (0x000B38) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x059D (0x000B3A) 0x212A- f:00020 d: 298 | A = OR[298]
0x059E (0x000B3C) 0xF800- f:00174 d: 0 | IOB , fn014
0x059F (0x000B3E) 0x212B- f:00020 d: 299 | A = OR[299]
0x05A0 (0x000B40) 0x1C00-0x5000 f:00016 d: 0 | A = A + 20480 (0x5000)
0x05A2 (0x000B44) 0xE400- f:00162 d: 0 | IOB , fn002
0x05A3 (0x000B46) 0x76EC- f:00073 d: 236 | R = P - 236 (0x04B7)
0x05A4 (0x000B48) 0x212A- f:00020 d: 298 | A = OR[298]
0x05A5 (0x000B4A) 0x290D- f:00024 d: 269 | OR[269] = A
0x05A6 (0x000B4C) 0x2102- f:00020 d: 258 | A = OR[258]
0x05A7 (0x000B4E) 0x1420- f:00012 d: 32 | A = A + 32 (0x0020)
0x05A8 (0x000B50) 0x290E- f:00024 d: 270 | OR[270] = A
0x05A9 (0x000B52) 0x1008- f:00010 d: 8 | A = 8 (0x0008)
0x05AA (0x000B54) 0x290F- f:00024 d: 271 | OR[271] = A
0x05AB (0x000B56) 0x7006- f:00070 d: 6 | P = P + 6 (0x05B1)
0x05AC (0x000B58) 0x310D- f:00030 d: 269 | A = (OR[269])
0x05AD (0x000B5A) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x05AE (0x000B5C) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x05AF (0x000B5E) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x05B0 (0x000B60) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x05B1 (0x000B62) 0x210F- f:00020 d: 271 | A = OR[271]
0x05B2 (0x000B64) 0x8E06- f:00107 d: 6 | P = P - 6 (0x05AC), A # 0
0x05B3 (0x000B66) 0xE000- f:00160 d: 0 | IOB , fn000
0x05B4 (0x000B68) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x05B5 (0x000B6A) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x05B6 (0x000B6C) 0x2102- f:00020 d: 258 | A = OR[258]
0x05B7 (0x000B6E) 0x1430- f:00012 d: 48 | A = A + 48 (0x0030)
0x05B8 (0x000B70) 0x2913- f:00024 d: 275 | OR[275] = A
0x05B9 (0x000B72) 0xF800- f:00174 d: 0 | IOB , fn014
0x05BA (0x000B74) 0x212B- f:00020 d: 299 | A = OR[299]
0x05BB (0x000B76) 0x1C00-0x4000 f:00016 d: 0 | A = A + 16384 (0x4000)
0x05BD (0x000B7A) 0xE400- f:00162 d: 0 | IOB , fn002
0x05BE (0x000B7C) 0x7707- f:00073 d: 263 | R = P - 263 (0x04B7)
0x05BF (0x000B7E) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x05C0 (0x000B80) 0x2930- f:00024 d: 304 | OR[304] = A
0x05C1 (0x000B82) 0x212A- f:00020 d: 298 | A = OR[298]
0x05C2 (0x000B84) 0x2931- f:00024 d: 305 | OR[305] = A
0x05C3 (0x000B86) 0x1130- f:00010 d: 304 | A = 304 (0x0130)
0x05C4 (0x000B88) 0x5800- f:00054 d: 0 | B = A
0x05C5 (0x000B8A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x05C6 (0x000B8C) 0x7C09- f:00076 d: 9 | R = OR[9]
0x05C7 (0x000B8E) 0x0200- f:00001 d: 0 | EXIT
0x05C8 (0x000B90) 0x0000- f:00000 d: 0 | PASS
0x05C9 (0x000B92) 0x003F- f:00000 d: 63 | PASS | **** non-standard encoding with D:0x003F ****
0x05CA (0x000B94) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05CB (0x000B96) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05CC (0x000B98) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05CD (0x000B9A) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05CE (0x000B9C) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05CF (0x000B9E) 0x0000- f:00000 d: 0 | PASS
0x05D0 (0x000BA0) 0x0000- f:00000 d: 0 | PASS
0x05D1 (0x000BA2) 0x0005- f:00000 d: 5 | PASS | **** non-standard encoding with D:0x0005 ****
0x05D2 (0x000BA4) 0x0000- f:00000 d: 0 | PASS
0x05D3 (0x000BA6) 0x0000- f:00000 d: 0 | PASS
0x05D4 (0x000BA8) 0x0000- f:00000 d: 0 | PASS
0x05D5 (0x000BAA) 0x0000- f:00000 d: 0 | PASS
0x05D6 (0x000BAC) 0x0000- f:00000 d: 0 | PASS
0x05D7 (0x000BAE) 0x0001- f:00000 d: 1 | PASS | **** non-standard encoding with D:0x0001 ****
0x05D8 (0x000BB0) 0x003F- f:00000 d: 63 | PASS | **** non-standard encoding with D:0x003F ****
0x05D9 (0x000BB2) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05DA (0x000BB4) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05DB (0x000BB6) 0x0000- f:00000 d: 0 | PASS
0x05DC (0x000BB8) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05DD (0x000BBA) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05DE (0x000BBC) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05DF (0x000BBE) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05E0 (0x000BC0) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05E1 (0x000BC2) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05E2 (0x000BC4) 0x0000- f:00000 d: 0 | PASS
0x05E3 (0x000BC6) 0x0000- f:00000 d: 0 | PASS
0x05E4 (0x000BC8) 0x0000- f:00000 d: 0 | PASS
0x05E5 (0x000BCA) 0x0000- f:00000 d: 0 | PASS
0x05E6 (0x000BCC) 0x0002- f:00000 d: 2 | PASS | **** non-standard encoding with D:0x0002 ****
0x05E7 (0x000BCE) 0x008C- f:00000 d: 140 | PASS | **** non-standard encoding with D:0x008C ****
0x05E8 (0x000BD0) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05E9 (0x000BD2) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05EA (0x000BD4) 0x0000- f:00000 d: 0 | PASS
0x05EB (0x000BD6) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05EC (0x000BD8) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05ED (0x000BDA) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05EE (0x000BDC) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05EF (0x000BDE) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05F0 (0x000BE0) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05F1 (0x000BE2) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05F2 (0x000BE4) 0x002D- f:00000 d: 45 | PASS | **** non-standard encoding with D:0x002D ****
0x05F3 (0x000BE6) 0x0001- f:00000 d: 1 | PASS | **** non-standard encoding with D:0x0001 ****
0x05F4 (0x000BE8) 0x0000- f:00000 d: 0 | PASS
0x05F5 (0x000BEA) 0x0003- f:00000 d: 3 | PASS | **** non-standard encoding with D:0x0003 ****
0x05F6 (0x000BEC) 0x003F- f:00000 d: 63 | PASS | **** non-standard encoding with D:0x003F ****
0x05F7 (0x000BEE) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05F8 (0x000BF0) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05F9 (0x000BF2) 0x0000- f:00000 d: 0 | PASS
0x05FA (0x000BF4) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05FB (0x000BF6) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05FC (0x000BF8) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05FD (0x000BFA) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x05FE (0x000BFC) 0x001E- f:00000 d: 30 | PASS | **** non-standard encoding with D:0x001E ****
0x05FF (0x000BFE) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0600 (0x000C00) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0601 (0x000C02) 0x0003- f:00000 d: 3 | PASS | **** non-standard encoding with D:0x0003 ****
0x0602 (0x000C04) 0x0001- f:00000 d: 1 | PASS | **** non-standard encoding with D:0x0001 ****
0x0603 (0x000C06) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0604 (0x000C08) 0x0004- f:00000 d: 4 | PASS | **** non-standard encoding with D:0x0004 ****
0x0605 (0x000C0A) 0x003F- f:00000 d: 63 | PASS | **** non-standard encoding with D:0x003F ****
0x0606 (0x000C0C) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0607 (0x000C0E) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0608 (0x000C10) 0x000F- f:00000 d: 15 | PASS | **** non-standard encoding with D:0x000F ****
0x0609 (0x000C12) 0x0000- f:00000 d: 0 | PASS
0x060A (0x000C14) 0x0000- f:00000 d: 0 | PASS
0x060B (0x000C16) 0x0000- f:00000 d: 0 | PASS
0x060C (0x000C18) 0x0000- f:00000 d: 0 | PASS
0x060D (0x000C1A) 0x0000- f:00000 d: 0 | PASS
0x060E (0x000C1C) 0x0000- f:00000 d: 0 | PASS
0x060F (0x000C1E) 0x0000- f:00000 d: 0 | PASS
0x0610 (0x000C20) 0x0000- f:00000 d: 0 | PASS
0x0611 (0x000C22) 0x0000- f:00000 d: 0 | PASS
0x0612 (0x000C24) 0x0000- f:00000 d: 0 | PASS
0x0613 (0x000C26) 0x0000- f:00000 d: 0 | PASS
0x0614 (0x000C28) 0x0000- f:00000 d: 0 | PASS
0x0615 (0x000C2A) 0x0000- f:00000 d: 0 | PASS
0x0616 (0x000C2C) 0x0000- f:00000 d: 0 | PASS
0x0617 (0x000C2E) 0x0000- f:00000 d: 0 | PASS
|
oeis/199/A199110.asm | neoneye/loda-programs | 11 | 169569 | ; A199110: a(n) = 7*3^n+1.
; 8,22,64,190,568,1702,5104,15310,45928,137782,413344,1240030,3720088,11160262,33480784,100442350,301327048,903981142,2711943424,8135830270,24407490808,73222472422,219667417264,659002251790,1977006755368,5931020266102,17793060798304,53379182394910,160137547184728,480412641554182,1441237924662544,4323713773987630,12971141321962888,38913423965888662,116740271897665984,350220815692997950,1050662447078993848,3151987341236981542,9455962023710944624,28367886071132833870,85103658213398501608
mov $1,3
pow $1,$0
mul $1,7
add $1,1
mov $0,$1
|
lib/target/enterprise/classic/enterprise_crt0.asm | Toysoft/z88dk | 0 | 22734 | <reponame>Toysoft/z88dk
;
; Enterprise 64/128 C stub
;
; <NAME> - 2011
;
;
; $Id: enterprise_crt0.asm,v 1.24 2016-07-15 21:03:25 dom Exp $
;
; There are a couple of #pragma commands which affect
; this file:
;
; #pragma no-streams - No stdio disc files
; #pragma no-fileio - No fileio at all
; #pragma no-protectmsdos - strip the MS-DOS protection header
;
; These can cut down the size of the resultant executable
MODULE enterprise_crt0
;
; Initially include the zcc_opt.def file to find out lots of lovely
; information about what we should do..
;
defc crt0 = 1
INCLUDE "zcc_opt.def"
;--------
; Some scope definitions
;--------
EXTERN _main
PUBLIC cleanup
PUBLIC l_dcal
; Enterprise 64/128 specific stuff
PUBLIC warmreset
PUBLIC set_exos_multi_variables
PUBLIC _DEV_VIDEO
PUBLIC _DEV_KEYBOARD
PUBLIC _DEV_NET
PUBLIC _DEV_EDITOR
PUBLIC _DEV_SERIAL
PUBLIC _DEV_TAPE
PUBLIC _DEV_PRINTER
PUBLIC _DEV_SOUND
PUBLIC _esccmd
PUBLIC _esccmd_cmd
PUBLIC _esccmd_x
PUBLIC _esccmd_y
PUBLIC _esccmd_p1
PUBLIC _esccmd_p2
PUBLIC _esccmd_p3
PUBLIC _esccmd_p4
PUBLIC _esccmd_p5
PUBLIC _esccmd_p6
PUBLIC _esccmd_p7
PUBLIC _esccmd_p8
PUBLIC _esccmd_p9
PUBLIC _esccmd_env
PUBLIC _esccmd_p
PUBLIC _esccmd_vl
PUBLIC _esccmd_vr
PUBLIC _esccmd_sty
PUBLIC _esccmd_ch
PUBLIC _esccmd_d
PUBLIC _esccmd_f
PUBLIC _esccmd_en
PUBLIC _esccmd_ep
PUBLIC _esccmd_er
PUBLIC _esccmd_phase
PUBLIC _esccmd_cp
PUBLIC _esccmd_cl
PUBLIC _esccmd_cr
PUBLIC _esccmd_pd
defc TAR__clib_exit_stack_size = 32
defc TAR__register_sp = 0x7f00
defc __CPU_CLOCK = 4000000
INCLUDE "crt/classic/crt_rules.inc"
IF !DEFINED_CRT_ORG_CODE
defc CRT_ORG_CODE = 100h
ENDIF
org CRT_ORG_CODE
;----------------------
; Execution starts here
;----------------------
start:
IF (startup=2)
IF !DEFINED_noprotectmsdos
; This protection takes little less than 50 bytes
defb $eb,$04 ;MS DOS protection... JMPS to MS-DOS message if Intel
ex de,hl
jp begin ;First decent instruction for Z80, if survived up to here !
defb $b4,$09 ;DOS protection... MOV AH,9 (Err msg for MS-DOS)
defb $ba
defw dosmessage ;DOS protection... MOV DX,OFFSET dosmessage
defb $cd,$21 ;DOS protection... INT 21h.
defb $cd,$20 ;DOS protection... INT 20h.
dosmessage:
defm "This program is for the Enterprise computer."
defb 13,10,'$'
begin:
ENDIF
ENDIF
; Inspired by the DizzyLord loader by ORKSOFT
;di
ld (start1+1),sp
ld a, 004h
out (0bfh), a
INCLUDE "crt/classic/crt_init_sp.asm"
ld a, 0ffh
out (0b2h), a
ld c, 060h
rst 30h
defb 0
ld hl, __VideoVariables
call set_exos_multi_variables
call daveReset
halt
halt
ld a, 66h
ld de, _DEV_VIDEO
rst 30h
defb 1
ld a, 69h
ld de, _DEV_KEYBOARD
rst 30h
defb 1
; ld a, 66h
; ld b, 4 ; @@FONT
; rst 30h
; defb 11
ld a, 66h
ld bc, $0101 ; @@DISP, from first line
ld de, $1901 ; to line 25, at screen line 1
rst 30h
defb 11 ; set 40x25 characters window
INCLUDE "crt/classic/crt_init_atexit.asm"
call crt0_init_bss
ld (exitsp),sp
; 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:
;
; Deallocate memory which has been allocated here!
;
IF CRT_ENABLE_STDIO = 1
EXTERN closeall
call closeall
ENDIF
IF (!DEFINED_startup | (startup=1))
warmreset:
ld sp, 0100h
ld a, 0ffh
out (0b2h), a
ld c, 60h
rst 30h
defb 0
ld de, _basiccmd
rst 30h
defb 26
ld a, 01h
out (0b3h), a
ld a, 6
jp 0c00dh
_basiccmd:
defb 5
defm "BASIC"
ENDIF
start1:
ld sp,0
ret
l_dcal:
jp (hl)
set_exos_multi_variables:
_l1: ld b, 1
ld c, (hl)
inc c
dec c
ret z
inc hl
ld d, (hl)
inc hl
rst 30h
defb 16
jr _l1
ret
daveReset:
push bc
xor a
ld bc, 010afh
_l2: out (c), a
dec c
djnz _l2
pop bc
ret
_DEV_VIDEO:
defb 6
defm "VIDEO:"
_DEV_KEYBOARD:
defb 9
defm "KEYBOARD:"
_DEV_EDITOR:
defb 4
defm "EDITOR:"
_DEV_NET:
defb 4
defm "NET:"
_DEV_SERIAL:
defb 7
defm "SERIAL:"
_DEV_TAPE:
defb 5
defm "TAPE:"
_DEV_PRINTER:
defb 8
defm "PRINTER:"
_DEV_SOUND:
defb 6
defm "SOUND:"
_esccmd:
defb 27
_esccmd_cmd:
defb 0
_esccmd_x:
_esccmd_p1:
_esccmd_env:
_esccmd_en:
defb 0
_esccmd_p2:
_esccmd_p:
_esccmd_ep:
defb 0
_esccmd_y:
_esccmd_p3:
_esccmd_er:
defb 0
_esccmd_phase:
_esccmd_p4:
_esccmd_vl:
_esccmd_cp:
defb 0
_esccmd_p5:
_esccmd_vr:
defb 0
_esccmd_p6:
_esccmd_sty:
_esccmd_cl:
defb 0
_esccmd_p7:
_esccmd_ch:
defb 0
_esccmd_p8:
_esccmd_d:
_esccmd_cr:
defb 0
_esccmd_p9:
_esccmd_pd:
defb 0
_esccmd_f:
defb 0
__VideoVariables:
defb 22, 0 ; MODE_VID - hw text mode
defb 23, 0 ; COLR_VID - mono
defb 24, 40 ; X_SIZ_VID
defb 25, 25 ; Y_SIZ_VID
defb 0
defm "Small C+ Enterprise"
end: defb 0
INCLUDE "crt/classic/crt_runtime_selection.asm"
INCLUDE "crt/classic/crt_section.asm"
|
Ada/problem_7/problem_7.ads | PyllrNL/Project_Euler_Solutions | 0 | 6982 | with Test_Solution; use Test_Solution;
with Ada.Containers.Vectors;
package Problem_7 is
type Int64 is range -2**63 .. 2**63 - 1;
package P is new Ada.Containers.Vectors(Index_Type => Natural, Element_Type => Int64);
function Solution_1( Num : Integer ) return Int64;
procedure Test_Solution_1;
function Get_Solutions return Solution_Case;
end Problem_7;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.