source
stringclasses 1
value | id
stringlengths 40
40
| language
stringclasses 2
values | date
stringclasses 1
value | author
stringclasses 1
value | url
stringclasses 1
value | title
stringclasses 1
value | extra
stringlengths 528
1.53k
| quality_signals
stringlengths 139
178
| text
stringlengths 6
1.05M
|
---|---|---|---|---|---|---|---|---|---|
TheStack | 0ec482549b8ea32575002c7ec348dd79634e28bc | Assemblycode:Assembly | {"size": 785, "ext": "asm", "max_stars_repo_path": "programs/oeis/223/A223578.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/223/A223578.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/223/A223578.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.2162162162, "max_line_length": 192, "alphanum_fraction": 0.549044586} | ; A223578: Positive integers n for which f(-n-1) < f(-n) < f(-n+1), where f(m) = floor(cot(Pi/(2m))).
; 2,3,4,7,12,15,18,23,26,29,34,37,40,45,48,51,54,59,62,65,70,73,76,81,84,87,92,95,98,103,106,109,114,117,120,125,128,131,136,139,142,147,150,153,158,161,164,169,172,175,180,183,186,191,194,197
mov $3,$0
add $3,1
mov $9,$0
lpb $3
mov $0,$9
sub $3,1
sub $0,$3
mov $5,$0
mov $7,2
lpb $7
mov $0,$5
sub $7,1
add $0,$7
sub $0,1
cal $0,223577 ; Positive integers n for which there is exactly one negative integer m such that -n = floor(cot(pi/(2m))).
mov $4,$0
add $4,$0
mov $2,$4
add $2,1
mov $8,$7
lpb $8
mov $6,$2
sub $8,1
lpe
lpe
lpb $5
mov $5,0
sub $6,$2
lpe
mov $2,$6
sub $2,1
add $1,$2
lpe
|
||||
TheStack | 491f8b1c9af14e1a88f26548b78e19c6335511db | Assemblycode:Assembly | {"size": 1943, "ext": "asm", "max_stars_repo_path": "programs/oeis/177/A177099.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/177/A177099.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/177/A177099.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 176.6363636364, "max_line_length": 1840, "alphanum_fraction": 0.8450849202} | ; A177099: a(n) = 81*n^2 + 2*n.
; 83,328,735,1304,2035,2928,3983,5200,6579,8120,9823,11688,13715,15904,18255,20768,23443,26280,29279,32440,35763,39248,42895,46704,50675,54808,59103,63560,68179,72960,77903,83008,88275,93704,99295,105048,110963,117040,123279,129680,136243,142968,149855,156904,164115,171488,179023,186720,194579,202600,210783,219128,227635,236304,245135,254128,263283,272600,282079,291720,301523,311488,321615,331904,342355,352968,363743,374680,385779,397040,408463,420048,431795,443704,455775,468008,480403,492960,505679,518560,531603,544808,558175,571704,585395,599248,613263,627440,641779,656280,670943,685768,700755,715904,731215,746688,762323,778120,794079,810200,826483,842928,859535,876304,893235,910328,927583,945000,962579,980320,998223,1016288,1034515,1052904,1071455,1090168,1109043,1128080,1147279,1166640,1186163,1205848,1225695,1245704,1265875,1286208,1306703,1327360,1348179,1369160,1390303,1411608,1433075,1454704,1476495,1498448,1520563,1542840,1565279,1587880,1610643,1633568,1656655,1679904,1703315,1726888,1750623,1774520,1798579,1822800,1847183,1871728,1896435,1921304,1946335,1971528,1996883,2022400,2048079,2073920,2099923,2126088,2152415,2178904,2205555,2232368,2259343,2286480,2313779,2341240,2368863,2396648,2424595,2452704,2480975,2509408,2538003,2566760,2595679,2624760,2654003,2683408,2712975,2742704,2772595,2802648,2832863,2863240,2893779,2924480,2955343,2986368,3017555,3048904,3080415,3112088,3143923,3175920,3208079,3240400,3272883,3305528,3338335,3371304,3404435,3437728,3471183,3504800,3538579,3572520,3606623,3640888,3675315,3709904,3744655,3779568,3814643,3849880,3885279,3920840,3956563,3992448,4028495,4064704,4101075,4137608,4174303,4211160,4248179,4285360,4322703,4360208,4397875,4435704,4473695,4511848,4550163,4588640,4627279,4666080,4705043,4744168,4783455,4822904,4862515,4902288,4942223,4982320,5022579,5063000
mov $1,$0
mul $1,9
pow $1,2
add $1,83
mov $2,$0
mul $2,164
add $1,$2
|
||||
TheStack | ac05b3af1446f236e30abb41324b3cd931d4088a | Assemblycode:Assembly | {"size": 2743, "ext": "asm", "max_stars_repo_path": "unused/develop/obj/spritesheet_6_tiles.asm", "max_stars_repo_name": "pau-tomas/gbvm", "max_stars_repo_stars_event_min_datetime": "2020-12-27T11:53:23.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-19T23:05:12.000Z", "max_issues_repo_path": "unused/develop/obj/spritesheet_6_tiles.asm", "max_issues_repo_name": "pau-tomas/gbvm", "max_issues_repo_issues_event_min_datetime": "2020-12-10T16:53:53.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-31T21:42:01.000Z", "max_forks_repo_path": "unused/develop/obj/spritesheet_6_tiles.asm", "max_forks_repo_name": "pau-tomas/gbvm", "max_forks_repo_forks_event_min_datetime": "2021-04-18T08:09:16.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-31T21:52:24.000Z"} | {"max_stars_count": 33, "max_issues_count": 2, "max_forks_count": 6, "avg_line_length": 24.0614035088, "max_line_length": 57, "alphanum_fraction": 0.3718556325} | ;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 4.1.4 #12246 (Mac OS X x86_64)
;--------------------------------------------------------
.module spritesheet_6_tiles
.optsdcc -mgbz80
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _spritesheet_6_tiles
.globl ___bank_spritesheet_6_tiles
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _DATA
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _INITIALIZED
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area _DABS (ABS)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area _HOME
.area _GSINIT
.area _GSFINAL
.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area _HOME
.area _HOME
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area _CODE_255
.area _CODE_255
___bank_spritesheet_6_tiles = 0x00ff
_spritesheet_6_tiles:
.dw #0x0004
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x3f ; 63
.db #0x3f ; 63
.db #0x40 ; 64
.db #0x7f ; 127
.db #0x5f ; 95
.db #0x60 ; 96
.db #0x5f ; 95
.db #0x6e ; 110 'n'
.db #0x5f ; 95
.db #0x6a ; 106 'j'
.db #0x5f ; 95
.db #0x6d ; 109 'm'
.db #0x5f ; 95
.db #0x60 ; 96
.db #0x40 ; 64
.db #0x7f ; 127
.db #0x3f ; 63
.db #0x3f ; 63
.db #0x02 ; 2
.db #0x03 ; 3
.db #0x02 ; 2
.db #0x03 ; 3
.db #0x02 ; 2
.db #0x03 ; 3
.db #0x02 ; 2
.db #0x03 ; 3
.db #0x03 ; 3
.db #0x03 ; 3
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0xfc ; 252
.db #0xfc ; 252
.db #0x02 ; 2
.db #0xfe ; 254
.db #0xfa ; 250
.db #0x06 ; 6
.db #0xfa ; 250
.db #0xd6 ; 214
.db #0xfa ; 250
.db #0xb6 ; 182
.db #0xfa ; 250
.db #0x56 ; 86 'V'
.db #0xfa ; 250
.db #0x06 ; 6
.db #0x02 ; 2
.db #0xfe ; 254
.db #0xfc ; 252
.db #0xfc ; 252
.db #0x40 ; 64
.db #0xc0 ; 192
.db #0xc0 ; 192
.db #0x40 ; 64
.db #0xc0 ; 192
.db #0x40 ; 64
.db #0xc0 ; 192
.db #0x40 ; 64
.db #0xc0 ; 192
.db #0xc0 ; 192
.area _INITIALIZER
.area _CABS (ABS)
|
||||
TheStack | d629d90d2b8ba3877fb3138fe482a3f627466ba2 | Assemblycode:Assembly | {"size": 1611, "ext": "asm", "max_stars_repo_path": "programs/oeis/166/A166588.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/166/A166588.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/166/A166588.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 123.9230769231, "max_line_length": 1399, "alphanum_fraction": 0.8919925512} | ; A166588: Partial sums of A097331; binomial transform of A166587.
; 1,2,2,3,3,5,5,10,10,24,24,66,66,198,198,627,627,2057,2057,6919,6919,23715,23715,82501,82501,290513,290513,1033413,1033413,3707853,3707853,13402698,13402698,48760368,48760368,178405158,178405158,656043858,656043858,2423307048,2423307048,8987427468,8987427468,33453694488,33453694488,124936258128,124936258128,467995871778,467995871778,1757900019102,1757900019102,6619846420554,6619846420554,24987199492706,24987199492706,94520750408710,94520750408710,358268702159070,358268702159070,1360510918810438,1360510918810438,5175497420902742,5175497420902742,19720133460129651,19720133460129651,75254198337177849,75254198337177849,287590328749420959,287590328749420959,1100534370899151723,1100534370899151723,4216819865806452985,4216819865806452985,16176618251666906477,16176618251666906477,62127422576288648841,62127422576288648841,238861285363295350241,238861285363295350241,919286657093271150631,919286657093271150631,3541413699369763259451,3541413699369763259451,13655332291007661393471,13655332291007661393471,52699762202912105352711,52699762202912105352711,203553241407997457013411,203553241407997457013411,786853361000994150101451,786853361000994150101451,3043971215078242223355171,3043971215078242223355171,11784299926611415613401491,11784299926611415613401491,45653073683802462499830981,45653073683802462499830981,176980971925971827977822881,176980971925971827977822881,686533217105588966032431453
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,126120 ; Catalan numbers (A000108) interpolated with 0's.
add $1,$2
lpe
add $1,1
mov $0,$1
|
||||
TheStack | 722207ac8028518729db9a9b4903ec19eb4d089a | Assemblycode:Assembly | {"size": 79, "ext": "asm", "max_stars_repo_path": "mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/shl32.asm", "max_stars_repo_name": "gb-archive/really-old-stuff", "max_stars_repo_stars_event_min_datetime": "2016-10-27T20:46:02.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-01T15:49:13.000Z", "max_issues_repo_path": "mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/shl32.asm", "max_issues_repo_name": "gb-archive/really-old-stuff", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/shl32.asm", "max_forks_repo_name": "gb-archive/really-old-stuff", "max_forks_repo_forks_event_min_datetime": "2015-03-11T14:28:08.000Z", "max_forks_repo_forks_event_max_datetime": "2017-11-02T10:57:57.000Z"} | {"max_stars_count": 10, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 7.9, "max_line_length": 37, "alphanum_fraction": 0.5696202532} |
__SHL32: ; Left Logical Shift 32 bits
sla l
rl h
rl e
rl d
ret
|
||||
TheStack | 6f5934d06eb3d5c4223de1c2b276d7ec7b619256 | Assemblycode:Assembly | {"size": 332, "ext": "asm", "max_stars_repo_path": "programs/oeis/330/A330003.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/330/A330003.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/330/A330003.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.2, "max_line_length": 205, "alphanum_fraction": 0.656626506} | ; A330003: Beatty sequence for (x+1)^2, where 1/x + 1/(x+1)^2 = 1.
; 5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,106,111,116,121,126,131,136,141,146,151,156,161,166,171,176,181,186,191,196,201,207,212,217,222,227,232,237,242,247,252,257,262,267,272,277,282
mov $1,$0
div $1,20
add $1,5
mov $2,$0
mul $2,5
add $1,$2
|
||||
TheStack | 97c4e275d9cd75758b72c9c88be8cabe5011d7c6 | Assemblycode:Assembly | {"size": 230, "ext": "asm", "max_stars_repo_path": "programs/oeis/011/A011931.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/011/A011931.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/011/A011931.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 32.8571428571, "max_line_length": 165, "alphanum_fraction": 0.6913043478} | ; A011931: [ n(n-1)(n-2)(n-3)/21 ].
; 0,0,0,0,1,5,17,40,80,144,240,377,565,817,1144,1560,2080,2720,3497,4429,5537,6840,8360,10120,12144,14457,17085,20057,23400,27144,31320,35960,41097,46765,53001,59840
bin $0,4
mul $0,8
div $0,7
|
||||
TheStack | b250f93480a351491fdfb4da615c9e4a065960a9 | Assemblycode:Assembly | {"size": 659, "ext": "asm", "max_stars_repo_path": "Etapa 01/Aula 03 - Registradores e Instr. MOV/codes/a03e03.asm", "max_stars_repo_name": "bellorini/unioeste", "max_stars_repo_stars_event_min_datetime": "2021-11-03T20:19:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-23T17:57:58.000Z", "max_issues_repo_path": "Etapa 01/Aula 03 - Registradores e Instr. MOV/codes/a03e03.asm", "max_issues_repo_name": "bellorini/unioeste", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Etapa 01/Aula 03 - Registradores e Instr. MOV/codes/a03e03.asm", "max_forks_repo_name": "bellorini/unioeste", "max_forks_repo_forks_event_min_datetime": "2022-02-02T15:48:45.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-22T18:17:52.000Z"} | {"max_stars_count": 6, "max_issues_count": null, "max_forks_count": 5, "avg_line_length": 16.475, "max_line_length": 63, "alphanum_fraction": 0.6282245827} | ; Aula 03 - Registradores e MOV
; arquivo: a03e03.asm
; objetivo: acesso aos dados dos registradores e transferencias
; nasm -f elf64 a03e03.asm ; ld a03e03.o -o a03e03.x
section .data
v1: dq 0x1111111122334455
v2: dq 0x0000000000000000
v3: dq 0x0000000000000000
section .text
global _start
_start:
pt1:
mov al , [v1]
mov ebx, [v1]
mov rcx, [v1]
pt2:
mov [v2], al
mov [v2], ebx
mov [v2], rcx
pt3:
mov al , 0x10
mov ebx, 0x20202020
mov rcx, 0x3030303030303030
pt4:
mov byte [v3], 0x10
mov word [v3], 0x1515
mov dword [v3], 0x20202020
fim:
mov rax, 60
mov rdi, 0
syscall
|
||||
TheStack | 68a3444cda2de780acd06c2165145f00acdcaddb | Assemblycode:Assembly | {"size": 4927, "ext": "asm", "max_stars_repo_path": "src/z3/randomizer/darkworldspawn.asm", "max_stars_repo_name": "PJBoy/alttp_sm_combo_randomizer_rom", "max_stars_repo_stars_event_min_datetime": "2018-05-03T06:43:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-16T13:17:01.000Z", "max_issues_repo_path": "src/z3/randomizer/darkworldspawn.asm", "max_issues_repo_name": "PJBoy/alttp_sm_combo_randomizer_rom", "max_issues_repo_issues_event_min_datetime": "2018-05-08T20:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-20T21:28:53.000Z", "max_forks_repo_path": "src/z3/randomizer/darkworldspawn.asm", "max_forks_repo_name": "PJBoy/alttp_sm_combo_randomizer_rom", "max_forks_repo_forks_event_min_datetime": "2018-05-04T12:25:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T20:27:57.000Z"} | {"max_stars_count": 31, "max_issues_count": 13, "max_forks_count": 26, "avg_line_length": 36.2279411765, "max_line_length": 113, "alphanum_fraction": 0.5408970976} | ;================================================================================
; Dark World Spawn Location Fix & Master Sword Grove Fix
;--------------------------------------------------------------------------------
DarkWorldSaveFix:
LDA.b #$a0 : PHA : PLB ; thing we wrote over - data bank change
JSL.l zelda_save_start_hook
JSL.l DarkWorldFlagSet
JSL.l MasterSwordFollowerClear
JSL.l StatSaveCounter
RTL
;--------------------------------------------------------------------------------
DarkWorldLoadFix:
SEP #$20 ; set 8 bit accumulator
JSL.l OnFileLoad ;TODO FIX
REP #$20 ; restore 16 bit accumulator
JSL.l zelda_copy_sm_items ; ALTTSM - Copy items from real SM SRAM to ALTTP temp buffer
LDA.w #$0007 : STA $7EC00D : STA $7EC013 ; thing we wrote over - sets up some graphics timers
RTL
;--------------------------------------------------------------------------------
DarkWorldFlagSet:
PHA
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BEQ +
LDA $10 : CMP #$12 : BEQ .done ; don't do anything in death mode
+
LDA $1B : BEQ + ; skip this unless indoors - THIS PART FIXES THE OTHER FUCKUP WITH THE PYRAMID SPAWN IN GLITCHED
LDA $A0 : BEQ .done ; skip if we died in ganon's room
+
JSL.l DoWorldFix
.done
PLA
RTL
;--------------------------------------------------------------------------------
DoWorldFix:
LDA.l Bugfix_MirrorlessSQToLW : BEQ +
LDA $7EF353 : BEQ .noMirror ; check if we have the mirror
+
LDA $7EF3C5 : CMP.b #$03 : !BLT .aga1Alive ; check if agahnim 1 is alive
BRA .done
.noMirror
.aga1Alive
LDA #$00 : STA $7EF3CA ; set flag to light world
LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$08 : STA $7EF3CC : + ; convert frog to dwarf
.done
RTL
;--------------------------------------------------------------------------------
SetDeathWorldChecked:
LDA $1B : BEQ + ; skip this for indoors
LDA $040C : CMP #$FF : BNE .done ; unless it's a cave
; check if we died in ganon's room and pyramid respawn is enabled
LDA $A0 : BNE +
LDA $A1 : BNE +
LDA GanonPyramidRespawn : BEQ +
BRA .pyramid
+
JMP DoWorldFix
.pyramid
LDA #$40 : STA $7EF3CA ; set flag to dark world
LDA $7EF3CC : CMP #$08 : BNE + : LDA.b #$07 : STA $7EF3CC : + ; convert dwarf to frog
.done
RTL
;--------------------------------------------------------------------------------
FakeWorldFix:
LDA FixFakeWorld : BEQ +
LDA $8A : AND.b #$40 : STA $7EF3CA
+
RTL
;--------------------------------------------------------------------------------
MasterSwordFollowerClear:
LDA $7EF3CC
CMP #$0E : BEQ .clear ; clear master sword follower
;CMP #$07 : BEQ .clear ; clear frog
;CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
RTL
.clear
LDA.b #$00 : STA $7EF3CC ; clear follower
RTL
;--------------------------------------------------------------------------------
FixAgahnimFollowers:
LDA.b #$00 : STA $7EF3CC ; clear follower
JSL PrepDungeonExit ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
macro SetMinimum(base,filler,compare)
LDA.l <compare> : !SUB.l <base> : !BLT ?done
STA.l <filler>
?done:
endmacro
RefreshRainAmmo:
LDA $7EF3C5 : CMP.b #$01 : BEQ + : RTL : + ; check if we're in rain state
.rain
LDA $7EF3C8
+ CMP.b #$03 : BNE + ; Uncle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Uncle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Uncle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Uncle)
BRA .done
+ CMP.b #$02 : BNE + ; Cell
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Cell)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Cell)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Cell)
BRA .done
+ CMP.b #$04 : BNE + ; Mantle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Mantle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Mantle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Mantle)
+
.done
RTL
;--------------------------------------------------------------------------------
!INFINITE_ARROWS = "$7F50C8"
!INFINITE_BOMBS = "$7F50C9"
!INFINITE_MAGIC = "$7F50CA"
SetEscapeAssist:
LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state
.rain
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : +
BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : +
BIT.b #$01 : BEQ + : STA !INFINITE_ARROWS : +
BRA ++
.notrain
LDA.l EscapeAssist : BIT.b #$04 : BEQ + : LDA.b #$00 : STA !INFINITE_MAGIC : +
LDA.l EscapeAssist : BIT.b #$02 : BEQ + : LDA.b #$00 : STA !INFINITE_BOMBS : +
LDA.l EscapeAssist : BIT.b #$01 : BEQ + : LDA.b #$00 : STA !INFINITE_ARROWS : +
++
RTL
;--------------------------------------------------------------------------------
SetSilverBowMode:
LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode
LDA $7EF340 : CMP.b #$3 : !BLT +
!SUB.b #$02 : STA $7EF340
+
RTL
;================================================================================
|
||||
TheStack | 7bd64f0f4beea5eefe59a54b1be40fd45e304358 | Assemblycode:Assembly | {"size": 350, "ext": "asm", "max_stars_repo_path": "bios/config.asm", "max_stars_repo_name": "zephray/Dramite", "max_stars_repo_stars_event_min_datetime": "2018-09-17T02:13:12.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-12T12:16:59.000Z", "max_issues_repo_path": "bios/config.asm", "max_issues_repo_name": "CapaciPort/Dramite", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "bios/config.asm", "max_forks_repo_name": "CapaciPort/Dramite", "max_forks_repo_forks_event_min_datetime": "2019-12-28T13:15:57.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-13T17:24:14.000Z"} | {"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 35.0, "max_line_length": 80, "alphanum_fraction": 0.3457142857} | ;*******************************************************************************
; Test BIOS - Project Dramite
;
; Copyright 2021 Wenting Zhang
;
; Licensed under MIT
;*******************************************************************************
%define DATE "01/01/70" ; BIOS release date
%define MODEL_BYTE 0fch ; IBM PC/AT |
||||
TheStack | 36674370a8adff9723c5de8305cd43fc7658de24 | Assemblycode:Assembly | {"size": 9197, "ext": "asm", "max_stars_repo_path": "Musics/Othersongs/source/Loading.asm", "max_stars_repo_name": "kosmonautdnb/TheLandsOfZador", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Musics/Othersongs/source/Loading.asm", "max_issues_repo_name": "kosmonautdnb/TheLandsOfZador", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Musics/Othersongs/source/Loading.asm", "max_forks_repo_name": "kosmonautdnb/TheLandsOfZador", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.3426395939, "max_line_length": 28, "alphanum_fraction": 0.7719908666} | kp_song
kp_reloc
dc.w kp_song_registers
dc.w kp_speed
dc.w kp_grooveboxpos
dc.w kp_grooveboxlen
dc.w kp_groovebox
dc.w kp_patternlen
dc.w kp_patternmap_lo
dc.w kp_patternmap_hi
dc.w kp_insmap_lo
dc.w kp_insmap_hi
dc.w kp_volmap_lo
dc.w kp_volmap_hi
dc.w kp_sequence
kp_song_registers
kp_speed
dc.b $02
kp_grooveboxpos
dc.b $00
kp_grooveboxlen
dc.b $04
kp_groovebox
dc.b $06
dc.b $05
dc.b $07
dc.b $05
dc.b $05
dc.b $04
dc.b $06
dc.b $04
kp_patternlen
dc.b $3F
kp_patternmap_lo
dc.b #<patnil
dc.b #<pat1
dc.b #<pat2
dc.b #<pat3
kp_patternmap_hi
dc.b #>patnil
dc.b #>pat1
dc.b #>pat2
dc.b #>pat3
patnil
kp_setinstrument 8,0
kp_settrackregister 0,16
kp_rewind $00
pat1
pat1loop
kp_settrackregister $01,$2C
kp_settrackregister $03,$0E
kp_setinstrument $02,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $01,$24
kp_settrackregister $03,$0E
kp_setinstrument $02,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_rewind [pat1loop-pat1]
pat2
pat2loop
kp_settrackregister $01,$10
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$0F
kp_setinstrument $02,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$04
kp_settrackregister $01,$5C
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_settrackregister $01,$54
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_settrackregister $01,$50
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $01,$10
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $01,$04
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$0F
kp_setinstrument $02,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$04
kp_settrackregister $01,$54
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_settrackregister $01,$50
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_settrackregister $01,$40
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_rewind [pat2loop-pat2]
pat3
pat3loop
kp_settrackregister $01,$48
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$04
kp_settrackregister $01,$50
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $01,$2C
kp_settrackregister $03,$0B
kp_setinstrument $02,$03
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$05
kp_settrackregister $03,$07
kp_settrackregister $00,$01
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $03,$07
kp_settrackregister $00,$05
kp_settrackregister $01,$10
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $01,$04
kp_settrackregister $03,$0F
kp_setinstrument $01,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$01
kp_settrackregister $03,$0F
kp_setinstrument $02,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$1C
kp_rewind [pat3loop-pat3]
kp_insmap_lo
dc.b #<insnil
dc.b #<ins1
dc.b #<ins2
dc.b #<ins3
kp_insmap_hi
dc.b #>insnil
dc.b #>ins1
dc.b #>ins2
dc.b #>ins3
kp_volmap_lo
dc.b #<volnil
dc.b #<vol1
dc.b #<vol2
dc.b #<vol3
kp_volmap_hi
dc.b #>volnil
dc.b #>vol1
dc.b #>vol2
dc.b #>vol3
insnil
KP_OSCV 0,0,0,0,15
KP_OSCJ 0
volnil
KP_VOLV 0,15
KP_VOLJ 0
ins1
ins1loop
KP_OSCV $1C,0,1,1,$02
KP_OSCV $24,0,1,1,$02
KP_OSCV $30,0,1,1,$02
KP_OSCV $40,0,1,1,$02
KP_OSCJ [ins1loop-ins1]
vol1
KP_VOLV $0A,$01
KP_VOLV $08,$01
KP_VOLV $07,$01
KP_VOLV $06,$01
KP_VOLV $05,$01
vol1loop
KP_VOLV $04,$00
KP_VOLJ [vol1loop-vol1]
ins2
KP_OSCV $00,0,1,1,$05
ins2loop
KP_OSCV $00,0,1,1,$03
KP_OSCJ [ins2loop-ins2]
vol2
KP_VOLV $07,$02
KP_VOLV $06,$01
KP_VOLV $05,$00
vol2loop
KP_VOLV $02,$00
KP_VOLJ [vol2loop-vol2]
ins3
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$00
ins3loop
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins3loop-ins3]
vol3
KP_VOLV $08,$00
vol3loop
KP_VOLV $07,$00
KP_VOLJ [vol3loop-vol3]
kp_sequence
dc.b $00,$01,$02,$00
dc.b $00,$01,$03,$00
dc.b $ff
dc.w $0008
|
||||
TheStack | a7a9039a7141df8449099b2424763b4f416abeab | Assemblycode:Assembly | {"size": 2707, "ext": "asm", "max_stars_repo_path": "programs/oeis/302/A302560.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/302/A302560.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/302/A302560.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 84.59375, "max_line_length": 2302, "alphanum_fraction": 0.8330254895} | ; A302560: Partial sums of icosahedral numbers (A006564).
; 1,13,61,185,440,896,1638,2766,4395,6655,9691,13663,18746,25130,33020,42636,54213,68001,84265,103285,125356,150788,179906,213050,250575,292851,340263,393211,452110,517390,589496,668888,756041,851445,955605,1069041,1192288,1325896,1470430,1626470,1794611,1975463,2169651,2377815,2600610,2838706,3092788,3363556,3651725,3958025,4283201,4628013,4993236,5379660,5788090,6219346,6674263,7153691,7658495,8189555,8747766,9334038,9949296,10594480,11270545,11978461,12719213,13493801,14303240,15148560,16030806,16951038,17910331,18909775,19950475,21033551,22160138,23331386,24548460,25812540,27124821,28486513,29898841,31363045,32880380,34452116,36079538,37763946,39506655,41308995,43172311,45097963,47087326,49141790,51262760,53451656,55709913,58038981,60440325,62915425,65465776,68092888,70798286,73583510,76450115,79399671,82433763,85553991,88761970,92059330,95447716,98928788,102504221,106175705,109944945,113813661,117783588,121856476,126034090,130318210,134710631,139213163,143827631,148555875,153399750,158361126,163441888,168643936,173969185,179419565,184997021,190703513,196541016,202511520,208617030,214859566,221241163,227763871,234429755,241240895,248199386,255307338,262566876,269980140,277549285,285276481,293163913,301213781,309428300,317809700,326360226,335082138,343977711,353049235,362299015,371729371,381342638,391141166,401127320,411303480,421672041,432235413,442996021,453956305,465118720,476485736,488059838,499843526,511839315,524049735,536477331,549124663,561994306,575088850,588410900,601963076,615748013,629768361,644026785,658525965,673268596,688257388,703495066,718984370,734728055,750728891,766989663,783513171,800302230,817359670,834688336,852291088,870170801,888330365,906772685,925500681,944517288,963825456,983428150,1003328350,1023529051,1044033263,1064844011,1085964335,1107397290,1129145946,1151213388,1173602716,1196317045,1219359505,1242733241,1266441413,1290487196,1314873780,1339604370,1364682186,1390110463,1415892451,1442031415,1468530635,1495393406,1522623038,1550222856,1578196200,1606546425,1635276901,1664391013,1693892161,1723783760,1754069240,1784752046,1815835638,1847323491,1879219095,1911525955,1944247591,1977387538,2010949346,2044936580,2079352820,2114201661,2149486713,2185211601,2221379965,2257995460,2295061756,2332582538,2370561506,2409002375,2447908875
mov $14,$0
mov $16,$0
add $16,1
lpb $16
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
add $13,1
lpb $13
mov $0,$11
sub $13,1
sub $0,$13
mov $2,5
mov $10,$0
mul $10,3
add $10,1
mul $10,$0
div $10,2
mul $2,$10
add $2,1
add $12,$2
lpe
add $15,$12
lpe
mov $1,$15
|
||||
TheStack | c46c2b4d19ea6cab645a768d23c3a2571284d478 | Assemblycode:Assembly | {"size": 1997, "ext": "asm", "max_stars_repo_path": "programs/oeis/017/A017714.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/017/A017714.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/017/A017714.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 332.8333333333, "max_line_length": 1933, "alphanum_fraction": 0.9499248873} | ; A017714: Binomial coefficients C(n,50).
; 1,51,1326,23426,316251,3478761,32468436,264385836,1916797311,12565671261,75394027566,418094152866,2160153123141,10468434365991,47855699958816,207374699821536,855420636763836,3371363686069236,12736262814039336,46252743903616536,161884603662657876,547324136192795676,1791242627540058576,5685248339583664176,17529515713716297876,52588547141148893628,153720368566435227528,438387717763537500728,1221222928055568752028,3326779700565170048628,8871412534840453463008,23180142429744410661408,59399114976220052319858,149397774031098919471158,369100382900362036340508,896386644186593516826948,2141368094445751179086598,5035108762615685204879298,11660251871320534158667848,26609292731987885644139448,59870908646972742699313758,132884211874988282576525658,291079702202355285643818108,629544472205093989880815908,1344935917892700796563561258,2839309159995701681634184878,5925514768686681770366994528,12229253884310811313310605728,24968060013801239764675820028,50445672272782096667406248628,100891344545564193334812497256,199804427433372226016001220056,391924069196230135646771623956,761663757117201961728631646556,1466907976670166741106994282256,2800460682733954687567898175216,5300872006603557087182092974516,9950759731694396637341823653916,18529000879706807531602016459016,34231543998102407134654572780216,62757830663187746413533383430396,114198675469079341834462386242196,206294381492530423959028826760096,370020081089776792180480276569696,659098269441164911071480492639771,1166096938242060996511080871593441,2049503709637561751443717895527866,3578984089964100371924104384727766,6210590038467115351280063491145241,10711017602573720678294602252844691,18361744461554949734219318147733756,31292550420396463631556866139095556,53023488212338452264582467624578581,89340945892022323678680048189358431,149706449873118488326436837506492506,249510749788530813877394729177487510,413662558859932665112522840478466135,682274610067681148951823386243703885
add $0,50
bin $0,50
|
||||
TheStack | eca9d7433d79c5cc809a930d6ff7580311d24982 | Assemblycode:Assembly | {"size": 583, "ext": "asm", "max_stars_repo_path": "Examples/ch09/Mult.asm", "max_stars_repo_name": "satadriver/LiunuxOS_t", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Examples/ch09/Mult.asm", "max_issues_repo_name": "satadriver/LiunuxOS_t", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Examples/ch09/Mult.asm", "max_forks_repo_name": "satadriver/LiunuxOS_t", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.32, "max_line_length": 53, "alphanum_fraction": 0.6466552316} | TITLE Multiply an Array (Mult.asm)
; This program multiplies each element of an array
; of 32-bit integers by a constant value.
INCLUDE Irvine32.inc
.data
array DWORD 1,2,3,4,5,6,7,8,9,10 ; test data
multiplier DWORD 10 ; test data
.code
main PROC
cld ; direction = up
mov esi,OFFSET array ; source index
mov edi,esi ; destination index
mov ecx,LENGTHOF array ; loop counter
L1: lodsd ; copy [ESI] into EAX
mul multiplier ; multiply by a value
stosd ; store EAX at [EDI]
loop L1
exit
main ENDP
END main |
||||
TheStack | 76f475b9234b19fbfe4de7709c95c6acaf79f3db | Assemblycode:Assembly | {"size": 412, "ext": "asm", "max_stars_repo_path": "examples/fib2.asm", "max_stars_repo_name": "shockkolate/shk-asm", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "examples/fib2.asm", "max_issues_repo_name": "shockkolate/shk-asm", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "examples/fib2.asm", "max_forks_repo_name": "shockkolate/shk-asm", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.1666666667, "max_line_length": 39, "alphanum_fraction": 0.4902912621} | LOD $1, fib_digit
CAL fib
STO #1:#0, $0 ; stdout
DIE
; in: fib digit
; out: result
fib:
MOV $0, #0 ; term 1
MOV $0x10, #1 ; term 2
MOV $0x11, #0 ; loop counter
.loop:
STO #1:#0, $0 ; stdout
ADD $0x12, $0, $0x10
MOV $0, $0x10
MOV $0x10, $0x12
ADD $0x11, $0x11, #1
CMP $0x13, $0x11, $1
BRA .loop, !LT $0x13
.end:
RET
fib_digit: DAT #10
|
||||
TheStack | e211562cc2718ae49df764912c5a864707c78f29 | Assemblycode:Assembly | {"size": 161, "ext": "asm", "max_stars_repo_path": "data/maps/headers/VermilionCity.asm", "max_stars_repo_name": "opiter09/ASM-Machina", "max_stars_repo_stars_event_min_datetime": "2022-02-15T00:19:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T00:19:44.000Z", "max_issues_repo_path": "data/maps/headers/VermilionCity.asm", "max_issues_repo_name": "opiter09/ASM-Machina", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "data/maps/headers/VermilionCity.asm", "max_forks_repo_name": "opiter09/ASM-Machina", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.8333333333, "max_line_length": 66, "alphanum_fraction": 0.7950310559} |
map_header VermilionCity, VERMILION_CITY, OVERWORLD, NORTH | EAST
connection north, Route6, ROUTE_6, 5
connection east, Route11, ROUTE_11, 4
end_map_header
|
||||
TheStack | 041e6a1b2635766675efa2c84d240b4e47e8858a | Assemblycode:Assembly | {"size": 184, "ext": "asm", "max_stars_repo_path": "programs/oeis/144/A144194.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/144/A144194.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/144/A144194.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 18.4, "max_line_length": 73, "alphanum_fraction": 0.5652173913} | ; A144194: Square array (6 X 6) read by rows.
; 0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0
mul $0,-2
pow $0,4
div $0,5
mul $0,12345679
mod $0,-7
mod $0,2
|
||||
TheStack | ad0e04960b773b56997bc21ecea1fb96956f13b3 | Assemblycode:Assembly | {"size": 110, "ext": "asm", "max_stars_repo_path": "src/clear_screen.asm", "max_stars_repo_name": "I8087/libm", "max_stars_repo_stars_event_min_datetime": "2015-06-13T00:56:27.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-25T16:55:26.000Z", "max_issues_repo_path": "src/clear_screen.asm", "max_issues_repo_name": "I8087/libm", "max_issues_repo_issues_event_min_datetime": "2016-02-02T23:34:27.000Z", "max_issues_repo_issues_event_max_datetime": "2019-06-11T22:41:23.000Z", "max_forks_repo_path": "src/clear_screen.asm", "max_forks_repo_name": "I8087/libm", "max_forks_repo_forks_event_min_datetime": "2016-06-21T05:19:15.000Z", "max_forks_repo_forks_event_max_datetime": "2016-06-21T05:19:15.000Z"} | {"max_stars_count": 13, "max_issues_count": 10, "max_forks_count": 1, "avg_line_length": 10.0, "max_line_length": 24, "alphanum_fraction": 0.6545454545} | global _clear_screen
_clear_screen:
push bp
mov bp, sp
call os_clear_screen
pop bp
ret
|
||||
TheStack | 88ef8ff4d6bf1df83fb7cc923827fdceb745a806 | Assemblycode:Assembly | {"size": 242, "ext": "asm", "max_stars_repo_path": "ex/testadd2.asm", "max_stars_repo_name": "jtzeng/herontitan", "max_stars_repo_stars_event_min_datetime": "2017-07-24T07:29:04.000Z", "max_stars_repo_stars_event_max_datetime": "2017-07-24T07:29:04.000Z", "max_issues_repo_path": "ex/testadd2.asm", "max_issues_repo_name": "jtzeng/herontitan", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ex/testadd2.asm", "max_forks_repo_name": "jtzeng/herontitan", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 10.5217391304, "max_line_length": 47, "alphanum_fraction": 0.4462809917} | ; a = 2, b = 3, a += a, a += b, b++, c = b, c--
START:
LDC 2,RA
LDC 3,RB
ADD RA,RA
ADD RB,RA
NOP
INC RB
MOV RB,RC
DEC RC
JMP END
SKIPPED:
CLR RA
INC R0
LDC 7,R1
JMP SKIPPED
END:
NOP
|
||||
TheStack | 6ea97bc741bc8d63b785e8a97c878c64fc4f186f | Assemblycode:Assembly | {"size": 17899, "ext": "asm", "max_stars_repo_path": "examples/SymbOS_nslookup/src/symbos_lib-SystemManager.asm", "max_stars_repo_name": "fengjixuchui/sjasmplus", "max_stars_repo_stars_event_min_datetime": "2016-10-22T19:44:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T20:57:04.000Z", "max_issues_repo_path": "examples/SymbOS_nslookup/src/symbos_lib-SystemManager.asm", "max_issues_repo_name": "ped7g/sjasmplus", "max_issues_repo_issues_event_min_datetime": "2018-05-07T10:31:23.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T04:35:59.000Z", "max_forks_repo_path": "examples/SymbOS_nslookup/src/symbos_lib-SystemManager.asm", "max_forks_repo_name": "ped7g/sjasmplus", "max_forks_repo_forks_event_min_datetime": "2016-05-12T21:27:36.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-27T15:16:16.000Z"} | {"max_stars_count": 220, "max_issues_count": 153, "max_forks_count": 51, "avg_line_length": 44.1950617284, "max_line_length": 95, "alphanum_fraction": 0.4701938656} | ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@ @
;@ S Y M B O S S Y S T E M L I B R A R Y @
;@ - SYSTEM MANAGER FUNCTIONS - @
;@ @
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;Author Prodatron / Symbiosis
;Date 28.03.2015
;The system manager is responsible for starting and stopping applications and
;it also provides several dialogue services.
;This library supports you in using the system manager functions.
;The existance of
;- "App_PrcID" (a byte, where the ID of the applications process is stored)
;- "App_MsgBuf" (the message buffer, 14 bytes, which are placed in the transfer
; ram area)
;is required.
;### SUMMARY ##################################################################
;use_SySystem_PRGRUN equ 0 ;Starts an application or opens a document
;use_SySystem_PRGEND equ 0 ;Stops an application and frees its resources
;use_SySystem_PRGSRV equ 0 ;Manages shared services or finds applications
;use_SySystem_SYSWRN equ 0 ;Opens an info, warning or confirm box
;use_SySystem_SELOPN equ 0 ;Opens the file selection dialogue
;use_SySystem_HLPOPN equ 0 ;Opens the help file for this application (##!!## missing doc)
;### MAIN FUNCTIONS ###########################################################
if use_SySystem_PRGRUN=1
SySystem_PRGRUN
;******************************************************************************
;*** Name Program_Run_Command
;*** Input HL = File path and name address
;*** A = [Bit0-3] File path and name ram bank (0-15)
;*** [Bit7 ] Flag, if system error message should be
;*** suppressed
;*** Output A = Success status
;*** 0 = OK
;*** 1 = File does not exist
;*** 2 = File is not an executable and its type is not
;*** associated with an application
;*** 3 = Error while loading (see P8 for error code)
;*** 4 = Memory full
;*** - If success status is 0:
;*** L = Application ID
;*** H = Process ID (the applications main process)
;*** - If success status is 3:
;*** L = File manager error code
;*** Destroyed F,BC,DE,IX,IY
;*** Description Loads and starts an application or opens a document with a
;*** known type by loading the associated application first.
;*** If Bit7 of A is not set, the system will open a message box,
;*** if an error occurs during the loading process.
;*** If the operation was successful, you will find the
;*** application ID and the process ID in L and H. If it failed
;*** because of loading problems L contains the file manager
;*** error code.
;******************************************************************************
ld c,MSC_SYS_PRGRUN
call SySystem_SendMessage
SySPRn1 call SySystem_WaitMessage
cp MSR_SYS_PRGRUN
jr nz,SySPRn1
ld a,(App_MsgBuf+1)
ld hl,(App_MsgBuf+8)
ret
endif
if use_SySystem_PRGEND=1
SySystem_PRGEND
;******************************************************************************
;*** Name Program_End_Command
;*** Input L = Application ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Stops an application and releases all its used system
;*** resources. This command first stops all processes of the
;*** application. After this all open windows will be closed and the
;*** reserved memory will be released.
;*** Please note, that this command can't release memory, stop
;*** processes and timers or close windows, which are not
;*** registered for the application. Such resources first have
;*** to be released by the application itself.
;******************************************************************************
ld c,MSC_SYS_PRGEND
jp SySystem_SendMessage
endif
if use_SySystem_PRGSRV=1
SySystem_PRGSRV
;******************************************************************************
;*** Name Program_SharedService_Command
;*** Input E = Command type
;*** 0 = search application or shared service
;*** 1 = search, start and use shared service
;*** 2 = release shared service
;*** - if E is 0 or 1:
;*** HL = Address of the 12byte application ID string
;*** - if E is 0 or 1:
;*** A = Ram bank (0-15) of the 12byte application ID string
;*** - if E is 2:
;*** Output A = Result status
;*** 0 = OK
;*** 5 = application or shared service not found (can only
;*** occur on command type 0)
;*** 1-4=error while starting shared service; same codes
;*** like in MSR_SYS_PRGRUN, please read there for a
;*** detailed description
;*** - If command type was 0 or 1, and result status is 0:
;*** L = Application ID
;*** H = Process ID (the applications main process)
;*** - If result status is 3:
;*** L = File manager error code
;*** Destroyed F,BC,DE,IX,IY
;*** Description This function can be used to find, start and release shared
;*** services or to find applications.
;*** For a detailed description please read chapter "System
;*** Manager", "Program_SharedService_Command" in the SymbOS
;*** Developer Documentation.
;******************************************************************************
ld c,MSC_SYS_PRGSRV
call SySystem_SendMessage
SySPSr1 call SySystem_WaitMessage
cp MSR_SYS_PRGSRV
jr nz,SySPSr1
ld a,(App_MsgBuf+1)
ld hl,(App_MsgBuf+8)
ret
endif
if use_SySystem_SYSWRN=1
SySystem_SYSWRN
;******************************************************************************
;*** Name Dialogue_Infobox_Command
;*** Input HL = Content data address (#C000-#FFFF)
;*** A = Content data ram bank (0-15)
;*** B = [Bit0-2] Number of buttons (1-3)
;*** 1 = "OK" button
;*** 2 = "Yes", "No" buttons
;*** 3 = "Yes", "No", "Cancel" buttons
;*** [Bit3-5] Titletext
;*** 0 = default (bit7=[0]"Error!"/[1]"Info")
;*** 1 = "Error!"
;*** 2 = "Info"
;*** 3 = "Warning"
;*** 4 = "Confirmation"
;*** [Bit6 ] Flag, if window should be modal window
;*** [Bit7 ] Box type
;*** 0 = default (warning [!] symbol)
;*** 1 = info (own symbol will be used)
;*** DE = 0 or data record of the caller window; the dialogue
;*** window will be a modal window of it, during its open
;*** Content data 00 1W Address of text line 1
;*** 02 1W 4 * [text line 1 pen] + 2
;*** 04 1W Address of text line 2
;*** 06 1W 4 * [text line 2 pen] + 2
;*** 08 1W Address of text line 3
;*** 10 1W 4 * [text line 3 pen] + 2
;*** - if E[bit7] is 1:
;*** 12 1W Address of symbol (24x24 pixel SymbOS graphic format)
;*** Output A = Result status
;*** 0 -> The infobox is currently used by another
;*** application. It can only be opened once at the
;*** same time, if it's not a pure info message (one
;*** button, not a modal window). The user should
;*** close the other infobox first before it can be
;*** opened again by the application.
;*** 2 -> The user clicked "OK".
;*** 3 -> The user clicked "Yes".
;*** 4 -> The user clicked "No".
;*** 5 -> The user clicked "Cancel" or the close button.
;*** Destroyed F,BC,DE,HL,IX,IY
;*** Description Opens an info, warning or confirm box and displays three line
;*** of text and up to three click buttons.
;*** If Bit7 of B is set to 1, you can specify an own symbol, which
;*** will be showed left to the text. If this bit is not set, a "!"-
;*** warning symbol will be displayed.
;*** If Bit6 of B is set to 1, the window will be opened as a modal
;*** window, and you will receive a message with its window number
;*** (see MSR_SYS_SYSWRN).
;*** Please note, that the content data must always be placed in the
;*** transfer ram area (#C000-#FFFF). The texts itself and the
;*** optional graphic must always be placed inside a 16K (data ram
;*** area).
;*** As the text line pen, you should choose 1, so 6 would be the
;*** correct value.
;*** For more information about the mentioned memory types (data,
;*** transfer) see the "applications" chapter.
;*** For more information about the SymbOS graphic format see the
;*** "desktop manager data records" chapter.
;******************************************************************************
ld (SySWrnW),de
ld e,b
ld c,MSC_SYS_SYSWRN
push bc
call SySystem_SendMessage
pop af
and 7+64
dec a
ret z
SySWrn1 call SySystem_WaitMessage
cp MSR_SYS_SYSWRN
jr nz,SySWrn1
ld ix,(SySWrnW)
db #dd:ld a,l
db #dd:or h
ld c,0
jr z,SySWrn2
ld (ix+51),c
inc c
SySWrn2 ld a,(App_MsgBuf+1)
cp 1
ret nz
dec c
jr nz,SySWrn1
ld a,(App_MsgBuf+2)
ld (ix+51),a
jr SySWrn1
SySWrnW dw 0
endif
if use_SySystem_SELOPN=1
SySystem_SELOPN
;******************************************************************************
;*** Name Dialogue_FileSelector_Command
;*** Input HL = File mask, path and name address (#C000-#FFFF)
;*** 00 3B File extension filter (e.g. "* ")
;*** 03 1B 0
;*** 04 256B path and filename
;*** A = [Bit0-3] File mask, path and name ram bank (0-15)
;*** [Bit6 ] Flag, if "open" (0) or "save" (1) dialogue
;*** [Bit7 ] Flag, if file (0) or directory (1) selection
;*** C = Attribute filter
;*** Bit0 = 1 -> don't show read only files
;*** Bit1 = 1 -> don't show hidden files
;*** Bit2 = 1 -> don't show system files
;*** Bit3 = 1 -> don't show volume ID entries
;*** Bit4 = 1 -> don't show directories
;*** Bit5 = 1 -> don't show archive files
;*** IX = Maximum number of directory entries
;*** IY = Maximum size of directory data buffer
;*** DE = Data record of the caller window; the file selector
;*** window will be a modal window of it, during its open)
;*** Output A = Success status
;*** 0 -> The user choosed a file and closed the dialogue
;*** with "OK". The complete file path and name can be
;*** found in the filepath buffer of the application.
;*** 1 -> The user aborted the file selection. The content
;*** of the applications filepath buffer is unchanged.
;*** 2 -> The file selection dialogue is currently used by
;*** another application. It can only be opened once
;*** at the same time. The user should close the
;*** dialogue first before it can be opened again by
;*** the application.
;*** 3 -> Memory full. There was not enough memory
;*** available for the directory buffer and/or the
;*** list data structure.
;*** 4 -> No window available. The desktop manager couldn't
;*** open a new window for the dialogue, as the
;*** maximum number of windows (32) has already been
;*** reached.
;*** Destroyed F,BC,DE,HL,IX,IY
;*** Description Opens the file selection dialogue. In this dialogue the user
;*** can move through the directory structure, change the drive and
;*** search and select a file or a directory for opening or saving.
;*** If you specify a path, the dialogue will start directly in the
;*** directory. If you append a filename, too, it will be used as
;*** the preselected file.
;*** You can filter the entries of the directory by attributes and
;*** filename extension. We recommend always to set Bit3 of the
;*** attribute filter byte.
;*** The File mask/path/name string (260 bytes) must always be
;*** placed in the transfer ram area (#C000-#FFFF). For more
;*** information about this memory types see the "applications"
;*** chapter.
;*** Please note, that the system will reserve memory to store the
;*** listed directory entries and the data structure of the list.
;*** With IX and IY you can choose, how much memory should be used.
;*** We recommend to set the number of entries between 100 and 200
;*** (Amsdos supports a maximum amount of 64 entries) and to set the
;*** data buffer between 5000 and 10000.
;******************************************************************************
ld (SySSOpW+2),de
push iy
ld iy,App_MsgBuf
ld (App_MsgBuf+6),a
ld (iy+7),c
ld (App_MsgBuf+8),hl
db #dd:ld a,l
ld (App_MsgBuf+10),a
db #dd:ld a,h
ld (App_MsgBuf+11),a
pop de
ld (App_MsgBuf+12),de
ld c,MSC_SYS_SELOPN
call SySystem_SendMessage
SySSOp1 call SySystem_WaitMessage
cp MSR_SYS_SELOPN
jr nz,SySSOp1
SySSOpW ld ix,0
ld (ix+51),0
ld a,(App_MsgBuf+1)
cp -1
ret nz
ld a,(App_MsgBuf+2)
ld (ix+51),a
jr SySSOp1
endif
if use_SySystem_HLPOPN=1
SySystem_HLPFLG db 0 ;flag, if HLP-path is valid
SySystem_HLPPTH db "%help.exe "
SySystem_HLPPTH1 ds 128
SySHInX db ".HLP",0
SySystem_HLPINI
ld hl,(App_BegCode)
ld de,App_BegCode
dec h
add hl,de ;HL = CodeEnd = Command line
ld de,SySystem_HLPPTH1
ld bc,0
db #dd:ld l,128
SySHIn1 ld a,(hl)
or a
jr z,SySHIn3
cp " "
jr z,SySHIn3
cp "."
jr nz,SySHIn2
ld c,e
ld b,d
SySHIn2 ld (de),a
inc hl
inc de
db #dd:dec l
ret z
jr SySHIn1
SySHIn3 ld a,c
or b
ret z
ld e,c
ld d,b
ld hl,SySHInX
ld bc,5
ldir
ld a,1
ld (SySystem_HLPFLG),a
ret
SySystem_HLPOPN
ld a,(SySystem_HLPFLG)
or a
ret z
ld hl,SySystem_HLPPTH
ld a,(App_BnkNum)
jp SySystem_PRGRUN
endif
;### SUB ROUTINES #############################################################
SySystem_SendMessage
;******************************************************************************
;*** Input C = Command
;*** HL,A,DE = additional Parameters
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the system manager
;******************************************************************************
ld iy,App_MsgBuf
ld (iy+0),c
ld (App_MsgBuf+1),hl
ld (App_MsgBuf+3),a
ld (App_MsgBuf+4),de
db #dd:ld h,PRC_ID_SYSTEM
ld a,(App_PrcID)
db #dd:ld l,a
rst #10
ret
SySystem_WaitMessage
;******************************************************************************
;*** Input -
;*** Output IY = message buffer
;*** A = first byte in the Message buffer (IY+0)
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the desktop manager, which includes the
;*** window ID and additional parameters
;******************************************************************************
ld iy,App_MsgBuf
SySWMs1 db #dd:ld h,PRC_ID_SYSTEM
ld a,(App_PrcID)
db #dd:ld l,a
rst #08 ;wait for a system manager message
db #dd:dec l
jr nz,SySWMs1
ld a,(App_MsgBuf+0)
ret
|
||||
TheStack | 53898ce22d458a09d0b95874fb0d249d4a078f59 | Assemblycode:Assembly | {"size": 455, "ext": "asm", "max_stars_repo_path": "programs/oeis/251/A251780.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/251/A251780.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/251/A251780.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.5, "max_line_length": 217, "alphanum_fraction": 0.5406593407} | ; A251780: Digital root of A069778(n-1) = n^3 - n^2 + 1, n >= 1. Repeat(1, 6, 3, 7, 6, 6, 4, 6, 9).
; 1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9,1,6,3,7,6,6,4,6,9
cal $0,64303 ; Seventh diagonal of triangle A064094.
sub $0,1
mov $1,1
mul $1,$0
mod $1,9
add $1,5
mul $1,2
sub $1,10
div $1,2
add $1,1
|
||||
TheStack | 448209b618863aee2f7bf8f7d282d89efd75691d | Assemblycode:Assembly | {"size": 6976, "ext": "asm", "max_stars_repo_path": "dimension/cell/io/storage/nvram/mini-archiver/mini-archiver.asm", "max_stars_repo_name": "ekscrypto/Unununium", "max_stars_repo_stars_event_min_datetime": "2019-03-04T08:53:33.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-28T19:32:12.000Z", "max_issues_repo_path": "dimension/cell/io/storage/nvram/mini-archiver/mini-archiver.asm", "max_issues_repo_name": "ekscrypto/Unununium", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dimension/cell/io/storage/nvram/mini-archiver/mini-archiver.asm", "max_forks_repo_name": "ekscrypto/Unununium", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 7, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.3333333333, "max_line_length": 89, "alphanum_fraction": 0.6692947248} | ;====---------------------------------------------------------------------====
; Mini-Archiver cell for Unununium OE (c)2001 Richard Fillion
; Driver for easy NVRAM access Distributed under BSD Licens
;====---------------------------------------------------------------------====
[bits 32]
section .c_info
;version
db 0,0,1,'a' ;0.0.1 alpha
dd str_cellname
dd str_author
dd str_copyright
str_cellname: db "Mini-Archiver NVRAM cell",0
str_author: db "Richard Fillion (Raptor-32)",0
str_copyright: db "(c) 2001 Richard Fillion",0
;====-------[ INITIALIZATION ]-------=====
section .c_init
global _start
_start:
;every computer has to have NVRAM, so its not a problem of detecting it,
;we must detect how big it is though, either 64bytes or 128bytes.
;register with devfs
mov ebx, _open
mov esi, nvram_device
externfunc devfs.register
mov al, 15 ;we read 15th byte
mov edx, 0x70 ;port for nvram
out dx, al
in al, 0x71
mov bl, al ;save byte 15
mov al, 15 + 64
mov edx, 0x70
out dx, al
in al, 0x71
cmp al, bl ;compare byte 15 to (64+15), if they are different, the additional
;64bytes is present otherwise it wraps around
jne .nvram_128bytes
mov al, 15
mov edx, 0x70
out dx, al
mov al, bl
inc al
mov edx, 0x71
out dx, al
mov edx, 0x70
mov al, 64+15
out dx, al
in al, 0x71
dec al
mov bh, al
;return byte 15 to its original position now
mov al, 15
mov edx, 0x70
out dx, al
mov al, bl
mov edx, 0x71
out dx, al ;byte 15 returned to original position
cmp bh, bl ;check if byte 15 (edited) has changed byte 64+15 if so, wehave 64byte nvram
je .nvram_64bytes
.nvram_128bytes:
mov byte [nvram_size], 127 ;we dont want those first 14bytes (RTC ownz them)
mov esi, str_128bytes
externfunc sys_log.print_string
popad
jmp end
.nvram_64bytes:
mov byte [nvram_size], 63
mov esi, str_64bytes
externfunc sys_log.print_string
end:
clc
retn
str_64bytes: db "NVRAM detected at 64bytes.",0
str_128bytes: db "NVRAM detected at 128bytes.",0
;====--------[POST INIT]---------=====
section .text
;====--------[ OPEN FILE ]-------====
_open:
push edx
mov ecx, local_file_descriptor_size
externfunc mem.alloc
mov dword[edi+file_descriptor.op_table], our_op_table
pop dword[edi+file_descriptor.fs_descriptor]
xor edx, edx
mov [edi+local_file_descriptor.pos], edx
mov ebx, edi
retn
;====--------[ CLOSE FILE ]-------====
__close:
mov eax, ebx
externfunc mem.dealloc
retn
;====--------[ READ FILE ]-------====
__read:
;ECX = number of bytes to read
;EDI = pointer to buffer to put data in
;EBX = pointer to file descriptor
;returned values
;EDI = unmodified
;errors as usual
push eax
push edx
push edi
push esi
xor eax, eax
movzx esi, word [nvram_size]
.write_byte:
mov al, byte [ebx + local_file_descriptor.pos] ;we know its less then 256
mov edx, 0x70
out dx, al
in al, 0x71
mov byte [edi], al
inc edi
cmp [ebx + local_file_descriptor], esi
je .done_nvram
inc byte [ebx + local_file_descriptor.pos] ;add 1 to his position
loop .write_byte
pop esi
pop edi
pop edx
pop eax
retn
.done_nvram:
mov byte [edi], 0x04 ;EOF
pop esi
pop edi
pop edx
pop eax
retn
;====--------[ WRITE FILE ]------====
__write:
;parameters
;ECX = number of bytes to write
;ESI = pointer to buffer to read data from
;EBX = pointer to file descriptor
;returned values
;errors as usual
push eax
push edx
push edi
push esi
xor eax, eax
movzx edi, word [nvram_size]
.write_byte:
mov al, byte [ebx + local_file_descriptor.pos] ;we know its less then 256
mov edx, 0x70
out dx, al
mov al, byte [esi]
mov edx, 0x71
out dx, al
inc esi
cmp [ebx + local_file_descriptor], edi
je .done_nvram
inc byte [ebx + local_file_descriptor.pos] ;add 1 to his position
loop .write_byte
pop esi
pop edi
pop edx
pop eax
retn
.done_nvram:
pop esi
pop edi
pop edx
pop eax
retn
;====--------[ SEEK CURSOR ]-----====
__seek_cur:
; parameters
; EDX:EAX = distance to seek, signed
; EBX = pointer to file handle
push ecx
test edx, edx ; is it further than 4gigs?
jnz .error_too_far
cmp eax, [nvram_size]
jae .error_too_far ;they cant seek right to the end, or begining either.
mov ecx, [ebx + local_file_descriptor.pos]
test edx, 0x80000000 ;check sign bit
jz .forward
.reverse:
cmp ecx, eax
jb .error_too_far
sub ecx, eax
jmp .mark_it
.forward:
add ecx, eax
cmp ecx, [nvram_size]
ja .error_too_far
.mark_it:
mov dword [ebx + local_file_descriptor.pos], ecx
pop ecx
clc
popad
retn
.error_too_far:
stc
pop ecx
mov eax, __ERROR_INVALID_PARAMETERS__
retn
;====--------[ SEEK START ]------====
__seek_start:
; parameters
; EDX:EAX = distance to seek, unsigned
; EBX = pointer to file handle
test edx, edx ; is it further than 4gigs?
jnz .error_too_far
cmp eax, [nvram_size]
ja .error_too_far
mov dword [ebx + local_file_descriptor.pos], eax
clc
retn
.error_too_far:
stc
mov eax, __ERROR_INVALID_PARAMETERS__
retn
;====--------[ SEEK END ]-------====
__seek_end:
; parameters
; EDX:EAX = distance to seek, unsigned
; EBX = pointer to file handle
test edx, edx ; is it further than 4gigs?
jnz .error_too_far
cmp eax, [nvram_size]
ja .error_too_far
mov edx, [nvram_size]
sub edx,eax
mov dword [ebx + local_file_descriptor.pos], edx
xor edx, edx ;return this guy to normal
clc
retn
.error_too_far:
stc
mov eax, __ERROR_INVALID_PARAMETERS__
retn
;====-------[ ERROR ]-------====
__error:
mov eax, __ERROR_OPERATION_NOT_SUPPORTED__
stc
retn
;====------[VARIABLES]------======
section .data
align 4
nvram_size: dd 0
nvram_device: db "/nvram",0
seek_cursor: dd 0 ;max is 128bytes, so we only need a byte for that. :)
;====-----[STRUCTURES]------=====
struc local_file_descriptor
.global: resb file_descriptor_size
.pos: resd 1
endstruc
our_file_descriptor:
istruc local_file_descriptor
at local_file_descriptor.global
istruc file_descriptor
at file_descriptor.op_table, dd our_op_table
iend
at local_file_descriptor.pos, dd 0 ; position in the file
iend
our_op_table: istruc file_op_table
at file_op_table.close, dd __close
at file_op_table.read, dd __read
at file_op_table.write, dd __write
at file_op_table.raw_read, dd __error
at file_op_table.raw_write, dd __error
at file_op_table.seek_cur, dd __seek_cur
at file_op_table.seek_start, dd __seek_start
at file_op_table.seek_end, dd __seek_end
at file_op_table.read_fork, dd __error
at file_op_table.write_fork, dd __error
at file_op_table.link, dd __error
at file_op_table.unlink, dd __error
at file_op_table.create, dd __error
at file_op_table.rename, dd __error
at file_op_table.copy, dd __error
at file_op_table.truncate, dd __error
at file_op_table.attrib, dd __error
;at file_op_table.list, dd __error
iend
;====------[ INCLUDES ]-----====
|
||||
TheStack | 995192dc620f4d29bc2cf147d4dd9831880d34ea | Assemblycode:Assembly | {"size": 41004, "ext": "asm", "max_stars_repo_path": "vga.asm", "max_stars_repo_name": "rakettitiede/octapentaveega", "max_stars_repo_stars_event_min_datetime": "2016-08-26T11:10:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-14T19:08:14.000Z", "max_issues_repo_path": "vga.asm", "max_issues_repo_name": "wanderingmoose/octapentaveega", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "vga.asm", "max_forks_repo_name": "wanderingmoose/octapentaveega", "max_forks_repo_forks_event_min_datetime": "2017-10-21T09:37:39.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-15T16:41:47.000Z"} | {"max_stars_count": 18, "max_issues_count": null, "max_forks_count": 7, "avg_line_length": 33.0677419355, "max_line_length": 96, "alphanum_fraction": 0.5132182226} | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; 32 x 16 character VGA output with UART for Attiny85. ;;
;; ;;
;; (C) Copyright 2015-2016 Jari Tulilahti ;;
;; ;;
;; All right and deserved. ;;
;; ;;
;; 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. ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.include "tn85def.inc"
; Registers have been named for easier access.
; in addition we use all of the X, Y and Z
; register pairs for pointers to different buffers
;
; X (r26:r27) is pointer to screen buffer, also used while
; clearing the screen
; Y (r28:r29) is pointer to either predraw, or currently being
; drawn buffer
; Z (r30:r31) pointer is used for fetching the data from flash
; with lpm instruction
;
.def zero = r0 ; Register for value 0
.def one = r1 ; Register for value 1
.def seq_cnt = r2 ; Counter for several sequences
.def row_cnt = r3 ; Vertical pixel counter
.def char_row = r4 ; Predraw-buffer x-offset
.def uart_seq = r5 ; UART sequence
.def uart_next = r6 ; Next UART sequence
.def clear_cnt = r7 ; Screen clear counter
.def uart_byte = r8 ; UART receiving counter & data
.def color_fg = r9 ; Foreground color
.def color_bg = r10 ; Background (4..7) color
.def ansi_val1 = r11 ; Storage for ANSI cmd value
.def ansi_val2 = r12 ; Storage for ANSI cmd value
.def vline_lo = r13 ; Vertical line low byte
.def vline_hi = r14 ; Vertical line high byte
.def scroll_row = r15 ; Row number for horizontal scroll
.def temp = r16 ; Temporary register
.def temp2 = r17 ; Temporary register 2
.def font_hi = r18 ; Font Flash addr high byte
.def scroll_lo = r19 ; Screen scroll offset low
.def scroll_hi = r20 ; Screen scroll offset high
.def ansi_state = r21 ; ANSI command states described below
.def uart_buf = r22 ; UART buffer
.def state = r23 ; Bitmask for states described below
.def cursor_lo = r24 ; Cursor offset low
.def cursor_hi = r25 ; Cursor offset high
; r26 .. r31 described above
; state: (bits)
;
.equ st_clear = 0 ; Screen clear mode active bit
.equ st_wrap = 1 ; Wrap mode active bit
.equ st_uart = 2 ; UART data in buffer
.equ st_scroll = 3 ; Scroll-clear in action
.equ st_left = 4 ; Scroll row left
.equ st_full_left = 5 ; Scroll full screen
.equ st_tricoder = 6 ; "Tricoder"-mode
.equ st_clear_val = (1 << 0) ; Value to set/clear clear mode
.equ st_wrap_val = (1 << 1) ; Value to set/clear wrap mode
.equ st_uart_val = (1 << 2) ; Value to set/clear UART buffer state
.equ st_scroll_val = (1 << 3) ; Value to set/clear scroll-clear state
.equ st_left_val = (1 << 4) ; Value to set/clear row-scroll
.equ st_full_left_val = (1 << 5) ; Value to set/clear full-screen-scroll
.equ st_tricoder_val = (1 << 6) ; Value to set/clear tricoder
; ansi_state: (value)
;
; 0 : None
; 1 : ESC received
; 2 : Opening bracket "[" received
; 3 : Two values received
; Constants
;
.equ UART_WAIT = 138 ; HSYNC timer value where we start to
; look for UART samples (or handle
; data received)
.equ HSYNC_WAIT = 2 ; HSYNC value to start precalculating
; the pixels and drawing to screen
.equ JITTERVAL = 248 ; Must be in sync with HSYNC_WAIT value.
; We want Timer0 counter to be 0-4 in
; jitterfix label. AVR Studio simulator
; was used to sync this value.
.equ VSYNC_LOW = 490 - 256 ; Turn VSYNC low on this vertical line
.equ VSYNC_HIGH = VSYNC_LOW + 2 ; Turn VSYNC high on this vertical line
.equ VISIBLE = 480 - 256 ; Visible vline count
.equ UART_XOR = 124 ; UART sequence magic XORing value
.equ UART_INIT = 100 ; UART sequence initial value after start
.equ UART_FIRST = 24 ; UART first sequence
.equ ALT_XOR = 32 ; Buffer flipping value
.equ DEFAULT_COLOR_FG = 7 ; White foreground
.equ DEFAULT_COLOR_BG = 0 ; Black background
; Pins used for different signals
;
.equ UART_PIN = PB0
.equ RGB_PIN = PB1
.equ VSYNC_PIN = PB2
.equ HSYNC_PIN = PB4
; General purpose IO registers used as storage
;
.equ LEFT_CNT = GPIOR0
.equ SPLIT_ROW = GPIOR1
.equ TRICODE_CNT = GPIOR2
; All of the 512 byte SRAM is used for screen buffer.
;
.dseg
.org 0x60
screenbuf:
.byte 512
screen_end:
; Start the code section.
; Only two vectors used. RESET for all versions
; and INT0 for slaves (synchronization)
.cseg
.org 0x00
vectors:
rjmp main
.ifdef VGA_SLAVE
rjmp slave_sync
.endif
main:
; Disable watchdog asap after reset. Timed sequence.
;
wdr
clr temp
out MCUSR, temp
ldi temp, (1 << WDCE) | (1 << WDE)
out WDTCR, temp
clr temp
out WDTCR, temp
; Set default values to registers
;
clr zero ; Zero the zero-register
clr uart_seq ; Zero UART sequence
clr uart_next ; Zero UART next
clr state ; Zero state
clr vline_lo ; Vertical line low
clr vline_hi ; Vertical line high
ldi temp, 3
mov row_cnt, temp ; Alternating counter
ldi font_hi, 0x16 ; Font flash addr high byte
clr one ; Register to hold
inc one ; the value 1
; Empty GPIO registers
out LEFT_CNT, zero
; Enable wrap-mode by default
;
sbr state, st_wrap_val
; Set default colors
;
ldi temp, DEFAULT_COLOR_FG
mov color_fg, temp ; Default foreground
ldi temp, DEFAULT_COLOR_BG
mov color_bg, temp ; Default background
; Make sure we clear the screen right after start
;
sbr state, st_clear_val ; Initiate clear mode
clr clear_cnt ; Clear counter zeroed
ldi XL, low(screenbuf) ; Start from the beginning
ldi XH, high(screenbuf) ; of SRAM
; Set GPIO directions
;
.ifdef VGA_MASTER
sbi DDRB, HSYNC_PIN ; Master drives both HSYNC
sbi DDRB, VSYNC_PIN ; and VSYNC
.else
cbi DDRB, VSYNC_PIN ; Slave sync to VSYNC, set as input
sbi PORTB, VSYNC_PIN ; Enable pull-up
.endif
sbi DDRB, RGB_PIN
cbi DDRB, UART_PIN
;
; Enable UART PULL-UP
sbi PORTB, UART_PIN
; Set USI mode
;
sbi USICR, USIWM0
.ifdef VGA_SLAVE
slave_setup:
; Slave synchronization happens with INT0, which listens
; to falling edge of VSYNC. We also put the slave to
; sleep-mode IDLE, from sleep we get jitter-free jump
; to ISR. We never return from ISR and we don't use stack
; so we don't care about stack pointer nor the return
; address in stack.
;
; First we delay for a moment - waiting for the power to
; stabilize and giving master some time to start VSYNC
; properly (50 millisecondish delay)
ldi temp, 16
waiting:
clr ZH
clr ZL
wait_a_bit:
sbiw ZH:ZL, 1
brne wait_a_bit ; Loop 65536 times
dec temp
brne waiting ; Loop 65536 * 16 times
ldi temp, (1 << INT0)
out GIMSK, temp ; Enable INT0
ldi temp, (1 << SE) | (1 << ISC01)
out MCUCR, temp ; Enable sleep and edge INT0
sei ; Enable interrupts
sleep ; Go to sleep
slave_sync:
; We continue here after INT0 has triggered.
;
cli ; Disable interrupts for good (rest of code in busyloop)
out GIMSK, zero ; Disable INT0
; Sync vertical line
;
ldi temp, 235
mov vline_lo, temp
mov vline_hi, one
; Delay for final sync
;
ldi temp, 187
slave_wait:
dec temp
brne slave_wait
; And then fine-tune
;
nop
nop
nop
.endif
set_timers:
; HSYNC timer. Prescaler 4, Compare value = 159 = 31.8us
; We generate HSYNC pulse with PWM
;
ldi temp, (1 << CS10) | (1 << CS11);
out TCCR1, temp
; Slave has comparator B disconnected from output pin
.ifdef VGA_MASTER
ldi temp, (1 << PWM1B) | (1 << COM1B1)
.else
ldi temp, (1 << PWM1B)
.endif
out GTCCR, temp
ldi temp, 130
out OCR1A, temp
ldi temp, 139
out OCR1B, temp
ldi temp, 158
out OCR1C, temp
; Jitter fix timer. Runs without prescaler.
;
ldi temp, (1 << WGM01)
out TCCR0A, temp
ldi temp, (1 << CS00)
out TCCR0B, temp
ldi temp, 158
out OCR0A, temp
; TCNT0 value has been calculated using simulator
; and clock cycle counting to be in sync with
; HSYNC timer value in TCNT1 in "jitterfix"
;
out TCNT1, zero
ldi temp, JITTERVAL
out TCNT0, temp
wait_uart:
; Wait for HSYNC timer to reach specified value
; for UART.
;
in temp, TCNT1
cpi temp, UART_WAIT
brlo wait_uart
uart_handling:
; Check if we are already receiving,
; uart_seq should not be 0 then.
;
cp uart_seq, zero
brne uart_receive
; Check for start condition
;
sbic PINB, UART_PIN ; Skip rjmp if bit is cleared
rjmp uart_gotdata ; Check if we have data in buffer then
; Start detected, set values to registers
;
ldi temp, 128
mov uart_byte, temp ; C flag set when byte received
ldi temp, UART_FIRST ; First sequence after start
mov uart_seq, temp ; bit is 4 HSYNC cycles
ldi temp, UART_INIT ; Init next sequence value
mov uart_next, temp
rjmp wait_hsync ; Start bit handling done
uart_receive:
; Seems we are already receiving. Roll the UART
; sequence variable to see if it's time to sample
; a bit or not
;
ror uart_seq ; Roll sequence right
brcs uart_sample_seq ; If C flag was set, we sample
rjmp uart_gotdata ; If not, check if we got data in buffer
uart_sample_seq:
; We are ready to sample a bit, but first let's
; check if we need to update UART sequence
;
ldi temp, 3
cp uart_seq, temp ; Was it stop bit?
brne uart_seq_update ; Not stop bit, continue to sequence update
clr uart_seq ; Stop bit. Clear uart_seq (wait start)
rjmp wait_hsync ; Go wait for hsync
uart_seq_update:
cp uart_seq, one ; Check if sequence contains "1"
brne uart_sample ; It doesn't, no need to update sequence
ldi temp, UART_XOR
eor uart_next, temp ; Switch between "3,3" and "4" cycles
mov uart_seq, uart_next ; and move it to next sequence
uart_sample:
; Sample one bit from UART and update to screen if needed
;
sbic PINB, UART_PIN ; Skip sec if bit is clear
sec ; Set Carry
ror uart_byte ; Roll it to UART buffer
brcs handle_data ; Do we have full byte?
rjmp wait_hsync ; Not full byte yet
handle_data:
; We got full byte from UART, buffer it
;
ldi temp, 7 ; Sequence to wait for stop
mov uart_seq, temp ; bit.
mov uart_buf, uart_byte ; Move it to buffer
sbr state, st_uart_val ; Tell we have data in buffer
rjmp wait_hsync
uart_gotdata:
; Check if we have data and handle it
;
sbrc state, st_uart ; Do we have UART byte in buffer?
rjmp uart_buffer_full ; Yes we do, handle it
; If no data in buffer, do we need to scroll row left?
;
sbrc state, st_left ; Scrolling row left?
rjmp row_left ; Yes, jump to left scroll
; Check if we need to scroll whole screen left?
;
in temp, LEFT_CNT ; Do we need to scroll screen left?
cpse zero, temp ; Skip next command if we don't
rjmp scroll_screen_left ; Yes we do, jump to scroll
; Scroll whole screen up?
;
sbrc state, st_scroll ; Scrolling screen up?
rjmp scroll_later ; Yes. Now is later!
; Nothing to do
rjmp wait_hsync
scroll_screen_left:
sbrc state, st_full_left ; If screen scrolling is ongoing
rjmp scroll_wait_row ; wait for "row 16"
sbr state, st_left_val ; Set row scrolling to happen later
clr seq_cnt
sbr state, st_full_left_val
clr scroll_row ; Start from row 0
rjmp wait_hsync
scroll_wait_row:
ldi temp, 16
cp scroll_row, temp ; See if we've done full
breq scroll_dec_count ; screen
sbr state, st_left_val ; Set row scrolling to happen later
clr seq_cnt
rjmp wait_hsync ; just jump to wait for uart
scroll_dec_count:
in temp, LEFT_CNT ; We've done full screen,
dec temp ; decrease the counter of
out LEFT_CNT, temp ; screenfuls to scroll
cbr state, st_full_left_val ; Check scroll on next round again
rjmp wait_hsync
uart_buffer_full:
; We have "full buffer" (1 byte)
; handle it now!
;
cbr state, st_uart_val ; Tell we're emptying buffer
cpse ansi_state, zero ; Are we in ANSI handling mode?
rjmp handle_ansi ; Yes we are, jump to handle ansi
cpi uart_buf, 27 ; Special case: ESC
breq handle_esc
cpi uart_buf, 13 ; Special case: CR
breq handle_cr_or_lf
cpi uart_buf, 10 ; Special case: LF
breq handle_cr_or_lf
cpi uart_buf, 8 ; Special case: BS
breq handle_bs
rjmp not_special
handle_bs:
; Backspace
;
cp scroll_lo, cursor_lo
cpc scroll_hi, cursor_hi ; Cursor at 0,0?
breq backspace_done ; Yes. Do nothing
cp cursor_lo, zero
cpc cursor_hi, zero
brne backspace_no_ovf ; No overflow
clr cursor_lo ; Reset cursor location
ldi cursor_hi, 2
backspace_no_ovf:
sbiw cursor_hi:cursor_lo, 1 ; Move cursor backwards
ldi YL, low(screenbuf) ; Get screenbuffer address
ldi YH, high(screenbuf)
add YL, cursor_lo ; Move pointer to cursor
adc YH, cursor_hi ; location
st Y, zero ; Store empty
backspace_done:
rjmp wait_hsync
handle_esc:
; ESC received, commence ANSI-escape parsing mode
;
ldi ansi_state, 1 ; Set ANSI parsing mode on
clr ansi_val1 ; Clear ANSI values
clr ansi_val2 ; Clear ANSI values
rjmp wait_hsync
handle_cr_or_lf:
; We treat CR and LF the same
;
andi cursor_lo, 224 ; First column
adiw cursor_hi:cursor_lo, 32 ; Next line
rjmp check_cursor_ovf
not_special:
; Not special, store character into buffer
;
sbrc state, st_tricoder ; Are we in tricoder mode?
rjmp tricoder_store
mov temp, color_fg
sbrs temp, COLOR_BIT ; skip if fg_color has our bit.
rjmp no_fg_match
mov temp, color_bg ; Check if bg_color has our bit.
sbrc temp, COLOR_BIT ; Skip if it does not (store byte as-is)
ldi uart_buf, 128 ; fg & bg both match = inverse block
rjmp store_char_to_buffer
tricoder_store:
in temp, TRICODE_CNT
mov temp2, temp
lsl temp2
sbrc temp2, 3
mov temp2, one
out TRICODE_CNT, temp2
sbrs temp, COLOR_BIT
rjmp wait_hsync
rjmp store_char_to_buffer
no_fg_match:
mov temp, color_bg ; Check if bg_color has our bit.
sbrs temp, COLOR_BIT
rjmp no_fg_bg_match ; Neither fore or background matches.
ldi temp, 128
eor uart_buf, temp ; Only background matches, reverse char
rjmp store_char_to_buffer
no_fg_bg_match:
ldi uart_buf, 0 ; Store empty if color doesn't match
store_char_to_buffer:
ldi YL, low(screenbuf) ; Get screenbuffer address
ldi YH, high(screenbuf)
add YL, cursor_lo ; Move pointer to cursor
adc YH, cursor_hi ; location
st Y+, uart_buf ; Store byte
sbrs state, st_wrap ; Check wrap mode
rjmp no_wrap_increase ; Non-wrap mode
adiw cursor_hi:cursor_lo, 1 ; Increase cursor location
rjmp check_cursor_ovf ; Normally in wrap-mode
no_wrap_increase:
mov temp, cursor_lo ; We're in no-wrap-mode
andi temp, 31 ; Check if end-of-row
cpi temp, 31
breq check_cursor_ovf ; End-of-row, don't inc cursor
adiw cursor_hi:cursor_lo, 1 ; Otherwise increase cursor location
check_cursor_ovf:
; Check if cursor overflows the screen buffer
;
cpi cursor_hi, 2
brne check_scroll ; Check if we need to scroll
clr cursor_lo ; End of buffer reached,
clr cursor_hi ; go back to beginning
check_scroll:
; If cursor position matches the scroll offset, we're at the
; end of screen and need to scroll.
cp scroll_lo, cursor_lo
cpc scroll_hi, cursor_hi ; Cursor at the scroll position?
breq scroll_screen ; Yes, then we scroll
rjmp wait_hsync ; If not, just wait HSYNC
scroll_screen:
; We don't have enough time to scroll now, set scroll to happen
; later, without loop
;
sbr state, st_scroll_val ; Set scrolling to happen later
ldi temp, 2
mov seq_cnt, temp ; Scroll happens in 2 sequences
rjmp wait_hsync
handle_ansi:
; ANSI Escape handling
;
cpse ansi_state, one ; Do we have bracket yet?
rjmp ansi_data ; Yes we do
; Check for bracket
;
ldi temp, 91 ; Ascii 91 = [
cpse uart_buf, temp ; Was next character bracket?
rjmp unknown_ansi ; No it was not..
ldi ansi_state, 2 ; Got bracket
rjmp wait_hsync ; Go wait for HSYNC
ansi_data:
; Handle ANSI values and commands.
; If command has multiple values separated by semicolon
; we only store the last two
;
out TRICODE_CNT, one ; Zero tricorder char
cpi uart_buf, ';' ; Check for semicolon
brne ansi_notsemi ; Was not semicolon
;
; Got value separator (semicolon)
mov ansi_val2, ansi_val1 ; Move data to 2nd buffer
clr ansi_val1 ; And clear 1st buffer
ldi ansi_state, 3 ; Tell we have more than 1 value
rjmp wait_hsync
ansi_notsemi:
; Was not semicolon. Check if we got number or command
;
cpi uart_buf, 'A' ; Crude separation to numbers & letters
brsh ansi_command ; It's command letter
ansi_value:
; Value parser
;
mov temp, ansi_val1 ; Multiply existing value by 10
lsl ansi_val1 ; ((n << 2) + n) << 1
lsl ansi_val1
add ansi_val1, temp
lsl ansi_val1
subi uart_buf, '0' ; Subtract ascii value for "0"
add ansi_val1, uart_buf ; Add result to value
rjmp wait_hsync ; Wait for HSYNC
ansi_command:
; Parse ANSI command
;
cpi uart_buf, '[' ; [ = scroll row left
breq ansi_scroll_row_left
cpi uart_buf, ']' ; [ = scroll row left
breq ansi_graphics_mode
cpi uart_buf, 'm' ; m = set color
breq ansi_set_color
cpi uart_buf, 'H' ; H = move cursor
breq ansi_move_xy
cpi uart_buf, 'f' ; f = move cursor
breq ansi_move_xy
cpi uart_buf, 'J' ; J = clear screen
breq ansi_clear_screen
cpi uart_buf, 'h' ; h = enable wrap
breq ansi_enable_wrap
cpi uart_buf, 'l' ; l = disable wrap (lower case L)
breq ansi_disable_wrap
cpi uart_buf, 'B' ; B = cursor down
breq ansi_move_down
cpi uart_buf, 'C' ; C = cursor right
breq ansi_move_right
; Unknown, dismiss ANSI
;
clr ansi_state
rjmp wait_hsync
ansi_scroll_row_left:
sbr state, st_left_val ; Set row scrolling to happen later
clr seq_cnt
mov scroll_row, ansi_val1 ; Store row number for later
rjmp ansi_done
ansi_move_down:
adiw cursor_hi:cursor_lo, 32
rjmp ansi_move_check_overflow
ansi_move_right:
adiw cursor_hi:cursor_lo, 1
rjmp ansi_move_check_overflow
ansi_move_xy:
clr cursor_hi ; Calculate cursor location
mov cursor_lo, ansi_val2
swap cursor_lo ; Shift left 4 times
lsl cursor_lo ; shift once more = * 32
rol cursor_hi ; push high bit to cursor_hi
add cursor_lo, ansi_val1
add cursor_lo, scroll_lo ; Add scroll offset to
adc cursor_hi, scroll_hi ; cursor
ansi_move_check_overflow:
cpi cursor_hi, 2 ; check if cursor overflows screen
brlo no_move_overflow
subi cursor_hi, 2 ; compensate overflow
no_move_overflow:
rjmp ansi_done
ansi_enable_wrap:
; Enable wrap
;
ldi temp, 157 ; Check value
cpse ansi_val1, temp ; ?7h = enable wrap
rjmp ansi_done
sbr state, st_wrap_val
rjmp ansi_done
ansi_disable_wrap:
; Disable wrap
;
ldi temp, 157 ; Check value
cpse ansi_val1, temp ; ?7l = disable wrap
rjmp ansi_done
cbr state, st_wrap_val
rjmp ansi_done
ansi_clear_screen:
; Screen clear
;
ldi temp, 2 ; Check value
cp ansi_val1, temp ; 2J = clear screen
breq ansi_commence_clear
clr ansi_state ; Dismiss, invalid number
rjmp wait_hsync
ansi_commence_clear:
; 2J received, clear the screen when we have time
;
sbr state, st_clear_val ; Initiate clear mode
clr clear_cnt ; Clear counter zeroed
ldi XL, low(screenbuf) ; Start from the beginning
ldi XH, high(screenbuf) ; of SRAM
clr ansi_state
rjmp wait_hsync
ansi_graphics_mode:
out SPLIT_ROW, ansi_val1
rjmp ansi_done
ansi_set_color:
; Set colors. We do same check for both values.
;
cp ansi_val1, zero ; Reset colors?
breq ansi_color_reset
ansi_set_color_val:
; Only check reset once
;
ldi temp, 40
cp ansi_val1, temp ; Back- or foreground color?
brlo ansi_color_fg ; Set foreground
sub ansi_val1, temp ; Get real color value
mov color_bg, ansi_val1 ; Set it as background
rjmp ansi_color_next
ansi_color_fg:
; Color was foreground
;
ldi temp, 30
sub ansi_val1, temp ; Get real color value
mov color_fg, ansi_val1 ; Move it to foreground color
ansi_color_next:
ldi temp, 3
cpse ansi_state, temp ; Check for more values
rjmp ansi_done ; No more values, we're done
mov ansi_val1, ansi_val2 ; Copy second value
dec ansi_state ; No more values (max 2)
rjmp ansi_set_color_val ; Do it again
ansi_color_reset:
ldi temp, DEFAULT_COLOR_FG
mov color_fg, temp ; Default foreground color
ldi temp, DEFAULT_COLOR_BG
mov color_bg, temp ; Default background color
rjmp ansi_color_next
ansi_done:
clr ansi_state ; Done Parsing ANSI
rjmp wait_hsync ; Wait for HSYNC
unknown_ansi:
; Unknown ANSI escape after ESC.
; We have implemented our own escape-codes which
; are checked here
;
clr ansi_state ; Done Parsing ANSI
cpi uart_buf, 'D' ; D = Left scroll
breq ansi_left_scroll
cpi uart_buf, 'G' ; G (Graphics) = Tricoder mode start
breq ansi_tricoder_start
cpi uart_buf, 'T' ; T (Text) = Tricoder mode stop
breq ansi_tricoder_stop
cpi uart_buf, 'c' ; c = Full reset (clear all)
breq full_reset
rjmp not_special ; Just store the char as-is
full_reset:
ldi temp, (1 << WDE) ; Reset with watchdog
out WDTCR, temp
reset_loop:
rjmp reset_loop
ansi_left_scroll:
in temp, LEFT_CNT ; Increase the screen
ldi temp2, 32 ; left scroll counter
cpse temp, temp2 ; Max out counter at 32 columns
inc temp
out LEFT_CNT, temp
rjmp wait_hsync
ansi_tricoder_start:
sbr state, st_tricoder_val
out TRICODE_CNT, one
rjmp wait_hsync
ansi_tricoder_stop:
cbr state, st_tricoder_val
rjmp wait_hsync
row_left:
; Scroll row left, in multiple cycles
;
cpse seq_cnt, zero
rjmp row_left_scroll
ldi YL, low(screenbuf) ; Get screenbuffer address
ldi YH, high(screenbuf)
add YL, scroll_lo ; Add scroll offset low
adc YH, scroll_hi ; Add scroll offset high
clr temp2 ; Calculate row address
mov temp, scroll_row ; Take row number from store
swap temp ; and multiply by 32
lsl temp ; with left shifting 5 times
rol temp2 ; Roll to high byte
add YL, temp ; Add row address to screen
adc YH, temp2 ; buffer address
ldi temp, 2
cpi YL, low(screen_end) ; check for screen buffer
cpc YH, temp ; address overflow
brlo row_left_no_overflow
subi YH, 2 ; compensate overflow
row_left_no_overflow:
out SPL, YL ; Store address
out SPH, YH ; for later
inc seq_cnt
rjmp wait_hsync
row_left_scroll:
; Commence the actual scroll
;
.macro scr_left
ldd temp, Y+1
st Y+, temp
.endmacro
in YL, SPL ; Retrieve buffer
in YH, SPH ; address
sbrc seq_cnt, 2
rjmp row_left_last
inc seq_cnt
scr_left
scr_left
scr_left
scr_left
scr_left
scr_left
scr_left
scr_left
out SPL, YL ; Store back
out SPH, YH ; for later
rjmp wait_hsync
row_left_last:
scr_left
scr_left
scr_left
scr_left
scr_left
scr_left
scr_left
st Y+, zero
; Increase counter (we might be full-screen scrolling)
;
inc scroll_row
; Implicate that row is done
;
cbr state, st_left_val
rjmp wait_hsync
scroll_later:
; We're scrolling. Clear the "last line on screen"
; and move the scroll offset. Now is later!
; We also do this during two horizontal lines
; because clock deprivation :)
;
ldi YL, low(screenbuf) ; Load screenbuffer address
ldi YH, high(screenbuf)
add YL, scroll_lo ; Add scroll offset
adc YH, scroll_hi
dec seq_cnt
breq scroll_later_second
; Store space, unrolled 32 times
;
st Y, zero
std Y+1, zero
std Y+2, zero
std Y+3, zero
std Y+4, zero
std Y+5, zero
std Y+6, zero
std Y+7, zero
std Y+8, zero
std Y+9, zero
std Y+10, zero
std Y+11, zero
std Y+12, zero
std Y+13, zero
std Y+14, zero
std Y+15, zero
std Y+16, zero
rjmp wait_hsync
scroll_later_second:
; Second part of the row clearing
;
std Y+17, zero
std Y+18, zero
std Y+19, zero
std Y+20, zero
std Y+21, zero
std Y+22, zero
std Y+23, zero
std Y+24, zero
std Y+25, zero
std Y+26, zero
std Y+27, zero
std Y+28, zero
std Y+29, zero
std Y+30, zero
std Y+31, zero
ldi temp, 32
add scroll_lo, temp ; Move scroll offset by 32 bytes
adc scroll_hi, zero ; (one row)
cbr state, st_scroll_val ; Remove scroll-later state
cpi scroll_hi, 2 ; Check scroll roll over
brne wait_hsync ; No, not yet
clr scroll_hi ; Overflow, clear scroll offset
wait_hsync:
; Wait for HSYNC timer to reach specified value
; for screen drawing
;
in temp, TCNT1
cpi temp, HSYNC_WAIT
brne wait_hsync
jitterfix:
; Read Timer0 counter and jump over nops with
; ijmp using the value to fix the jitter
;
in temp, TCNT0
ldi ZL, low(jitternop)
ldi ZH, high(jitternop)
add ZL, temp
adc ZH, zero
ijmp
jitternop:
; If timer start value is good, we jump over 0-4 nops
;
nop
nop
nop
nop
nop ; The last nop is for porch finetuning
check_visible:
; Check if we are in visible screen area or in vertical blanking
; area of the screen
;
add vline_lo, one
adc vline_hi, zero
ldi temp, VISIBLE
cp vline_lo, temp ; Visible area low byte
cpc vline_hi, one ; Visible area high byte
brlo visible_area
rjmp vertical_sync
visible_area:
; We are in visible area. Select if we actually draw pixels
; or not. If we are clearing the screen, no need to draw
; pixels.
;
sbrs state, st_clear
rjmp draw_pixels ; Draw pixels
clear_screen:
; We jump here if clearing screen
;
ldi temp, 64
clear_loop:
st X+, zero ; X is set when we get clear command.
dec temp ; We clear the whole 512 bytes
brne clear_loop ; of memory 64 bytes at a time.
inc clear_cnt ; Increase counter
sbrs clear_cnt, 3 ; Have we reached 8 yet?
rjmp wait_uart ; Jump if we haven't
cbr state, st_clear_val ; Everything cleared, clear state bit
ldi XL, low(screenbuf) ; Reset X back to beginning of
ldi XH, high(screenbuf) ; screen buffer
clr scroll_hi
clr scroll_lo
clr cursor_hi
clr cursor_lo
rjmp wait_uart ; Done clearing
draw_pixels:
; Macro to fetch character and push bits out of USI
.macro draw_char
ld ZL, X+ ; Load char from screen buffer (X) to ZL
lpm temp, Z ; and fetch font byte from flash (Z)
out USIDR, temp ; then store it to predraw buffer (Y)
sbi USICR, USICLK ; Just push pixels out
sbi USICR, USICLK
sbi USICR, USICLK
sbi USICR, USICLK
sbi USICR, USICLK
.endmacro
mov ZH, font_hi
; Fetch'n'draw 32 characters in unrolled loop
;
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
draw_char
; Make sure we don't draw to porch
;
nop
nop
sbi USICR, USICLK
sbiw XH:XL, 32 ; Go back to beginning or row
check_housekeep:
; If we have drawn the current line 4 times,
; time to do some housekeeping.
;
dec row_cnt
breq housekeeping
rjmp wait_uart
housekeeping:
; Advance to next line, alternate buffers
; and do some other housekeeping after pixels
; have been drawn
;
ldi temp, 3
mov row_cnt, temp ; Reset pixel counter
inc font_hi ; Increase font line
; Check if we have drawn one row of characters
;
cpi font_hi, 0x20 ; Text font
breq done_one_row
cpi font_hi, 0x16 ; Pixel font
breq done_one_row
rjmp wait_uart ; Not yet full row
done_one_row:
; We've drawn one row of charactesrs,
; advance to next row
inc char_row ; Increase row counter
adiw XH:XL, 32 ; Increase buffer offset
; See if our buffer has overflown the memory
; (might happen if we have scrolled)
;
ldi temp, high(screen_end)
cpi XL, low(screen_end)
cpc XH, temp
brne no_buffer_overflow
ldi XL, low(screenbuf)
ldi XH, high(screenbuf)
no_buffer_overflow:
in temp, SPLIT_ROW ; See where the text
cp char_row, temp ; mode starts from
brlo next_row_text
ldi font_hi, 0x16
rjmp wait_uart
next_row_text:
ldi font_hi, 0x0C
rjmp wait_uart
vertical_sync:
; Check if we need to switch VSYNC low
; Only Master does this.
;
.ifdef VGA_MASTER
ldi temp, VSYNC_LOW
cp vline_lo, temp ; Low
cpc vline_hi, one ; High
brne check_vsync_high
cbi PORTB, VSYNC_PIN ; Vsync low
rjmp wait_uart
check_vsync_high:
; Check if we need to switch VSYNC high
;
ldi temp, VSYNC_HIGH
cp vline_lo, temp ; Low
cpc vline_hi, one ; High
brne check_vlines
sbi PORTB, VSYNC_PIN ; Vsync high
rjmp wait_uart
.endif
check_vlines:
; Have we done 525 lines?
;
ldi temp2, 2 ; High byte (525)
ldi temp, 13
cp vline_lo, temp ; Low (525)
cpc vline_hi, temp2 ; High (525)
breq screen_done
vblank:
; We are outside visible screen
;
sbrc state, st_clear ; If bit it clear, we skip
rjmp clear_screen ; the jump to screen clearing
rjmp wait_uart
screen_done:
; We have drawn full screen, initialize values
; back to start values for next refresh
;
clr vline_lo ; Vertical line low
clr vline_hi ; Vertical line high
ldi temp, 3
mov row_cnt, temp ; Pixel counter
clr char_row ; Character row counter
ldi XL, low(screenbuf) ; Pointer to start of
ldi XH, high(screenbuf) ; the screen buffer.
add XL, scroll_lo ; Add scroll offset
adc XH, scroll_hi ; to address
in temp, SPLIT_ROW
cp temp, zero
breq font_begin_text
ldi font_hi, 0x0C ; Start with pixel font
rjmp wait_uart
font_begin_text:
; Screen begins with text font
;
ldi font_hi, 0x16
rjmp wait_uart
.include "pixels.inc"
.include "font.inc"
|
||||
TheStack | 14534dd4020259e1332bcad0aebb05167fb774d6 | Assemblycode:Assembly | {"size": 460, "ext": "asm", "max_stars_repo_path": "programs/oeis/077/A077605.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/077/A077605.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/077/A077605.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 51.1111111111, "max_line_length": 201, "alphanum_fraction": 0.5369565217} | ; A077605: Left summing matrix, S.
; 1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0
mov $1,1
mov $2,$0
seq $2,202023 ; Triangle T(n,k), read by rows, given by (1, 0, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.
min $1,$2
mov $0,$1
|
||||
TheStack | b01d48dcce85a277ff68214c81a645a0f7dff369 | Assemblycode:Assembly | {"size": 3999, "ext": "asm", "max_stars_repo_path": "assembler/tests/t_8008/t_8008.asm", "max_stars_repo_name": "paulscottrobson/RCA-Cosmac-VIP-III", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "assembler/tests/t_8008/t_8008.asm", "max_issues_repo_name": "paulscottrobson/RCA-Cosmac-VIP-III", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assembler/tests/t_8008/t_8008.asm", "max_forks_repo_name": "paulscottrobson/RCA-Cosmac-VIP-III", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 8.2453608247, "max_line_length": 43, "alphanum_fraction": 0.4753688422} | page 0
cpu 8008
;-----------------------------------
; CPU Control Group
hlt
;-----------------------------------
; Input and Output Group
inp 5
out 13h
;-----------------------------------
; Jump Group
jmp 1234h
jfc 1234h
jfz 1234h
jfs 1234h
jfp 1234h
jc 1234h
jz 1234h
js 1234h
jp 1234h
;-----------------------------------
; Call and Return Group
cal 1234h
cfc 1234h
cfz 1234h
cfs 1234h
cfp 1234h
cc 1234h
cz 1234h
cs 1234h
cp 1234h
ret
rfc
rfz
rfs
rfp
rc
rz
rs
rp
rst 38h
;-----------------------------------
; Load Group
laa
lab
lac
lad
lae
lah
lal
lba
lbb
lbc
lbd
lbe
lbh
lbl
lca
lcb
lcc
lcd
lce
lch
lcl
lda
ldb
ldc
ldd
lde
ldh
ldl
lea
leb
lec
led
lee
leh
lel
lha
lhb
lhc
lhd
lhe
lhh
lhl
lla
llb
llc
lld
lle
llh
lll
lam
lbm
lcm
ldm
lem
lhm
llm
lma
lmb
lmc
lmd
lme
lmh
lml
lai 55h
lbi 55h
lci 55h
ldi 55h
lei 55h
lhi 55h
lli 55h
lmi 55h
;-----------------------------------
; Arithmetic Group
ada
adb
adc
add
ade
adh
adl
adm
adi 55h
aca
acb
acc
acd
ace
ach
acl
acm
aci 55h
sua
sub
suc
sud
sue
suh
sul
sum
sui 55h
sba
sbb
sbc
sbd
sbe
sbh
sbl
sbm
sbi 55h
nda
ndb
ndc
ndd
nde
ndh
ndl
ndm
ndi 55h
xra
xrb
xrc
xrd
xre
xrh
xrl
xrm
xri 55h
ora
orb
orc
ord
ore
orh
orl
orm
ori 55h
cpa
cpb
cpc
cpd
cpe
cph
cpl
cpm
cpi 55h
inb
inc
ind
ine
inh
inl
dcb
dcc
dcd
dce
dch
dcl
;-----------------------------------
; Rotate Group
rlc
rrc
ral
rar
;===================================
cpu 8008new
;-----------------------------------
; CPU Control Group
hlt
;-----------------------------------
; Input and Output Group
in 5
out 13h
;-----------------------------------
; Jump Group
jmp 1234h
jnc 1234h
jnz 1234h
jp 1234h
jpo 1234h
jc 1234h
jz 1234h
jm 1234h
jpe 1234h
;-----------------------------------
; Call and Return Group
call 1234h
cnc 1234h
cnz 1234h
cp 1234h
cpo 1234h
cc 1234h
cz 1234h
cm 1234h
cpe 1234h
ret
rnc
rnz
rp
rpo
rc
rz
rm
rpe
rst 38h
;-----------------------------------
; Load Group
mov a,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov b,a
mov b,b
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov c,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov d,a
mov d,b
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov e,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov h,a
mov h,b
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov l,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov a,m
mov b,m
mov c,m
mov d,m
mov e,m
mov h,m
mov l,m
mov m,a
mov m,b
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
mvi a,55h
mvi b,55h
mvi c,55h
mvi d,55h
mvi e,55h
mvi h,55h
mvi l,55h
mvi m,55h
lxi b,1234h ; convenience built-in macro:
lxi d,1234h ; LXI is assembled as 2 x MVI
lxi h,1234h
;-----------------------------------
; Arithmetic Group
add a
add b
add c
add d
add e
add h
add l
add m
adi 55h
adc a
adc b
adc c
adc d
adc e
adc h
adc l
adc m
aci 55h
sub a
sub b
sub c
sub d
sub e
sub h
sub l
sub m
sui 55h
sbb a
sbb b
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbi 55h
ana a
ana b
ana c
ana d
ana e
ana h
ana l
ana m
ani 55h
xra a
xra b
xra c
xra d
xra e
xra h
xra l
xra m
xri 55h
ora a
ora b
ora c
ora d
ora e
ora h
ora l
ora m
ori 55h
cmp a
cmp b
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cpi 55h
inr b
inr c
inr d
inr e
inr h
inr l
dcr b
dcr c
dcr d
dcr e
dcr h
dcr l
;-----------------------------------
; Rotate Group
rlc
rrc
ral
rar
|
||||
TheStack | 401565a4ce1ce48bb0bd6869d3f5c7476799d83c | Assemblycode:Assembly | {"size": 783, "ext": "asm", "max_stars_repo_path": "programs/oeis/061/A061006.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/061/A061006.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/061/A061006.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 52.2, "max_line_length": 578, "alphanum_fraction": 0.5708812261} | ; A061006: a(n) = (n-1)! mod n.
; 0,1,2,2,4,0,6,0,0,0,10,0,12,0,0,0,16,0,18,0,0,0,22,0,0,0,0,0,28,0,30,0,0,0,0,0,36,0,0,0,40,0,42,0,0,0,46,0,0,0,0,0,52,0,0,0,0,0,58,0,60,0,0,0,0,0,66,0,0,0,70,0,72,0,0,0,0,0,78,0,0,0,82,0,0,0,0,0,88,0,0,0,0,0,0,0,96,0,0,0,100,0,102,0,0,0,106,0,108,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,126,0,0,0,130,0,0,0,0,0,136,0,138,0,0,0,0,0,0,0,0,0,148,0,150,0,0,0,0,0,156,0,0,0,0,0,162,0,0,0,166,0,0,0,0,0,172,0,0,0,0,0,178,0,180,0,0,0,0,0,0,0,0,0,190,0,192,0,0,0,196,0,198,0,0,0,0,0,0,0,0,0,0,0,210,0,0,0,0,0,0,0,0,0,0,0,222,0,0,0,226,0,228,0,0,0,232,0,0,0,0,0,238,0,240,0,0,0,0,0,0,0,0,0
sub $0,2
mov $1,2
bin $1,$0
mov $2,$1
cmp $2,0
add $1,$2
div $0,$1
add $0,2
mov $1,$0
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
mul $1,$0
|
||||
TheStack | 4ed4d7d28d166bbc5113167f3d582647c3a3f873 | Assemblycode:Assembly | {"size": 529, "ext": "asm", "max_stars_repo_path": "src/firmware-tests/Platform/Lcd/EnableDisable/IsLcdEnabledAfterLcdDisabledTest.asm", "max_stars_repo_name": "pete-restall/Cluck2Sesame-Prototype", "max_stars_repo_stars_event_min_datetime": "2019-12-12T09:07:08.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-12T09:07:08.000Z", "max_issues_repo_path": "src/firmware-tests/Platform/Lcd/EnableDisable/IsLcdEnabledAfterLcdDisabledTest.asm", "max_issues_repo_name": "pete-restall/Cluck2Sesame-Prototype", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/firmware-tests/Platform/Lcd/EnableDisable/IsLcdEnabledAfterLcdDisabledTest.asm", "max_forks_repo_name": "pete-restall/Cluck2Sesame-Prototype", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.064516129, "max_line_length": 62, "alphanum_fraction": 0.763705104} | #include "Platform.inc"
#include "FarCalls.inc"
#include "Lcd.inc"
#include "../../../../firmware/Platform/Lcd/Isr.inc"
#include "TestFixture.inc"
radix decimal
IsLcdEnabledAfterLcdDisabledTest code
global testArrange
testArrange:
fcall initialiseLcd
fcall enableLcd
waitUntilLcdIsEnabled:
fcall pollLcd
banksel lcdFlags
btfss lcdFlags, LCD_FLAG_ENABLED
testAct:
fcall disableLcd
fcall isLcdEnabled
testAssert:
.aliasWForAssert _a
.assert "_a == 0, 'Expected isLcdEnabled() to return false.'"
return
end
|
||||
TheStack | ad2ae732ad774703c733eedd0af5850bcd50fc3a | Assemblycode:Assembly | {"size": 667, "ext": "asm", "max_stars_repo_path": "oeis/154/A154021.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/154/A154021.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/154/A154021.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 44.4666666667, "max_line_length": 483, "alphanum_fraction": 0.8215892054} | ; A154021: a(n+2) = 16*a(n+1) - a(n), with a(1)=0, a(2)=4.
; Submitted by Jon Maiga
; 0,4,64,1020,16256,259076,4128960,65804284,1048739584,16714029060,266375725376,4245297576956,67658385505920,1078288870517764,17184963542778304,273881127813935100,4364913081480183296,69564728175868997636,1108670737732423778880,17669167075542911464444,281598002470954159652224,4487898872459723642971140,71524783956884624127886016,1139908644437694262403205116,18167013527046223574323395840,289532307788301882926771128324,4614349911085783903254014657344,73540066269584240569137463389180
mov $2,1
lpb $0
sub $0,1
mov $1,$3
mul $1,14
add $2,$1
add $3,$2
lpe
mov $0,$3
mul $0,4
|
||||
TheStack | 63fc3d6c20964e55b8eb99b3e5be285bc187cda0 | Assemblycode:Assembly | {"size": 169, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/exp.asm", "max_stars_repo_name": "ahjelm/z88dk", "max_stars_repo_stars_event_min_datetime": "2021-12-23T15:34:05.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-23T15:36:16.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/exp.asm", "max_issues_repo_name": "ahjelm/z88dk", "max_issues_repo_issues_event_min_datetime": "2022-03-20T22:17:35.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-24T16:10:00.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/exp.asm", "max_forks_repo_name": "ahjelm/z88dk", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 4, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 11.2666666667, "max_line_length": 25, "alphanum_fraction": 0.7869822485} |
SECTION code_fp_math16
PUBLIC expf16
EXTERN _m16_expf
defc expf16 = _m16_expf
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _expf16
defc _expf16 = expf16
ENDIF
|
||||
TheStack | dfe2f6d1e458dd5c1dc5f4ec49f54b3a04e38162 | Assemblycode:Assembly | {"size": 2537, "ext": "asm", "max_stars_repo_path": "programs/oeis/271/A271035.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "programs/oeis/271/A271035.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/271/A271035.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 253.7, "max_line_length": 2359, "alphanum_fraction": 0.8931809223} | ; A271035: Number of 3 X 3 X 3 triangular 0..n arrays with some element less than a w, nw or ne neighbor exactly once.
; 10,72,294,896,2268,5040,10164,19008,33462,56056,90090,139776,210392,308448,441864,620160,854658,1158696,1547854,2040192,2656500,3420560,4359420,5503680,6887790,8550360,10534482,12888064,15664176,18921408,22724240,27143424,32256378,38147592,44909046,52640640,61450636,71456112,82783428,95568704,109958310,126109368,144190266,164381184,186874632,211876000,239604120,270291840,304186610,341551080,382663710,427819392,477330084,531525456,590753548,655381440,725795934,802404248,885634722,975937536,1073785440,1179674496,1294124832,1417681408,1550914794,1694421960,1848827078,2014782336,2192968764,2384097072,2588908500,2808175680,3042703510,3293330040,3560927370,3846402560,4150698552,4474795104,4819709736,5186498688,5576257890,5990123944,6429275118,6894932352,7388360276,7910868240,8463811356,9048591552,9666658638,10319511384,11008698610,11735820288,12502528656,13310529344,14161582512,15057504000,16000166490,16991500680,18033496470,19128204160,20277735660,21484265712,22750033124,24077342016,25468563078,26926134840,28452564954,30050431488,31722384232,33471146016,35299514040,37210361216,39206637522,41291371368,43467670974,45738725760,48107807748,50578272976,53153562924,55837205952,58632818750,61544107800,64574870850,67728998400,71010475200,74423381760,77971895872,81660294144,85492953546,89474352968,93609074790,97901806464,102357342108,106980584112,111776544756,116750347840,121907230326,127252543992,132791757098,138530456064,144474347160,150629258208,157001140296,163596069504,170420248642,177480009000,184781812110,192332251520,200138054580,208206084240,216543340860,225156964032,234054234414,243242575576,252729555858,262522890240,272630442224,283060225728,293820406992,304919306496,316365400890,328167324936,340333873462,352874003328,365796835404,379111656560,392827921668,406955255616,421503455334,436482491832,451902512250,467773841920,484106986440,500912633760,518201656280,535985112960,554274251442,573080510184,592415520606,612291109248,632719299940,653712315984,675282582348,697442727872,720205587486,743584204440,767591832546,792241938432,817548203808,843524527744,870185028960,897544048128,925616150186,954416126664,983958998022,1014260016000,1045334665980,1077198669360,1109867985940,1143358816320,1177687604310,1212871039352,1248926058954,1285869851136,1323719856888,1362493772640,1402209552744,1442885411968,1484539828002,1527191543976
mov $1,$0
add $1,5
bin $1,$0
add $0,5
mul $1,$0
mul $1,2
|
||||
TheStack | c92776066a4057301714b0e0c5421500246415c1 | Assemblycode:Assembly | {"size": 243, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/arch/zx/misc/c/sccz80/zx_scroll_up_pix_callee.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/arch/zx/misc/c/sccz80/zx_scroll_up_pix_callee.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/arch/zx/misc/c/sccz80/zx_scroll_up_pix_callee.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 13.5, "max_line_length": 46, "alphanum_fraction": 0.7901234568} | ; void zx_scroll_up_pix(uchar rows, uchar pix)
SECTION code_clib
SECTION code_arch
PUBLIC zx_scroll_up_pix_callee
EXTERN asm0_zx_scroll_up_pix
zx_scroll_up_pix_callee:
pop af
pop hl
pop de
push af
jp asm0_zx_scroll_up_pix
|
||||
TheStack | a20c313fefd33b301ad1cb78e0931c86fa2d5ab5 | Assemblycode:Assembly | {"size": 1297, "ext": "asm", "max_stars_repo_path": "maps/Route2NuggetHouse.asm", "max_stars_repo_name": "Dev727/ancientplatinum", "max_stars_repo_stars_event_min_datetime": "2019-11-08T07:19:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-20T10:17:54.000Z", "max_issues_repo_path": "maps/Route2NuggetHouse.asm", "max_issues_repo_name": "Dev727/ancientplatinum", "max_issues_repo_issues_event_min_datetime": "2020-01-11T17:00:40.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-14T01:27:38.000Z", "max_forks_repo_path": "maps/Route2NuggetHouse.asm", "max_forks_repo_name": "Dev727/ancientplatinum", "max_forks_repo_forks_event_min_datetime": "2020-05-28T17:31:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-07T20:49:35.000Z"} | {"max_stars_count": 28, "max_issues_count": 13, "max_forks_count": 22, "avg_line_length": 19.6515151515, "max_line_length": 149, "alphanum_fraction": 0.767925983} | object_const_def ; object_event constants
const ROUTE2NUGGETHOUSE_FISHER
Route2NuggetHouse_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
Route2NuggetHouseFisherScript:
faceplayer
opentext
checkevent EVENT_GOT_NUGGET_FROM_GUY
iftrue .GotNugget
writetext Route2NuggetHouseFisherText
buttonsound
verbosegiveitem NUGGET
iffalse .NoRoom
setevent EVENT_GOT_NUGGET_FROM_GUY
.GotNugget:
writetext Route2NuggetHouseFisherText_GotNugget
waitbutton
.NoRoom:
closetext
end
Route2NuggetHouseBookshelf:
; unused
jumpstd difficultbookshelf
Route2NuggetHouseFisherText:
text "Hi! Wow, I'm glad"
line "to see you."
para "You're the first"
line "visitor I've had"
cont "in a long time."
para "I'm super-happy!"
line "Let me give you a"
cont "little present."
done
Route2NuggetHouseFisherText_GotNugget:
text "That's a NUGGET."
para "I can't give you"
line "any nuggets of"
para "wisdom, so that'll"
line "have to do!"
done
Route2NuggetHouse_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 7, ROUTE_2, 1
warp_event 3, 7, ROUTE_2, 1
db 0 ; coord events
db 0 ; bg events
db 1 ; object events
object_event 2, 4, SPRITE_FISHER, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 2, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, Route2NuggetHouseFisherScript, -1
|
||||
TheStack | acca2b088d4d1ecb5ebd01cbea62c6f4d42b59ff | Assemblycode:Assembly | {"size": 621, "ext": "asm", "max_stars_repo_path": "oeis/157/A157367.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/157/A157367.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/157/A157367.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 51.75, "max_line_length": 495, "alphanum_fraction": 0.8115942029} | ; A157367: a(n) = 4802*n^2 + 196*n + 1.
; 4999,19601,43807,77617,121031,174049,236671,308897,390727,482161,583199,693841,814087,943937,1083391,1232449,1391111,1559377,1737247,1924721,2121799,2328481,2544767,2770657,3006151,3251249,3505951,3770257,4044167,4327681,4620799,4923521,5235847,5557777,5889311,6230449,6581191,6941537,7311487,7691041,8080199,8478961,8887327,9305297,9732871,10170049,10616831,11073217,11539207,12014801,12499999,12994801,13499207,14013217,14536831,15070049,15612871,16165297,16727327,17298961,17880199,18471041
add $0,1
mul $0,196
add $0,4
pow $0,2
sub $0,40000
div $0,784
mul $0,98
add $0,4999
|
||||
TheStack | 5cd24b15619dc9de4016cfa6710ced2b93cec1ac | Assemblycode:Assembly | {"size": 309, "ext": "asm", "max_stars_repo_path": "programs/oeis/011/A011767.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/011/A011767.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/011/A011767.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 12.875, "max_line_length": 67, "alphanum_fraction": 0.5533980583} | ; A011767: From studying monochromatic solutions to x3-x2=x2-x1+2n.
; 9,14,17,21,25,30,34,38,42,46,50
mov $2,$0
sub $3,$0
mul $0,6
mul $2,4
mov $4,$0
lpb $0
add $2,1
div $4,2
add $1,$4
mov $0,$1
add $3,1
mov $5,$3
cmp $5,0
add $3,$5
div $0,$3
sub $0,$3
sub $3,$1
lpe
mov $0,$2
add $0,9
|
||||
TheStack | 4615cab732aa30084e315d4b0e90181c5debc783 | Assemblycode:Assembly | {"size": 786, "ext": "asm", "max_stars_repo_path": "oeis/018/A018927.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/018/A018927.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/018/A018927.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 41.3684210526, "max_line_length": 489, "alphanum_fraction": 0.7951653944} | ; A018927: For each permutation p of {1,2,...,n} define maxjump(p) = max(p(i) - i); a(n) is sum of maxjumps of all p.
; Submitted by Christian Krause
; 0,1,7,45,313,2421,20833,198309,2073793,23664021,292834513,3907994949,55967406433,856355084661,13944569166193,240803714700069,4395998055854593,84596337986326101,1711691067680320273,36329581765125539589,807099012174816776353,18731512468236076050741,453331115236374699583153,11421756684634008372961509,299128152338082570599944513,8131477788469436887580981781,229136220558954410877648458833,6684877590077396637802248773829,201682074025077526917331370415073,6285588008460700269242319306367221
add $0,1
mov $1,$0
lpb $0
add $3,$1
mul $1,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $4,1
pow $3,$4
sub $1,$3
lpe
mov $0,$1
|
||||
TheStack | 98a75662be2dd3abeb9d0a5a4576e7c930071f14 | Assemblycode:Assembly | {"size": 81, "ext": "asm", "max_stars_repo_path": "src/main/fragment/mos6502-common/vwsm1=vwsm2_minus__deref_pwsz3.asm", "max_stars_repo_name": "jbrandwood/kickc", "max_stars_repo_stars_event_min_datetime": "2022-03-01T02:21:14.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-01T04:33:35.000Z", "max_issues_repo_path": "src/main/fragment/mos6502-common/vwsm1=vwsm2_minus__deref_pwsz3.asm", "max_issues_repo_name": "jbrandwood/kickc", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/main/fragment/mos6502-common/vwsm1=vwsm2_minus__deref_pwsz3.asm", "max_forks_repo_name": "jbrandwood/kickc", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 8.1, "max_line_length": 12, "alphanum_fraction": 0.5432098765} | sec
lda {m2}
ldy #0
sbc ({z3}),y
sta {m1}
lda {m2}+1
iny
sbc ({z3}),y
sta {m1}+1
|
||||
TheStack | 0fa3ce0def466a0b888ad67a674baeb34583c180 | Assemblycode:Assembly | {"size": 3839, "ext": "asm", "max_stars_repo_path": "release/src/router/gmp/source/mpn/x86/mod_1.asm", "max_stars_repo_name": "zhoutao0712/rtn11pb1", "max_stars_repo_stars_event_min_datetime": "2020-01-08T01:33:02.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-16T00:25:34.000Z", "max_issues_repo_path": "release/src/router/gmp/source/mpn/x86/mod_1.asm", "max_issues_repo_name": "zhoutao0712/rtn11pb1", "max_issues_repo_issues_event_min_datetime": "2019-12-19T19:34:56.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-10T10:11:28.000Z", "max_forks_repo_path": "release/src/router/gmp/source/mpn/x86/mod_1.asm", "max_forks_repo_name": "zhoutao0712/rtn11pb1", "max_forks_repo_forks_event_min_datetime": "2022-03-30T13:12:22.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T18:12:10.000Z"} | {"max_stars_count": 12, "max_issues_count": 8, "max_forks_count": 2, "avg_line_length": 23.4085365854, "max_line_length": 78, "alphanum_fraction": 0.7254493358} | dnl x86 mpn_mod_1 -- mpn by limb remainder.
dnl Copyright 1999, 2000, 2001, 2002, 2003, 2007 Free Software Foundation,
dnl Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 3 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C 486 42 approx, maybe
C P5 44
C P6 39
C K6 20
C K7 41
C P4 58
C mp_limb_t mpn_mod_1 (mp_srcptr src, mp_size_t size, mp_limb_t divisor);
C mp_limb_t mpn_mod_1c (mp_srcptr src, mp_size_t size, mp_limb_t divisor,
C mp_limb_t carry);
C
C Essentially this code is the same as the division based part of
C mpn/generic/mod_1.c, but has the advantage that we get the desired divl
C instruction even when gcc is not being used (where longlong.h only has the
C rather slow generic C udiv_qrnnd().
C
C A test is done to see if the high limb is less than the divisor, and if so
C one less div is done. A div is between 20 and 40 cycles on the various
C x86s, so assuming high<divisor about half the time, then this test saves
C half that amount. The branch misprediction penalty on each chip is less
C than half a div.
C
C
C Notes for K6:
C
C Back-to-back div instructions take 20 cycles, the same as the loop here,
C so it seems there's nothing to gain by rearranging. Pairing the mov and
C loop instructions was found to gain nothing. Normally we use a loop
C instruction rather than decl/jnz, but it gains nothing here.
C
C A multiply-by-inverse is used in mpn/x86/k6/pre_mod_1.asm, but it saves
C only 2 c/l so currently we haven't bothered with the same for mpn_mod_1.
C If an inverse takes about 40 cycles for normalized or perhaps 60 for
C unnormalized (due to bsfl being slow on k6) then the threshold would be at
C least 20 or 30 limbs.
C
defframe(PARAM_CARRY, 16)
defframe(PARAM_DIVISOR,12)
defframe(PARAM_SIZE, 8)
defframe(PARAM_SRC, 4)
TEXT
ALIGN(16)
PROLOGUE(mpn_mod_1)
deflit(`FRAME',0)
movl PARAM_SIZE, %ecx
pushl %ebx FRAME_pushl()
movl PARAM_SRC, %ebx
pushl %esi FRAME_pushl()
orl %ecx, %ecx
jz L(done_zero)
movl PARAM_DIVISOR, %esi
movl -4(%ebx,%ecx,4), %eax C src high limb
cmpl %esi, %eax
sbbl %edx, %edx C -1 if high<divisor
addl %edx, %ecx C skip one division if high<divisor
jz L(done_eax)
andl %eax, %edx C carry if high<divisor
L(top):
C eax scratch (quotient)
C ebx src
C ecx counter
C edx carry (remainder)
C esi divisor
C edi
C ebp
movl -4(%ebx,%ecx,4), %eax
divl %esi
decl %ecx
jnz L(top)
movl %edx, %eax
L(done_eax):
popl %esi
popl %ebx
ret
EPILOGUE()
C This code located after mpn_mod_1, so the jump to L(top) here is
C back and hence will be predicted as taken. (size==0 is considered
C unlikely.)
ALIGN(16)
PROLOGUE(mpn_mod_1c)
deflit(`FRAME',0)
movl PARAM_SIZE, %ecx
pushl %ebx FRAME_pushl()
movl PARAM_SRC, %ebx
pushl %esi FRAME_pushl()
movl PARAM_DIVISOR, %esi
orl %ecx, %ecx
movl PARAM_CARRY, %edx
jnz L(top)
popl %esi
movl %edx, %eax
popl %ebx
ret
C This code is for mpn_mod_1, but is positioned here to save some
C space in the alignment padding.
C
L(done_zero):
popl %esi
xorl %eax, %eax
popl %ebx
ret
EPILOGUE()
|
||||
TheStack | 40153ffdb6d5517f5093ca3d6ca1f91f0d76bba5 | Assemblycode:Assembly | {"size": 5516, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_629.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_629.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_629.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 42.106870229, "max_line_length": 2999, "alphanum_fraction": 0.654822335} | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdx
lea addresses_WC_ht+0xd420, %rbp
nop
nop
nop
nop
nop
sub %r12, %r12
mov $0x6162636465666768, %r15
movq %r15, (%rbp)
nop
nop
nop
cmp $209, %rax
lea addresses_WC_ht+0x1a9e0, %r15
nop
nop
nop
sub %rcx, %rcx
movups (%r15), %xmm4
vpextrq $1, %xmm4, %rbp
nop
nop
nop
nop
cmp $34352, %rcx
lea addresses_D_ht+0x153e0, %rbx
nop
nop
nop
nop
nop
inc %rdx
movw $0x6162, (%rbx)
nop
add %r12, %r12
lea addresses_UC_ht+0xcc0, %rbx
clflush (%rbx)
nop
nop
xor $29876, %rcx
movups (%rbx), %xmm4
vpextrq $0, %xmm4, %r15
dec %rcx
lea addresses_A_ht+0x28e0, %r12
inc %rbp
movb (%r12), %bl
nop
nop
nop
cmp $42739, %rax
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %rdx
push %rsi
// Store
lea addresses_US+0x1900a, %rdx
inc %r12
movw $0x5152, (%rdx)
and $25558, %r10
// Load
lea addresses_RW+0xbe60, %rdx
nop
sub $16819, %rsi
movups (%rdx), %xmm3
vpextrq $0, %xmm3, %r12
nop
and $14092, %rsi
// Faulty Load
lea addresses_UC+0x148e0, %r10
nop
nop
nop
nop
nop
and $63642, %r12
mov (%r10), %dx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
||||
TheStack | 589d29f6323bed9e8c2902514d9bf2fb5914980d | Assemblycode:Assembly | {"size": 1149, "ext": "asm", "max_stars_repo_path": "programs/oeis/002/A002309.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/002/A002309.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/002/A002309.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 82.0714285714, "max_line_length": 992, "alphanum_fraction": 0.8529155788} | ; A002309: Sum of first n fourth powers of odd numbers.
; 1,82,707,3108,9669,24310,52871,103496,187017,317338,511819,791660,1182285,1713726,2421007,3344528,4530449,6031074,7905235,10218676,13044437,16463238,20563863,25443544,31208345,37973546,45864027,55014652,65570653,77688014,91533855,107286816,125137441,145288562,167955683,193367364,221765605,253406230,288559271,327509352,370556073,418014394,470215019,527504780,590247021,658821982,733627183,815077808,903607089,999666690,1103727091,1216277972,1337828597,1468908198,1610066359,1761873400,1924920761,2099821386,2287210107,2487744028,2702102909,2930989550,3175130175,3435274816,3712197697,4006697618,4319598339,4651748964,5004024325,5377325366,5772579527,6190741128,6632791753,7099740634,7592625035,8112510636,8660491917,9237692542,9845265743,10484394704,11156292945,11862204706,12603405331,13381201652,14196932373,15051968454,15947713495,16885604120,17867110361,18893736042,19967019163,21088532284,22259882909,23482713870,24758703711,26089567072,27477055073,28922955698,30429094179,31997333380
lpb $0
mov $2,$0
add $2,$0
sub $0,1
add $2,1
pow $2,4
add $1,$2
lpe
add $1,1
mov $0,$1
|
||||
TheStack | b80f8787a9d4999be8ad7ca7f42d7cc20f608e34 | Assemblycode:Assembly | {"size": 826, "ext": "asm", "max_stars_repo_path": "sys/boot/st/host.asm", "max_stars_repo_name": "olifink/smsqe", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "sys/boot/st/host.asm", "max_issues_repo_name": "olifink/smsqe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sys/boot/st/host.asm", "max_forks_repo_name": "olifink/smsqe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.3555555556, "max_line_length": 61, "alphanum_fraction": 0.6355932203} | ; ATARI Bootable File Host Module
section base
include 'dev8_keys_stella_bl'
base
bra.s start
text dc.l last_zero-start ; points to 0 at end (TOS fixup)
dc.l 0 ; data
dc.l 0 ; BSS
dc.l 0 ; symbol
dc.l 0 ; res
dc.l 0 ; res
dc.w 0 ; res
start
pea boot ; the boot code
move.w #$26,-(sp) ; supexec
trap #14
boot
move.w #$2700,sr
lea $400,sp ; safe-ish stack
lea host_end,a0
add.l sbl_mbase(a0),a0 ; code of next module (= loader)
jmp (a0)
fixup
dc.l text-* ; fixup text length
dc.l -(start-base)-4 ; + length of file is last_zero-start
dc.l 0
host_end
; all the rest of the modules will be inserted here
trailer
dc.l 0 ; no header
dc.l trailer-base ; length of module
dc.l 0 ; length
dc.l 0 ; checksum
dc.l fixup-base ; fixup
last_zero
dc.l 0
end
|
||||
TheStack | adbc26e2dfd4229bbeabc297c0f04d5b3e5f7bbc | Assemblycode:Assembly | {"size": 732, "ext": "asm", "max_stars_repo_path": "oeis/045/A045355.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/045/A045355.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/045/A045355.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 31.8260869565, "max_line_length": 398, "alphanum_fraction": 0.6693989071} | ; A045355: Primes congruent to {2, 5, 7} mod 8.
; Submitted by Jon Maiga
; 2,5,7,13,23,29,31,37,47,53,61,71,79,101,103,109,127,149,151,157,167,173,181,191,197,199,223,229,239,263,269,271,277,293,311,317,349,359,367,373,383,389,397,421,431,439,461,463,479,487,503,509,541,557,599,607,613,631,647,653,661,677,701,709,719,727,733,743,751,757,773,797,821,823,829,839,853,863,877,887,911,919,941,967,983,991,997,1013,1021,1031,1039,1061,1063,1069,1087,1093,1103,1109,1117,1151
mov $1,1
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,8
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
div $5,6
mov $6,$5
lpe
mov $0,$5
add $0,1
|
||||
TheStack | fa3d47a45132f6bcb57c49c85e4d83c858cc0c54 | Assemblycode:Assembly | {"size": 422, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/string/c/sccz80/strrstrip.asm", "max_stars_repo_name": "Frodevan/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/string/c/sccz80/strrstrip.asm", "max_issues_repo_name": "Frodevan/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/string/c/sccz80/strrstrip.asm", "max_forks_repo_name": "Frodevan/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 12.7878787879, "max_line_length": 30, "alphanum_fraction": 0.7203791469} |
; char *strrstrip(char *s)
SECTION code_clib
SECTION code_string
PUBLIC strrstrip
EXTERN asm_strrstrip
defc strrstrip = asm_strrstrip
IF __CLASSIC && __CPU_GBZ80__
PUBLIC _strrstrip
_strrstrip:
ld hl,sp+2
ld a,(hl+)
ld h,(hl)
ld l,a
call asm_strrstrip
ld d,h
ld e,l
ret
ENDIF
; SDCC bridge for Classic
IF __CLASSIC && !__CPU_GBZ80__
PUBLIC _strrstrip
defc _strrstrip = strrstrip
ENDIF
|
||||
TheStack | 066e9ad4f81248f99a5bbb52a59d285a774c76b0 | Assemblycode:Assembly | {"size": 110, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/asin.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/asin.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/asin.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 11.0, "max_line_length": 28, "alphanum_fraction": 0.8454545455} |
SECTION code_clib
SECTION code_fp_math48
PUBLIC asin
EXTERN cm48_sccz80_asin
defc asin = cm48_sccz80_asin
|
||||
TheStack | 86db4ee8504296028ed258ced7747f5816c4d085 | Assemblycode:Assembly | {"size": 638, "ext": "asm", "max_stars_repo_path": "MyPrint/myPrint.asm", "max_stars_repo_name": "Korkmatik/Assemby", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "MyPrint/myPrint.asm", "max_issues_repo_name": "Korkmatik/Assemby", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "MyPrint/myPrint.asm", "max_forks_repo_name": "Korkmatik/Assemby", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 13.5744680851, "max_line_length": 47, "alphanum_fraction": 0.6661442006} | section .data
text1 db "Hello World!", 10, 0
text2 db "I Love Code!", 10, 0
section .text
global _start
_start:
; example usage of myPrint subroutine
; example 1
mov rax, text1
call _myPrint
; example 2
mov rax, text2
call _myPrint
mov rax, 1
mov rdi, 0
syscall
; ======INPUT======
; RAX: pointer to string that should be printed
; the string should be null terminated
; ======OUTPUT=====
; prints the given string
_myPrint:
push rax
mov rbx, 0
_myPrintLoop:
inc rax
inc rbx
mov cl, [rax]
cmp cl, 0
jne _myPrintLoop
; printing with syscall
mov rax, 1
mov rdi, 1
pop rsi
mov rdx, rbx
syscall
ret
|
||||
TheStack | 990983feee280491937ad2faec28960947b4a547 | Assemblycode:Assembly | {"size": 348, "ext": "asm", "max_stars_repo_path": "programs/oeis/079/A079632.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/079/A079632.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/079/A079632.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 26.7692307692, "max_line_length": 201, "alphanum_fraction": 0.5086206897} | ; A079632: a(n) = floor(n/floor(sqrt(n)))-floor(sqrt(n)).
; 0,1,2,0,0,1,1,2,0,0,0,1,1,1,2,0,0,0,0,1,1,1,1,2,0,0,0,0,0,1,1,1,1,1,2,0,0,0,0,0,0,1,1,1,1,1,1,2,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,0
add $0,1
mov $1,$0
lpb $1
mov $1,$0
add $2,1
div $1,$2
sub $1,$2
lpe
mov $0,$1
|
||||
TheStack | 3cac16c41f6cdb0e99da3d5c42bfc19d554f4507 | Assemblycode:Assembly | {"size": 8231, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_560.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_560.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_560.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 33.3238866397, "max_line_length": 2999, "alphanum_fraction": 0.6550844369} | .global s_prepare_buffers
s_prepare_buffers:
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xc5d6, %rsi
lea addresses_UC_ht+0x14116, %rdi
nop
and $1519, %rdx
mov $101, %rcx
rep movsb
and $22368, %rdi
lea addresses_normal_ht+0xbc5c, %rsi
lea addresses_A_ht+0x57a2, %rdi
mfence
mov $47, %rcx
rep movsl
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x14c36, %rdi
nop
nop
nop
nop
sub %rbp, %rbp
mov $0x6162636465666768, %rcx
movq %rcx, (%rdi)
xor %rdx, %rdx
lea addresses_WT_ht+0x3356, %rsi
lea addresses_UC_ht+0x1734e, %rdi
nop
nop
nop
dec %r15
mov $55, %rcx
rep movsb
dec %rdi
lea addresses_normal_ht+0x101d6, %rdx
clflush (%rdx)
nop
nop
nop
cmp %rcx, %rcx
movw $0x6162, (%rdx)
nop
cmp %r15, %r15
lea addresses_D_ht+0x183d6, %rsi
lea addresses_normal_ht+0x8b76, %rdi
nop
nop
nop
nop
sub %r8, %r8
mov $12, %rcx
rep movsw
nop
nop
nop
and $41924, %rcx
lea addresses_UC_ht+0x1dd3, %rbp
nop
nop
nop
nop
cmp $24646, %rsi
movl $0x61626364, (%rbp)
and $47569, %rsi
lea addresses_WT_ht+0x198ac, %rsi
lea addresses_UC_ht+0x9ad6, %rdi
xor %rax, %rax
mov $19, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rax, %rax
lea addresses_A_ht+0x1c59a, %rcx
nop
nop
cmp %rbp, %rbp
movb (%rcx), %al
nop
nop
nop
nop
nop
and $18766, %r8
lea addresses_D_ht+0x946, %rax
clflush (%rax)
nop
nop
nop
sub $56726, %rdi
movups (%rax), %xmm3
vpextrq $1, %xmm3, %rcx
nop
nop
nop
xor %r15, %r15
lea addresses_normal_ht+0x73d6, %rsi
inc %r15
movups (%rsi), %xmm1
vpextrq $1, %xmm1, %rax
nop
sub $58181, %r8
lea addresses_WT_ht+0x9c46, %rsi
nop
nop
nop
nop
and $53508, %rdi
mov (%rsi), %rcx
nop
sub %rbp, %rbp
lea addresses_A_ht+0x176d6, %rsi
lea addresses_WT_ht+0x6ed6, %rdi
nop
nop
nop
xor %r15, %r15
mov $107, %rcx
rep movsq
nop
nop
nop
nop
nop
add %rax, %rax
lea addresses_WT_ht+0x16a66, %rbp
nop
nop
nop
nop
nop
cmp $19695, %rdx
mov $0x6162636465666768, %rdi
movq %rdi, (%rbp)
nop
nop
and %rbp, %rbp
lea addresses_A_ht+0x145d6, %rdx
nop
nop
nop
nop
sub %rbp, %rbp
movb (%rdx), %al
nop
nop
cmp $21554, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_A+0xd67a, %rcx
cmp $55035, %rax
movw $0x5152, (%rcx)
nop
nop
cmp $24121, %rax
// Load
lea addresses_D+0xd1d6, %r9
nop
nop
nop
xor %r11, %r11
mov (%r9), %ax
nop
nop
nop
nop
nop
cmp %rdx, %rdx
// Faulty Load
lea addresses_RW+0xa7d6, %rbp
and $50233, %r9
movb (%rbp), %r8b
lea oracles, %r11
and $0xff, %r8
shlq $12, %r8
mov (%r11,%r8,1), %r8
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A', 'congruent': 2}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D', 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_RW', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 7}}
{'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
*/
|
||||
TheStack | 0bf1a79b6662a07321190ae02e6e1ff28f4f1d6a | Assemblycode:Assembly | {"size": 354, "ext": "asm", "max_stars_repo_path": "caseChange.asm", "max_stars_repo_name": "tamim87/Assembly-Samples", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "caseChange.asm", "max_issues_repo_name": "tamim87/Assembly-Samples", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "caseChange.asm", "max_forks_repo_name": "tamim87/Assembly-Samples", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 12.6428571429, "max_line_length": 22, "alphanum_fraction": 0.4350282486} | ;case changing
org 100h
mov cx,len
mov si,offset str
toupper:
mov al,[si]
sub al,020h;
mov [si],al
inc si
loop toupper
;tolower:
; mov al,[si]
;
; add al,020h;
; mov [si],al
; inc si
; loop tolower
ret
str db 'bsdf'
len equ ($-str)
|
||||
TheStack | 9971cc83a43f1905e24f68bbb0adc29faf37413f | Assemblycode:Assembly | {"size": 2690, "ext": "asm", "max_stars_repo_path": "programs/oeis/060/A060895.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/060/A060895.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/060/A060895.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 448.3333333333, "max_line_length": 2648, "alphanum_fraction": 0.9550185874} | ; A060895: n^16 + 1.
; 1,2,65537,43046722,4294967297,152587890626,2821109907457,33232930569602,281474976710657,1853020188851842,10000000000000001,45949729863572162,184884258895036417,665416609183179842,2177953337809371137,6568408355712890626,18446744073709551617,48661191875666868482,121439531096594251777,288441413567621167682,655360000000000000001,1430568690241985328322,3011361496339065143297,6132610415680998648962,12116574790945106558977,23283064365386962890626,43608742899428874059777,79766443076872509863362,142734349946674946768897,250246473680347348787522,430467210000000000000001,727423121747185263828482,1208925819614629174706177,1977985201462558877934082,3189059870763703892770817,5070942774902496337890626,7958661109946400884391937,12337511914217166362274242,18903296479567620845142017,28644003124274380508351362,42949672960000000000000001,63759030914653054346432642,93753749683698750476845057,136614025729312093462315202,197352587024076973231046657,282748441902441558837890626,401906756202069927458308097,566977372488557307219621122,794071845499378503449051137,1104427674243920646305299202,1525878906250000000000000001,2094704750199298376445300802,2857942574656970690381479937,3876269050118516845397872322,5227573613485916806405226497,7011372354671045074462890626,9354238358105289311446368257,12416457054691003038858224002,16400152899115243850138976257,21559177407076402401757871042,28211099074560000000000000001,36751693856637464631913392962,47672401706823533450263330817,61581291280182164914327485442,79228162514264337593543950337,101534516782101416168212890626,129629238163050258624287932417,164890958756244164895763202882,208998227690370098316628197377,263988769565513973843201106882,332329305696010000000000000001,416997623116370028124580469122,521578814501447328359509917697,650377879817809571042122834562,808551180810136214718004658177,1002259575761854648590087890626,1238846438084943599707227160577,1527044182248015256482296477762,1877213388752445800995314794497,2301619141096101839813550846722,2814749767106560000000000000001,3433683820292512484657849089282,4178511850022702569647809560577,5072820298953863752478356399682,6144245739270881311250517590017,7425108623606394726715087890626,8953136790196197357146289012737,10772290133751755506346104768642,12933699143209908517669873647617,15496731425178936435099327730562,18530201888518410000000000000001,22113743972843938840712550613442,26339361174458854765907679379457,31313180170800116587336013460802,37157429083410091685945089785857,44012666865176569775543212890626,52040292466647269602037015248897,61425365346268570446197767595522,72379772059249583476264088436737,85145777109487563964501441198402
pow $0,16
add $0,1
|
||||
TheStack | 360a1fcb79fc9de15e62e13df76981b8a98a0ca5 | Assemblycode:Assembly | {"size": 389, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_destroy.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_destroy.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_destroy.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 20.4736842105, "max_line_length": 62, "alphanum_fraction": 0.8868894602} |
; void wv_priority_queue_destroy(wv_priority_queue_t *q)
SECTION code_clib
SECTION code_adt_wv_priority_queue
PUBLIC wv_priority_queue_destroy
EXTERN asm_wv_priority_queue_destroy
defc wv_priority_queue_destroy = asm_wv_priority_queue_destroy
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _wv_priority_queue_destroy
defc _wv_priority_queue_destroy = wv_priority_queue_destroy
ENDIF
|
||||
TheStack | 37ef0d515fe5503641e8a5e8fd8b585c127d8c3c | Assemblycode:Assembly | {"size": 10686, "ext": "asm", "max_stars_repo_path": "musiced/editor.asm", "max_stars_repo_name": "nanoflite/victracker", "max_stars_repo_stars_event_min_datetime": "2021-09-20T20:35:14.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-20T20:35:14.000Z", "max_issues_repo_path": "musiced/editor.asm", "max_issues_repo_name": "nanoflite/victracker", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "musiced/editor.asm", "max_forks_repo_name": "nanoflite/victracker", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 13.0955882353, "max_line_length": 75, "alphanum_fraction": 0.6275500655} | ;**************************************************************************
;*
;* FILE editor.asm
;* Copyright (c) 1994, 2003 Daniel Kahlin <[email protected]>
;* Written by Daniel Kahlin <[email protected]>
;* $Id: editor.asm,v 1.11 2003/08/07 12:53:35 tlr Exp $
;*
;* DESCRIPTION
;* The main editor. Does all the dirty work for editpattern.asm,
;* editarp.asm, editpattlist.asm.
;*
;* Public:
;* ResetEditor
;* EditRoutine
;* UnEdit
;* StartEdit
;*
;******
OffsetZP EQU $f7
PeekZP EQU $f9
;**************************************************************************
;*
;* EditorStuff
;*
;******
ResetEditor:
ldx #0
txa
re_lp1:
sta INFOBLOCK,x
inx
cpx #ib_sizeof
bne re_lp1
; FALL THRU
InitEditor:
lda #>ColorRAM
sta ColorZP+1
lda #>ScreenRAM
sta ScreenZP+1
rts
;**************************************************************************
;*
;* UnEdit
;*
;******
UnEdit:
lda TermRoutine
ora TermRoutine+1
beq ue_ex1
;Branch to TermRoutine
lda #>[ue_ret1-1]
pha
lda #<[ue_ret1-1]
pha
jmpind TermRoutine
ue_ret1:
ue_ex1:
rts
;**************************************************************************
;*
;* StartEditor
;*
;******
StartEdit:
jsr SetColors
jsr PrintPattern
lda #<[ScreenRAM+22*9]
sta ScreenZP
lda #>[ScreenRAM+22*9]
sta ScreenZP+1
;Branch to ScreenRoutine
lda #>[se_ret1-1]
pha
lda #<[se_ret1-1]
pha
jmpind ScreenRoutine
se_ret1:
jsr ToggleCursor
rts
;**************************************************************************
;*
;* Setup Colors for edit
;*
;******
SetColors:
; Setup the colors of the edit info line
lda #EditTextColor2
sta ColorRAM+22*9
sta ColorRAM+22*9+1
ldx #2
lda #EditTextColor
sc_lp3:
sta ColorRAM+22*9,x
inx
cpx #22
bne sc_lp3
;Set up the colors of the edit area
lda #>ColorRAM
sta ColorZP+1
lda #<ColorRAM
sta ColorZP
ldx #8
sc_lp1:
ldy #21
sc_lp2:
lda ColorTab,y
sta (ColorZP),y
dey
bpl sc_lp2
lda ColorZP
clc
adc #22
sta ColorZP
dex
bpl sc_lp1
rts
;**************************************************************************
;*
;* Update whole Pattern
;*
;******
PrintPattern:
lda #>ScreenRAM
sta ScreenZP+1
lda CurrentLine
sec
sbc #4
sta CLine
lda #0
sbc #0
sta CLine+1
ldy #0
pp_lp1:
lda ScreenTabLOW,y
sta ScreenZP
lda CLine+1
bne pp_skp1
lda Length
cmp CLine
bcc pp_skp1
lda CLine
jsr PrintEditLine
jmp pp_skp2
pp_skp1:
jsr BlankLine
pp_skp2:
inc CLine
bne pp_skp3
inc CLine+1
pp_skp3:
iny
cpy #9
bne pp_lp1
rts
CLine:
dc.w 0
;**************************************************************************
;*
;* Print A row in a pattern
;*
;* A - Line
;*
;******
BlankLine:
tya
pha
ldy #0
bl_lp1:
lda #$20
sta (ScreenZP),y
iny
cpy #22
bne bl_lp1
pla
tay
rts
PrintEditLine:
sta LineTemp
txa
pha
tya
pha
lda #0
sta OffsetZP+1
lda LineTemp
ldx Step
beq pel_skp3
pel_lp2:
asl
rol OffsetZP+1
dex
bne pel_lp2
pel_skp3:
sta OffsetZP
ldy #0
ldx #0
pel_lp1:
sty YTemp
lda CursorTab,x
beq pel_PBlank
and #CT_LINENUM ;LineNum?
bne pel_PLineNum
lda CursorTab,x
and #CT_DATA ;Data?
bne pel_PData
;*** Blank **
pel_PBlank:
lda #" "
jmp pelpd_Put
;*** LineNum ***
pel_PLineNum:
; Print every other line
lda LineTemp
pha
lda CursorTab,x
and #CT_LINENUMHALF ;LineNum?
beq pelpln_skp1
pla
lsr
bcs pelpd_PutDash
pha
pelpln_skp1:
lda CursorTab,x
and #CT_HIGHNYBBLE
beq pelln_skp1
pla
lsr
lsr
lsr
lsr
jsr PutNybble
jmp pel_skp1
pelln_skp1:
pla
jsr PutNybble
jmp pel_skp1
;*** Data
pel_PData:
lda CursorTab,x
and #CT_NOSTEP
bne pelpd_skp3
lda AddressTabLOW,x
clc
adc OffsetZP
sta PeekZP
lda AddressTabHIGH,x
adc OffsetZP+1
sta PeekZP+1
jmp pelpd_skp4
pelpd_skp3:
lda AddressTabLOW,x
clc
adc LineTemp
sta PeekZP
lda AddressTabHIGH,x
adc #0
sta PeekZP+1
pelpd_skp4:
ldy #0
lda CursorTab,x
and #CT_NOTE
beq pelpd_skp2
;Check for special case notes
lda (PeekZP),y
beq pelpd_PutDash
cmp #$80
beq pelpd_PutPlus
;Print ordinary nybble
pelpd_skp2:
lda CursorTab,x
and #CT_HIGHNYBBLE
beq pelpd_skp1
;High nybble...
lda (PeekZP),y
lsr
lsr
lsr
lsr
ldy YTemp
jsr PutNybble
jmp pel_skp1
;Low nybble...
pelpd_skp1:
lda (PeekZP),y
ldy YTemp
jsr PutNybble
pel_skp1:
inx
cpx #22
beq pel_ex1
jmp pel_lp1
pel_ex1:
pla
tay
pla
tax
rts
pelpd_PutDash:
lda #"-"
jmp pelpd_Put
pelpd_PutPlus:
lda #"+"
;FALL THRU
pelpd_Put:
ldy YTemp
sta (ScreenZP),y
iny
jmp pel_skp1
;**************************************************************************
;*
;* Main EditorRoutine
;*
;* Check keys and Handle cursor
;*
;******
EditRoutine:
jsr ToggleCursor
; check for cursor keys
cmp #17
beq ed_Down
cmp #145
beq ed_Up
cmp #29
beq ed_Right
cmp #157
beq ed_Left
;Branch to KeyRoutine
tax
lda #>[ed_ret2-1]
pha
lda #<[ed_ret2-1]
pha
txa
jmpind KeyRoutine
ed_ret2:
beq ed_ex1
; check if EditorKEys
jsr CheckEditorKeys
beq ed_ex1
; check if data is entered
jsr ByteInput
jsr CheckHex
jsr ToggleCursor
rts
ed_ex1:
lda #>[ed_ret1-1]
pha
lda #<[ed_ret1-1]
pha
jmpind UpdateRoutine
ed_ret1:
jsr ToggleCursor
lda #0
rts
;**************************************************************************
;*
;* Handle Cursor movement
;*
;* ed_Up
;* ed_Down
;* ed_Right
;* ed_Left
;*
;******
ed_Up:
lda CurrentLine
bne edu_skp1
lda Length
sta CurrentLine
jmp edu_skp2
edu_skp1:
dec CurrentLine
edu_skp2:
jsr PrintPattern
jmp ed_ex1
ed_Down:
jsr ed_GoDown
jsr PrintPattern
jmp ed_ex1
ed_GoDown:
lda CurrentLine
cmp Length
bne edd_skp1
lda #0
sta CurrentLine
jmp edd_skp2
edd_skp1:
inc CurrentLine
edd_skp2:
rts
ed_Right:
inc CurrentColumn
ldx CurrentColumn
cpx #22
bne edr_skp1
ldx #0
stx CurrentColumn
edr_skp1:
lda CursorTab,x
and #CT_DATA
beq ed_Right
jmp ed_ex1
ed_Left:
dec CurrentColumn
ldx CurrentColumn
bpl edl_skp1
ldx #21
stx CurrentColumn
edl_skp1:
lda CursorTab,x
and #CT_DATA
beq ed_Left
jmp ed_ex1
;**************************************************************************
;*
;* ToggleCursor
;*
;* Inverts cursor position
;*
;******
ToggleCursor:
pha
ldx CurrentColumn
lda ScreenRAM+22*4,x
eor #$80
sta ScreenRAM+22*4,x
pla
rts
;**************************************************************************
;*
;* ByteInput
;*
;* checks if a Special char was in ACC
;* if it was then change buffers.
;* advance down always
;*
;******
ByteInput:
pha
ldx CurrentColumn
lda CursorTab,x
and #CT_NOTE
beq bi_skp1
pla
;NOTE $80 may be written using Shift-Space
cmp #" "|$80
beq bi_FoundShiftSpace
bne bi_skp2
bi_skp1:
pla
;Value $00 may be written using Space
bi_skp2:
cmp #" "
beq bi_FoundSpace
rts
bi_FoundSpace:
lda #$00
sta PokeByte
jmp bi_Found
bi_FoundShiftSpace:
lda #$80
sta PokeByte
bi_Found:
pla ;Pull return Adress
pla
lda #$00
sta PokeMask ;Update the whole byte
jmp ch_Poke
;**************************************************************************
;*
;* HexInput (Controlled by AdvanceMode)
;*
;* checks if a hex char was in ACC
;* if it was then change buffers.
;* advance according to AdvanceMode
;*
;******
CheckHex:
ldx #15
ch_lp1:
cmp HexTab_ASCII,x
beq ch_Found
dex
bpl ch_lp1
rts
HexTab_ASCII:
dc.b "0123456789ABCDEF"
;Found Hex Nybble (in x)
ch_Found:
pla ;Pull return Adress
pla
stx PokeByte
lda #$f0
sta PokeMask
ldx CurrentColumn
lda CursorTab,x
and #CT_HIGHNYBBLE
beq chf_skp1
;Highnybble if even column
lda PokeByte
asl
asl
asl
asl
sta PokeByte
lda #$0f
sta PokeMask
chf_skp1:
;FALL THRU
ch_Poke:
lda #0
sta OffsetZP+1
lda CurrentLine
sta OffsetZP
lda CursorTab,x
and #CT_NOSTEP
bne ch_skp3
ldx Step
beq ch_skp3
lda OffsetZP
ch_lp2:
asl
rol OffsetZP+1
dex
bne ch_lp2
sta OffsetZP
ch_skp3:
ldx CurrentColumn
lda AddressTabLOW,x
clc
adc OffsetZP
sta PokeZP
lda AddressTabHIGH,x
adc OffsetZP+1
sta PokeZP+1
ldy #0
lda (PokeZP),y
and PokeMask
ora PokeByte
sta (PokeZP),y
ldy #4
lda #>ScreenRAM
sta ScreenZP+1
lda ScreenTabLOW,y
sta ScreenZP
lda CurrentLine
jsr PrintEditLine
lda PokeMask ;If mask is $00, Go down always
beq chf_Down
lda AdvanceMode
beq chf_Right
chf_Down:
lda EditStep
sec
sbc #1
beq chf_skp2
tax
chf_lp1:
jsr ed_GoDown
dex
bne chf_lp1
chf_skp2:
jmp ed_Down
chf_Right:
jmp ed_Right
;**************************************************************************
;*
;* HexConvert
;*
;******
PutNybble:
pha
stx XTemp
and #$0f
jsr ph_rec
ldx XTemp
pla
rts
YTemp:
dc.b 0
XTemp:
dc.b 0
PutHex:
stx XTemp
pha
lsr
lsr
lsr
lsr
jsr ph_rec
pla
and #$0f
jsr ph_rec
ldx XTemp
rts
ph_rec:
tax
lda HexTab_SCREEN,x
sta (ScreenZP),y
iny
rts
HexTab_SCREEN:
dc.b "0123456789",1,2,3,4,5,6
;**************************************************************************
;*
;* Editor keys
;*
;******
CheckEditorKeys:
cmp #137 ;F2
beq ced_ChangeAdvance
cmp #19 ;HOME
beq ced_Home
;check for SHIFTED numbers
cmp #33 ;SHIFT-1
bcc ced_skp1
cmp #42 ;SHIFT-0 + 1
bcc ced_ShiftNum
ced_skp1:
jsr ced_EditStep
cmp #0
rts
ced_ChangeAdvance:
lda AdvanceMode
eor #$ff
sta AdvanceMode
jmp ced_ex1
ced_Home:
lda #0
sta CurrentLine
jmp ced_ex2
ced_End:
lda Length
sta CurrentLine
jmp ced_ex2
ced_ShiftNum:
sec
sbc #33 ;SHIFT-1
tax
beq ced_Home
cpx #8
beq ced_End
lda Length
clc
adc #1
ror
lsr
lsr
sta PeekZP ;Temp
lda #0
cedsn_lp1:
clc
adc PeekZP
dex
bne cedsn_lp1
sta CurrentLine
jmp ced_ex2
ced_EditStep
ldx #10
cedes_lp1:
cmp ced_Tab-1,x
beq cedes_skp1
dex
bne cedes_lp1
rts
cedes_skp1:
stx EditStep
lda #0
rts
ced_ex2:
jsr PrintPattern
ced_ex1:
lda #0
rts
ced_Tab: ;ASCII for CTRL-1..CTRL-0
dc.b 144,5,28,159,156,30,31,158,18,146
;**************************************************************************
;*
;* Data
;*
;******
ScreenTabLOW:
dc.b <[ScreenRAM+22*0]
dc.b <[ScreenRAM+22*1]
dc.b <[ScreenRAM+22*2]
dc.b <[ScreenRAM+22*3]
dc.b <[ScreenRAM+22*4]
dc.b <[ScreenRAM+22*5]
dc.b <[ScreenRAM+22*6]
dc.b <[ScreenRAM+22*7]
dc.b <[ScreenRAM+22*8]
LineTemp:
dc.b 0
PokeByte:
dc.b 0
PokeMask:
dc.b 0
INFOBLOCK:
;*** THE INFO BLOCK ***
EditMode:
dc.b 0
; The line we are editing (in the middle of the edit area)
CurrentLine:
ds.b 1
; The column we are editing
CurrentColumn:
ds.b 1
; When a character was entered where should we go?
; any nonzero here will make it down else right
AdvanceMode:
ds.b 1
EditStep:
ds.b 1
InitRoutine:
ds.w 1
ScreenRoutine:
ds.w 1
UpdateRoutine:
ds.w 1
KeyRoutine:
ds.w 1
TermRoutine:
ds.w 1
Length:
ds.b 1
; Number of shifts
Step:
ds.b 1
ColorTab:
ds.b 22
CursorTab:
ds.b 22
AddressTabLOW:
ds.b 22
AddressTabHIGH:
ds.b 22
INFOBLOCKEND:
ib_sizeof EQU INFOBLOCKEND-INFOBLOCK
; eof
|
||||
TheStack | 329a6458d6c3354dba9884c8725cd6b40965f6f2 | Assemblycode:Assembly | {"size": 1162, "ext": "asm", "max_stars_repo_path": "programs/oeis/255/A255108.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/255/A255108.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/255/A255108.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 89.3846153846, "max_line_length": 758, "alphanum_fraction": 0.8158347676} | ; A255108: Number of length n+1 0..2 arrays with at most one downstep in every n consecutive neighbor pairs.
; 9,26,66,147,294,540,927,1507,2343,3510,5096,7203,9948,13464,17901,23427,30229,38514,48510,60467,74658,91380,110955,133731,160083,190414,225156,264771,309752,360624,417945,482307,554337,634698,724090,823251,932958,1054028,1187319,1333731,1494207,1669734,1861344,2070115,2297172,2543688,2810885,3100035,3412461,3749538,4112694,4503411,4923226,5373732,5856579,6373475,6926187,7516542,8146428,8817795,9532656,10293088,11101233,11959299,12869561,13834362,14856114,15937299,17080470,18288252,19563343,20908515,22326615,23820566,25393368,27048099,28787916,30616056,32535837,34550659,36664005,38879442,41200622,43631283,46175250,48836436,51618843,54526563,57563779,60734766,64043892,67495619,71094504,74845200,78752457,82821123,87056145,91462570,96045546,100810323
add $0,1
lpb $0
mov $2,$0
sub $0,1
seq $2,252814 ; Number of n X 2 nonnegative integer arrays with upper left 0 and every value within 2 of its city block distance from the upper left and every value increasing by 0 or 1 with every step right or down.
add $1,$2
lpe
add $1,3
mov $0,$1
|
||||
TheStack | 7e904cd57c4edfe2fb4aac268e6ea33617ddfb7b | Assemblycode:Assembly | {"size": 1235, "ext": "asm", "max_stars_repo_path": "programs/oeis/059/A059894.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/059/A059894.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/059/A059894.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 58.8095238095, "max_line_length": 893, "alphanum_fraction": 0.6736842105} | ; A059894: Complement and reverse the order of all but the most significant bit in binary expansion of n. n = 1ab..yz -> 1ZY..BA = a(n), where A = 1-a, B = 1-b, ... .
; 1,3,2,7,5,6,4,15,11,13,9,14,10,12,8,31,23,27,19,29,21,25,17,30,22,26,18,28,20,24,16,63,47,55,39,59,43,51,35,61,45,53,37,57,41,49,33,62,46,54,38,58,42,50,34,60,44,52,36,56,40,48,32,127,95,111,79,119,87,103,71,123,91,107,75,115,83,99,67,125,93,109,77,117,85,101,69,121,89,105,73,113,81,97,65,126,94,110,78,118,86,102,70,122,90,106,74,114,82,98,66,124,92,108,76,116,84,100,68,120,88,104,72,112,80,96,64,255,191,223,159,239,175,207,143,247,183,215,151,231,167,199,135,251,187,219,155,235,171,203,139,243,179,211,147,227,163,195,131,253,189,221,157,237,173,205,141,245,181,213,149,229,165,197,133,249,185,217,153,233,169,201,137,241,177,209,145,225,161,193,129,254,190,222,158,238,174,206,142,246,182,214,150,230,166,198,134,250,186,218,154,234,170,202,138,242,178,210,146,226,162,194,130,252,188,220,156,236,172,204,140,244,180,212,148,228,164,196,132,248,184,216,152,232,168,200,136,240,176,208
mov $4,$0
lpb $0
sub $0,1
div $0,2
add $2,1
mod $4,2
sub $2,$4
add $2,1
mov $3,3
sub $3,$2
sub $2,3
mul $2,2
mov $4,$0
lpe
mov $1,1
mul $1,$3
add $1,1
|
||||
TheStack | 504209d6c795f4623fe2ddb9d70534dfa783913c | Assemblycode:Assembly | {"size": 401, "ext": "asm", "max_stars_repo_path": "programs/oeis/027/A027924.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/027/A027924.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/027/A027924.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 36.4545454545, "max_line_length": 205, "alphanum_fraction": 0.6583541147} | ; A027924: a(n) = least k such that 1+2+...+k >= 1^3 + 2^3 + ... + n^3.
; 1,4,8,14,21,30,40,51,64,78,93,110,129,148,170,192,216,242,269,297,327,358,390,424,460,496,535,574,615,658,701,747,793,841,891,942,994,1048,1103,1160,1218,1277,1338,1400,1464,1529,1595,1663,1732,1803,1875
mov $2,$0
bin $0,2
add $0,6
mul $2,2
add $0,$2
seq $0,87057 ; Smallest number whose square is larger than 2*n^2.
sub $0,9
|
||||
TheStack | dd632ee9063dd8a170586b7997bdf46e1b8d3ff1 | Assemblycode:Assembly | {"size": 452, "ext": "asm", "max_stars_repo_path": "oeis/064/A064921.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/064/A064921.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/064/A064921.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 45.2, "max_line_length": 242, "alphanum_fraction": 0.6150442478} | ; A064921: Iterate A064920 until a prime is reached.
; Submitted by Jamie Morken(s4)
; 2,3,3,5,3,7,5,5,3,11,3,13,5,7,5,17,5,19,5,5,3,23,3,5,5,11,3,29,3,31,17,13,5,11,5,37,5,7,3,41,3,43,5,13,3,47,5,13,5,19,5,53,5,7,5,5,3,59,5,61,17,7,13,17,5,67,5,5,5,71,5,73,5,19,3,17,5,79,5,29,3,83,5,5,5,31,5,89,3,19,5,13,5,23,5,97,5,19,3,101
lpb $0
seq $0,64920 ; a(n) = n/gpf(n) + gpf(n) - 1, where gpf = A006530 = greatest prime factor.
sub $0,2
lpe
add $0,2
|
||||
TheStack | caecd56a27dc560afd36d83a70a32d8aa56fc322 | Assemblycode:Assembly | {"size": 3669, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1987.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1987.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1987.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 89.487804878, "max_line_length": 2999, "alphanum_fraction": 0.6636685745} | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %rbp
push %rcx
push %rsi
// Faulty Load
lea addresses_WC+0x1cb66, %r12
nop
nop
nop
dec %r15
mov (%r12), %si
lea oracles, %rcx
and $0xff, %rsi
shlq $12, %rsi
mov (%rcx,%rsi,1), %rsi
pop %rsi
pop %rcx
pop %rbp
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': True, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
||||
TheStack | 10c6d60a8f862be2661c6cf94fd196343528373e | Assemblycode:Assembly | {"size": 310, "ext": "asm", "max_stars_repo_path": "programs/oeis/021/A021367.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/021/A021367.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/021/A021367.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 28.1818181818, "max_line_length": 199, "alphanum_fraction": 0.5419354839} | ; A021367: Decimal expansion of 1/363.
; 0,0,2,7,5,4,8,2,0,9,3,6,6,3,9,1,1,8,4,5,7,3,0,0,2,7,5,4,8,2,0,9,3,6,6,3,9,1,1,8,4,5,7,3,0,0,2,7,5,4,8,2,0,9,3,6,6,3,9,1,1,8,4,5,7,3,0,0,2,7,5,4,8,2,0,9,3,6,6,3,9,1,1,8,4,5,7,3,0,0,2,7,5,4,8,2,0,9,3
add $0,1
mov $1,10
pow $1,$0
mul $1,8
div $1,2904
mod $1,10
mov $0,$1
|
||||
TheStack | e7a73a061193f9f80f089b1f420ad70b27de7da6 | Assemblycode:Assembly | {"size": 1452, "ext": "asm", "max_stars_repo_path": "src/BreathOfTheWild/Mods/FPS++/patch_VSync.asm", "max_stars_repo_name": "slashiee/cemu_graphic_packs", "max_stars_repo_stars_event_min_datetime": "2017-01-10T13:10:55.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-20T18:34:19.000Z", "max_issues_repo_path": "src/BreathOfTheWild/Mods/FPS++/patch_VSync.asm", "max_issues_repo_name": "slashiee/cemu_graphic_packs", "max_issues_repo_issues_event_min_datetime": "2017-01-11T21:13:20.000Z", "max_issues_repo_issues_event_max_datetime": "2020-11-27T11:33:05.000Z", "max_forks_repo_path": "src/BreathOfTheWild/Mods/FPS++/patch_VSync.asm", "max_forks_repo_name": "slashiee/cemu_graphic_packs", "max_forks_repo_forks_event_min_datetime": "2017-01-10T06:06:43.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-06T21:16:49.000Z"} | {"max_stars_count": 1002, "max_issues_count": 347, "max_forks_count": 850, "avg_line_length": 17.9259259259, "max_line_length": 88, "alphanum_fraction": 0.7741046832} | [BotW_VSync_V208]
moduleMatches = 0x6267BFD0
.origin = codecave
setSwapInterval:
li r11, $keepVsync
cmpwi r11, 1
bne setSwapIntervalTo0
lis r11, fpsLimit@ha
lfs f12, fpsLimit@l(r11)
lis r11, const_30@ha
lfs f10, const_30@l(r11)
fcmpu cr0, f10, f12
beq setSwapIntervalTo2
# lis r11, const_60@ha
# lfs f10, const_60@l(r11)
# fcmpu cr0, f10, f12
# beq setSwapIntervalTo1
; Disable vsync for everything else
b setSwapIntervalTo0
setSwapIntervalTo0: ; Disable vsync
mflr r11
li r3, 0
bl import.gx2.GX2SetSwapInterval
mtlr r11
b _convertTicksToFrametime
setSwapIntervalTo1: ; Double Buffered 30FPS
mflr r11
li r3, 1
bl import.gx2.GX2SetSwapInterval
mtlr r11
b _convertTicksToFrametime
setSwapIntervalTo2: ; Double Buffered 30FPS
mflr r11
li r3, 2
bl import.gx2.GX2SetSwapInterval
mtlr r11
b _convertTicksToFrametime
waitForVsyncAddr:
.ptr 0x031FACD4
conditionalVsyncWait:
stwu r1, -0x20(r1)
li r12, $keepVsync
cmpwi r12, 1
beqlr
lis r12, waitForVsyncAddr@ha
lwz r12, waitForVsyncAddr@l(r12)
mtlr r12
blr
0x031FACCC = bla conditionalVsyncWait
conditionalSwapStatus:
li r6, $keepVsync
cmpwi r6, 1
beq continueSwapStatus
cmpw r12, r12
blr
continueSwapStatus:
cmplw r12, r0
blr
0x031FACF0 = bla conditionalSwapStatus
# Disable vsync entirely if not running at 30FPS
# 0x031FACD0 = .uint (($keepVsync == 1) * 0x4914DAB9) + (($keepVsync == 0) * 0x60000000)
# 0x031FACF4 = .uint (($keepVsync == 1) * 0x4180FFDC) + (($keepVsync == 0) * 0x60000000) |
||||
TheStack | 3463ccb82bd51b831203bad4bec0289775ec5ddf | Assemblycode:Assembly | {"size": 145, "ext": "asm", "max_stars_repo_path": "other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Pause-j.asm", "max_stars_repo_name": "prismotizm/gigaleak", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Pause-j.asm", "max_issues_repo_name": "prismotizm/gigaleak", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Pause-j.asm", "max_forks_repo_name": "prismotizm/gigaleak", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.7142857143, "max_line_length": 47, "alphanum_fraction": 0.8068965517} | Name: Pause-j.asm
Type: file
Size: 44148
Last-Modified: '1992-07-14T23:56:57Z'
SHA-1: 0C7F2252C7F4239F10FFBC08B142A6AB7920AEA4
Description: null
|
||||
TheStack | 2368a600fbd747c80d728cb1f695abcf0ee5c82b | Assemblycode:Assembly | {"size": 1699, "ext": "asm", "max_stars_repo_path": "programs/oeis/051/A051876.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/051/A051876.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/051/A051876.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 212.375, "max_line_length": 1608, "alphanum_fraction": 0.8287227781} | ; A051876: 24-gonal numbers: a(n) = n*(11*n-10).
; 0,1,24,69,136,225,336,469,624,801,1000,1221,1464,1729,2016,2325,2656,3009,3384,3781,4200,4641,5104,5589,6096,6625,7176,7749,8344,8961,9600,10261,10944,11649,12376,13125,13896,14689,15504,16341,17200,18081,18984,19909,20856,21825,22816,23829,24864,25921,27000,28101,29224,30369,31536,32725,33936,35169,36424,37701,39000,40321,41664,43029,44416,45825,47256,48709,50184,51681,53200,54741,56304,57889,59496,61125,62776,64449,66144,67861,69600,71361,73144,74949,76776,78625,80496,82389,84304,86241,88200,90181,92184,94209,96256,98325,100416,102529,104664,106821,109000,111201,113424,115669,117936,120225,122536,124869,127224,129601,132000,134421,136864,139329,141816,144325,146856,149409,151984,154581,157200,159841,162504,165189,167896,170625,173376,176149,178944,181761,184600,187461,190344,193249,196176,199125,202096,205089,208104,211141,214200,217281,220384,223509,226656,229825,233016,236229,239464,242721,246000,249301,252624,255969,259336,262725,266136,269569,273024,276501,280000,283521,287064,290629,294216,297825,301456,305109,308784,312481,316200,319941,323704,327489,331296,335125,338976,342849,346744,350661,354600,358561,362544,366549,370576,374625,378696,382789,386904,391041,395200,399381,403584,407809,412056,416325,420616,424929,429264,433621,438000,442401,446824,451269,455736,460225,464736,469269,473824,478401,483000,487621,492264,496929,501616,506325,511056,515809,520584,525381,530200,535041,539904,544789,549696,554625,559576,564549,569544,574561,579600,584661,589744,594849,599976,605125,610296,615489,620704,625941,631200,636481,641784,647109,652456,657825,663216,668629,674064,679521
mov $1,11
mul $1,$0
sub $1,10
mul $1,$0
|
||||
TheStack | 998614f7ddfa9d47ad9d54b7b203ccfcadb711a6 | Assemblycode:Assembly | {"size": 2306, "ext": "asm", "max_stars_repo_path": "programs/oeis/017/A017504.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/017/A017504.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/017/A017504.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 329.4285714286, "max_line_length": 2244, "alphanum_fraction": 0.9423243712} | ; A017504: a(n) = (11*n + 9)^8.
; 43046721,25600000000,852891037441,9682651996416,62259690411361,281474976710656,1001129150390625,2992179271065856,7837433594376961,18509302102818816,40213853471634241,81573072100000000,156225851787813921,284936905588473856,498311414318121121,840221879151902976,1372062286687890625,2177953337809371136,3371031134626313601,5100960362726891776,7562821648920027361,11007531417600000000,15753961211814252001,22202932088065597696,30853268336830129281,42320103423722192896,57355639689187890625,76872571987558646016,101970394089246452641,133964815312812507136,174420523496591010081,225187539062500000000,288441413567621167681,366727534782080679936,463009808974713123841,580723999730940764416,723836011270250390625,896905412873600106496,1105154509674038506081,1354543273706768752896,1651850457757840166401,2004761223193600000000,2421961621595988176961,2913240278671707832576,3489597637546254592801,4163363127196737601536,4948320630420375390625,5859842634378499768576,6915033455398850985921,8132881938361897517056,9534424039639863880321,11142915711200100000000,12984016512127375695841,15085984382462633967616,17479882022898686824161,20199795332516287488256,23283064365386962890625,26770527275511940448256,30706777728209453204161,35140436264705657487616,40124436115327347335841,45716323965337600000000,51978576186098436940321,58978931052887534797056,66790737479338970905921,75493320807120938008576,85172366198106312890625,95920320184934913761536,107836810944509231272801,121029087867608368152576,135612481006447872516961,151710880990656100000000,169457240010780689926401,188994094477081690832896,210474109970010820726081,234060649107419297546496,259928362962179625390625,288263806672549672124416,319266079896250324103841,353147492767870953799936,390134258027859886207681,430467210000000000000000,474402551102912549470081,522212626589775243387136,574186728219083566972641,630631927567927283286016,691873939707897000390625,758258017972378640752896,830149880552636599409281,907936669668729327517696,992027944069944027992001,1082856705628080100000000,1180880460795553919187361,1286582317708940490571776,1400472119727210461133601,1523087616202563929211136,1654995671290405437890625,1796793511613647489662976,1949110013605172869701121,2112607031360929015193856
mul $0,11
add $0,9
pow $0,8
|
||||
TheStack | d25bbe03c2c990ee848a412d39b49e80a5dd8075 | Assemblycode:Assembly | {"size": 13239, "ext": "asm", "max_stars_repo_path": "Osdk/_final_/sample/floppybuilder/code/loader.asm", "max_stars_repo_name": "nekoniaow/OSDK", "max_stars_repo_stars_event_min_datetime": "2018-10-31T10:33:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-28T14:33:52.000Z", "max_issues_repo_path": "Osdk/_final_/sample/floppybuilder/code/loader.asm", "max_issues_repo_name": "nekoniaow/OSDK", "max_issues_repo_issues_event_min_datetime": "2018-05-15T06:06:14.000Z", "max_issues_repo_issues_event_max_datetime": "2018-05-17T05:52:59.000Z", "max_forks_repo_path": "Osdk/_final_/sample/floppybuilder/code/loader.asm", "max_forks_repo_name": "nekoniaow/OSDK", "max_forks_repo_forks_event_min_datetime": "2018-10-31T10:35:20.000Z", "max_forks_repo_forks_event_max_datetime": "2018-10-31T10:35:20.000Z"} | {"max_stars_count": 5, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 25.2171428571, "max_line_length": 165, "alphanum_fraction": 0.6721051439} |
#define OPCODE_RTS $60
#define OPCODE_JMP $4C
#define COLOR(color) pha:lda #16+(color&7):sta $bb80+40*27:pla
#define STOP(color) pha:lda #16+(color&7):sta $bb80+40*27:jmp *:pla
;
; VIA registers definition
;
#define via_portb $0300
#define via_ddrb $0302
#define via_ddra $0303
#define via_t1cl $0304
#define via_t1ch $0305
#define via_t1ll $0306
#define via_t1lh $0307
#define via_t2ll $0308
#define via_t2ch $0309
#define via_sr $030a
#define via_acr $030b
#define via_pcr $030c
#define via_ifr $030d
#define via_ier $030e
#define via_porta $030f
;
; Microdisc register values
;
#define FDC_command_register $0310
#define FDC_status_register $0310
#define FDC_track_register $0311
#define FDC_sector_register $0312
#define FDC_data $0313
#define FDC_flags $0314
#define FDC_drq $0318
#define FDC_Flags_Mask %10000100 ; Disable ROM/EPROM, no FDC interrupt requests, A drive, Side 0
#define FDC_Flag_DiscSide %00010000 ; Accesses second side of the disk
#define CMD_ReadSector $80
#define CMD_Seek $1F
#define wait_status_floppy 30
;
; Jasmin register values
;
#define FDC_JASMIN_command_register $03f4
#define FDC_JASMIN_status_register $03f4
#define FDC_JASMIN_track_register $03f5
#define FDC_JASMIN_sector_register $03f6
#define FDC_JASMIN_data $03f7
#define FDC_JASMIN_flags $03f8
#define FDC_JASMIN_drq $03FC
#define FDC_JASMIN_Flag_DiscSide %00000001
#define CMD_JASMIN_ReadSector $8c
#include "floppy_description.h" ; This file is generated by the floppy builder
.zero
*=LOADER_BASE_ZERO_PAGE
; If you add or remove any variables, make sure that LOADER_BASE_ZERO_PAGE is still correct (defined in the floppy builder script)
current_track .dsb 1 ; Index of the track being loaded
current_sector .dsb 1 ; Index of the sector being loaded
current_side .dsb 1 ; Has the bit 4 set to 0 or 1 to be used as a mask on the Microdisc control register (other bits have to be set to zero)
ptr_destination .dsb 2 ; Destination adress where we depack
ptr_destination_end .dsb 2 ; Point on the end of the depacked stuff
ptr_source_back .dsb 2 ; Temporary used to hold a pointer on depacked stuff
offset .dsb 2
mask_value .dsb 1
nb_dst .dsb 1
.text
*=FLOPPY_LOADER_ADDRESS
; ------------------------------------------------------------------------------
; Startup section
; ------------------------------------------------------------------------------
;
; This section of the loader can be overwritten after the loader has been installed in memory.
; It contains initialization code that just need to be run once at the start of the application.
; If there are specific initialization, setup of video mode, etc... you need to do, that's the place.
;
; By default the Microdisc/Jasmin setup code is performed here:
; The code of the loader is setup to load things from a Microdisc, but if we are called with X not null,
; then we patch all the values to replace them by Jasmin equivalents
;
_LoaderTemporaryStart
sei ; Make sure interrupts are disabled
cld ; Force decimal mode
cpx #0 ; If we are on Jasmin, patch all the FDC related values
beq end_jasmin_init
lda #<FDC_JASMIN_command_register
sta 1+__fdc_command_1
sta 1+__fdc_command_2
lda #<FDC_JASMIN_status_register
sta 1+__fdc_status_1
sta 1+__fdc_status_2
lda #<FDC_JASMIN_track_register
sta 1+__fdc_track_1
lda #<FDC_JASMIN_sector_register
sta 1+__fdc_sector_1
lda #<FDC_JASMIN_data
sta 1+__fdc_data_1
sta 1+__fdc_data_2
lda #<FDC_JASMIN_flags
sta 1+__fdc_flags_1
sta 1+__fdc_flags_2
lda #<FDC_JASMIN_drq
sta 1+__fdc_drq_1
lda #CMD_JASMIN_ReadSector
sta 1+__fdc_readsector
lda #FDC_JASMIN_Flag_DiscSide
sta 1+__fdc_discside
end_jasmin_init
ldx #$ff ; Reset the stack pointer
txs
lda #$ff ; Initialize the VIA to known values (code is from Atmos ROM)
sta via_ddra
lda #$f7
sta via_ddrb
lda #$b7
sta via_portb
lda #$dd
sta via_pcr
lda #$7f
sta via_ier
lda #$40
sta via_acr
lda #$c0
sta via_ier
lda #$10
sta via_t1ll
sta via_t1cl
lda #$27
sta via_t1lh
sta via_t1ch
forever_loop
jsr LoadData ; Load the main game (parameters are directly initialized in the loader variables at the end of the file)
jsr _LoaderApiJump ; Give control to the application and hope it knows what to do
jmp forever_loop
; -------------------------------------------------------------------------------
; Resident section
; -------------------------------------------------------------------------------
;
; This section of the loader stays in memory at all time.
; It contains all the code for loading, saving, as well as memory areas used by the
; API to communicated between the main application and the loader.
;
_LoaderResidentStart
; X=File index
LoadData
ldy #0
sty __fetchByte+1
; We have to start somewhere no matter what, compressed or not
sei
; Make sure the microdisc IRQ is disabled
jsr WaitCompletion
lda #FDC_Flags_Mask ; Disable the FDC (Eprom select + FDC Interrupt request)
__fdc_flags_1
sta FDC_flags
; Starting track
ldy #%00000000 ; Side 0
lda _LoaderApiFileStartTrack ; If the track id is larger than 128, it means it is on the other side of the floppy
bpl first_side
; The file starts on the second side
ldy #FDC_Flag_DiscSide ; Side 1
and #%01111111 ; Mask out the extra bit
first_side
sty current_side
sta current_track
; First sector
lda _LoaderApiFileStartSector
and #%01111111 ; Clear out the top bit (compressed flag)
sta current_sector
clc
lda _LoaderApiAddressLow
sta ptr_destination+0
adc _LoaderApiFileSizeLow
sta ptr_destination_end+0
lda _LoaderApiAddressHigh
sta ptr_destination+1
adc _LoaderApiFileSizeHigh
sta ptr_destination_end+1
; Now at this stage we have to check if the data is compressed or not
lda _LoaderApiFileStartSector
bmi LoadCompressedData
LoadUncompressedData
ldy #0
read_sectors_loop
jsr GetNextByte ; Read from source stream
sta (ptr_destination),y
; We increase the current destination pointer, by a given value, white checking if we reach the end of the buffer.
inc ptr_destination
bne skip_destination_inc1
inc ptr_destination+1
skip_destination_inc1
lda ptr_destination
cmp ptr_destination_end
lda ptr_destination+1
sbc ptr_destination_end+1
bcc read_sectors_loop
cli ; Data successfully loaded (we hope), so we restore the interrupts
rts
LoadCompressedData
cli
; Initialise variables
; We try to keep "y" null during all the code, so the block copy routine has to be sure that Y is null on exit
lda #1
sta mask_value
unpack_loop
; Handle bit mask
lsr mask_value
bne end_reload_mask
jsr GetNextByte ; Read from source stream
ror
sta mask_value
end_reload_mask
bcc back_copy
write_byte
; Copy one byte from the source stream
jsr GetNextByte ; Read from source stream
sta (ptr_destination),y
lda #1
sta nb_dst
_UnpackEndLoop
; We increase the current destination pointer, by a given value, white checking if we reach the end of the buffer.
clc
lda ptr_destination
adc nb_dst
sta ptr_destination
bcc skip_destination_inc
inc ptr_destination+1
skip_destination_inc
cmp ptr_destination_end
lda ptr_destination+1
sbc ptr_destination_end+1
bcc unpack_loop
rts
back_copy
;BreakPoint jmp BreakPoint
; Copy a number of bytes from the already unpacked stream
; Here we know that Y is null. So no need for clearing it: Just be sure it's still null at the end.
; At this point, the source pointer points to a two byte value that actually contains a 4 bits counter, and a 12 bit offset to point back into the depacked stream.
; The counter is in the 4 high order bits.
;clc <== No need, since we access this routie from a BCC
jsr GetNextByte ; Read from source stream
adc #1
sta offset
jsr GetNextByte ; Read from source stream
tax
and #$0f
adc #0
sta offset+1
txa
lsr
lsr
lsr
lsr
clc
adc #3
sta nb_dst
sec
lda ptr_destination
sbc offset
sta ptr_source_back
lda ptr_destination+1
sbc offset+1
sta ptr_source_back+1
; Beware, in that loop, the direction is important since RLE like depacking is done by recopying the
; very same byte just copied... Do not make it a reverse loop to achieve some speed gain...
.(
copy_loop
lda (ptr_source_back),y ; Read from already unpacked stream
sta (ptr_destination),y ; Write to destination buffer
iny
cpy nb_dst
bne copy_loop
.)
ldy #0
beq _UnpackEndLoop
rts
GetNextByte
php
lda __fetchByte+1
bne __fetchByte
nop
nop
nop
nop
sei
jsr ReadNextSector
nop
nop
nop
nop
cli
ldx #0
ldy #0
__fetchByte
lda LOADER_SECTOR_BUFFER
inc __fetchByte+1
plp
rts
ReadNextSector
lda current_sector ; Check if we have reached the end of the track
cmp #FLOPPY_SECTOR_PER_TRACK+1
bne end_change_track
inc current_track ; Move to the next track
lda current_track
cmp #FLOPPY_TRACK_NUMBER
bne end_side_change
lda #0 ; Reset to the first track on the other side
sta current_track
__fdc_discside
lda #FDC_Flag_DiscSide
sta current_side
end_side_change
lda #1 ; Reset the sector position
sta current_sector
end_change_track
cli
jsr WaitCommand
sei
lda current_sector
__fdc_sector_1
sta FDC_sector_register
inc current_sector
lda current_track ; Check if the drive is on the correct track
__fdc_track_1
cmp FDC_track_register
beq stay_on_the_track
__fdc_data_1
sta FDC_data ; Set the new track
lda #CMD_Seek
__fdc_command_1
sta FDC_command_register
jsr WaitCompletion
stay_on_the_track
lda #FDC_Flags_Mask ; Apply the side selection mask
ora current_side
__fdc_flags_2
sta FDC_flags
__fdc_readsector
lda #CMD_ReadSector
__fdc_command_2
sta FDC_command_register
jsr WaitCommand
; Read the sector data
ldx #0
loop_read_sector
__fdc_drq_1
lda FDC_drq
bmi loop_read_sector
__fdc_data_2
lda FDC_data
sta LOADER_SECTOR_BUFFER,x ; Store the byte in the sector buffer
inx
bne loop_read_sector
__fdc_status_1
lda FDC_status_register
and #$1C
jsr WaitCompletion
cli
rts
WaitCommand
ldx #wait_status_floppy
waitcommand
nop
nop
dex
bne waitcommand
rts
WaitCompletion
txa
pha
php
sei
nop
nop
nop
ldx #4
r_wait_completion
dex
bne r_wait_completion
plp
r2_wait_completion
__fdc_status_2
lda FDC_status_register
lsr
bcs r2_wait_completion
pla
tax
rts
IrqHandler
bit $304
IrqDoNothing
rti
_EndLoaderCode
;
; This is free memory that can be used, when it reaches zero then the loader start address should be changed
;
.dsb $FFEF - _EndLoaderCode
_Vectors
#if ( _Vectors <> $FFEF )
#error - Vector address is incorrect, loader will crash
#else
;
; Here are the functions that the user can call from his own application
;
_LoaderApiFileStartSector .byt LOADER_GAME_PROGRAM_SECTOR ; $FFEF
_LoaderApiFileStartTrack .byt LOADER_GAME_PROGRAM_TRACK ; $FFF0
_LoaderApiFileSize
_LoaderApiFileSizeLow .byt <LOADER_GAME_PROGRAM_SIZE ; $FFF1
_LoaderApiFileSizeHigh .byt >LOADER_GAME_PROGRAM_SIZE ; $FFF2
; Could have a JMP here as well to launch the loaded program
_LoaderApiJump .byt OPCODE_JMP ; $FFF3
_LoaderApiAddress
_LoaderApiAddressLow .byt <LOADER_GAME_PROGRAM_ADDRESS ; $FFF4
_LoaderApiAddressHigh .byt >LOADER_GAME_PROGRAM_ADDRESS ; $FFF5
_LoaderXxxxxx_available .byt 0 ; $FFF6
_LoaderApiLoadFile .byt OPCODE_JMP,<LoadData,>LoadData ; $FFF7-$FFF9
;
; These three HAVE to be at these precise adresses, they map to hardware registers
;
_VectorNMI .word IrqDoNothing ; $FFFA-$FFFB - NMI Vector (Usually points to $0247)
_VectorReset .word IrqDoNothing ; $FFFC-$FFFD - RESET Vector (Usually points to $F88F)
_VectorIRQ .word IrqHandler ; $FFFE-$FFFF - IRQ Vector (Normally points to $0244)
#echo Remaining space in the loader code:
#print (_Vectors - _EndLoaderCode)
#endif
; End of the loader - Nothing should come after because it's out of the addressable memory range :)
|
||||
TheStack | cf92777b7d0dbda0d409b6461e1c4aa67bc1ea70 | Assemblycode:Assembly | {"size": 332, "ext": "asm", "max_stars_repo_path": "a/assembler_nasm_macho64.asm", "max_stars_repo_name": "zackarhino/hello-world", "max_stars_repo_stars_event_min_datetime": "2021-05-06T18:23:35.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-11T15:45:48.000Z", "max_issues_repo_path": "a/assembler_nasm_macho64.asm", "max_issues_repo_name": "zackarhino/hello-world", "max_issues_repo_issues_event_min_datetime": "2019-01-27T06:06:31.000Z", "max_issues_repo_issues_event_max_datetime": "2019-02-22T04:30:12.000Z", "max_forks_repo_path": "a/assembler_nasm_macho64.asm", "max_forks_repo_name": "zackarhino/hello-world", "max_forks_repo_forks_event_min_datetime": "2020-10-12T10:59:03.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-17T10:50:05.000Z"} | {"max_stars_count": 94, "max_issues_count": 6, "max_forks_count": 10, "avg_line_length": 18.4444444444, "max_line_length": 40, "alphanum_fraction": 0.4759036145} | global start
section .text
start:
mov rax, 0x2000004 ; write
mov rdi, 1 ; stdout
mov rsi, msg
mov rdx, msg.len
syscall
mov rax, 0x2000001 ; exit
mov rdi, 0
syscall
section .data
msg: db "Hello, World!", 10
.len: equ $ - msg
|
||||
TheStack | f33deaa9a586e3cf731b7fe05481838f2a60cb5b | Assemblycode:Assembly | {"size": 562, "ext": "asm", "max_stars_repo_path": "libsrc/input/x1/in_Wait.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/input/x1/in_Wait.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/input/x1/in_Wait.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 18.1290322581, "max_line_length": 50, "alphanum_fraction": 0.5427046263} | ;
; Sharp X1 - Keyboard Input
;
; void in_Wait(void)
; 2013, Karl Von Dyson (X1s.org)
;
SECTION code_clib
PUBLIC in_Wait
PUBLIC _in_Wait
EXTERN t_delay
; Waits a period of time measured in milliseconds.
;
; enter : HL = time to wait in ms
; used : AF,BC,DE,HL
.in_Wait
._in_Wait
; wait 1ms in loop controlled by HL
; at 3.5MHz, 1ms = 3500 T states
ld e,l
ld d,h
.loop ld hl,3500 - 36
call t_delay
dec de
ld a,d
or e
jr nz, loop
ret
|
||||
TheStack | 6e9ed825a4534a49df6ce6e388138e306af3b34c | Assemblycode:Assembly | {"size": 438, "ext": "asm", "max_stars_repo_path": "programs/oeis/040/A040540.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/040/A040540.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/040/A040540.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 29.2, "max_line_length": 190, "alphanum_fraction": 0.600456621} | ; A040540: Continued fraction for sqrt(564).
; 23,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1,46,1,2,1
seq $0,10197 ; Continued fraction for sqrt(138).
seq $0,47423 ; Numbers that are congruent to {2, 3, 4, 5, 6} mod 8.
mov $1,9
mul $1,$0
div $0,2
mul $0,7
add $1,3
sub $1,$0
div $1,4
sub $1,4
mov $0,$1
|
||||
TheStack | 0b5b6a0844950bb61ee76398ed101d143cf6e2d3 | Assemblycode:Assembly | {"size": 2069, "ext": "asm", "max_stars_repo_path": "Borland/CBuilder5/Source/RTL/source/cstrings/strcpy.asm", "max_stars_repo_name": "TrevorDArcyEvans/DivingMagpieSoftware", "max_stars_repo_stars_event_min_datetime": "2021-05-27T10:27:25.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-27T10:27:25.000Z", "max_issues_repo_path": "Borland/CBuilder5/Source/RTL/source/cstrings/strcpy.asm", "max_issues_repo_name": "TrevorDArcyEvans/Diving-Magpie-Software", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Borland/CBuilder5/Source/RTL/source/cstrings/strcpy.asm", "max_forks_repo_name": "TrevorDArcyEvans/Diving-Magpie-Software", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.8805970149, "max_line_length": 75, "alphanum_fraction": 0.4601256646} | ;[]-----------------------------------------------------------------[]
;| STRCPY.ASM -- copy string src to string dest |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include RULES.ASI
; Segments Definitions
Header@
;-----------------------------------------------------------------------
;
;Name strcpy - copy string src to string dest
;
;Usage char *strcpy (char *dest, const char *src);
;
;Prototype in string.h
;
;Description Copy the ASCIIZ string *src to the buffer *dest. It is the
; callers responsibility to ensure that the dest buffer is
; large enough to contain the string, and to guard against
; supplying NULL arguments.
;
;Return value strcpy returns dest.
;
;-----------------------------------------------------------------------
Code_seg@
Func@ strcpy, _EXPFUNC, _RTLENTRYF, <pointer dest>, <pointer src>
Link@ esi,edi
mov edi,src ; get source string
mov esi,edi ; copy to esi and edi
mov ecx,-1
xor al,al ; search for null at end of source string
cld
repne scasb ; scan one character past null
not ecx ; ecx = no. of characters including null
mov edi,dest ; get destination buffer
mov eax,edi ; copy to eax for return value
mov edx,ecx ; save count
shr ecx,1 ; calculate longword count
shr ecx,1
cld
rep movsd ; copy longwords
mov ecx,edx ; get back count
and ecx,3 ; calculate remainder byte count (0-3)
rep movsb ; copy remaining bytes
Unlink@ esi,edi
Return@
EndFunc@ strcpy
Code_EndS@
end
|
||||
TheStack | 5f17df328ccfb4ba73f2f24394a6819eb77155bf | Assemblycode:Assembly | {"size": 257, "ext": "a51", "max_stars_repo_path": "Lab_4/C_Task_2.a51", "max_stars_repo_name": "DeeptimaanB/8051_Programs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Lab_4/C_Task_2.a51", "max_issues_repo_name": "DeeptimaanB/8051_Programs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Lab_4/C_Task_2.a51", "max_forks_repo_name": "DeeptimaanB/8051_Programs", "max_forks_repo_forks_event_min_datetime": "2021-09-19T12:10:50.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-19T12:10:50.000Z"} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 19.7692307692, "max_line_length": 74, "alphanum_fraction": 0.7470817121} | ;Write an 8051 ALP to find whether given eight bit number is odd or even.
;If odd store 00h in accumulator. If even store FFh in accumulator.
ORG 0000H
MOV A,55H
MOV C,ACC.0
JC ODD
MOV A,#0FFH
SJMP END1
ODD:MOV A,#00H
END1:NOP
END ;Deeptimaan Banerjee
|
||||
TheStack | cf852c0ea9216932a8db36bd40eefb369816b7a9 | Assemblycode:Assembly | {"size": 306, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 25.5, "max_line_length": 84, "alphanum_fraction": 0.9150326797} |
; int bv_priority_queue_shrink_to_fit_fastcall(bv_priority_queue_t *q)
SECTION code_clib
SECTION code_adt_bv_priority_queue
PUBLIC _bv_priority_queue_shrink_to_fit_fastcall
EXTERN asm_bv_priority_queue_shrink_to_fit
defc _bv_priority_queue_shrink_to_fit_fastcall = asm_bv_priority_queue_shrink_to_fit
|
||||
TheStack | a110827e68bb06a305ad99408036bbbcfd95080a | Assemblycode:Assembly | {"size": 5165, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48_notsx.log_21829_504.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48_notsx.log_21829_504.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48_notsx.log_21829_504.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 44.525862069, "max_line_length": 2999, "alphanum_fraction": 0.6602129719} | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x10d8b, %rsi
lea addresses_D_ht+0x82b, %rdi
nop
nop
cmp $2283, %r9
mov $18, %rcx
rep movsb
nop
dec %r8
lea addresses_WC_ht+0x1ea9b, %r11
nop
xor %r13, %r13
mov (%r11), %r8d
nop
nop
nop
nop
add $32917, %rdi
lea addresses_WC_ht+0xa0eb, %rsi
lea addresses_WC_ht+0x7aeb, %rdi
clflush (%rdi)
nop
sub %rbp, %rbp
mov $84, %rcx
rep movsq
nop
nop
nop
nop
and $39254, %rsi
lea addresses_A_ht+0xe413, %r9
nop
nop
nop
xor %rsi, %rsi
movb (%r9), %r8b
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x18ceb, %rsi
lea addresses_A_ht+0xb5eb, %rdi
nop
nop
nop
xor $31053, %rbp
mov $48, %rcx
rep movsq
nop
nop
nop
nop
nop
and %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rbp
push %rdi
push %rdx
// Faulty Load
lea addresses_WT+0x1b8eb, %r9
nop
nop
xor %r10, %r10
mov (%r9), %r12d
lea oracles, %rdi
and $0xff, %r12
shlq $12, %r12
mov (%rdi,%r12,1), %r12
pop %rdx
pop %rdi
pop %rbp
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': True, 'size': 4, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 2}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
||||
TheStack | 00a7c9db7f317072d5edf5fb85284a2e2855c5ed | Assemblycode:Assembly | {"size": 174, "ext": "asm", "max_stars_repo_path": "Userland/SampleCodeModule/asm/syscall.asm", "max_stars_repo_name": "migdiluca/TP2-SO", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Userland/SampleCodeModule/asm/syscall.asm", "max_issues_repo_name": "migdiluca/TP2-SO", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Userland/SampleCodeModule/asm/syscall.asm", "max_forks_repo_name": "migdiluca/TP2-SO", "max_forks_repo_forks_event_min_datetime": "2018-09-04T23:47:33.000Z", "max_forks_repo_forks_event_max_datetime": "2020-10-08T09:18:04.000Z"} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 7.5652173913, "max_line_length": 15, "alphanum_fraction": 0.6551724138} | GLOBAL _syscall
section .text
_syscall:
push rbp
mov rbp, rsp
mov rax, rdi
mov rdi, rsi
mov rsi, rdx
mov rdx, rcx
mov r10, r8
mov r8, r9
int 80h
leave
ret
|
||||
TheStack | c7643e5769d4b03a9971b4064e3d152aeec47bfd | Assemblycode:Assembly | {"size": 1567, "ext": "asm", "max_stars_repo_path": "src/kernel/x86_64/cpu.asm", "max_stars_repo_name": "nothotscott/VisualOS", "max_stars_repo_stars_event_min_datetime": "2021-01-05T07:53:36.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-09T17:57:09.000Z", "max_issues_repo_path": "src/kernel/x86_64/cpu.asm", "max_issues_repo_name": "nothotscott/VisualOS", "max_issues_repo_issues_event_min_datetime": "2021-05-24T00:14:49.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-29T11:12:15.000Z", "max_forks_repo_path": "src/kernel/x86_64/cpu.asm", "max_forks_repo_name": "nothotscott/VisualOS", "max_forks_repo_forks_event_min_datetime": "2020-12-19T02:02:22.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-10T11:47:48.000Z"} | {"max_stars_count": 28, "max_issues_count": 4, "max_forks_count": 6, "avg_line_length": 21.4657534247, "max_line_length": 80, "alphanum_fraction": 0.6541161455} | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; File: cpu.asm
;; Note: The functions should follow Sys V ABI
;; Copyright 2021 Scott Maday
;; Check the LICENSE file that came with this program for licensing terms
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EXTERN cpu_get_bsp
EXTERN cpu_init
EXTERN cpuid_get_local_apic_id
%include "cpu.inc"
;; Global initializors
SECTION .text
GLOBAL cpu_init_bsp
cpu_init_bsp:
push rbp
mov rbp, rsp
call cpu_get_bsp
mov rdi, rax
jmp cpu_init_common
GLOBAL cpu_init_ap
cpu_init_ap:
push rbp
mov rbp, rsp
mov QWORD [rdi + CPUContext.stack_kernel], rsi
jmp cpu_init_common
cpu_init_common: ; rdi=[cpu_context]
mov r12, rdi
; Set some of the context struct
call cpuid_get_local_apic_id
mov BYTE [rdi + CPUContext.local_apic_id], al
; Set gs/fs base MSRs
mov rax, cr4
or rax, 0x10000
mov cr4, rax
mov rdi, r12
mov ecx, CPU_MSR_KERNELGSBASE
mov eax, edi ; low
shr rdi, 32
mov edx, edi ; high
wrmsr
; Finish initialization in C
mov rdi, r12
call cpu_init
pop rbp
ret
GLOBAL cpu_enable_features
cpu_enable_features:
push rbp
mov rbp, rsp
push rbx
; Enable Coprocessors (FPU and SSE)
mov rax, cr0
and rax, 0xfffffffffffffffb ; disable FPU emulation
or rax, 0x22 ; enable monitoring coprocessor and numeric error
mov cr0, rax
mov rax, cr4
; TODO enable XSAVE here
or rax, 0x0406b0 ; enable OSFXSR, OSXMMEXCPT and others
mov cr4, rax
fninit
; Finish
pop rbx
pop rbp
ret |
||||
TheStack | 274ca0f2fedc4a88a711b8ca1067f6c43843355f | Assemblycode:Assembly | {"size": 334, "ext": "asm", "max_stars_repo_path": "programs/oeis/129/A129958.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/129/A129958.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/129/A129958.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.2666666667, "max_line_length": 180, "alphanum_fraction": 0.6646706587} | ; A129958: First differences of A129957.
; 0,8,18,38,60,92,126,170,216,272,330,398,468,548,630,722,816,920,1026,1142,1260,1388,1518,1658,1800,1952,2106,2270,2436,2612,2790,2978,3168,3368,3570,3782,3996,4220,4446,4682,4920
mul $0,2
lpb $0
mov $2,$0
mov $3,$0
trn $0,3
add $2,$0
sub $0,1
add $2,$3
add $1,$2
lpe
mul $1,2
|
||||
TheStack | fb1d5102f6852b395f24fc22ccab779988b3fefe | Assemblycode:Assembly | {"size": 664, "ext": "asm", "max_stars_repo_path": "assembly/of.asm", "max_stars_repo_name": "mohsend/Magnificent-University-projects", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "assembly/of.asm", "max_issues_repo_name": "mohsend/Magnificent-University-projects", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assembly/of.asm", "max_forks_repo_name": "mohsend/Magnificent-University-projects", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 15.8095238095, "max_line_length": 48, "alphanum_fraction": 0.5753012048} | ; sets (OV), and clears (NV) the overflow flag.
;------------
; stack segment :
STSEG SEGMENT
DB 64 DUP (?)
STSEG ENDS
;------------
; data segment :
DTSEG SEGMENT
; place program data here
DTSEG ENDS
;------------
; code segment :
CDSEG SEGMENT
MAIN PROC FAR
ASSUME CS:CDSEG, DS:DTSEG, SS:STSEG
MOV AX, DTSEG
MOV DS, AX
; main code starts here
; set overflow flag (OV)
PUSHF
POP AX
OR AX, 0800H
PUSH AX
POPF
; clear overflow flag (NV)
PUSHF
POP AX
AND AX, 0F7FFH
PUSH AX
POPF
; end (terminate) program
terminate:
MOV AH, 4CH
INT 21H
MAIN ENDP
CDSEG ENDS
END MAIN
|
||||
TheStack | 1271911131bd626ffc27a79e519b1e1a26aa64ed | Assemblycode:Assembly | {"size": 17636, "ext": "asm", "max_stars_repo_path": "s3d/music-original/The Final Fight.asm", "max_stars_repo_name": "Cancer52/flamedriver", "max_stars_repo_stars_event_min_datetime": "2017-10-09T20:28:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-29T21:19:20.000Z", "max_issues_repo_path": "s3d/music-original/The Final Fight.asm", "max_issues_repo_name": "Cancer52/flamedriver", "max_issues_repo_issues_event_min_datetime": "2018-08-01T13:52:20.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-21T02:19:37.000Z", "max_forks_repo_path": "s3d/music-original/The Final Fight.asm", "max_forks_repo_name": "Cancer52/flamedriver", "max_forks_repo_forks_event_min_datetime": "2018-02-17T19:50:36.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-30T19:28:06.000Z"} | {"max_stars_count": 9, "max_issues_count": 12, "max_forks_count": 2, "avg_line_length": 32.3596330275, "max_line_length": 115, "alphanum_fraction": 0.6267861193} | Snd_FinalFight_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Snd_FinalFight_Voices
smpsHeaderChan $06, $03
smpsHeaderTempo $01, $0A
smpsHeaderDAC Snd_FinalFight_DAC
; The $B4 in the below line is an invalid transpose value that
; creates impossibly-low notes. In Sonic 3D's driver, these
; impossibly low notes would underflow and safely wrap around, but
; other drivers (including Sonic 1 & 2's) will not handle this so
; gracefully, and instead produce incorrect notes.
smpsHeaderFM Snd_FinalFight_FM1, $B4, $17
smpsHeaderFM Snd_FinalFight_FM2, $00, $14
smpsHeaderFM Snd_FinalFight_FM3, $00, $14
smpsHeaderFM Snd_FinalFight_FM4, $00, $18
smpsHeaderFM Snd_FinalFight_FM5, $00, $18
smpsHeaderPSG Snd_FinalFight_PSG1, $E8, $00, $00, $00
smpsHeaderPSG Snd_FinalFight_PSG2, $E8, $02, $00, $00
smpsHeaderPSG Snd_FinalFight_PSG3, $47, $00, $00, $00
; FM1 Data
Snd_FinalFight_FM1:
smpsSetvoice $00
smpsAlterNote $FE
Snd_FinalFight_Loop09:
dc.b nA1, $06, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1
dc.b nA1, nA1, nA1, nA1, nA1
smpsLoop $00, $07, Snd_FinalFight_Loop09
dc.b nRst, $48, nA1, $06, nA1, nA1, nA1
Snd_FinalFight_Loop0A:
dc.b nA1, $06, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1
dc.b nA1, nA1, nA1, nA1, nA1
smpsLoop $00, $08, Snd_FinalFight_Loop0A
Snd_FinalFight_Loop0B:
dc.b nA1, $06, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1
dc.b nA1, nA1, nA1, nA1, nA1
smpsLoop $00, $07, Snd_FinalFight_Loop0B
dc.b nA1, $06, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nRst, $30, nRst
dc.b $60, nRst, $60, nRst, $60, nRst, $30, nA1, $06, nA1, nA1, nA1
dc.b nA1, nA1, nA1, nA1
Snd_FinalFight_Loop0C:
dc.b nA1, $06, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1, nA1
dc.b nA1, nA1, nA1, nA1, nA1
smpsLoop $00, $03, Snd_FinalFight_Loop0C
dc.b nRst, $60
smpsJump Snd_FinalFight_Loop0A
; Unreachable
smpsStop
; FM2 Data
Snd_FinalFight_FM2:
smpsSetvoice $03
smpsPan panCenter, $00
Snd_FinalFight_Loop07:
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsLoop $00, $02, Snd_FinalFight_Loop07
Snd_FinalFight_Loop08:
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsLoop $00, $02, Snd_FinalFight_Loop08
smpsAlterPitch $02
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FB
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $05
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FF
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call04
smpsAlterPitch $FF
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call04
smpsAlterPitch $04
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsJump Snd_FinalFight_Loop08
; Unreachable
smpsStop
Snd_FinalFight_Call03:
smpsPan panCenter, $00
dc.b nA3, $06
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $FD
smpsPan panCenter, $00
dc.b nA3, $06
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $FD
smpsPan panCenter, $00
dc.b nA3, $06
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $FD
smpsPan panCenter, $00
dc.b nA3, $06
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $F7
smpsReturn
Snd_FinalFight_Call04:
smpsFMAlterVol $09
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $03
smpsPan panLeft, $00
dc.b nA3
smpsPan panRight, $00
dc.b nA3
smpsFMAlterVol $EB
dc.b nRst, $24
smpsReturn
; FM3 Data
Snd_FinalFight_FM3:
smpsSetvoice $03
smpsPan panCenter, $00
smpsAlterPitch $04
Snd_FinalFight_Loop05:
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsLoop $00, $02, Snd_FinalFight_Loop05
Snd_FinalFight_Loop06:
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsLoop $00, $02, Snd_FinalFight_Loop06
smpsAlterPitch $01
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FB
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $05
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call04
smpsAlterPitch $FF
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call04
smpsAlterPitch $04
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $FC
smpsCall Snd_FinalFight_Call03
smpsCall Snd_FinalFight_Call03
smpsAlterPitch $04
smpsJump Snd_FinalFight_Loop06
; Unreachable
smpsStop
; FM4 Data
Snd_FinalFight_FM4:
smpsAlterNote $04
smpsPan panLeft, $00
Snd_FinalFight_Jump00:
smpsModSet $24, $01, $04, $08
smpsSetvoice $02
Snd_FinalFight_Loop02:
smpsCall Snd_FinalFight_Call01
smpsLoop $00, $03, Snd_FinalFight_Loop02
dc.b nA2, $0C, nA3, $06, nA2, $0C, nA3, $06, nA2, $12, nA2, $06
dc.b nA3, $0C, nF3, nG3, nRst, $48, nC4, $0C, nB3
Snd_FinalFight_Loop03:
smpsCall Snd_FinalFight_Call01
smpsLoop $00, $04, Snd_FinalFight_Loop03
Snd_FinalFight_Loop04:
smpsCall Snd_FinalFight_Call02
smpsLoop $00, $03, Snd_FinalFight_Loop04
smpsCall Snd_FinalFight_Call01
dc.b nRst, $60, nRst, $60, nRst, $60, nRst, $30, nRst, $0C, nA3, nF3
dc.b nG3
smpsCall Snd_FinalFight_Call01
smpsCall Snd_FinalFight_Call01
smpsJump Snd_FinalFight_Loop03
; Unreachable
smpsStop
Snd_FinalFight_Call01:
dc.b nA2, $0C, nA3, $06, nA2, $0C, nA3, $06, nA2, $12, nA2, $06
dc.b nA3, $0C, nF3, nG3, nA2, $0C, nA3, $06, nA2, $0C, nA3, $06
dc.b nA2, $12, nA2, $06, nA3, $0C, nC4, nB3
smpsReturn
Snd_FinalFight_Call02:
dc.b nA2, $0C, nA3, $06, nA2, $0C, nA3, $06, nA2, $12, nA2, $06
dc.b nA3, $0C, nFs3, nG3, nA2, $0C, nA3, $06, nA2, $0C, nA3, $06
dc.b nA2, $12, nA2, $06, nA3, $0C, nC4, nB3
smpsReturn
; FM5 Data
Snd_FinalFight_FM5:
smpsAlterNote $F8
smpsPan panRight, $00
smpsJump Snd_FinalFight_Jump00
; Unreachable
smpsStop
; PSG1 Data
Snd_FinalFight_PSG1:
smpsModSet $24, $01, $01, $04
Snd_FinalFight_Jump01:
smpsPSGvoice sTone_03
smpsPSGAlterVol $0D
dc.b nA2, $60, nA2, nA2, nA2, nF2, nF2, nF2, nF2
smpsPSGAlterVol $F3
Snd_FinalFight_Jump02:
dc.b nRst, $0C, nB3, $0C, nE4, $06, nRst, nD4, nRst, nE4, $12, nA4
dc.b $1E, smpsNoAttack, nA4, $30, nCs5, $03, smpsNoAttack, nD5, $2D, smpsNoAttack, nB4, $60
dc.b nA4, nRst, $0C, nB3, $0C, nE4, $06, nRst, nD4, nRst, nE4, $12
dc.b nA4, $1E, smpsNoAttack, nA4, $30, nCs5, $03, smpsNoAttack, nD5, $2D, nEb5, $03
dc.b smpsNoAttack, nE5, $5D, smpsNoAttack, nE5, $48, nRst, $18, nRst, $0C, nFs3, $06
dc.b nRst, nCs4, nRst, nB3, nRst, nCs4, $12, nF4, $03, smpsNoAttack, nFs4, $1B
dc.b smpsNoAttack, nFs4, $0C, nE4, $06, nRst, nFs4, nRst, nA4, nRst, nBb4, $03
dc.b smpsNoAttack, nB4, $15, nB4, $18, nRst, $0C, nA4, $06, nRst, nB4, nRst
dc.b nA4, nRst, nFs4, smpsNoAttack, nFs4, nE4, nFs4, nE4, nD4, nB3, nD4, nB3
dc.b nRst, nA3, nRst, nAb3, nRst, nFs3, $3C, nRst, $0C, nFs3, $06, nRst
dc.b nCs4, nRst, nB3, nRst, nCs4, $12, nF4, $03, smpsNoAttack, nFs4, nRst, $06
dc.b nRst, nE4, nRst, nFs4, $12, nB4, $03, smpsNoAttack, nCs5, $03, nRst, $0C
dc.b nB4, $3C, nA4, $0C, nF4, $06, nD4, nBb3, nA4, nF4, nD4, nBb4
dc.b $03, nA4, nF4, nD4, nBb4, nA4, nF4, nD4, nBb4, nA4, nF4, nD4
dc.b nBb4, nA4, nF4, nD4, nC5, $03, smpsNoAttack, nD5, $2D, nRst, $30
smpsPSGAlterVol $0D
dc.b nA2, $60, nA2, nA2, nA2, nF2, nF2, nF2, nF2
smpsPSGAlterVol $F3
smpsJump Snd_FinalFight_Jump02
; Unreachable
smpsStop
; PSG2 Data
Snd_FinalFight_PSG2:
smpsModSet $24, $01, $01, $05
smpsAlterNote $FE
dc.b nRst, $08
smpsJump Snd_FinalFight_Jump01
; Unreachable
smpsStop
; PSG3 Data
Snd_FinalFight_PSG3:
smpsPSGform $E7
smpsPSGvoice sTone_01
Snd_FinalFight_Loop0D:
smpsCall Snd_FinalFight_Call05
smpsLoop $00, $07, Snd_FinalFight_Loop0D
dc.b nRst, $60
Snd_FinalFight_Loop0E:
smpsCall Snd_FinalFight_Call05
smpsLoop $00, $07, Snd_FinalFight_Loop0E
dc.b (nMaxPSG2-$47)&$FF, $06, (nMaxPSG2-$47)&$FF, nRst, (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_27
dc.b (nMaxPSG2-$47)&$FF, smpsNoAttack, (nMaxPSG2-$47)&$FF, nRst, $30
smpsLoop $01, $02, Snd_FinalFight_Loop0E
dc.b nRst, $60, nRst, nRst, nRst
smpsCall Snd_FinalFight_Call05
smpsCall Snd_FinalFight_Call05
smpsCall Snd_FinalFight_Call05
dc.b nRst, $60
smpsJump Snd_FinalFight_Loop0E
; Unreachable
smpsStop
Snd_FinalFight_Call05:
smpsPSGvoice sTone_01
dc.b (nMaxPSG2-$47)&$FF, $06, (nMaxPSG2-$47)&$FF, nRst, (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_27
dc.b (nMaxPSG2-$47)&$FF, smpsNoAttack, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_01
dc.b (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_27
dc.b (nMaxPSG2-$47)&$FF, smpsNoAttack, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_01
dc.b (nMaxPSG2-$47)&$FF, (nMaxPSG2-$47)&$FF
smpsPSGvoice sTone_27
dc.b (nMaxPSG2-$47)&$FF, smpsNoAttack, (nMaxPSG2-$47)&$FF
smpsReturn
; DAC Data
Snd_FinalFight_DAC:
smpsPan panCenter, $00
dc.b nRst, $60, nRst, nRst, nRst
Snd_FinalFight_Loop00:
smpsCall Snd_FinalFight_Call00
smpsLoop $00, $03, Snd_FinalFight_Loop00
dc.b dFinalFightMetalCrash, $06, dFinalFightMetalCrash, dFinalFightMetalCrash, dFinalFightMetalCrash, dSnareS3
smpsPan panRight, $00
dc.b dElectricMidTom
smpsPan panLeft, $00
dc.b dElectricFloorTom
smpsPan panCenter, $00
dc.b dSnareS3, nRst, nRst
smpsPan panRight, $00
dc.b dElectricMidTom, $03
smpsPan panCenter, $00
dc.b dElectricLowTom
smpsPan panLeft, $00
dc.b dElectricFloorTom
smpsPan panCenter, $00
dc.b dSnareS3, dSnareS3, $06, dSnareS3, dSnareS3, dSnareS3
Snd_FinalFight_Loop01:
smpsCall Snd_FinalFight_Call00
smpsLoop $00, $07, Snd_FinalFight_Loop01
dc.b dFinalFightMetalCrash, $06, dFinalFightMetalCrash, dFinalFightMetalCrash, dFinalFightMetalCrash, dSnareS3
smpsPan panRight, $00
dc.b dElectricMidTom
smpsPan panLeft, $00
dc.b dElectricFloorTom
smpsPan panCenter, $00
dc.b nRst, nRst, $30
smpsLoop $01, $02, Snd_FinalFight_Loop01
dc.b nRst, $60, nRst, nRst, nRst, nRst, nRst, nRst, dSnareS3, $06, dSnareS3, dSnareS3
dc.b dSnareS3, nRst, nRst, nRst
smpsPan panRight, $00
dc.b dElectricMidTom, $03
smpsPan panCenter, $00
dc.b dElectricLowTom
smpsPan panLeft, $00
dc.b dElectricFloorTom, $06
smpsPan panCenter, $00
dc.b dSnareS3, dSnareS3, dSnareS3, dSnareS3, dSnareS3, dSnareS3, dSnareS3
smpsJump Snd_FinalFight_Loop01
; Unreachable
smpsStop
Snd_FinalFight_Call00:
dc.b dFinalFightMetalCrash, $06, dFinalFightMetalCrash, dFinalFightMetalCrash, dFinalFightMetalCrash, dSnareS3
smpsPan panRight, $00
dc.b dElectricMidTom
smpsPan panLeft, $00
dc.b dElectricFloorTom
smpsPan panCenter, $00
dc.b dSnareS3, dFinalFightMetalCrash, dSnareS3, dFinalFightMetalCrash, nRst, nRst, nRst, nRst, nRst
smpsReturn
Snd_FinalFight_Voices:
; Voice $00
; $35
; $02, $02, $02, $02, $1F, $5F, $1F, $5F, $0E, $00, $12, $00
; $00, $08, $02, $08, $4F, $0F, $4F, $0F, $12, $88, $88, $88
smpsVcAlgorithm $05
smpsVcFeedback $06
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $00, $00
smpsVcCoarseFreq $02, $02, $02, $02
smpsVcRateScale $01, $00, $01, $00
smpsVcAttackRate $1F, $1F, $1F, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $12, $00, $0E
smpsVcDecayRate2 $08, $02, $08, $00
smpsVcDecayLevel $00, $04, $00, $04
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $08, $08, $08, $12
; Voice $01
; $3D
; $01, $01, $01, $11, $1C, $18, $18, $1B, $06, $05, $04, $05
; $06, $05, $06, $06, $60, $89, $59, $79, $18, $88, $88, $88
smpsVcAlgorithm $05
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $01, $00, $00, $00
smpsVcCoarseFreq $01, $01, $01, $01
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1B, $18, $18, $1C
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $05, $04, $05, $06
smpsVcDecayRate2 $06, $06, $05, $06
smpsVcDecayLevel $07, $05, $08, $06
smpsVcReleaseRate $09, $09, $09, $00
smpsVcTotalLevel $08, $08, $08, $18
; Voice $02
; $3D
; $71, $02, $01, $10, $0F, $0D, $0F, $13, $0B, $05, $04, $05
; $06, $05, $06, $06, $6F, $8F, $5F, $7F, $18, $88, $88, $88
smpsVcAlgorithm $05
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $01, $00, $00, $07
smpsVcCoarseFreq $00, $01, $02, $01
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $13, $0F, $0D, $0F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $05, $04, $05, $0B
smpsVcDecayRate2 $06, $06, $05, $06
smpsVcDecayLevel $07, $05, $08, $06
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $08, $08, $08, $18
; Voice $03
; $04
; $02, $02, $03, $03, $1F, $17, $1F, $17, $00, $0E, $00, $0E
; $00, $00, $00, $00, $4F, $FF, $4F, $FF, $19, $88, $19, $88
smpsVcAlgorithm $04
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $00, $00
smpsVcCoarseFreq $03, $03, $02, $02
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $17, $1F, $17, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $0E, $00, $0E, $00
smpsVcDecayRate2 $00, $00, $00, $00
smpsVcDecayLevel $0F, $04, $0F, $04
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $08, $19, $08, $19
; Unused voice
; Voice $04
; $04
; $12, $22, $23, $13, $1F, $1D, $1F, $1D, $00, $00, $00, $00
; $09, $03, $09, $03, $0F, $0F, $0F, $0F, $0D, $90, $0D, $90
smpsVcAlgorithm $04
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $01, $02, $02, $01
smpsVcCoarseFreq $03, $03, $02, $02
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1D, $1F, $1D, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $00
smpsVcDecayRate2 $03, $09, $03, $09
smpsVcDecayLevel $00, $00, $00, $00
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $10, $0D, $10, $0D
; Unused voice
; Voice $05
; $35
; $00, $01, $11, $21, $13, $1F, $1F, $1F, $0E, $00, $00, $00
; $00, $02, $02, $02, $4F, $0F, $0F, $0F, $12, $88, $88, $88
smpsVcAlgorithm $05
smpsVcFeedback $06
smpsVcUnusedBits $00
smpsVcDetune $02, $01, $00, $00
smpsVcCoarseFreq $01, $01, $01, $00
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1F, $13
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $0E
smpsVcDecayRate2 $02, $02, $02, $00
smpsVcDecayLevel $00, $00, $00, $04
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $08, $08, $08, $12
|
||||
TheStack | 5f21e425473b78c5e3c4af63caec9ed98819be43 | Assemblycode:Assembly | {"size": 25550, "ext": "asm", "max_stars_repo_path": "bsp/upd70f3454/drivers/cstartup.asm", "max_stars_repo_name": "Davidfind/rt-thread", "max_stars_repo_stars_event_min_datetime": "2015-01-01T09:23:08.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T19:34:05.000Z", "max_issues_repo_path": "bsp/upd70f3454/drivers/cstartup.asm", "max_issues_repo_name": "zlzerg/rt-thread", "max_issues_repo_issues_event_min_datetime": "2015-01-09T02:01:34.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T23:10:14.000Z", "max_forks_repo_path": "bsp/upd70f3454/drivers/cstartup.asm", "max_forks_repo_name": "zlzerg/rt-thread", "max_forks_repo_forks_event_min_datetime": "2015-01-06T07:05:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T18:21:50.000Z"} | {"max_stars_count": 7482, "max_issues_count": 2543, "max_forks_count": 4645, "avg_line_length": 30.4166666667, "max_line_length": 78, "alphanum_fraction": 0.3604305284} | ;-----------------------------------------------------------------------------
; This file contains the startup code used by the V850 C/C++ compiler.
;
; Copyright (c) 1998-2009 IAR Systems AB.
;
; $Revision: 5028 $
;
;-----------------------------------------------------------------------------
;
; Naming covention of labels in this file:
;
; ?xxx - External labels only accessed from assembler.
; __xxx - External labels accessed from or defined in C.
; xxx - Labels local to one module (note: this file contains
; several modules).
; main - The starting point of the user program.
;
#include "lxx.h"
#include "cfi.h"
CASEON
#define A0 R1
#define A1 R5
#define A2 R6
;---------------------------------------------------------------;
; Call Frame Informatio ;
;---------------------------------------------------------------;
CFNAMES
CFCOMMON
;---------------------------------------------------------------;
; Reset Vector ;
;---------------------------------------------------------------;
MODULE ?RESET
PUBLIC ?creset
EXTERN __program_start
COMMON INTVEC:CODE:ROOT(2)
?creset:
MOV __program_start, R1
JMP [R1]
ENDMOD
;---------------------------------------------------------------;
; Module start. ;
;---------------------------------------------------------------;
MODULE __program_start
PUBLIC __program_start
PUBLIC ?cstartup
EXTERN ?creset
REQUIRE ?creset
;---------------------------------------------------------------;
; Forward declarations of segments used in this module. ;
;---------------------------------------------------------------;
RSEG CODE:CODE:NOROOT(2)
RSEG CSTACK:DATA(2)
;---------------------------------------------------------------;
; The startup code. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
;;
;; The startup sequence contained in the final linked
;; application will consist of a mosaic containing
;; modules and segment parts defined in this file.
;;
;; The only part which is required is the call to
;; the function "main".
;;
EXTERN ?cstart_call_main
REQUIRE ?cstart_call_main
EXTERN __cstart_low_level_init
REQUIRE __cstart_low_level_init
PUBLIC ?BTT_cstart_begin
?BTT_cstart_begin:
?cstartup:
__program_start:
;---------------------------------------------------------------;
; Set up the stack and the global pointer. ;
;---------------------------------------------------------------;
#if __CORE__ == __CORE_V850__
;; If an interrupt is issued beteween the MOVEA and
;; MOVHI instructions the SP will point into
;; nowhere. To fix this problem we build the new SP
;; value in R1 and moves it with an atomic operation
;; to SP.
MOVE_M SFE CSTACK, R1
MOV R1, SP
#else
MOVE_M SFE CSTACK, SP
#endif
EXTERN ?BREL_BASE
MOVE_M ?BREL_BASE + 0x8000, GP
EXTERN ?BREL_CBASE
MOVE_M ?BREL_CBASE + 0x8000, R25
;---------------------------------------------------------------;
; Setup constant registers. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_REG
?INIT_REG: MOV 255, R18
ORI 65535, zero, R19
ENDMOD
;---------------------------------------------------------------;
; Initialize the saddr base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_SADDR_BASE
RTMODEL "__reg_ep", "saddr"
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_SADDR_BASE
?INIT_SADDR_BASE:
EXTERN ?SADDR_BASE
MOVE_M ?SADDR_BASE, EP
ENDMOD
;---------------------------------------------------------------;
; If hardware must be initialized from C or if watch dog timer ;
; must be handled or if the segment init should not be ;
; performed it can now be done in `__low_level_init'. ;
;---------------------------------------------------------------;
; Call the user function __low_level_init, if defined. ;
; It is the responsibility of __low_level_init to require ;
; __cstart_low_level_init in order to be called by cstartup. ;
;---------------------------------------------------------------;
MODULE ?CSTART_LOW_LEVEL_INIT
RSEG CSTART:CODE:NOROOT(1)
PUBLIC __cstart_low_level_init
EXTERN __low_level_init
REQUIRE __low_level_init
EXTERN ?no_seg_init
__cstart_low_level_init:
CALL_FUNC __low_level_init, LP, R1
ANDI 0xFF, R1, R1
BZ ?no_seg_init
ENDMOD
;---------------------------------------------------------------;
; Segment initialization code. Copy initialized ROMmed code to ;
; RAM and ?seg_clear uninitialized variables. ;
;---------------------------------------------------------------;
MODULE ?INIT_MEMORY
;---------------------------------------------------------------;
; Zero out NEAR_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_NEAR_Z
RSEG NEAR_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_NEAR_Z:
MOVE_M SFB NEAR_Z, A0
MOVE_M SFE NEAR_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out BREL_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_BREL_Z
RSEG BREL_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_BREL_Z:
MOVE_M SFB BREL_Z, A0
MOVE_M SFE BREL_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out SADDR7_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR7_Z
RSEG SADDR7_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_SADDR7_Z:
MOVE_M SFB SADDR7_Z, A0
MOVE_M SFE SADDR7_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out SADDR8_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR8_Z
RSEG SADDR8_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_SADDR8_Z:
MOVE_M SFB SADDR8_Z, A0
MOVE_M SFE SADDR8_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out BREL23_Z ;
;---------------------------------------------------------------;
#if __CORE__ >= __CORE_V850E2M__
PUBLIC ?INIT_BREL23_Z
RSEG BREL23_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_BREL23_Z:
MOVE_M SFB BREL23_Z, A0
MOVE_M SFE BREL23_Z, A1
JARL ?seg_clear, LP
#endif
;---------------------------------------------------------------;
; Zero out HUGE_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_HUGE_Z
RSEG HUGE_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_HUGE_Z:
MOVE_M SFB HUGE_Z, A0
MOVE_M SFE HUGE_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Copy NEAR_ID into NEAR_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_NEAR_I
RSEG NEAR_I(2)
RSEG NEAR_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_NEAR_I:
MOVE_M SFB NEAR_ID, A0
MOVE_M SFE NEAR_ID, A1
MOVE_M SFB NEAR_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy BREL_ID into BREL_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_BREL_I
RSEG BREL_I(2)
RSEG BREL_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_BREL_I:
MOVE_M SFB BREL_ID, A0
MOVE_M SFE BREL_ID, A1
MOVE_M SFB BREL_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy SADDR7_ID into SADDR7_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR7_I
RSEG SADDR7_I(2)
RSEG SADDR7_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_SADDR7_I:
MOVE_M SFB SADDR7_ID, A0
MOVE_M SFE SADDR7_ID, A1
MOVE_M SFB SADDR7_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy SADDR8_ID into SADDR8_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR8_I
RSEG SADDR8_I(2)
RSEG SADDR8_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_SADDR8_I:
MOVE_M SFB SADDR8_ID, A0
MOVE_M SFE SADDR8_ID, A1
MOVE_M SFB SADDR8_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy BREL23_ID into BREL23_I ;
;---------------------------------------------------------------;
#if __CORE__ >= __CORE_V850E2M__
PUBLIC ?INIT_BREL23_I
RSEG BREL23_I(1)
RSEG BREL23_ID(1)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_BREL23_I:
MOVE_M SFB BREL23_ID, A0
MOVE_M SFE BREL23_ID, A1
MOVE_M SFB BREL23_I, A2
JARL ?seg_copy, LP
#endif
;---------------------------------------------------------------;
; Copy HUGE_ID into HUGE_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_HUGE_I
RSEG HUGE_I(1)
RSEG HUGE_ID(1)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_HUGE_I:
MOVE_M SFB HUGE_ID, A0
MOVE_M SFE HUGE_ID, A1
MOVE_M SFB HUGE_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Destination label when skipping data initialization. ;
;---------------------------------------------------------------;
PUBLIC ?no_seg_init
RSEG CSTART:CODE:NOROOT(1)
?no_seg_init:
ENDMOD
;---------------------------------------------------------------;
; Calculate code distance (PIC only). ;
;---------------------------------------------------------------;
MODULE ?INIT_PIC
PUBLIC ?INIT_PIC
RSEG CSTART:CODE:NOROOT(1)
RTMODEL "__code_model", "pic"
EXTERN ?CODE_DISTANCE
EXTERN_LS_M
?INIT_PIC:
JARL ref_point, A1
ref_point: MOVE_M ref_point, A2
SUB A2, A1
;; Expands to correct store instruction/sequence.
STORE_M A1, ?CODE_DISTANCE, A2
;; Note: A1 (the value of ?CODE_DISTANCE) is used below!
ENDMOD
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; Initialize the BSEL system register bank selector. ;
;---------------------------------------------------------------;
MODULE ?INIT_BSEL
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_BSEL
?INIT_BSEL:
LDSR R0, 31 ; BSEL
ENDMOD
#endif
#if __CORE__ >= __CORE_V850E__
;---------------------------------------------------------------;
; Initialize the CALLT base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_CALLT
PUBLIC ?INIT_CALLT
EXTERN ?CALLT_BASE
COMMON CLTVEC(2)
RSEG CSTART:CODE:NOROOT(1)
RTMODEL "__cpu", "v850e"
REQUIRE ?CALLT_BASE
;; The Call table base pointer
?INIT_CALLT:
MOVE_M SFB CLTVEC, A2
#ifdef CODE_MODEL_PIC
EXTERN ?CODE_DISTANCE
REQUIRE ?CODE_DISTANCE
;; Add the value of ?CODE_DISTANCE calculated above
ADD A1, A2
#endif
#if __CORE__ >= __CORE_V850E2M__
EXTERN ?INIT_BSEL
REQUIRE ?INIT_BSEL
#endif
LDSR A2, 20 ; CTBP
ENDMOD
#endif
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; Initialize the SYSCALL base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_SYSCALL
PUBLIC ?INIT_SYSCALL
EXTERN ?INIT_BSEL
EXTERN ?SYSCALL_BASE
COMMON SYSCALLVEC(2)
RSEG CSTART:CODE:NOROOT(1)
REQUIRE ?INIT_BSEL
REQUIRE ?SYSCALL_BASE
;; The syscall table base pointer
?INIT_SYSCALL:
MOVE_M SFB SYSCALLVEC, A2
#ifdef CODE_MODEL_PIC
EXTERN ?CODE_DISTANCE
REQUIRE ?CODE_DISTANCE
;; Add the value of ?CODE_DISTANCE calculated above
ADD A1, A2
#endif
LDSR A2, 12 ; SCBP
MOVE_M ((SFE SYSCALLVEC - SFB SYSCALLVEC)/4) - 1, A2
LDSR A2, 11 ; SCCFG
ENDMOD
#endif
;---------------------------------------------------------------;
; This segment part is required by the compiler when it is ;
; necessary to call constructors of global objects. ;
;---------------------------------------------------------------;
MODULE ?CALL_MAIN
RSEG DIFUNCT(2)
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?cstart_call_ctors
EXTERN __call_ctors
?cstart_call_ctors:
MOVE_M SFB DIFUNCT, R1
MOVE_M SFE DIFUNCT, R5
CALL_FUNC __call_ctors, LP, R6
;---------------------------------------------------------------;
; Call C main() with no parameters. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?cstart_call_main
EXTERN main
EXTERN exit
EXTERN __exit
?cstart_call_main:
CALL_FUNC main, LP, R6
;---------------------------------------------------------------;
; If we come here we have returned from main with a 'return' ;
; statement, not with a call to exit() or abort(). ;
; In this case we must call exit() here for a nice ending. ;
; Note: The return value of main() is the argument to exit(). ;
;---------------------------------------------------------------;
CALL_FUNC exit, LP, R6
;---------------------------------------------------------------;
; We should never come here, but just in case. ;
;---------------------------------------------------------------;
MOV __exit, LP
JMP [LP]
PUBLIC ?BTT_cstart_end
?BTT_cstart_end:
;---------------------------------------------------------------;
; Copy a chunk of memory. ;
; A0 = Start of from block ;
; A1 = End of from block (+1) ;
; A2 = Start of to block ;
;---------------------------------------------------------------;
PUBLIC ?seg_copy
PUBLIC ?seg_clear
RSEG CSTART:CODE:NOROOT(1)
REQUIRE done
cp_cont: LD.B 0[A0], R7
ADD 1, A0
ST.B R7, 0[A2]
ADD 1, A2
;; Note: The entry point is here.
?seg_copy: CMP A0, A1
BNE cp_cont
RSEG CSTART:CODE:NOROOT(1)
done: JMP [LP]
;---------------------------------------------------------------;
; Clear a chunk of memory. ;
; A0 = Start of block ;
; A1 = End of block (+1) ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
REQUIRE done
?seg_clear: CMP A0, A1
BE done
cl_cont: ST.B zero, 0[A0]
ADD 1, A0
BR ?seg_clear
ENDMOD
;---------------------------------------------------------------;
; _exit code ;
; ;
; Call destructors (if required), then fall through to __exit. ;
;---------------------------------------------------------------;
MODULE ?_exit
PUBLIC _exit
PUBLIC ?BTT_exit_begin
EXTERN ?exit_restore2
RSEG RCODE:CODE:NOROOT(1)
?BTT_exit_begin:
_exit:
REQUIRE ?exit_restore2
;; If any of the two pieces of code "__cstart_call_dtors"
;; or "__cstart_closeall" is called we need to save the
;; argument to "_exit". However, since we never will
;; from this function we can use a permanent register
;; rather than storing the value on the stack.
RSEG RCODE:CODE:NOROOT(1)
EXTERN ?exit_restore
PUBLIC ?exit_save
?exit_save:
REQUIRE ?exit_restore
MOV R1, R29
RSEG RCODE:CODE:NOROOT(1)
PUBLIC __cstart_call_dtors
EXTERN __call_dtors
REQUIRE ?exit_save
;; This label is required by "__record_needed_destruction".
__cstart_call_dtors:
CALL_FUNC __call_dtors, LP, R1
ENDMOD
;; A new module is needed so that a non-terminal-IO program
;; doesn't include this, which requires __putchar.
MODULE ?__cstart_closeall
RSEG RCODE:CODE:NOROOT(1)
;; When stdio is used, the following piece of code is
;; required by the _Closreg macro.
PUBLIC __cstart_closeall
EXTERN ?exit_save
REQUIRE ?exit_save
;; This label is required by _Closreg
__cstart_closeall:
EXTERN _Close_all
CALL_FUNC _Close_all, LP, R1
ENDMOD
;; Restore the argument previously stored by the "save" section
;; above.
MODULE ?_exit_end
RSEG RCODE:CODE:NOROOT(1)
PUBLIC ?exit_restore
EXTERN ?exit_restore2
?exit_restore:
REQUIRE ?exit_restore2
MOV R29, R1
ENDMOD
MODULE ?_exit_end2
PUBLIC ?BTT_exit_end
RSEG RCODE:CODE:NOROOT(1)
PUBLIC ?exit_restore2
EXTERN __exit
?exit_restore2:
MOV __exit, LP
JMP [LP]
?BTT_exit_end:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the base relative (brel) data for RAM. ;
; ;
; This empty segment should be places in front of the brel ;
; RAM data segments. ;
;---------------------------------------------------------------;
MODULE ?BREL_BASE
PUBLIC ?BREL_BASE
RSEG BREL_BASE:DATA:NOROOT(2)
?BREL_BASE:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the base relative (brel) data for ROM. ;
; ;
; This empty segment should be places in front of the brel ;
; ROM data segment. ;
;---------------------------------------------------------------;
MODULE ?BREL_CBASE
PUBLIC ?BREL_CBASE
RSEG BREL_CBASE:CONST:NOROOT(2)
?BREL_CBASE:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the short addressing (saddr) data. ;
; ;
; This empty segment should be places in front of the saddr ;
; data segments. ;
;---------------------------------------------------------------;
MODULE ?SADDR_BASE
RTMODEL "__reg_ep", "saddr"
PUBLIC ?SADDR_BASE
RSEG SADDR_BASE:CONST:NOROOT(2)
EXTERN ?INIT_SADDR_BASE
REQUIRE ?INIT_SADDR_BASE
?SADDR_BASE:
ENDMOD
;---------------------------------------------------------------;
; The base of the CALLT vector. ;
;---------------------------------------------------------------;
MODULE ?CALLT_BASE
PUBLIC ?CALLT_BASE
COMMON CLTVEC:CONST:NOROOT(2)
DATA
?CALLT_BASE:
ENDMOD
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; The base of the SYSCALL vector. ;
;---------------------------------------------------------------;
MODULE ?SYSCALL_BASE
PUBLIC ?SYSCALL_BASE
COMMON SYSCALLVEC:CONST:NOROOT(2)
DATA
?SYSCALL_BASE:
ENDMOD
#endif
;---------------------------------------------------------------;
; The distance the code has been moved when using position ;
; independent code. ;
;---------------------------------------------------------------;
MODULE ?CODE_DISTANCE
RTMODEL "__code_model", "pic"
PUBLIC ?CODE_DISTANCE
RSEG LIBRARY_N:DATA:NOROOT(2)
EXTERN ?INIT_PIC
REQUIRE ?INIT_PIC
?CODE_DISTANCE:
DS 4
ENDMOD
;---------------------------------------------------------------;
; A dummy "low level init" that will be used if the user ;
; hasn't defined this function. ;
;---------------------------------------------------------------;
MODULE ?__low_level_init_stub
PUBLIC __low_level_init
RSEG RCODE:CODE:NOROOT
__low_level_init:
MOV 1, R1
JMP [LP]
ENDMOD
END
|
||||
TheStack | d8a52b278aa7ab5b285d8d82937bbe9b6932800f | Assemblycode:Assembly | {"size": 489, "ext": "asm", "max_stars_repo_path": "programs/oeis/040/A040404.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/040/A040404.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/040/A040404.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.8620689655, "max_line_length": 188, "alphanum_fraction": 0.5132924335} | ; A040404: Continued fraction for sqrt(425).
; 20,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,1,1,40,1,1
mov $4,2
mov $5,$0
lpb $4
mov $0,$5
sub $4,1
add $0,$4
sub $0,1
div $0,7
mov $2,$4
mov $3,$0
add $3,1
add $3,$0
mul $3,20
sub $3,$0
sub $3,1
lpb $2
mov $1,$3
sub $2,1
lpe
lpe
lpb $5
sub $1,$3
mov $5,0
lpe
add $1,1
|
||||
TheStack | c0cb7b089e2d38c5d36788811e30fc7163bc6baf | Assemblycode:Assembly | {"size": 242, "ext": "asm", "max_stars_repo_path": "programs/oeis/011/A011852.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/011/A011852.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/011/A011852.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.5714285714, "max_line_length": 170, "alphanum_fraction": 0.7107438017} | ; A011852: a(n) = floor(binomial(n,6)/6).
; 0,0,0,0,0,0,0,1,4,14,35,77,154,286,500,834,1334,2062,3094,4522,6460,9044,12435,16824,22432,29516,38371,49335,62790,79170,98962,122713,151032,184594,224150,270526,324632
bin $0,6
div $0,6
mov $1,$0
|
||||
TheStack | eafe6068c95fd31ce189fbcdd901b106f7d4b884 | Assemblycode:Assembly | {"size": 5216, "ext": "asm", "max_stars_repo_path": "common/alias.asm", "max_stars_repo_name": "DigitalMars/optlink", "max_stars_repo_stars_event_min_datetime": "2015-02-03T01:38:24.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-23T05:48:24.000Z", "max_issues_repo_path": "common/alias.asm", "max_issues_repo_name": "DigitalMars/optlink", "max_issues_repo_issues_event_min_datetime": "2015-01-02T14:51:20.000Z", "max_issues_repo_issues_event_max_datetime": "2021-01-09T21:37:19.000Z", "max_forks_repo_path": "common/alias.asm", "max_forks_repo_name": "DigitalMars/optlink", "max_forks_repo_forks_event_min_datetime": "2015-02-11T17:43:56.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-05T11:07:02.000Z"} | {"max_stars_count": 28, "max_issues_count": 20, "max_forks_count": 9, "avg_line_length": 18.9672727273, "max_line_length": 108, "alphanum_fraction": 0.7473159509} | TITLE ALIAS - Copyright (c) SLR Systems 1994
INCLUDE MACROS
INCLUDE SYMBOLS
PUBLIC ALIASS
.DATA
EXTERNDEF END_OF_RECORD:DWORD
EXTERNDEF SYMBOL_GARRAY:STD_PTR_S,SYMBOL_TPTR:TPTR_STRUCT
EXTERNDEF OPTI_MOVE:DWORD
.CODE PASS1_TEXT
EXTERNDEF OBJ_PHASE:PROC,FAR_INSTALL:PROC,ERR_ASCIZ_RET:PROC,ADD_TO_ALIASED_LIST:PROC
EXTERNDEF REMOVE_FROM_EXTERNAL_LIST:PROC,REMOVE_FROM_LIBSYM_LIST:PROC,REMOVE_FROM_WEAK_LIST:PROC
EXTERNDEF REMOVE_FROM_WEAK_DEFINED_LIST:PROC,REMOVE_FROM_LAZY_DEFINED_LIST:PROC,REMOVE_FROM_LAZY_LIST:PROC
EXTERNDEF REMOVE_FROM__IMP__LIST:PROC
EXTERNDEF ALIAS_IGNORED_ERR:ABS
;ALIASS_VARS STRUC
;SYMBOL_TP_BP TPTR_STRUCT<>
; DB SYMBOL_TEXT_SIZE DUP(?)
;ALIASS_VARS ENDS
;FIX MACRO X
;X EQU [EBP].ALIASS_VARS.(X&_BP)
; ENDM
;FIX SYMBOL_TP
ALIASS PROC
;
;DECLARE A SYMBOL AND ITS ALIAS...
;
;MAY BE OVERIDDEN BY PUBDEF OR WHATEVER
;
CMP END_OF_RECORD,ESI
; LEA EAX,[ESP - SIZEOF ALIASS_VARS - 4]
JBE ALIAS_3
; PUSH EBP
; MOV EBP,EAX
; MOV ESP,EAX
L0$:
; LEA EDI,SYMBOL_TP
MOV EDI,OFF SYMBOL_TPTR
ASSUME EDI:PTR TPTR_STRUCT
GET_NAME_HASH ;ALIAS_SYMBOL, PUT IN SYMBOL_TEXT
; LEA EAX,SYMBOL_TP
; XOR ECX,ECX ;NOT A LOCAL SYMBOL
CALL FAR_INSTALL ;GET SYMBOL GINDEX
ASSUME ECX:PTR SYMBOL_STRUCT
XOR EDX,EDX
PUSH EAX
MOV DL,[ECX]._S_NSYM_TYPE
PUSHM ECX,EDX
; LEA EDI,SYMBOL_TP
MOV EDI,OFF SYMBOL_TPTR
GET_NAME_HASH ;SUBSTITUTE_SYMBOL, PUT IN SYMBOL_TEXT
; LEA EAX,SYMBOL_TP
; XOR ECX,ECX
CALL FAR_INSTALL ;GET SYMBOL POINTER
POPM EBX,ECX
MOV EDX,EAX
POP EAX
CALL ALIAS_TABLE[EBX*2]
ALIAS_2:
CMP END_OF_RECORD,ESI
JA L0$
; LEA ESP,[EBP+SIZEOF ALIASS_VARS+4]
; MOV EBP,[EBP+SIZEOF ALIASS_VARS]
ALIAS_3:
JNZ ERROR
RET
ERROR:
CALL OBJ_PHASE
RET
ALIASS ENDP
.CONST
ALIGN 4
ALIAS_TABLE DD ALIAS_ASSIGN ;JUST ASSIGN ALIAS PLEASE
DD ALIAS_IGNORE ;ALREADY DEFINED - ASEG
DD ALIAS_IGNORE ;ALREADY DEFINED - RELOC
DD ALIAS_IGNORE ;ALREADY DEFINED - NEAR COMMUNAL
DD ALIAS_IGNORE ;ALREADY DEFINED - FAR COMMUNAL
DD ALIAS_IGNORE ;ALREADY DEFINED - HUGE COMMUNAL
DD ALIAS_IGNORE ;ALREADY DEFINED - CONST
DD ALIAS_ASSIGN ;IN LIB, JUST ASSIGN PLEASE
DD ALIAS_IGNORE ;ALREADY DEFINED - IMPORT
DD ALIAS_IGNORE ;PROMISED, I DON'T KNOW...
DD ALIAS_EXTRN ;REMOVE FROM EXTRN LIST, MAKE SURE ALIAS IS IN EXTRN LIST...
DD ALIAS_WEAK ;WEAK, ALIAS OVERRIDES
DD ALIAS_ASSIGN ;POSWEAK, ALIAS OVERRIDES
DD ALIAS_LIB ;REMOVE FROM LIB LIST, MAKE SURE SUBSTITUTE GOES IN CORRECT LIST
DD ALIAS_ASSIGN ;__imp__ UNREF, ASSIGN
DD ALIAS_COMPARE ;ALREADY ALIAS, COMPARE SYMBOL PLEASE...
DD ALIAS_IGNORE ;ALREADY DEFINED - COMDAT
DD ALIAS_WEAK_DEFINED ;WEAK_DEFINED, HELP...
DD ALIAS_ASSIGN ;WEAK-UNREF, ALIAS OVERRIDES
DD ALIAS_COMPARE ;ALIAS-UNREF, COMPARE
DD ALIAS_ASSIGN ;POS-LAZY, OVERRIDE
DD ALIAS_LAZY ;LAZY, OVERRIDE
DD ALIAS_ASSIGN ;LAZY-UNREF, OVERRIDE
DD ALIAS_COMPARE ;ALIAS-DEFINED, COMPARE
DD ALIAS_LAZY_DEFINED ;LAZY-DEFINED, OVERRIDE
DD ALIAS_IGNORE ;NCOMM-UNREF
DD ALIAS_IGNORE ;FCOMM-UNREF
DD ALIAS_IGNORE ;HCOMM-UNREF
DD ALIAS__IMP__ ;__imp__, OVERIDE
DD ALIAS_IGNORE ;UNDECORATED, CAN'T HAPPEN
.ERRNZ ($-ALIAS_TABLE)/2 -NSYM_SIZE
.CODE PASS1_TEXT
ALIAS_IGNORE PROC NEAR
;
;WHO CARES...
;
RET
ALIAS_IGNORE ENDP
ALIAS_WARN PROC NEAR
;
;PREVIOUSLY DEFINED, IGNORED
;
MOV AX,ALIAS_IGNORED_ERR
LEA ECX,[ECX]._S_NAME_TEXT
CALL ERR_ASCIZ_RET
RET
ALIAS_WARN ENDP
ALIAS_COMPARE PROC NEAR
;
;PREVIOUSLY DEFINED AS AN ALIAS, DOES IT MATCH?
;
CMP [ECX]._S_ALIAS_SUBSTITUTE_GINDEX,EDX
JNZ L5$
RET
L5$:
MOV [ECX]._S_ALIAS_SUBSTITUTE_GINDEX,EDX
CALL ALIAS_WARN
RET
ALIAS_COMPARE ENDP
ALIAS_EXTRN PROC NEAR
;
;REMOVE FROM EXTERNAL_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_EXTERNAL_LIST
AE_1::
POP EDX
; JMP ALIAS_ASSIGN
ALIAS_EXTRN ENDP
ALIAS_ASSIGN PROC NEAR
;
;JUST MARK THIS AS AN ALIAS, PLAIN AND SIMPLE
;EAX:ECX IS SYMBOL, EDX IS SUBSTITUTE
;
MOV BL,[ECX]._S_REF_FLAGS
MOV [ECX]._S_ALIAS_SUBSTITUTE_GINDEX,EDX
TEST BL,MASK S_REFERENCED
MOV [ECX]._S_NSYM_TYPE,NSYM_ALIASED_UNREF ;ASSUME UNREF
JZ L9$
CALL ADD_TO_ALIASED_LIST
L9$:
RET
ALIAS_ASSIGN ENDP
ALIAS_LIB PROC NEAR
;
;REMOVE FROM LIBSYM_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_LIBSYM_LIST
JMP AE_1
ALIAS_LIB ENDP
ALIAS_WEAK PROC NEAR
;
;REMOVE FROM WEAK_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_WEAK_LIST
JMP AE_1
ALIAS_WEAK ENDP
ALIAS_WEAK_DEFINED PROC NEAR
;
;REMOVE FROM WEAK_DEFINED_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_WEAK_DEFINED_LIST
JMP AE_1
ALIAS_WEAK_DEFINED ENDP
ALIAS_LAZY PROC NEAR
;
;REMOVE FROM LAZY_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_LAZY_LIST
JMP AE_1
ALIAS_LAZY ENDP
ALIAS__IMP__ PROC NEAR
;
;REMOVE FROM __IMP__LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM__IMP__LIST
JMP AE_1
ALIAS__IMP__ ENDP
ALIAS_LAZY_DEFINED PROC NEAR
;
;REMOVE FROM LAZY_DEFINED_LIST, ADD TO ALIASED LIST
;
PUSH EDX
CALL REMOVE_FROM_LAZY_DEFINED_LIST
JMP AE_1
ALIAS_LAZY_DEFINED ENDP
END
|
||||
TheStack | 2ba48409d63da3fff7788a6628256cdfa4943c27 | Assemblycode:Assembly | {"size": 3845, "ext": "asm", "max_stars_repo_path": "src/demo.asm", "max_stars_repo_name": "RingingResonance/8085-Assembler", "max_stars_repo_stars_event_min_datetime": "2019-12-28T15:26:28.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-18T20:19:22.000Z", "max_issues_repo_path": "src/demo.asm", "max_issues_repo_name": "RingingResonance/8085-Assembler", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/demo.asm", "max_forks_repo_name": "RingingResonance/8085-Assembler", "max_forks_repo_forks_event_min_datetime": "2021-12-22T06:22:11.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-22T06:22:11.000Z"} | {"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 28.2720588235, "max_line_length": 92, "alphanum_fraction": 0.4031209363} | ;*********************************************************************************
; Robot Pet Obstacle Avoidance Program *
; *
; Ezra Thomas *
;*********************************************************************************
MVI A, 00 ; Setup timer B
OUT 44
MVI A, 42 ; Setup timer B
OUT 45
MVI A, CE ; Start timer B and set up port BB and BC to OUTPUT
OUT 40
MVI A, 02 ; Enable front sonar
OUT 43
LXI SP, 40FF ; Set stack pointer
JMP PRE
ORG 44
PRE: MVI A, 0C ; Set Servo Port to OUTPUT
OUT 00
MVI A, 20 ; Center Shaft
OUT 03
CENTER: IN 41 ; Wait until shaft is centered
ANI 08
JZ CENTER
START: MVI A, 21 ; Move shaft forward and drive
OUT 03
MVI A, 02 ; Enable front sonar
OUT 43
PING_POLL: CALL SUB_PING ; Poll for obstical
CPI 4F
JNC PING_POLL
MVI A, 20 ; Stop
OUT 03
MVI A, 01 ; Enable left sonar
OUT 43
CALL SUB_PING ; Read left distance
MOV L,A ; Store left distance in L
MVI A, 03 ; Enable right sonar
OUT 43
CALL SUB_PING ; Read right distance
CMP L ; Compare right distance to left distance
JC LEFT ; Turn left if there is more room to the left
JZ FLIP ; Turn left or right if distances are equal
MVI A, 3C ; Turn shaft right
OUT 03
JMP TURN
LEFT: MVI A, 00 ; Turn shaft left
OUT 03
JMP TURN
FLIP: LDA TurnDir
XRI 3C
STA TurnDir
OUT 03
TURN: IN 41 ; Wait for shaft to finish turning
ANI 08
JZ TURN
IN 03 ; Turn on drive motor to turn
INR A
OUT 03
CALL SUB_TURN_DELAY ; Wait for turn to finish
JMP START ; Loop back to START
SUB_PING: ; Ping subroutine
CALL SUB_DELAY ; Rest delay
LXI B, 800A ; Setup timeout timer
CALL SUB_TMR
POLL: IN 41 ; Poll for echo or timout
ANI 05
CPI 05
JZ POLL
CPI 01 ; If timout reached jump to set max distance
JZ CLEAR
IN 44 ; If echo, calculate distance
MOV B,A
MVI A, FF
SUB B
JMP WRITE
CLEAR: MVI A, FF ; Set distance to max if no object detected
WRITE: OUT 42 ; Write distance to LED readout
RET ; Return, note that distance is in A
SUB_TMR: MOV A,B ; Timer subroutine
OUT 05
MOV A,C
OUT 04
MVI A, CC
OUT 00
RET ; Return
SUB_DELAY: LXI B,0C37 ; Delay subroutine for PING refresh (50ms)
DELAYLoop: DCX B
MOV A,B
ORA C
JNZ DELAYLoop
RET ; Return
SUB_TURN_DELAY:
MVI B, 08 ; Delay subroutine for turning (2s)
LOOP1: MVI C, D6
LOOP2: MVI D, 7C
LOOP3: DCR D
JNZ LOOP3
DCR C
JNZ LOOP2
DCR B
JNZ LOOP1
RET ; Return
ORG F4
TurnDir: DB 3C |
||||
TheStack | 2a062de760b398ca8247a32914f42e79e7dfce37 | Assemblycode:Assembly | {"size": 414, "ext": "asm", "max_stars_repo_path": "programs/oeis/071/A071555.asm", "max_stars_repo_name": "neoneye/loda", "max_stars_repo_stars_event_min_datetime": "2018-02-06T19:19:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T21:53:31.000Z", "max_issues_repo_path": "programs/oeis/071/A071555.asm", "max_issues_repo_name": "neoneye/loda", "max_issues_repo_issues_event_min_datetime": "2021-02-22T19:00:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T10:47:47.000Z", "max_forks_repo_path": "programs/oeis/071/A071555.asm", "max_forks_repo_name": "neoneye/loda", "max_forks_repo_forks_event_min_datetime": "2021-02-24T21:14:16.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-09T19:48:05.000Z"} | {"max_stars_count": 22, "max_issues_count": 41, "max_forks_count": 5, "avg_line_length": 46.0, "max_line_length": 192, "alphanum_fraction": 0.7801932367} | ; A071555: Smallest x > 1 such that x^prime(n) == 1 mod(prime(i)) 3<=i<=n.
; 6,36,386,5006,85086,1616616,37182146,1078282206,33426748356,1236789689136,50708377254536,2180460221945006,102481630431415236,5431526412865007456,320460058359035439846,19548063559901161830546
add $0,3
seq $0,2110 ; Primorial numbers (first definition): product of first n primes. Sometimes written prime(n)#.
sub $0,30
div $0,6
add $0,6
|
||||
TheStack | c8598fcc76b743b287cf49b7aff36906e364854d | Assemblycode:Assembly | {"size": 1154, "ext": "asm", "max_stars_repo_path": "src/spread/sprites/tfnd.asm", "max_stars_repo_name": "olifink/qspread", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/spread/sprites/tfnd.asm", "max_issues_repo_name": "olifink/qspread", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/spread/sprites/tfnd.asm", "max_forks_repo_name": "olifink/qspread", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.1463414634, "max_line_length": 51, "alphanum_fraction": 0.5866551127} | ;Sprite source code generated with EASYSOURCE V3.02
; 1991/92 Albin Hessler Software
;************************************************
; -> tfnd <- 1993 Jul 02 23:13:40
section sprite
xdef mes_tfnd
xref mes_zero
mes_tfnd
sp1_tfnd
dc.w $0100,$0000 ;form, time/adaption
dc.w $0014,$0013 ;x size, y size
dc.w $0007,$0007 ;x origin, y origin
dc.l cp1_tfnd-* ;pointer to colour pattern
dc.l mes_zero-* ;pointer to pattern mask
dc.l 0 ;pointer to next definition
cp1_tfnd
dc.w $0700,$E000,$0000,$0000
dc.w $1F00,$F000,$0000,$0000
dc.w $3F0F,$F8C0,$0000,$0000
dc.w $7030,$3C30,$0000,$0000
dc.w $404C,$4C08,$0000,$0000
dc.w $4850,$6C08,$0000,$0000
dc.w $A890,$3404,$0000,$0000
dc.w $8080,$7404,$0000,$0000
dc.w $8080,$F404,$0000,$0000
dc.w $4140,$E808,$0000,$0000
dc.w $4340,$DC1C,$0000,$0000
dc.w $3030,$3A3E,$0000,$0000
dc.w $0F0F,$D1DF,$0000,$0000
dc.w $0000,$080F,$8080,$0000
dc.w $0300,$8407,$40C0,$0000
dc.w $0300,$8203,$20E0,$0000
dc.w $0300,$8101,$10F0,$0000
dc.w $0000,$0000,$90F0,$0000
dc.w $0000,$0000,$6060,$0000
;
end
|
||||
TheStack | 7355abbd1c5666d08b4d1a6e8d9bcf284b03f894 | Assemblycode:Assembly | {"size": 847, "ext": "asm", "max_stars_repo_path": "programs/oeis/022/A022371.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "programs/oeis/022/A022371.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/022/A022371.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 65.1538461538, "max_line_length": 710, "alphanum_fraction": 0.8465171192} | ; A022371: Fibonacci sequence beginning 2, 18.
; 2,18,20,38,58,96,154,250,404,654,1058,1712,2770,4482,7252,11734,18986,30720,49706,80426,130132,210558,340690,551248,891938,1443186,2335124,3778310,6113434,9891744,16005178,25896922,41902100,67799022,109701122,177500144,287201266,464701410,751902676,1216604086,1968506762,3185110848,5153617610,8338728458,13492346068,21831074526,35323420594,57154495120,92477915714,149632410834,242110326548,391742737382,633853063930,1025595801312,1659448865242,2685044666554,4344493531796,7029538198350,11374031730146,18403569928496,29777601658642,48181171587138,77958773245780,126139944832918,204098718078698,330238662911616,534337380990314,864576043901930,1398913424892244,2263489468794174,3662402893686418,5925892362480592
mov $1,4
mov $3,36
lpb $0,1
sub $0,1
mov $2,$1
mov $1,$3
add $3,$2
lpe
div $1,2
|
||||
TheStack | b008dad35b51ed4eca36255ce55ceec4efeccddf | Assemblycode:Assembly | {"size": 3492, "ext": "asm", "max_stars_repo_path": "examples/asm/monitor.asm", "max_stars_repo_name": "zignig/Boneless-CPU", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "examples/asm/monitor.asm", "max_issues_repo_name": "zignig/Boneless-CPU", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "examples/asm/monitor.asm", "max_forks_repo_name": "zignig/Boneless-CPU", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.0689655172, "max_line_length": 77, "alphanum_fraction": 0.6325887743} | ; The serial monitor a simple monitor program
; for teathering the CPU
;
; Needs to provide the following commands
;
; READ : read a specific word from memory -> R , ADDR , VAL
; WRITE : write a specific word to memory -> W , ADDR , VAL
; CALL : jump the execution to a memory position -> J ADDR
;
; extras
;
; bulk read
; bulk write
; running checksum
; name some registers
.def W, R0 ; incoming data
.def ADDR , R1 ; src/desitination address
.def COUNT , R2 ; counter for bulk
.def LEN , R3 ; length for bulk
.def MAX , R4 ; max address pos
.def COM, R5 ; command
.def STP, R7 ; stack pointer
J init
.alloc stack ,16
.macro popr , reg
LD $reg,STP,0
ST R6,STP,0
SUBI STP,1
.endm
.macro pushr , reg
ST $reg,STP,0
ADDI STP,1
.endm
.macro pop
LD W,STP,0
ST R6,STP,0
SUBI STP,1
.endm
.macro push
ST W,STP,0
ADDI STP,1
.endm
.macro command , val , target
MOVL COM, $val
CMP W,COM
JE $target
.endm
.macro jump_target, char,target
.int $char
.@ $target
.endm
jump_table:
jump_target 0 , halt ;
jump_target 82 , read ; R
jump_target 87 , write ; W
jump_target 67 , call ; C
jump_target 68, dump ; D
jump_target 73, bulk_write; I
jump_target 79, bulk_read; O
jump_table_end:
NOP
; macro to send an external halt to the simulator
.macro HALT
XOR R6,R6,R6
XOR R6,R6,R6
STX R6,R6,1
.endm
.macro return
J loop
.endm
.macro out
STX W,R6,0
.endm
.macro in
LDX W,R6,0
.endm
init:
MOVL R0,0 ; reset the working register
MOVL STP,9 ; set the stack pointer
loop:
MOVA MAX,jump_table_end ; set max to the end of the jump table
MOVL COM,0 ; reset command
MOVL W,0 ; reset the working register
MOVH W,0 ; high byte
in ; grab a word from input
MOVA ADDR,jump_table ; locate the jump tables in ADDR
MOVL COUNT,0 ; reset the count
scan:
LD COM,ADDR,0 ; load the values at ADDR into COM
CMP W,COM ; check COM against the current value
JE go ; if they are equal , move to go
ADDI ADDR,2 ; add 2 to the address, jump tables is (val,jump address)
CMP MAX,ADDR ; are we at the end of the jump table
JE loop ; start again
J scan ; keep scanning
go:
ADDI ADDR,1 ;add 1 to the current address to get the target
LD ADDR,ADDR,0 ;load the address of the target back into ADDR
JR ADDR,0 ; jump there
J loop
halt: ; stop the simulator and get a line
HALT
return
; READ A VALUE FROM MEMORY
; needs an ADDRESS
read:
in ; Get the address off the input, goes into W
LD W,W,0 ; load it
out ; Send it out
read_out:
return
; WRITE A VALUE TO MEMORY
; needs an address and a value
write:
in ; Get the address off the input, goes into W
MOV W,ADDR ; move the value into the address register
in
ST W,ADDR,0 ; copy the data into place
return
; CALL AN ADDRESS
; needs an address
call:
in ; get the address off the input
JR W,0
return
; DUMP the entire memory space
; set to 1024 words for now
dump:
MOVL COUNT,0
MOVL MAX,0x00
MOVH MAX,0x04
dump_loop:
LD W,COUNT,0
out
ADDI COUNT,1
CMP COUNT,MAX
JE dump_exit
J dump_loop
dump_exit:
return
; BULK READ
; needs an Address and a count
bulk_read:
return
; BULK WRITE
; needs an address and a count
bulk_write:
return
; end of the monitor
|
||||
TheStack | 9ed87d4800d78bbe35842d35fb83367416fc1400 | Assemblycode:Assembly | {"size": 36140, "ext": "asm", "max_stars_repo_path": "kernel.asm", "max_stars_repo_name": "hiroki-repo/GocaineRTOS-Krnl", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "kernel.asm", "max_issues_repo_name": "hiroki-repo/GocaineRTOS-Krnl", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "kernel.asm", "max_forks_repo_name": "hiroki-repo/GocaineRTOS-Krnl", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.6192684183, "max_line_length": 75, "alphanum_fraction": 0.6131156613} | .org 000000H
.assume ADL=0
versionvl:.equ 0070h
di
stmix
jp.lil init
.fill 8h-$
jp.lil svcfromrst
.fill 10h-$
jp.lil addprcfromrst
.fill 66h-$
jp.lil preemptive
.fill 256-$
jp.lil putch
jp.lil getch
jp.lil kbhit
jp.lil diskread_compat
jp.lil diskwrite_compat
jp.lil sistran_compat
jp.lil diskerrchk_compat
;UC1
jp.lil rs232c_out
jp.lil rs232c_in
jp.lil rs232c_st
;LPT
jp.lil prn_out
jp.lil invaliddev_in
jp.lil prn_st
;UL1
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
;UP1
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
;UP2
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
;UR1
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
;UR2
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
;TTY
jp.lil invaliddev_out
jp.lil invaliddev_in
jp.lil invaliddev_st
jp.lil add_prc_ind;31
jp.lil get_prc_id;32
jp.lil ter_prc;33
jp.lil ter_prc_other;34
jp.lil _fopen;35
jp.lil _fseek;36
jp.lil _fread;37
jp.lil _fwrite;38
jp.lil _fclose;39
jp.lil preemptive;40
jp.lil get_prc_consid;41
jp.lil set_prc_consid;42
jp.lil get_fsstk_ptr;43
jp.lil setmsghandler;44
jp.lil sendmsg;45
jp.lil getintvecptr;46
jp.lil get_global_consid;47
jp.lil set_global_consid;48
jp.lil setdma_compat;49
jp.lil setsec_compat;50
jp.lil settck_compat;51
jp.lil get_version;52
jp.lil strprint;53
jp.lil putch16;54
jp.lil getidps;55
init:
.assume ADL=1
di
stmix
ld.lil (compatstack+64+0),bc
ld.lil (compatstack+64+3),de
ld.lil (compatstack+64+6),hl
ld.lil (compatstack+64+9),sp
ld.lil (compatstack+64+12),a
ld a,(fcestack4em+9)
and a
jp z,init_main
inc sp
pop hl
push hl
ld hl,0
add hl,sp
dec sp
;ld hl,(hl)
;ld (fcestack4em+3),hl
ld hl,(hl)
ld (fcestack4em+6),hl
;out0 (4),l
;out0 (4),h
push af
ld b,7
init_fcebegin:
ld hl,(hl)
ld (fcestack4em),hl
;out0 (4),l
;out0 (4),h
ld a,l
;out0 (4),a
cp a,0cbh
jp z,init_fce_sll
cp a,040h
jp z,init_fcebegin_x
cp a,049h
jp z,init_fcebegin_x
cp a,052h
jp z,init_fcebegin_x
cp a,05bh
jp z,init_fcebegin_x
;cp a,071h
;jp z,init_fcebegin_y
cp a,0edh
jp z,init_fce_syscall
ld a,h
cp a,0cbh
jp z,init_fce_ixiy_sll
dec b
jp nz,init_fcebegin_y
jp lplp
init_main:
ld a,1
ld (fcestack4em+9),a
im 2
ld hl,vector >> 8 & 0ffffh
ld i,hl
ld a,1
ld (backupstk+36),a
ld a,i
ld sp,spsp4mp
ei
;ld hl,z80prctest
;call.il add_prc
;ld hl,lplp2
;call add_prc
;jp.lil 010000h
ld hl,010000h
call.il add_prc
ld sp,spsp4taskstk
ld (spsp4taskstksto),sp
ld sp,spsp4taskstk2
lplp:
call bios_ttyprc_th
ld a,(spsp4taskstksto+3)
and a
jr nz,add_prc_caller
jp lplp
halt
add_prc_caller:
ld (spsp4taskstksto+9),sp
ld sp,(spsp4taskstksto)
pop hl
ld (spsp4taskstksto),sp
ld sp,(spsp4taskstksto+9)
call.il add_prc
ld a,(spsp4taskstksto+3)
dec a
ld (spsp4taskstksto+3),a
jr lplp
add_prc_ind:
ld (spsp4taskstksto+6),sp
ld sp,(spsp4taskstksto)
push hl
ld (spsp4taskstksto),sp
ld a,(spsp4taskstksto+3)
inc a
ld (spsp4taskstksto+3),a
ld sp,(spsp4taskstksto+6)
ret.l
fcestack4em:
.dl 0,0,0,0
get_version:
ld hl,versionvl
ret
svcfromrst:
call.il preemptive_0
ret
addprcfromrst:
call.il add_prc
ret
init_fce_syscall:
ld a,h
cp a,071h
jp z,init_fce_syscall_func
jp init_retfce2
init_fce_syscall_func:
ld.lil (compatstack+64+15),sp
ld.lil hl,(compatstack+64+9)
ld a,(hl)
bit 0,a
;jp z,init_fce_syscall_func_b_seq
inc hl
ld hl,(hl)
inc hl
ld bc,(hl)
ld.lil (init_fce_syscall_funcno),bc
ld.lil hl,(compatstack+64+9)
inc hl
ld bc,(hl)
inc bc
inc bc
inc bc
init_fce_syscall_func_b_main:
ld a,(init_fce_syscall_funcno)
;out0 (4),a
ld (hl),bc
;ld.lil sp,(compatstack+64+15)
;pop af
;ld.lil (compatstack+64+15),sp
ld.lil sp,(compatstack+64+9)
ld.lil (compatstack+64+18),ix
ld bc,(init_fce_syscall_funcno)
ld ix,0
add ix,bc
add ix,bc
add ix,bc
add ix,bc
add ix,bc
ld bc,0100h
add ix,bc
ld a,(init_fce_syscall_funcno+1)
and a
jr nz,init_fce_syscall_svc
ld c,a
ld a,(init_fce_syscall_funcno+2)
and a
jr nz,init_fce_syscall_svc
ld b,a
ld a,(init_fce_syscall_funcno)
or a,b
or a,c
cp a,32
jr c,init_fce_syscall_ilsvc
cp a,49
jr c,init_fce_syscall_svc
cp a,52
jr c,init_fce_syscall_ilsvc
cp a,54
jr z,init_fce_syscall_ilsvc
init_fce_syscall_svc:
;pop af
ld.lil bc,(compatstack+64+0)
ld.lil de,(compatstack+64+3)
ld.lil hl,(compatstack+64+6)
ld.lil sp,(compatstack+64+9)
ld.lil a,(compatstack+64+12)
call syscall_jpixix
ld.lil ix,(compatstack+64+18)
ld.lil (compatstack+64+0),bc
ld.lil (compatstack+64+3),de
ld.lil (compatstack+64+6),hl
ld.lil (compatstack+64+12),a
ld.lil sp,(compatstack+64+15)
;pop bc
;push af
jp init_retfce2
init_fce_syscall_ilsvc:
;pop af
ld.lil bc,(compatstack+64+0)
ld.lil de,(compatstack+64+3)
ld.lil hl,(compatstack+64+6)
ld.lil sp,(compatstack+64+9)
ld.lil a,(compatstack+64+12)
call.il syscall_jpixix
ld.lil ix,(compatstack+64+18)
ld.lil (compatstack+64+0),bc
ld.lil (compatstack+64+3),de
ld.lil (compatstack+64+6),hl
ld.lil (compatstack+64+12),a
ld.lil sp,(compatstack+64+15)
;pop bc
;push af
jp init_retfce2
syscall_jpixix:
jp (ix)
init_fce_syscall_func_b_seq:
inc hl
ld hl,(hl)
inc hl
ld bc,(hl)
ld.lil (init_fce_syscall_funcno),bc
ld.lil hl,(compatstack+64+9)
inc hl
ld bc,(hl)
inc bc
inc bc
jp init_fce_syscall_func_b_main
init_fce_syscall_funcno:
.dl 0
init_fcebegin_x:
ld.lil (compatstack+64+15),sp
inc hl
ld bc,(hl)
inc bc
ld (hl),bc
ld.lil sp,(compatstack+64+15)
pop af
inc sp
pop hl
push hl
dec sp
push af
inc hl
jp init_fcebegin
init_fcebegin_y:
ld.lil (compatstack+64+15),sp
inc hl
ld bc,(hl)
dec bc
ld (hl),bc
ld.lil sp,(compatstack+64+15)
pop af
inc sp
pop hl
push hl
dec sp
push af
dec hl
jp init_fcebegin
init_retfce:
ld.lil (compatstack+64+15),sp
ld.lil hl,(compatstack+64+9)
inc hl
ld bc,(hl)
inc bc
inc bc
;inc bc
ld (hl),bc
ld.lil sp,(compatstack+64+15)
pop af
ld.lil bc,(compatstack+64+0)
ld.lil de,(compatstack+64+3)
ld.lil hl,(compatstack+64+6)
ld.lil sp,(compatstack+64+9)
ld.lil a,(compatstack+64+12)
ei
ret.l
init_retfce2:
ld.lil (compatstack+64+15),sp
ld.lil hl,(compatstack+64+9)
inc hl
ld bc,(hl)
inc bc
;inc bc
ld (hl),bc
ld.lil sp,(compatstack+64+15)
pop af
ld.lil bc,(compatstack+64+0)
ld.lil de,(compatstack+64+3)
ld.lil hl,(compatstack+64+6)
ld.lil sp,(compatstack+64+9)
ld.lil a,(compatstack+64+12)
ei
ret.l
init_retfce3:
ld.lil (compatstack+64+15),sp
ld.lil hl,(compatstack+64+9)
inc hl
ld bc,(hl)
inc bc
inc bc
inc bc
;inc bc
ld (hl),bc
ld.lil sp,(compatstack+64+15)
pop af
ld.lil bc,(compatstack+64+0)
ld.lil de,(compatstack+64+3)
ld.lil hl,(compatstack+64+6)
ld.lil sp,(compatstack+64+9)
ld.lil a,(compatstack+64+12)
ei
ret.l
init_fce_ixiy_sll:
ld a,l
cp a,0ddh
jp z,init_fce_ix_sll
cp a,0fdh
jp z,init_fce_iy_sll
jp init_retfce3
init_fce_ix_sll:
ld a,(fcestack4em+2)
ld (init_fce_ix_slled0+2),a
ld (init_fce_ix_slled1+2),a
init_fce_ix_slled0:
pop af
ld a,(ix+0)
scf
rla
init_fce_ix_slled1:
ld (ix+0),a
push af
jp init_retfce3
init_fce_iy_sll:
ld a,(fcestack4em+2)
ld (init_fce_iy_slled0+2),a
ld (init_fce_iy_slled1+2),a
init_fce_iy_slled0:
pop af
ld a,(iy+0)
scf
rla
init_fce_iy_slled1:
ld (iy+0),a
push af
jp init_retfce3
init_fce_sll:
ld a,h
;out0 (4),a
sub a,030h
cp a,0
jp z,init_fce_sll_b
cp a,1
jp z,init_fce_sll_c
cp a,2
jp z,init_fce_sll_d
cp a,3
jp z,init_fce_sll_e
cp a,4
jp z,init_fce_sll_h
cp a,5
jp z,init_fce_sll_l
cp a,6
jp z,init_fce_sll_hl
cp a,7
jp z,init_fce_sll_a
jp init_retfce2
init_fce_sll_b:
pop af
ld a,(compatstack+64+0+1)
scf
rla
ld (compatstack+64+0+1),a
push af
jp init_retfce2
init_fce_sll_c:
pop af
ld a,(compatstack+64+0+0)
scf
rla
ld (compatstack+64+0+0),a
push af
jp init_retfce2
init_fce_sll_d:
pop af
ld a,(compatstack+64+3+1)
scf
rla
ld (compatstack+64+3+1),a
push af
jp init_retfce2
init_fce_sll_e:
pop af
ld a,(compatstack+64+3+0)
scf
rla
ld (compatstack+64+3+0),a
push af
jp init_retfce2
init_fce_sll_h:
pop af
ld a,(compatstack+64+6+1)
scf
rla
ld (compatstack+64+6+1),a
push af
jp init_retfce2
init_fce_sll_l:
pop af
ld a,(compatstack+64+6+0)
scf
rla
ld (compatstack+64+6+0),a
push af
jp init_retfce2
init_fce_sll_hl:
ld hl,(compatstack+64+6+0)
pop af
ld a,(hl)
scf
rla
ld (hl),a
ld (compatstack+64+6+0),hl
push af
jp init_retfce2
init_fce_sll_a:
pop af
ld a,(compatstack+64+12+0)
scf
rla
ld (compatstack+64+12+0),a
push af
jp init_retfce2
getintvecptr:
ld hl,vector
ret
set_prc_consid:
ld (backupstk+38),a
ret
get_prc_consid:
ld a,(backupstk+38)
ret
retsequence1:
;pop hl
;push hl
;bit 0,l
;jr nz,retsequence1_1
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ret
retsequence1_1:
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ret.l
retsequence2:
;ld.lil sp,(compatstack+9)
;pop hl
;push hl
;bit 0,l
;jr nz,retsequence2_1
ld.lil bc,(compatstack+0)
ld.lil de,(compatstack+3)
ld.lil hl,(compatstack+6)
ld.lil sp,(compatstack+9)
ld.lil a,(compatstack+12)
ei
ret.l
retsequence2_1:
ld.lil bc,(compatstack+0)
ld.lil de,(compatstack+3)
ld.lil hl,(compatstack+6)
ld.lil sp,(compatstack+9)
ld.lil a,(compatstack+12)
ei
ret
retsequence2p16:
;ld.lil sp,(compatstack+16+9)
;pop hl
;push hl
;bit 0,l
;jr nz,retsequence2p16_1
ld.lil bc,(compatstack+16+0)
ld.lil de,(compatstack+16+3)
ld.lil hl,(compatstack+16+6)
ld.lil sp,(compatstack+16+9)
ld.lil a,(compatstack+16+12)
;ei
ret
retsequence2p16_1:
ld.lil bc,(compatstack+16+0)
ld.lil de,(compatstack+16+3)
ld.lil hl,(compatstack+16+6)
ld.lil sp,(compatstack+16+9)
ld.lil a,(compatstack+16+12)
ei
ret
getidps:
ld hl,idps
ret
putch:
ld (backupstk+39),a
putch_spwait:
ld a,(compatstack_semaphore)
bit 1,a
jr nz,putch_spwait
set 1,a
ld (compatstack_semaphore),a
ld a,(backupstk+39)
;di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
;out0 (4),a
ld l,a
ld h,0
call bios_putch
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
putch16:
ld (backupstk+39),a
putch16_spwait:
ld a,(compatstack_semaphore)
bit 1,a
jr nz,putch16_spwait
set 1,a
ld (compatstack_semaphore),a
ld a,(backupstk+39)
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
;out0 (4),a
call bios_putch
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
getch:
;ld (backupstk+39),a
getch_spwait:
;ld a,(compatstack_semaphore)
;bit 1,a
;jr nz,getch_spwait
;set 1,a
;ld (compatstack_semaphore),a
;ld a,(backupstk+39)
;ld.lil (compatstack+0),bc
;ld.lil (compatstack+3),de
;ld.lil (compatstack+6),hl
;ld.lil (compatstack+9),sp
;ld.lil (compatstack+12),a
;ld sp,spsp4mp
call bios_getch
;ld.lil (compatstack+12),a
;ld a,(compatstack_semaphore)
;res 1,a
;ld (compatstack_semaphore),a
;jp retsequence2
ret.l
kbhit:
ld (backupstk+39),a
kbhit_spwait:
ld a,(compatstack_semaphore)
bit 1,a
jr nz,kbhit_spwait
di
set 1,a
ld (compatstack_semaphore),a
ld a,(backupstk+39)
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_kbhit
ld.lil (compatstack+12),a
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
get_fsstk_ptr:
ld hl,fsstk
ret
kbint:
jp.lil bios_keyhandler
ei
ret.l
fsstk:
.dl 0,0,0,0,0,0,0,0
_fopen:
;di
ld.lil (compatstack+16+0),bc
ld.lil (compatstack+16+3),de
ld.lil (compatstack+16+6),hl
ld.lil (compatstack+16+9),sp
ld.lil (compatstack+16+12),a
pop hl
ld hl,0
ld (fsstk+(3*0)),hl
pop hl
ld (fsstk+(3*1)),hl
pop hl
ld (fsstk+(3*2)),hl
ld sp,spsp4mp+36
call bios_fsdrv
ld.lil (compatstack+16+6),hl
jp retsequence2p16
ret
_fseek:
;di
ld.lil (compatstack+16+0),bc
ld.lil (compatstack+16+3),de
ld.lil (compatstack+16+6),hl
ld.lil (compatstack+16+9),sp
ld.lil (compatstack+16+12),a
pop hl
ld hl,1
ld (fsstk+(3*0)),hl
pop hl
ld (fsstk+(3*1)),hl
pop hl
ld (fsstk+(3*2)),hl
pop hl
ld (fsstk+(3*3)),hl
ld sp,spsp4mp+36
call bios_fsdrv
ld.lil (compatstack+16+6),hl
jp retsequence2p16
ret
_fread:
;di
ld.lil (compatstack+16+0),bc
ld.lil (compatstack+16+3),de
ld.lil (compatstack+16+6),hl
ld.lil (compatstack+16+9),sp
ld.lil (compatstack+16+12),a
pop hl
ld hl,2
ld (fsstk+(3*0)),hl
pop hl
ld (fsstk+(3*1)),hl
pop hl
ld (fsstk+(3*2)),hl
pop hl
ld (fsstk+(3*3)),hl
pop hl
ld (fsstk+(3*4)),hl
ld sp,spsp4mp+36
call bios_fsdrv
ld.lil (compatstack+16+6),hl
jp retsequence2p16
ret
_fwrite:
;di
ld.lil (compatstack+16+0),bc
ld.lil (compatstack+16+3),de
ld.lil (compatstack+16+6),hl
ld.lil (compatstack+16+9),sp
ld.lil (compatstack+16+12),a
pop hl
ld hl,3
ld (fsstk+(3*0)),hl
pop hl
ld (fsstk+(3*1)),hl
pop hl
ld (fsstk+(3*2)),hl
pop hl
ld (fsstk+(3*3)),hl
pop hl
ld (fsstk+(3*4)),hl
ld sp,spsp4mp+36
call bios_fsdrv
ld.lil (compatstack+16+6),hl
jp retsequence2p16
ret
_fclose:
;di
ld.lil (compatstack+16+0),bc
ld.lil (compatstack+16+3),de
ld.lil (compatstack+16+6),hl
ld.lil (compatstack+16+9),sp
ld.lil (compatstack+16+12),a
pop hl
ld hl,4
ld (fsstk+(3*0)),hl
pop hl
ld (fsstk+(3*1)),hl
ld sp,spsp4mp+36
call bios_fsdrv
ld.lil (compatstack+16+6),hl
jp retsequence2p16
ret
diskread_compat:
ld (backupstk+39),a
diskread_compat_spwait:
ld a,(compatstack_semaphore)
bit 1,a
jr nz,diskread_compat_spwait
set 1,a
ld (compatstack_semaphore),a
ld a,(backupstk+39)
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
ld hl,rmode4cpmcompat
push hl
ld hl,fname4cpmcompat
push hl
call _fopen
;di
ld (fp4cpmcompat),hl
pop bc
pop bc
ld a,l
or a,h
jp z,disk_compaterr
ld hl,0
push hl
ld hl,0
ld a,(0ac900h+21)
ld l,a
ld a,(0ac900h+24)
ld h,a
ld c,l
ld (hlbitedittmp),hl
ld b,128
mlt bc
ld a,h
rrc a
ld e,a
ld a,b
call c,disk_compat_cf80
ld b,a
ld a,e
and a,127
ld (hlbitedittmp+2),a
ld a,b
ld (hlbitedittmp+1),a
ld a,c
ld (hlbitedittmp+0),a
ld hl,(hlbitedittmp)
push hl
ld hl,(fp4cpmcompat)
push hl
call _fseek
;di
pop bc
pop bc
pop bc
ld hl,(fp4cpmcompat)
push hl
ld hl,1
push hl
ld hl,128
push hl
ld hl,0ff0000h
ld a,(0ac900h+18)
ld l,a
ld a,(0ac900h+19)
ld h,a
push hl
call _fread
;di
pop bc
pop bc
pop bc
pop bc
ld hl,(fp4cpmcompat)
push hl
call _fclose
;di
pop bc
ld a,0h
ld.lil (compatstack+12),a
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
disk_compat_cf80:
add a,128
ret
disk_compaterr:
ld a,0ffh
ld.lil (compatstack+12),a
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
diskwrite_compat:
ld (backupstk+39),a
diskwrite_compat_spwait:
ld a,(compatstack_semaphore)
bit 1,a
jr nz,diskwrite_compat_spwait
set 1,a
ld (compatstack_semaphore),a
ld a,(backupstk+39)
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
ld hl,wmode4cpmcompat
push hl
ld hl,fname4cpmcompat
push hl
call _fopen
;di
ld (fp4cpmcompat),hl
pop bc
pop bc
ld a,l
or a,h
jp z,disk_compaterr
ld hl,0
push hl
ld hl,0
ld a,(0ac900h+21)
ld l,a
ld a,(0ac900h+24)
ld h,a
ld c,l
ld (hlbitedittmp),hl
ld b,128
mlt bc
ld a,h
rrc a
ld e,a
ld a,b
call c,disk_compat_cf80
ld b,a
ld a,e
and a,127
ld (hlbitedittmp+2),a
ld a,b
ld (hlbitedittmp+1),a
ld a,c
ld (hlbitedittmp+0),a
ld hl,(hlbitedittmp)
push hl
ld hl,(fp4cpmcompat)
push hl
call _fseek
;di
pop bc
pop bc
pop bc
ld hl,(fp4cpmcompat)
push hl
ld hl,1
push hl
ld hl,128
push hl
ld hl,0ff0000h
ld a,(0ac900h+18)
ld l,a
ld a,(0ac900h+19)
ld h,a
push hl
call _fwrite
;di
pop bc
pop bc
pop bc
pop bc
ld hl,(fp4cpmcompat)
push hl
call _fclose
;di
pop bc
ld a,0h
ld.lil (compatstack+12),a
ld a,(compatstack_semaphore)
res 1,a
ld (compatstack_semaphore),a
jp retsequence2
hlbitedittmp:
.dl 0
fp4cpmcompat:
.dl 0
rmode4cpmcompat:
.db "rb",0
wmode4cpmcompat:
.db "ab",0
fname4cpmcompat:
.db "cpm.bin",0
diskerrchk_compat:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
ld a,0ffh
jp retsequence2
setdma_compat:
ld (0ac900h+18),bc
ret.l
setsec_compat:
ld (0ac900h+21),bc
ret.l
settck_compat:
ld (0ac900h+24),bc
ret.l
invaliddev_out:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
jp retsequence2
invaliddev_in:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld a,0h
jp retsequence2
invaliddev_st:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld a,0h
jp retsequence2
rs232c_out:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_rs232cout
jp retsequence2
rs232c_in:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_rs232cin
ld.lil (compatstack+12),a
jp retsequence2
rs232c_st:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_rs232cst
ld.lil (compatstack+12),a
jp retsequence2
prn_out:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_prnout
jp retsequence2
prn_st:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
ld sp,spsp4mp
call bios_prnst
ld.lil (compatstack+12),a
jp retsequence2
sistran_compat:
di
ld.lil (compatstack+0),bc
ld.lil (compatstack+3),de
ld.lil (compatstack+6),hl
ld.lil (compatstack+9),sp
ld.lil (compatstack+12),a
pop hl
ld l,02h
push hl
jp retsequence2
compatstack:
.fill 255
compatstack_semaphore:
.db 0
z80prctest:
ld sp,02FF00h
ld a,2
ld mb,a
ld a,0c3h
ld (020000h),a
ld a,049h
ld (02EFFEh),a
ld a,0c9h
ld (02EFFFh),a
call.is 0
lplp2:
jp lplp2
get_prc_id:
ld a,(pid)
ret
strprint:
di
ld a,(hl)
call.il putch
inc hl
ld a,(hl)
and a
jr nz,strprint
ei
ret
add_prc:
di
ld (backupstk4hl),hl
ld (backupstk+0),bc
ld (backupstk+3),de
ld (backupstk+6),hl
ld (backupstk+9),ix
ld (backupstk+12),iy
exx
ld (backupstk+15),bc
ld (backupstk+18),de
ld (backupstk+21),hl
exx
ld (backupstk+24),sp
pop hl
ld (backupstk+27),hl
pop hl
ld (backupstk+30),hl
ld sp,spsp
push af
pop hl
push hl
ld (backupstk+33),hl
ld a,mb
ld (backupstk+37),a
ld a,(pid)
ex de,hl
ld de,45
ld hl,backupstk4p
and a
jr z,add_prc_lplp1bp
add_prc_lplp1:
add hl,de
dec a
jr nz,add_prc_lplp1
add_prc_lplp1bp:
ex de,hl
ld hl,backupstk
ld bc,45
ldir
add_prc_lplpk:
ld a,(pid)
inc a
ld (pid),a
ld de,45
ld hl,backupstk4p
and a
jr z,add_prc_lplp2bp
add_prc_lplp2:
add hl,de
dec a
jr nz,add_prc_lplp2
add_prc_lplp2bp:
ld de,backupstk
ld bc,45
ldir
ld a,(backupstk+36)
bit 0,a
jr nz,add_prc_lplpk
set 0,a
ld (backupstk+36),a
ld a,(pid)
ex de,hl
ld de,45
ld hl,backupstk4p
and a
jr z,add_prc_lplp3bp
add_prc_lplp3:
add hl,de
dec a
jr nz,add_prc_lplp3
add_prc_lplp3bp:
ex de,hl
ld hl,backupstk
ld bc,45
ldir
ld hl,(backupstk4hl)
;call.il preemptive4newproc
ei
jp (hl)
ter_prc:
ld a,(pid)
ter_prc_other:
and a
jp z,preemptive_lplpkk
ld de,45
ld hl,backupstk4p
and a
jr z,ter_prc_lplp1bp
ter_prc_lplp1:
add hl,de
dec a
jr nz,ter_prc_lplp1
ter_prc_lplp1bp:
ld bc,45
ter_prc_lplp1bpx:
ld a,0
ld (hl),a
inc hl
djnz ter_prc_lplp1bpx
ld (pid),a
jp preemptive_lplpkk
backupstk4hl:
.dl 0,0,0
setmsghandler:
ld (backupstk+40),hl
ret
get_global_consid:
ld a,(global_consid_db)
ret
set_global_consid:
ld (global_consid_db),a
ret
sendmsg:
di
ld l,45
ld h,a
mlt hl
ld.lil (compatstack+3),de
ld de,backupstk4p+40
add hl,de
ld.lil de,(compatstack+3)
call sendmsghdl
ei
ret
sendmsghdl:
jp (hl)
preemptive4newproc:
di
ld sp,040000h
ld a,(pid)
ld d,a
ld e,128
mlt de
ex de,hl
add hl,sp
ld sp,hl
ex de,hl
preemptive:
di
;out0 (4),a
jp.il preemptive_lr
preemptive_aft:
;out0 (4),a
;bit 0,a
;cp a,1h
;jr z,preemptive_aft_16bit
ld sp,backupstk+33
pop af
ld sp,(backupstk+24)
ei
reti.l
preemptive_aft_16bit:
ld sp,backupstk+33
pop af
ld sp,(backupstk+24)
ei
reti
preemptive_lr:
ld (backupstk+0),bc
ld (backupstk+3),de
ld (backupstk+6),hl
ld (backupstk+9),ix
ld (backupstk+12),iy
exx
ld (backupstk+15),bc
ld (backupstk+18),de
ld (backupstk+21),hl
exx
ld (backupstk+24),sp
pop hl
ld (backupstk+27),hl
pop hl
ld (backupstk+30),hl
ld sp,spsp
push af
pop hl
push hl
ld (backupstk+33),hl
ld a,mb
ld (backupstk+37),a
ld a,(pid)
ex de,hl
ld de,45
ld hl,backupstk4p
and a
jr z,preemptive_lplp1bp
preemptive_lplp1:
add hl,de
dec a
jr nz,preemptive_lplp1
preemptive_lplp1bp:
ex de,hl
ld hl,backupstk
ld bc,45
ldir
preemptive_lplpk:
ld a,(pid)
inc a
ld (pid),a
preemptive_lplpkk:
ld de,45
ld hl,backupstk4p
and a
jr z,preemptive_lplp2bp
preemptive_lplp2:
add hl,de
dec a
jr nz,preemptive_lplp2
preemptive_lplp2bp:
ld de,backupstk
ld bc,45
ldir
ld a,(backupstk+36)
bit 0,a
jr z,preemptive_lplpk
ld sp,(backupstk+24)
ld bc,(backupstk+0)
ld de,(backupstk+3)
ld hl,(backupstk+6)
ld ix,(backupstk+9)
ld iy,(backupstk+12)
exx
ld bc,(backupstk+15)
ld de,(backupstk+18)
ld hl,(backupstk+21)
exx
ld a,(backupstk+37)
ld mb,a
;for debug
;ld a,(pid)
;out0 (4),a
ld a,(backupstk+27)
jp preemptive_aft
preemptive_0:
di
;out0 (4),a
jp.il preemptive_0_lr
preemptive_0_aft:
;out0 (4),a
;bit 0,a
;cp a,1h
;jr z,preemptive_0_aft_16bit
ld sp,backupstk+33
pop af
ld sp,(backupstk+24)
ei
reti.l
preemptive_0_aft_16bit:
ld sp,backupstk+33
pop af
ld sp,(backupstk+24)
ei
reti
preemptive_0_lr:
ld (backupstk+0),bc
ld (backupstk+3),de
ld (backupstk+6),hl
ld (backupstk+9),ix
ld (backupstk+12),iy
exx
ld (backupstk+15),bc
ld (backupstk+18),de
ld (backupstk+21),hl
exx
ld (backupstk+24),sp
pop hl
ld (backupstk+27),hl
pop hl
ld (backupstk+30),hl
ld sp,spsp
push af
pop hl
push hl
ld (backupstk+33),hl
ld a,mb
ld (backupstk+37),a
ld a,(pid)
ex de,hl
ld de,45
ld hl,backupstk4p
and a
jr z,preemptive_0_lplp1bp
preemptive_0_lplp1:
add hl,de
dec a
jr nz,preemptive_0_lplp1
preemptive_0_lplp1bp:
ex de,hl
ld hl,backupstk
ld bc,45
ldir
ld a,0
ld (pid),a
jr preemptive_0_lplpkk
preemptive_0_lplpk:
ld a,(pid)
inc a
ld (pid),a
preemptive_0_lplpkk:
ld de,45
ld hl,backupstk4p
and a
jr z,preemptive_0_lplp2bp
preemptive_0_lplp2:
add hl,de
dec a
jr nz,preemptive_0_lplp2
preemptive_0_lplp2bp:
ld de,backupstk
ld bc,45
ldir
ld a,(backupstk+36)
bit 0,a
jr z,preemptive_0_lplpk
ld sp,(backupstk+24)
ld bc,(backupstk+0)
ld de,(backupstk+3)
ld hl,(backupstk+6)
ld ix,(backupstk+9)
ld iy,(backupstk+12)
exx
ld bc,(backupstk+15)
ld de,(backupstk+18)
ld hl,(backupstk+21)
exx
ld a,(backupstk+37)
ld mb,a
;for debug
;ld a,(pid)
;out0 (4),a
ld a,(backupstk+27)
jp preemptive_0_aft
backupstk:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.fill 256-($%256)
vector:
.dl preemptive
.dl kbint
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
spsp:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
backupstk4p:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
pid:
.db 0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
spsp4mp:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
spsp4taskstk:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
spsp4taskstk2:
.dl 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
idps:
.db 00h,00h,00h,01h,00h,05h,00h,01h,08h,029h,03dh,033h,07ah,0e6h,0c5h,07dh
spsp4taskstksto:
.dl 0,0,0,0
global_consid_db:
.db 0
.fill 256-($%256)
bios_putch: .equ $+(5*0)
bios_getch: .equ $+(5*1)
bios_kbhit: .equ $+(5*2)
bios_fsdrv: .equ $+(5*3)
bios_ttyprc_th: .equ $+(5*4)
bios_rs232cout: .equ $+(5*5)
bios_rs232cin: .equ $+(5*6)
bios_rs232cst: .equ $+(5*7)
bios_prnout: .equ $+(5*8)
bios_prnst: .equ $+(5*9)
bios_keyhandler: .equ $+(5*10)
|
||||
TheStack | c0fbe8019e72f7a52594cc7678ae81b9bed06ecd | Assemblycode:Assembly | {"size": 650, "ext": "asm", "max_stars_repo_path": "oeis/190/A190983.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/190/A190983.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/190/A190983.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 46.4285714286, "max_line_length": 476, "alphanum_fraction": 0.8169230769} | ; A190983: a(n) = 9*a(n-1) - 6*a(n-2), with a(0)=0, a(1)=1.
; Submitted by Jon Maiga
; 0,1,9,75,621,5139,42525,351891,2911869,24095475,199388061,1649919699,13652948925,112977022131,934875505629,7736017417875,64014903727101,529718029036659,4383372838967325,36272047376485971,300148189354569789,2483701419932212275,20552423643262491741,170069604269769152019,1407311896568347417725,11645389443496511847411,96364633612058522120349,797409365847547627998675,6598496490955577519265981,54602012223514911905401779,451827131065900742033020125,3738832106252017206864770451
mov $1,1
lpb $0
sub $0,1
add $2,$1
mul $1,3
add $1,$2
mul $1,2
lpe
mov $0,$2
|
||||
TheStack | 0bf09ff5b509081a8e758c2ce94917910c93507f | Assemblycode:Assembly | {"size": 1109, "ext": "asm", "max_stars_repo_path": "_build/dispatcher/jmp_ippsGFpElementInit_cb14f679.asm", "max_stars_repo_name": "zyktrcn/ippcp", "max_stars_repo_stars_event_min_datetime": "2021-10-04T10:21:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-04T10:21:54.000Z", "max_issues_repo_path": "_build/dispatcher/jmp_ippsGFpElementInit_cb14f679.asm", "max_issues_repo_name": "zyktrcn/ippcp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "_build/dispatcher/jmp_ippsGFpElementInit_cb14f679.asm", "max_forks_repo_name": "zyktrcn/ippcp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.4358974359, "max_line_length": 99, "alphanum_fraction": 0.8016230839} | extern m7_ippsGFpElementInit:function
extern n8_ippsGFpElementInit:function
extern y8_ippsGFpElementInit:function
extern e9_ippsGFpElementInit:function
extern l9_ippsGFpElementInit:function
extern n0_ippsGFpElementInit:function
extern k0_ippsGFpElementInit:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpElementInit
.Larraddr_ippsGFpElementInit:
dq m7_ippsGFpElementInit
dq n8_ippsGFpElementInit
dq y8_ippsGFpElementInit
dq e9_ippsGFpElementInit
dq l9_ippsGFpElementInit
dq n0_ippsGFpElementInit
dq k0_ippsGFpElementInit
segment .text
global ippsGFpElementInit:function (ippsGFpElementInit.LEndippsGFpElementInit - ippsGFpElementInit)
.Lin_ippsGFpElementInit:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpElementInit:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpElementInit]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpElementInit:
|
||||
TheStack | 9844a60cd91134ae6861a40aaaf210891af0367b | Assemblycode:Assembly | {"size": 7936, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_603.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_603.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_603.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 34.2068965517, "max_line_length": 2999, "alphanum_fraction": 0.6553679435} | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x136b4, %r12
clflush (%r12)
nop
nop
nop
nop
nop
xor $10584, %r15
vmovups (%r12), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r10
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_WC_ht+0x1e584, %r8
nop
sub %rbp, %rbp
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
movups %xmm4, (%r8)
nop
sub $58593, %rbp
lea addresses_A_ht+0xf284, %r8
nop
nop
nop
nop
nop
dec %rdx
vmovups (%r8), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r10
nop
sub $7885, %r10
lea addresses_WT_ht+0xe054, %rbp
nop
nop
nop
nop
sub %r15, %r15
mov (%rbp), %r8w
add $11857, %r15
lea addresses_WC_ht+0x18184, %rdx
nop
xor $65491, %r8
movb $0x61, (%rdx)
nop
add %r10, %r10
lea addresses_D_ht+0x3144, %r10
clflush (%r10)
nop
nop
sub %rbp, %rbp
mov $0x6162636465666768, %r12
movq %r12, (%r10)
and $35161, %r15
lea addresses_normal_ht+0x5dfc, %rsi
lea addresses_WC_ht+0x13604, %rdi
nop
nop
sub %rax, %rax
mov $104, %rcx
rep movsl
add %rdx, %rdx
lea addresses_WC_ht+0x1bfd0, %rsi
lea addresses_D_ht+0x16604, %rdi
nop
nop
nop
and %r10, %r10
mov $114, %rcx
rep movsw
nop
nop
nop
cmp %r12, %r12
lea addresses_D_ht+0x1734c, %rsi
nop
add $65477, %rax
mov (%rsi), %cx
nop
nop
xor $41870, %r10
lea addresses_A_ht+0x13708, %rsi
lea addresses_WC_ht+0x181c2, %rdi
and $29244, %rdx
mov $94, %rcx
rep movsb
dec %rbp
lea addresses_WC_ht+0x6b04, %rsi
lea addresses_WT_ht+0x104, %rdi
nop
nop
and $28480, %rax
mov $17, %rcx
rep movsw
nop
nop
nop
and $33771, %rcx
lea addresses_D_ht+0x7a04, %rsi
nop
nop
nop
nop
nop
lfence
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
add $16039, %r8
lea addresses_UC_ht+0x7184, %rsi
lea addresses_D_ht+0xe704, %rdi
nop
nop
xor %rdx, %rdx
mov $80, %rcx
rep movsq
nop
cmp $22971, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rsi
// Store
lea addresses_WT+0x1cb1e, %r14
and %r9, %r9
movl $0x51525354, (%r14)
nop
nop
nop
nop
nop
xor %rcx, %rcx
// Store
lea addresses_WC+0x1bd84, %r14
clflush (%r14)
nop
nop
nop
dec %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
movups %xmm0, (%r14)
nop
nop
nop
sub $56706, %r8
// Faulty Load
lea addresses_US+0x1e984, %r15
nop
nop
nop
nop
sub $659, %r8
movntdqa (%r15), %xmm0
vpextrq $1, %xmm0, %rcx
lea oracles, %r9
and $0xff, %rcx
shlq $12, %rcx
mov (%r9,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}}
{'49': 2326, '00': 17770, '45': 371, '48': 1126, '44': 236}
00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 48 00 00 00 00 49 00 00 48 00 00 00 00 49 00 00 49 00 00 49 00 00 48 00 00 00 00 49 00 00 00 00 00 45 00 00 00 00 49 00 00 44 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 45 00 48 00 00 00 00 49 00 00 00 00 49 00 00 48 00 48 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 48 00 00 00 00 00 45 00 00 00 00 00 00 00 48 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 48 00 49 00 00 00 00 49 00 00 00 00 49 00 00 45 00 48 00 00 00 00 49 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 49 00 00 00 00 00 00 00 48 00 00 00 00 48 00 00 00 00 00 00 00 00 00 45 00 00 00 00 45 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 49 00 00 45 00 00 00 00 49 00 00 48 00 00 49 00 00 00 00 48 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 49 00 00 00 00 49 00 49 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 48 00 00 00 00 45 00 49 00 00 49 00 00 49 00 00 00 00 49 00 00 45 00 49 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 48 00 00 49 00 00 00 00 00 00 00 49 00 00 48 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 00 45 00 00 00 00 00 00 00 00 00 48 00 00 00 00 44 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 48 00 00 49 00 00 00 00 00 45 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 44 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 48 00 49 00 00 48 00 00 00 00 48 00 00 00 00 00 00 00 00 00 45 00 00 00 00 49 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 45 00 49 00 00 49 00 00 48 00 00 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 49 00 00 49 00 00 49 00 00 49 00 00 48 00 00 00 00 49 00 00 49 00 00 00 00 49 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 49 00 00 49 00 00 00 00 49 00 00 00 00 45 00 00 48 00 00 00 00 00 00 00 00 00 00 00 48 00 00 49 00 00 00 00 48 00 00 00 00 49 00 00 00 00 49 00 00 44 00 00 00 00 49 00 00 48 00 49 00 00 00 00 49 00 00 49 00 00 00 00 00 00 49 00 00 00 00 49 00 00 45 00 49 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 48 00 00 49 00 00 49 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 49 00 00 00 00 00 49 00 00 48 00 49 00 00 49 00 00 45 00 00 00 00 00 48 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 49 00 00 49 00 00 00 00 00 00 00 48 00 00 00 00 49 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49
*/
|
||||
TheStack | 53e941b47107f51f099362f954ecfeb2ff2f3dbb | Assemblycode:Assembly | {"size": 69, "ext": "asm", "max_stars_repo_path": "nasm/string.asm", "max_stars_repo_name": "scoraig52/code", "max_stars_repo_stars_event_min_datetime": "2021-02-18T04:42:40.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-12T00:27:42.000Z", "max_issues_repo_path": "nasm/string.asm", "max_issues_repo_name": "akar-0/code", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "nasm/string.asm", "max_forks_repo_name": "akar-0/code", "max_forks_repo_forks_event_min_datetime": "2021-11-20T10:24:09.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-20T10:24:09.000Z"} | {"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 34.5, "max_line_length": 68, "alphanum_fraction": 0.8115942029} | // https://www.codewars.com/kata/52774a314c2333f0a7000688/train/nasm
|
||||
TheStack | edef2921ae837c337019fd03b776771e5380f6e9 | Assemblycode:Assembly | {"size": 444, "ext": "asm", "max_stars_repo_path": "Userland/SampleCodeModule/asm/syscalls_asm.asm", "max_stars_repo_name": "malevasquez/TPE_Arqui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Userland/SampleCodeModule/asm/syscalls_asm.asm", "max_issues_repo_name": "malevasquez/TPE_Arqui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Userland/SampleCodeModule/asm/syscalls_asm.asm", "max_forks_repo_name": "malevasquez/TPE_Arqui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 11.1, "max_line_length": 33, "alphanum_fraction": 0.6756756757} | GLOBAL readKeyboardSys
GLOBAL isKeyboardEmptySys
GLOBAL clearDisplaySys
section .text
readKeyboardSys:
push rbp
mov rbp, rsp
mov rax, 0 ;ID read
int 80h
mov rsp, rbp
pop rbp
ret
isKeyboardEmptySys:
push rbp
mov rbp, rsp
mov rax, 11 ;ID bufferEmpty
int 80h
mov rsp, rbp
pop rbp
ret
clearDisplaySys:
push rbp
mov rbp, rsp
mov rax, 2 ;ID clear Display
int 80h
mov rsp, rbp
pop rbp
ret
|
||||
TheStack | 4ee99bdfdf89c7bc4517b3f0401db01416c26dca | Assemblycode:Assembly | {"size": 147, "ext": "asm", "max_stars_repo_path": "other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_msge3.asm", "max_stars_repo_name": "prismotizm/gigaleak", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_msge3.asm", "max_issues_repo_name": "prismotizm/gigaleak", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_msge3.asm", "max_forks_repo_name": "prismotizm/gigaleak", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.0, "max_line_length": 47, "alphanum_fraction": 0.8163265306} | Name: zel_msge3.asm
Type: file
Size: 23837
Last-Modified: '2016-05-13T04:25:37Z'
SHA-1: D63F772A5BFDB21D66BCCECF53553909DF672783
Description: null
|
||||
TheStack | 54dffd2429bd34ec199e471f5aa8435a910e0796 | Assemblycode:Assembly | {"size": 6286, "ext": "asm", "max_stars_repo_path": "15-ComplexScene1.asm", "max_stars_repo_name": "TheRealCatherine/MakingGamesForAtari2600-MADS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "15-ComplexScene1.asm", "max_issues_repo_name": "TheRealCatherine/MakingGamesForAtari2600-MADS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "15-ComplexScene1.asm", "max_forks_repo_name": "TheRealCatherine/MakingGamesForAtari2600-MADS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.9416058394, "max_line_length": 65, "alphanum_fraction": 0.602290805} | ; @com.wudsn.ide.asm.hardware=ATARI2600
icl "vcs.asm"
icl "macro.asm"
icl "xmacro.asm"
opt h-
org $80
PFPtr .ds 2 ; pointer to playfield data
PFIndex .ds 1 ; offset into playfield array
PFCount .ds 1 ; lines left in this playfield segment
Temp .ds 1 ; temporary
YPos .ds 1 ; Y position of player sprite
XPos .ds 1 ; X position of player sprite
SpritePtr .ds 2 ; pointer to sprite bitmap table
ColorPtr .ds 2 ; pointer to sprite color table
; Temporary slots used during kernel
Bit2p0 .ds 1
Colp0 .ds 1
YP0 .ds 1
; Height of sprite in scanlines
SpriteHeight equ 9
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
opt f+
.proc Code
org $f000
Start
CLEAN_START
; Set up initial pointers and player position
lda #<PlayfieldData
sta PFPtr
lda #>PlayfieldData
sta PFPtr+1
lda #<Frame0
sta SpritePtr
lda #>Frame0
sta SpritePtr+1
lda #<ColorFrame0
sta ColorPtr
lda #>ColorFrame0
sta ColorPtr+1
lda #242
sta YPos
lda #38
sta XPos
NextFrame
VERTICAL_SYNC
; Set up VBLANK timer
TIMER_SETUP 37
lda #$88
sta COLUBK ; bg color
lda #$5b
sta COLUPF ; fg color
lda #$68
sta COLUP0 ; player color
lda #1
sta CTRLPF ; symmetry
lda #0
sta PFIndex ; reset playfield offset
; Set temporary Y counter and set horizontal position
lda YPos
sta YP0 ; yp0 = temporary counter
lda XPos
ldx #0
jsr SetHorizPos
sta WSYNC
sta HMOVE ; gotta apply HMOVE
; Wait for end of VBLANK
TIMER_WAIT
sta WSYNC
lda #0
sta VBLANK
; Set up timer (in case of bugs where we don't hit exactly)
TIMER_SETUP 192
SLEEP 10 ; to make timing analysis work out
NewPFSegment
; Load a new playfield segment.
; Defined by length and then the 3 PF registers.
; Length = 0 means stop
ldy PFIndex ; load index into PF array
lda (PFPtr),y ; load length of next segment
beq NoMoreSegs ; == 0, we're done
sta PFCount ; save for later
; Preload the PF0/PF1/PF2 registers for after WSYNC
iny
lda (PFPtr),y ; load PF0
tax ; PF0 -> X
iny
lda (PFPtr),y ; load PF1
sta Temp ; PF1 -> Temp
iny
lda (PFPtr),y ; load PF2
iny
sty PFIndex
tay ; PF2 -> Y
; WSYNC, then store playfield registers
; and also the player 0 bitmap for line 2
sta WSYNC
stx PF0 ; X -> PF0
lda Temp
sta PF1 ; Temp -> PF1
lda Bit2p0 ; player bitmap
sta GRP0 ; Bit2p0 -> GRP0
sty PF2 ; Y -> PF2
; Load playfield length, we'll keep this in X for the loop
ldx PFCount
KernelLoop
; Does this scanline intersect our sprite?
lda #SpriteHeight ; height in 2xlines
isb YP0 ; INC yp0, then SBC yp0
bcs DoDraw ; inside bounds?
lda #0 ; no, load the padding offset (0)
DoDraw
; Load color value for both lines, store in temp var
pha ; save original offset
tay ; -> Y
lda (ColorPtr),y ; color for both lines
sta Colp0 ; -> colp0
; Load bitmap value for each line, store in temp var
pla
asl ; offset * 2
tay ; -> Y
lda (SpritePtr),y ; bitmap for first line
sta Bit2p0 ; -> bit2p0
iny
lda (SpritePtr),y ; bitmap for second line
; WSYNC and store values for first line
sta WSYNC
sta GRP0 ; Bit1p0 -> GRP0
lda Colp0
sta COLUP0 ; Colp0 -> COLUP0
dex
beq NewPFSegment ; end of this playfield segment?
; WSYNC and store values for second line
sta WSYNC
lda Bit2p0
sta GRP0 ; Bit2p0 -> GRP0
jmp KernelLoop
NoMoreSegs
; Change colors so we can see when our loop ends
lda #0
sta COLUBK
; Wait for timer to finish
TIMER_WAIT
; Set up overscan timer
TIMER_SETUP 30
lda #2
sta VBLANK
jsr MoveJoystick
TIMER_WAIT
jmp NextFrame
SetHorizPos
sta WSYNC ; start a new line
bit 0 ; waste 3 cycles
sec ; set carry flag
DivideLoop
sbc #15 ; subtract 15
bcs DivideLoop ; branch until negative
eor #7 ; calculate fine offset
asl
asl
asl
asl
sta RESP0,x ; fix coarse position
sta HMP0,x ; set fine offset
rts ; return to caller
; Read joystick movement and apply to object 0
MoveJoystick
; Move vertically
; (up and down are actually reversed since ypos starts at bottom)
ldx YPos
lda #%00100000 ;Up?
bit SWCHA
bne SkipMoveUp
cpx #175
bcc SkipMoveUp
dex
SkipMoveUp
lda #%00010000 ;Down?
bit SWCHA
bne SkipMoveDown
cpx #254
bcs SkipMoveDown
inx
SkipMoveDown
stx YPos
; Move horizontally
ldx XPos
lda #%01000000 ;Left?
bit SWCHA
bne SkipMoveLeft
cpx #1
bcc SkipMoveLeft
dex
SkipMoveLeft
lda #%10000000 ;Right?
bit SWCHA
bne SkipMoveRight
cpx #153
bcs SkipMoveRight
inx
SkipMoveRight
stx XPos
rts
.endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.align $100; make sure data doesn't cross page boundary
PlayfieldData
.byte 4,%00000000,%11111110,%00110000
.byte 8,%11000000,%00000001,%01001000
.byte 15,%00100000,%01111110,%10000100
.byte 20,%00010000,%10000000,%00010000
.byte 20,%00010000,%01100011,%10011000
.byte 15,%00100000,%00001100,%01000100
.byte 8,%11000000,%00110000,%00110010
.byte 4,%00000000,%11000000,%00001100
.byte 0
; Bitmap data "standing" position
Frame0
.byte 0
.byte 0
.byte %01101100;$F6
.byte %00101000;$86
.byte %00101000;$86
.byte %00111000;$86
.byte %10111010;$C2
.byte %10111010;$C2
.byte %01111100;$C2
.byte %00111000;$C2
.byte %00111000;$16
.byte %01000100;$16
.byte %01111100;$16
.byte %01111100;$18
.byte %01010100;$18
.byte %01111100;$18
.byte %11111110;$F2
.byte %00111000;$F4
; Color data for each line of sprite
ColorFrame0
.byte $FF
.byte $86
.byte $86
.byte $C2
.byte $C2
.byte $16
.byte $16
.byte $18
.byte $F4
; Epilogue
org $fffc
.word Code.Start
.word Code.Start
|
||||
TheStack | eb5f1f9b4ca4ce170b1bbb4eb113e9bfed57ed7a | Assemblycode:Assembly | {"size": 3913, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_10_440.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_10_440.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_10_440.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"} | {"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 18.9033816425, "max_line_length": 145, "alphanum_fraction": 0.6427293637} | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r14
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x11a29, %rsi
lea addresses_D_ht+0xb409, %rdi
nop
nop
nop
nop
dec %r10
mov $83, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $31080, %r11
lea addresses_normal_ht+0x1ce23, %rdi
nop
nop
nop
inc %rsi
movb (%rdi), %r11b
nop
nop
nop
nop
nop
dec %rcx
lea addresses_WC_ht+0x173a9, %r14
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%r14), %r10
nop
nop
nop
xor $32298, %rdi
lea addresses_UC_ht+0x3e29, %rcx
sub %r12, %r12
and $0xffffffffffffffc0, %rcx
movntdqa (%rcx), %xmm2
vpextrq $0, %xmm2, %rsi
nop
mfence
lea addresses_WT_ht+0x12cc2, %r10
and $15472, %r12
mov (%r10), %rdi
nop
nop
nop
nop
sub $4798, %r10
pop %rsi
pop %rdi
pop %rcx
pop %r14
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r14
push %r8
push %rax
push %rcx
// Load
lea addresses_US+0x5429, %r11
nop
dec %r10
vmovups (%r11), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r8
sub %r10, %r10
// Store
mov $0x3a1, %rax
nop
nop
nop
add %r12, %r12
movb $0x51, (%rax)
nop
nop
nop
xor $26433, %rcx
// Store
lea addresses_UC+0x7d29, %r11
clflush (%r11)
nop
sub $38943, %r8
movw $0x5152, (%r11)
nop
nop
nop
cmp $8868, %rax
// Store
lea addresses_normal+0xca29, %r14
nop
nop
nop
nop
nop
sub %r12, %r12
movw $0x5152, (%r14)
nop
nop
nop
add %rax, %rax
// Store
lea addresses_WC+0x1b0a9, %r12
nop
nop
nop
cmp %r10, %r10
movb $0x51, (%r12)
nop
xor $58386, %r12
// Store
lea addresses_normal+0x19b69, %rax
nop
nop
sub $15877, %rcx
mov $0x5152535455565758, %r14
movq %r14, (%rax)
nop
nop
nop
nop
add %r14, %r14
// Store
lea addresses_US+0x1c179, %r10
nop
nop
nop
nop
sub $32914, %rax
mov $0x5152535455565758, %r11
movq %r11, %xmm0
vmovups %ymm0, (%r10)
nop
inc %rax
// Faulty Load
lea addresses_normal+0xca29, %r14
nop
nop
nop
cmp $42094, %r11
movb (%r14), %al
lea oracles, %r11
and $0xff, %rax
shlq $12, %rax
mov (%r11,%rax,1), %rax
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'52': 10}
52 52 52 52 52 52 52 52 52 52
*/
|
||||
TheStack | f6eb1af67ec412fed64043bc28624b8e95ab6c99 | Assemblycode:Assembly | {"size": 18455, "ext": "asm", "max_stars_repo_path": "rom0/timexscr.asm", "max_stars_repo_name": "nagydani/zx-rom-mods", "max_stars_repo_stars_event_min_datetime": "2018-09-07T15:49:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-21T20:47:14.000Z", "max_issues_repo_path": "rom0/timexscr.asm", "max_issues_repo_name": "nagydani/zx-rom-mods", "max_issues_repo_issues_event_min_datetime": "2020-05-24T08:43:07.000Z", "max_issues_repo_issues_event_max_datetime": "2020-05-26T22:02:36.000Z", "max_forks_repo_path": "rom0/timexscr.asm", "max_forks_repo_name": "nagydani/zx-rom-mods", "max_forks_repo_forks_event_min_datetime": "2020-08-03T06:28:34.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-29T00:27:50.000Z"} | {"max_stars_count": 15, "max_issues_count": 6, "max_forks_count": 3, "avg_line_length": 15.1893004115, "max_line_length": 61, "alphanum_fraction": 0.6248171227} | SCR_ALL:LD B,$17
CL_SCR: RES 7,(IY+BORDCR-ERR_NR) ; flashing cursor OFF
LD A,(S_MODE)
AND $F8
JR NZ,SCROLL
RST $30
DEFW L0E00 ; CL-SCROLL
RET
SCROLL: INC B
RST $30
DEFW L0E9B
SCR_L: PUSH BC
PUSH HL
JR SCR_S
SCR_R: PUSH BC
LD BC,$0020
LDIR
SET 5,H
SET 5,D
LD C,$20
DEC HL
DEC DE
LDDR
RES 5,H
INC HL
POP BC
SCR_S: LD D,H
LD E,L
LD A,L
ADD A,$20
LD L,A
JR NC,SCR_LT
LD A,H
ADD A,$08
LD H,A
SCR_LT: DJNZ SCR_R
POP HL
POP BC
INC H
LD A,$07
AND H
JR NZ,SCR_L
LD A,H
SUB $08
LD H,A
LD B,1
CLLINE: LD A,(S_MODE)
AND $F8
JR NZ,SCRCLL
RST $30
DEFW L0E44 ; CL-LINE
RET
SCRCLL: PUSH BC
SUB $10
JR Z,CLLL
LD A,(ATTR_P)
BIT 0,(IY+$02) ; TV_FLAG, upper screen
JR Z,CLLL
LD A,(BORDCR)
CLLL: PUSH BC
PUSH AF
RST $30
DEFW L0E9B ; CL-ADDR
POP AF
SCR_MC: LD E,L
LD D,H
INC DE
LD (HL),0
LD BC,$001F
LDIR
SET 5,H
LD E,L
LD D,H
DEC DE
LD (HL),A
LD C,$1F
LDDR
RES 5,H
LD C,A
INC H
LD A,$07
AND H
LD A,C
JR NZ,SCR_MC
POP BC
LD C,A
LD A,(DF_SZ)
INC A
CP B
LD A,C
JR Z,CLLLE
DJNZ CLLL
CLLLE: POP BC
OR A
RET Z
EX AF,AF'
LD A,B
PUSH BC
CALL BC32A
EX AF,AF'
DEC BC
LD HL,$5AFF
LD DE,$5AFE
LD (HL),A
LDDR
POP BC
RET
BC32A: RRCA
RRCA
RRCA
LD B,A
AND $E0
LD C,A
XOR B
LD B,A
RET
POSCR: LD DE,CLSET
PUSH DE
LD A,B
BIT 0,(IY+$02)
JP NZ,POSCR4
CP (IY+$31)
JR C,ERROR_5
RET NZ
BIT 4,(IY+$02)
JR Z,POSCR2
LD E,(IY+$2D)
DEC E
JR Z,POSCR3
XOR A
RST $30
DEFW L1601 ; CHAN-OPEN
LD SP,(LIST_SP)
RES 4,(IY+$02) ; end of AUTOLIST
RST $10
ERROR_5:RST $30
DEFW L0C86
POSCR2: DEC (IY+$52)
JR NZ,POSCR3
LD A,$18
SUB B
LD (SCR_CT),A
LD HL,(ATTR_T)
PUSH HL
LD A,(P_FLAG)
PUSH AF
LD DE,L0CF8 ; scroll?
RST $30
DEFW MSG_WAIT
OR A
JR Z,SCRONE
CP " "
JR Z,ERROR_D
CP $E2
JR Z,ERROR_D
OR $20
CP "n"
JR Z,ERROR_D
CP "1"
JR NZ,SCRMANY
SCRONE: LD A,1
LD (SCR_CT),A
SCRMANY:LD A,$FE ; System channel S
RST $30
DEFW L1601 ; CHAN-OPEN
POP AF
LD (P_FLAG),A
POP HL
LD (ATTR_T),HL
POSCR3: CALL SCR_ALL
LD BC,(S_WIDTH)
LD B,(IY+$31)
INC B
LD A,(S_STATE)
AND $40
LD A,(S_MODE)
CP $10
RET NC ; no attribute magic in mono mode
RST $30
DEFW PO_SCR_ATTR ; attribute magic
LD A,(S_MODE)
AND $F8
RET Z ; no further magic in standard mode
PUSH BC ; multicolor attribute magic
RST $30
DEFW L0E9B ; CL-ADDR
SET 5,H
LD DE,$70E0
LD A,(DE)
LD C,(HL)
EX DE,HL
SCR3A: LD B,$20
SCR3A0: LD (DE),A
LD (HL),C
INC E
INC L
DJNZ SCR3A0
INC H
INC D
LD B,$20
SCR3A1: DEC E
DEC L
LD (DE),A
LD (HL),C
DJNZ SCR3A1
INC H
INC D
BIT 3,H
JR Z,SCR3A
POP BC
RET
ERROR_D:RST $30
DEFW L0D00 ; BREAK - CONT repeats
POSCR4: CP $02
JP C,ERROR_5
ADD A,(IY+$31)
SUB $19
RET NC
NEG
PUSH BC
LD B,A
LD HL,(ATTR_T)
PUSH HL
LD HL,(P_FLAG)
PUSH HL
RST $30
DEFW L0D4D ; TEMPS
LD A,B
POSCR4A:PUSH AF
LD HL,DF_SZ
LD B,(HL)
LD A,B
INC A
LD (HL),A
LD HL,S_POSN + 1
CP (HL)
JR C,POSCR4B
INC (HL)
LD B,$17
POSCR4B:CALL CL_SCR
POP AF
DEC A
JR NZ,POSCR4A
POP HL
LD (IY+$57),L
POP HL
LD (ATTR_T),HL
LD BC,(S_POSN)
RES 0,(IY+$02)
CALL CLSET
SET 0,(IY+$02)
POP BC
RET
DRAWAT: LD A,$FF
AND A
JR DOPLOT
PLOT1: XOR A
DOPLOT: LD (COORDS+1),A
CALL SETORIG
RST $28 ; calculate
DEFB $E3 ; get SCALEY
DEFB $04 ; multiply
DEFB $E1 ; get ORIGY
DEFB $0F ; add
DEFB $C5 ; store COORDY
DEFB $01 ; exchange
DEFB $E2 ; get SCALEX
DEFB $04 ; multiply
DEFB $E0 ; get ORIGX
DEFB $0F ; add
DEFB $C4 ; store COORDX
DEFB $38 ; end
DOPLOT1:LD HL,MEMBOT
LD (MEM),HL
ENDDRAW:XOR A
LD (COORDS),A ; delete mask to identify clipped point
LD A,(S_MODE)
CP $10
JR NC,PLOT_HIRES
EX AF,AF' ; save S_MODE
RST $30
DEFW L2DD5 ; FP-TO-A x coordinate
JR C,DELPLT ; over 255
JR NZ,DELPLT ; negative
LD B,A
LD HL,WEST
CALL CLIPPX
JR NC,DELPLT ; clipped
PUSH BC
RST $30
DEFW L2DD5 ; FP-TO-A y coordinate
POP BC
RET C ; over 255
RET NZ ; negative
LD C,B
LD B,A
LD HL,NORTH
CALL CLIPPX
RET NC ; clipped
LD A,B
RST $30
DEFW L22AA+7 ; PIXEL-ADD + 6
CALL SETPIX
JR C,PXATTR ; DRAW endpoint
EX AF,AF' ; restore S_MODE
POP BC ; remove SWAP
CP $08
JR NC,PLOT_HICOLOR
LD BC,L0BDB ; find and set attribute
JR E_PLOT
; Set attribute
; In: HL=display file address, A'=(S_MODE)
; Out: CF clear
PXATTR: EX AF,AF'
AND $F8
JR Z,PXATTRL
PXATTRH:SET 5,H
PUSH DE
RST $30
DEFW X0BE4
POP DE
RES 5,H
RET
PXATTRL:PUSH DE
PUSH HL
RST $30
DEFW L0BDB ; PO-ATTR
POP HL
POP DE
RET
DELPLT: RST $28
DEFB $02 ; delete y coordinate
DEFB $38 ; end
RET
PLOT_HICOLOR:
SET 5,H
LD BC,X0BE4 ; set attribute
E_PLOT: PUSH BC
RST $10 ; return via PO-ATTR
PLOT_HIRES:
RST $30
DEFW L2DA2 ; FP-TO-BC x coordinate
RET C ; over 65535
RET NZ ; negative
LD A,B
SRL A
RET NZ ; over 512
LD A,C
RRA
LD HL,WEST
CALL CLIPPX
RET NC ; clipped
PUSH BC
RST $30
DEFW L2DA2 ; FP-TO-BC y coordinate
POP DE
RET C
RET NZ
LD A,B
OR A
RET NZ ; over 256
LD HL,NORTH
LD A,C
CALL CLIPPX
RET NC ; clipped
CALL PIXADD
SETPIX: LD B,A
INC B
LD A,$FE
PIXL: RRCA
DJNZ PIXL
LD (COORDS),A ; save mask for DRAW
LD (COORDS2),HL
INC (IY+COORDS+1-ERR_NR)
SCF
RET Z ; DRAW endpoint
MASKPIX:LD B,A
LD A,(HL)
LD C,(IY+$57)
BIT 0,C
JR NZ,PIXOVER
AND B
PIXOVER:BIT 2,C
JR NZ,PIXEND
XOR B
CPL
PIXEND: LD (HL),A
RET
; Pixel address from DE=x, BC=y
PIXADD: LD A,E
SRL D
RRA
RRA
RRA
RRA
LD L,A
LD A,C
RRA
SCF
RRA
AND A
RRA
XOR C
AND $F8
XOR C
LD H,A
LD A,C
ADD A,A
ADD A,A
XOR L
AND $E0
XOR L
LD L,A
LD A,E
AND $07
RET
DRAW3: RST $28
DEFB $3D ; restack
DEFB $38 ; end
DRAW3R: CALL STEPBACK
CALL STEPBACK
RST $30
DEFW L3293 ; RE-ST-TWO
LD A,(DE)
CP (HL)
JR NC,DRAW3S
LD A,(HL)
DRAW3S: LD HL,5
ADD HL,DE
SUB 2
ADD A,(HL)
JP C,DRAW3DO
LD (STKEND),HL ; delete a
STCOORD:
DRAW2: LD HL,COORDX
LD DE,MEMBOT
LD BC,2*5
LDIR ; save starting point
RET C
CALL SETORIG
RST $28 ; calculate
DEFB $E3 ; get SCALEY
DEFB $04 ; multiply
DEFB $01 ; exchange
DEFB $E2 ; get SCALEX
DEFB $04 ; multiply
DEFB $38 ; end
; draw from outside the screen
LD A,(COORDS)
OR A
JP NZ,DRINS
DEC HL
DEC HL
DEC HL
DEC HL
BIT 7,(HL)
EX AF,AF' ; save Z
DEC HL
RST $30
DEFW L33B4 ; STACK-NUM
RST $30
DEFW L33B4 ; STACK-NUM
EX AF,AF' ; restore Z
JR Z,CLDOWN
LD A,(SOUTH)
INC A
ADD A,A
ADD A,A
ADD A,A
DEC A
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $E5 ; get COORDY
DEFB $03 ; subtract
DEFB $31 ; duplicate
DEFB $37 ; greater-0
DEFB $00 ; jump-true
DEFB NCDWN - $
DEFB $C5 ; store COORDY
DEFB $02 ; delete
DEFB $01 ; exchange
DEFB $31 ; duplicate
DEFB $E5 ; get COORDY
DEFB $03 ; subtract
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB CLIPUP - $
DEFB $31 ; duplicate
NCDWN: DEFB $02 ; delete
NCDWN1: DEFB $02 ; delete
DEFB $02 ; delete
DEFB $38 ; end
CALL RESCRD
JR NCDWN2
CLDOWN: LD A,(NORTH)
ADD A,A
ADD A,A
ADD A,A
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $E5 ; get COORDY
DEFB $03 ; subtract
DEFB $31 ; duplicate
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB NCDWN - $
DEFB $C5 ; store COORDY
DEFB $02 ; delete
DEFB $01 ; exchange
DEFB $31 ; duplicate
DEFB $E5 ; get COORDY
DEFB $03 ; subtract
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB NCDWN1 - $
CLIPUP: DEFB $05 ; division
DEFB $E5 ; get COORDY
DEFB $04 ; multiply
DEFB $E4 ; get COORDX
DEFB $0F ; addition
DEFB $C4 ; store COORDX
DEFB $38 ; end
POP AF
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $C5 ; store COORDY
DEFB $E5 ; get COORDY
DEFB $E4 ; get COORDX
DEFB $38 ; end
LD (IY+COORDS+1-ERR_NR),$FF
CALL DOPLOT1
EX AF,AF'
CALL MASKPIX
RST $28
DEFB $E1 ; get old COORDY ; dy, dx, new X, new Y, old Y
DEFB $03 ; subtract ; dy, dx, new X, new Y - old Y
DEFB $C3 ; store M3 ; M3 = new Y - old Y
DEFB $02 ; delete ; dy, dx, new X
DEFB $E0 ; get old COORDX ; dy, dx, new X, old X
DEFB $03 ; subtract ; dy, dx, new X - old X
DEFB $03 ; subtract ; dy, new dx
DEFB $01 ; exchange ; new dx, dy
DEFB $E3 ; get M3 ; new dx, dy, new Y - old Y
DEFB $03 ; subtract ; new dx, new dy
DEFB $01 ; exchange ; new dy, new dx
DEFB $38 ; end
AND A
CALL SETORIG
SCF
CALL STCOORD
RST $28
DEFB $38 ; end
NCDWN2: POP AF
LD A,(COORDS)
OR A
JP NZ,DRINS ; no horizontal clipping needed
INC HL
BIT 7,(HL)
EX AF,AF' ; save Z
LD BC,-6
ADD HL,BC
RST $30
DEFW L33B4 ; STACK-NUM
RST $30
DEFW L33B4 ; STACK-NUM
EX AF,AF' ; restore Z
JR Z,CLRGHT
LD A,(EAST)
INC A
ADD A,A
ADD A,A
ADD A,A
DEC A
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $E4 ; get COORDX
DEFB $03 ; subtract
DEFB $31 ; duplicate
DEFB $37 ; greater-0
DEFB $00 ; jump-true
DEFB NCRGT - $
DEFB $C4 ; store COORDX
DEFB $02 ; delete
DEFB $31 ; duplicate
DEFB $E4 ; get COORDX
DEFB $03 ; subtract
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB CLIPLF - $
DEFB $31 ; duplicate
NCRGT: DEFB $02 ; delete
NCRGT1: DEFB $02 ; delete
DEFB $02 ; delete
DEFB $38 ; end
CALL RESCRD
JR NCRGT2
CLRGHT: LD A,(WEST)
ADD A,A
ADD A,A
ADD A,A
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $E4 ; get COORDX
DEFB $03 ; subtract
DEFB $31 ; duplicate
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB NCRGT - $
DEFB $C4 ; store COORDX
DEFB $02 ; delete
DEFB $31 ; duplicate
DEFB $E4 ; get COORDX
DEFB $03 ; subtract
DEFB $36 ; less-0
DEFB $00 ; jump-true
DEFB NCRGT1 - $
CLIPLF: DEFB $05 ; division
DEFB $E4 ; get COORDX
DEFB $04 ; multiply
DEFB $E5 ; get COORDY
DEFB $0F ; addition
DEFB $C5 ; store COORDY
DEFB $38 ; end
POP AF
PUSH AF
RST $30
DEFW L2D28 ; STACK-A
RST $28
DEFB $C4 ; store COORDX
DEFB $E5 ; get COORDY
DEFB $E4 ; get COORDX
DEFB $38 ; end
LD (IY+COORDS+1-ERR_NR),$FF
CALL DOPLOT1
EX AF,AF'
CALL MASKPIX
RST $28
DEFB $E0 ; get old COORDX ; dy, dx, new Y, new X, old X
DEFB $03 ; subtract ; dy, dx, new Y, new X - old X
DEFB $C3 ; store M3 ; M3 = new X - old X
DEFB $02 ; delete ; dy, dx, new Y
DEFB $E1 ; get old COORDY ; dy, dx, new Y, old Y
DEFB $03 ; subtract ; dy, dx, new Y - old Y
DEFB $01 ; exchange ; dy, new Y - old Y, dx
DEFB $E3 ; get M3 ; dy, new Y - old Y, dx, new X - old X
DEFB $03 ; subtract ; dy, new Y - old Y, new dx
DEFB $C3 ; store M3 ; M3 = new dx
DEFB $02 ; delete ; dy, new Y - old Y
DEFB $03 ; subtract ; new dy
DEFB $E3 ; get M3 ; new dy, new dx
DEFB $38 ; end
AND A
CALL SETORIG
SCF
CALL STCOORD
RST $28
DEFB $38 ; end
NCRGT2: POP AF
DRINS: LD (LIST_SP),SP
CALL STEPBACK
INC HL
LD A,(S_MODE)
AND $F8
XOR $08
LD BC,PXDOWN
JR NZ,PXDLC
LD BC,PXDOWNHC
PXDLC: BIT 7,(HL)
JR Z,DDOWN
PUSH AF
LD HL,MEMBOT+5
RST $30
DEFW L346E ; negate
LD BC,PXUP
POP AF
OR A
JR NZ,DDOWN
LD BC,PXUPHC
DDOWN: PUSH BC ; vertical step
EX DE,HL
INC HL
LD BC,PXRIGHT
BIT 7,(HL)
JR Z,DRIGHT
LD HL,MEMBOT
RST $30
DEFW L346E ; negate
LD BC,PXLEFT
DRIGHT: PUSH BC ; horizontal step
LD BC,2*5 ; dup2
RST $30
DEFW L1F05 ; TEST-ROOM
LD HL,(STKEND)
LD E,L
LD D,H
ADD HL,BC
LD (STKEND),HL
EX DE,HL
DEC HL
DEC DE
LDDR
RST $28 ; calculate
DEFB $E4 ; get COORDX dy,dx,x1
DEFB $0F ; add dy,x2
DEFB $C4 ; store COORDX
DEFB $02 ; delete dy
DEFB $E5 ; get COORDY dy,y1
DEFB $0F ; add y2
DEFB $C5 ; store COORDY
DEFB $02 ; delete
DEFB $38 ; end
LD HL,MEMBOT
LD (MEM),HL
LD A,(COORDS)
OR A
JR NZ,DRAWDO ; jump, if not clipped
POP HL ; discard horizontal step
POP HL ; discard vertical step
RST $28
DEFB $02 ; delete
DEFB $02 ; delete
DEFB $38 ; end
JP DRENDP
DRAWDO: LD BC,2*5
ADD HL,BC
EX DE,HL
LD HL,COORDX
LDIR ; x2,y2 to M2,M3
RST $28
DEFB $38 ; end
CALL STEPBACK
RST $30
DEFW L3293 ; RE-ST-TWO
LD (STKEND),HL ; remove dx and dy from calculator stack
LD A,(HL)
INC HL
LD B,(HL)
SET 7,B ; disregard sign
INC HL
LD C,(HL)
EX DE,HL
SUB (HL) ; exponent difference
INC HL
LD D,(HL)
SET 7,D ; disregard sign
INC HL
LD E,(HL)
JR C,BCSHFT
JR NZ,STEEP
EX DE,HL
SBC HL,BC
ADD HL,BC
EX DE,HL
JR NC,NSHFTDR
STEEP: EXX
EX AF,AF'
LD HL,MEMBOT
LD DE,MEMBOT+5
RST $30
DEFW EXCHANGE
LD HL,MEMBOT+3*5
LD BC,5
LDIR
EX AF,AF'
POP HL
EX (SP),HL ; swap transversal
PUSH HL ; and longitudal steps
EXX
LD L,C
LD H,B
EX DE,HL
LD C,L
LD B,H
NEG
JR Z,NSHFTDR
BCSHFT: CP $F0
JR NC,DSHFTL
LD BC,$0000
JR NSHFTDR
DSHFTL: SRL B
RR C
INC A
JR NZ,DSHFTL
NSHFTDR:SRL B
RR C
SRL D
RR E
PUSH BC ; placeholder for length in pixels
PUSH BC ; t
PUSH DE ; l
PUSH BC
LD C,E
LD B,D
RST $30
DEFW L2D2B + 4 ; STACK-BC + 4 l
POP BC
RST $30
DEFW L2D2B + 4 ; STACK-BC + 4 t
LD A,(MEMBOT+1)
ADD A,A
JR NC,DRFWD
LD HL,MEMBOT+2*5
RST $30
DEFW L346E ; negate
DRFWD: RST $28 ; calculate
DEFB $E0 ; get M0 M0
DEFB $31 ; duplicate M0,M0
DEFB $27 ; int M0,int(M0)
DEFB $C3 ; store M3 M0,int(M0)
DEFB $03 ; subtract frac(M0)
DEFB $31 ; duplicate frac(M0),frac(M0)
DEFB $E3 ; get M3 frac(M0),frac(M0),int(M0)
DEFB $E2 ; get M2 frac(M0),frac(M0),int(M0),M2
DEFB $27 ; int frac(M0),frac(M0),int(M0),int(M2)
DEFB $03 ; subtract frac(M0),frac(M0),int(M0)-int(M2)
DEFB $38 ; end
RST $30
DEFW L2DA2 + 2 ; FP-TO-BC length in pixels
PUSH BC
RST $30
DEFW L2DA2 + 2 ; FP-TO-BC frac(M0)
POP BC
OR A
LD HL,$0004
ADD HL,SP
LD (HL),C
INC HL
LD (HL),B ; save length in pixels at placeholder
JR NZ,DRPIX
INC HL
LD E,(HL)
INC HL
LD D,(HL)
EXX
CALL PXTRV ; actually longitudal step
LD (COORDS2),HL
DRPIX: RST $28 ; calculate
DEFB $04 ; multiply l,t*frac(M0)
DEFB $01 ; exchange t*frac(M0),l
DEFB $A2 ; stk-half t*frac(M0),l,0.5
DEFB $E1 ; get M1 t*frac(M0),l,0.5,M1
DEFB $31 ; duplicate t*frac(M0),l,0.5,M1,M1
DEFB $27 ; int t*frac(M0),l,0.5,M1,int(M1)
DEFB $03 ; subtract t*frac(M0),l,0.5,frac(M1)
DEFB $03 ; subtract t*frac(M0),l,0.5-frac(M1)
DEFB $31 ; duplicate t*frac(M0),l,0.5-frac(M1),0.5-frac(M1)
DEFB $36 ; less-zero t*frac(M0),l,0.5-frac(M1),'
DEFB $03 ; subtract t*frac(M0),l,0.5-frac(M1)'
DEFB $04 ; multiply t*frac(M0),l*(0.5-frac(M1))'
DEFB $0F ; addition t*frac(M0)+l*(0.5-frac(M1))'
DEFB $38 ; end
RST $30
DEFW L2DA2 + 2 ; FP-TO-BC
JR Z,DRPOS
POP HL
PUSH HL
ADD HL,HL
SBC HL,BC
JR DRNON0
DRPOS: LD L,C
LD H,B ; HL = remainder
DRNON0: POP DE ; DE = l
POP BC ; BC = t
EXX
POP BC ; BC = length in pixels
POP HL ; longitudal step
POP DE ; transversal step
LD A,B
OR C
JR Z,DRENDP
AND A
EX AF,AF'
; CF' set if attributes need updating
; BC=length in pixels
; DE=transversal step pointer
; HL=longitudal step pointer
; BC'=transversal difference
; DE'=longitudal difference
; HL'=remainder
EXX
BRESEN: AND A
SBC HL,BC
PUSH HL
LD HL,(COORDS2)
JR NC,STRGHT
POP HL
ADD HL,DE
PUSH HL
CALL PXTRV
STRGHT: PUSH BC
LD A,(COORDS)
CALL MASKPIX
EX AF,AF'
SCF
EX AF,AF'
POP BC
EXX
DEC BC
LD A,B
OR C
EXX
PUSH AF
CALL NZ,PXLON2
POP AF
LD (COORDS2),HL
POP HL
JR NZ,BRESEN
EXX
DRENDP: LD HL,COORDY
LD DE,(STKEND)
LD C,5
LDIR
LD HL,COORDX
LD C,5
LDIR
LD (STKEND),DE
LD A,(COORDS)
LD HL,(COORDS2)
LD L,A
PUSH HL
LD (IY+COORDS+1-ERR_NR),$FF ; signal DRAW endpoint
CALL ENDDRAW
POP HL
LD A,(COORDS2+1)
CP H
RET Z
LD A,(COORDS)
CP L
RET Z
LD HL,(COORDS2)
JP MASKPIX
PXTRV: LD HL,(COORDS2)
EXX
PUSH DE
EXX
RET
PXLON: LD HL,(COORDS2)
PXLON2: EXX
PUSH HL
EXX
RET
PXDOWNHC:
EX AF,AF'
CALL C,PXATTRH
EX AF,AF'
PXDOWN: INC H
LD A,H
AND $07
RET NZ
DEC H
EX AF,AF'
CALL C,PXATTRL
EX AF,AF'
LD A,(SOUTH)
XOR H
INC H
AND $18
CALL Z,PDOWN
LD A,L
ADD $20
LD L,A
RET C
LD A,H
SUB A,$08
LD H,A
RET
PDOWN: LD A,(SOUTH)
DDVERT: RRCA
RRCA
RRCA
XOR L
AND $E0
RET NZ
DABORT: LD SP,(LIST_SP)
LD (COORDS),A ; signal clipping
RET
PUP: LD A,(NORTH)
JR DDVERT
PXUPHC: EX AF,AF'
CALL C,PXATTRH
EX AF,AF'
PXUP: LD A,H
DEC H
AND $07
RET NZ
INC H
EX AF,AF'
CALL C,PXATTRL
EX AF,AF'
LD A,(NORTH)
XOR H
DEC H
AND $18
CALL Z,PUP
LD A,L
SUB $20
LD L,A
RET C
LD A,H
ADD A,$08
LD H,A
RET
PXRIGHT:RRC (IY+COORDS-ERR_NR)
RET C
LD A,(S_MODE)
CP $10
JR C,PXRLR
BIT 5,H
JR NZ,PXRHR
SET 5,H
RET
PXRHR: RES 5,H
PXRDO: LD A,(EAST)
XOR L
AND $1F
JR Z,DABORT
INC L
RET
PXRLR: EX AF,AF'
CALL C,PXATTR
EX AF,AF'
JR PXRDO
PXLEFT: RLC (IY+COORDS-ERR_NR)
RET C
LD A,(S_MODE)
CP $10
JR C,PXLLR
BIT 5,H
JR Z,PXLHR
RES 5,H
RET
PXLHR: SET 5,H
PXLDO: LD A,(WEST)
XOR L
AND $1F
JR Z,DABORT
DEC L
RET
PXLLR: EX AF,AF'
CALL C,PXATTR
EX AF,AF'
JR PXLDO
;DRAW1: RST $28 ; calculate
; DEFB $E1 ; get M1
; DEFB $E2 ; get M2
; DEFB $38 ; end
; RST $30
; DEFW DRAW_LINE
; RET
DRAW3DO:DEC (HL) ; a/2
RST $28
DEFB $C4 ; store a/2 to M4
DEFB $38
DEC (HL) ; a/4
LD A,(HL)
CP $7F
JR C,TANSKIP ; tan x = x
RST $28
DEFB $21 ; tan
DEFB $38 ; end
TANSKIP:RST $28 ; calculate
DEFB $C5 ; store tan(a/4) to M5
DEFB $02 ; delete tan(a/4)
DEFB $38 ; end
CALL STEPBACK
RST $30
DEFW L3293 ; RE-ST-TWO
LD A,(HL)
OR A
JR Z,DRAW3S1
DEC (HL) ; /2
DRAW3S1:EX DE,HL
LD A,(HL)
OR A
JR Z,DRAW3S2
DEC (HL) ; /2
DRAW3S2:RST $28
DEFB $C1 ; store dy/2 to M1
DEFB $E5 ; get tan(a/4)
DEFB $04 ; multiply
DEFB $C3 ; store dy*tan(a/4)/2 to M3
DEFB $01 ; exchange
DEFB $C0 ; store dx/2 to M0
DEFB $E5 ; get tan(a/2)/2
DEFB $04 ; multiply
DEFB $C2 ; store dx*tan(a/4)/2 to M2
DEFB $01 ; exchange
DEFB $E0 ; get dx/2
DEFB $03 ; subtract
DEFB $1B ; negate
DEFB $01 ; exchange
DEFB $E1 ; get dy/2
DEFB $0F ; addition
DEFB $E4 ; get a/2
DEFB $E0 ; get dx/2
DEFB $E3 ; get dy*tan(a/4)/2
DEFB $0F ; addition
DEFB $E1 ; get dy/2
DEFB $E2 ; get dx*tan(a/4)/2
DEFB $03 ; subtract
DEFB $E4 ; get a/2
DEFB $38 ; end
CALL DRAW3R
DRAW3J: JP DRAW3
CIRCLE: RST $28
DEFB $C4 ; store R
DEFB $0F ; addition
DEFB $38 ; end
CALL DRAWAT
EX AF,AF'
CALL MASKPIX
;; CALL PLOT1
RST $28
DEFB $E4 ; get R
DEFB $1B ; negate
DEFB $E4 ; get R
DEFB $A3 ; stk-pi2
DEFB $E4 ; get R
DEFB $E4 ; get R
DEFB $A3 ; stk-pi2
DEFB $E4 ; get R
DEFB $E4 ; get R
DEFB $1B ; negate
DEFB $A3 ; stk-pi2
DEFB $E4 ; get R
DEFB $1B ; negate
DEFB $E4 ; get R
DEFB $1B ; negate
DEFB $A3 ; stk-pi2
DEFB $38 ; end
CALL CIRCL
CIRCL: CALL DRAW3
JR DRAW3J
; Clip pixel coordinate in A beteen (HL) and (HL+1)
CLIPPX: RRA
RRA
RRA
AND $1F
CP (HL)
CCF
RET NC
RET Z
DEC A
INC L
CP (HL)
RET
RESCRD: EXX
LD HL,MEMBOT
LD DE,COORDX
LD BC,2*5
LDIR
EXX
RET
include "calculator.asm"
|
||||
TheStack | 78984b4266029bbe433302c64d04c9457e15721f | Assemblycode:Assembly | {"size": 2425, "ext": "asm", "max_stars_repo_path": "third-party/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm", "max_stars_repo_name": "jhh67/chapel", "max_stars_repo_stars_event_min_datetime": "2015-01-06T11:26:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T06:17:21.000Z", "max_issues_repo_path": "third-party/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm", "max_issues_repo_name": "jhh67/chapel", "max_issues_repo_issues_event_min_datetime": "2015-01-05T04:50:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T23:39:19.000Z", "max_forks_repo_path": "third-party/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm", "max_forks_repo_name": "jhh67/chapel", "max_forks_repo_forks_event_min_datetime": "2015-01-08T18:58:18.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-20T15:37:45.000Z"} | {"max_stars_count": 1602, "max_issues_count": 11789, "max_forks_count": 498, "avg_line_length": 21.6517857143, "max_line_length": 79, "alphanum_fraction": 0.6507216495} | dnl ARM64 mpn_bdiv_dbm1c.
dnl Copyright 2008, 2011, 2012, 2014 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C Cortex-A53 8
C Cortex-A57 7
C X-Gene 4.25
define(`qp', `x0')
define(`up', `x1')
define(`n', `x2')
define(`bd', `x3')
define(`cy', `x4')
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_bdiv_dbm1c)
ldr x5, [up], #8
ands x6, n, #3
b.eq L(fi0)
cmp x6, #2
b.cc L(fi1)
b.eq L(fi2)
L(fi3): mul x12, x5, bd
umulh x13, x5, bd
ldr x5, [up], #8
b L(lo3)
L(fi0): mul x10, x5, bd
umulh x11, x5, bd
ldr x5, [up], #8
b L(lo0)
L(fi1): subs n, n, #1
mul x12, x5, bd
umulh x13, x5, bd
b.ls L(wd1)
ldr x5, [up], #8
b L(lo1)
L(fi2): mul x10, x5, bd
umulh x11, x5, bd
ldr x5, [up], #8
b L(lo2)
L(top): ldr x5, [up], #8
subs x4, x4, x10
str x4, [qp], #8
sbc x4, x4, x11
L(lo1): mul x10, x5, bd
umulh x11, x5, bd
ldr x5, [up], #8
subs x4, x4, x12
str x4, [qp], #8
sbc x4, x4, x13
L(lo0): mul x12, x5, bd
umulh x13, x5, bd
ldr x5, [up], #8
subs x4, x4, x10
str x4, [qp], #8
sbc x4, x4, x11
L(lo3): mul x10, x5, bd
umulh x11, x5, bd
ldr x5, [up], #8
subs x4, x4, x12
str x4, [qp], #8
sbc x4, x4, x13
L(lo2): subs n, n, #4
mul x12, x5, bd
umulh x13, x5, bd
b.hi L(top)
L(wd2): subs x4, x4, x10
str x4, [qp], #8
sbc x4, x4, x11
L(wd1): subs x4, x4, x12
str x4, [qp]
sbc x0, x4, x13
ret
EPILOGUE()
|
||||
TheStack | 8281bd4b63314313880a1cd276f94723fb36500d | Assemblycode:Assembly | {"size": 776, "ext": "asm", "max_stars_repo_path": "Build/Interpreters/Ozmoo/asm/constants-header.asm", "max_stars_repo_name": "polluks/Puddle-BuildTools", "max_stars_repo_stars_event_min_datetime": "2021-06-18T12:56:15.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-12T20:38:40.000Z", "max_issues_repo_path": "Build/Interpreters/Ozmoo/asm/constants-header.asm", "max_issues_repo_name": "polluks/Puddle-BuildTools", "max_issues_repo_issues_event_min_datetime": "2021-06-20T16:28:12.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-17T21:33:56.000Z", "max_forks_repo_path": "Build/Interpreters/Ozmoo/asm/constants-header.asm", "max_forks_repo_name": "polluks/Puddle-BuildTools", "max_forks_repo_forks_event_min_datetime": "2021-06-18T18:18:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-22T08:01:32.000Z"} | {"max_stars_count": 38, "max_issues_count": 2, "max_forks_count": 6, "avg_line_length": 26.7586206897, "max_line_length": 37, "alphanum_fraction": 0.8182989691} | ; story file header constants
header_version = $0
header_flags_1 = $1
header_high_mem = $4
header_initial_pc = $6
header_dictionary = $8
header_object_table = $a
header_globals = $c
header_static_mem = $e
header_flags_2 = $10
header_serial = $12
header_abbreviations = $18
header_filelength = $1a
header_checksum = $1c
header_interpreter_number = $1e
header_interpreter_version = $1f
header_screen_height_lines = $20
header_screen_width_chars = $21
header_screen_width_units = $22
header_screen_height_units = $24
header_font_width_units = $26
header_font_height_units = $27
header_default_bg_colour = $2c
header_default_fg_colour = $2d
header_terminating_chars_table = $2e
header_standard_revision_number = $32
header_alphabet_table = $34
header_header_extension_table = $36
|
||||
TheStack | 924bafb500b895c1801d56a166998ce73d4367ee | Assemblycode:Assembly | {"size": 267, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/alloc/malloc/c/sdcc_iy/calloc_unlocked.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/alloc/malloc/c/sdcc_iy/calloc_unlocked.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/alloc/malloc/c/sdcc_iy/calloc_unlocked.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"} | {"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 12.1363636364, "max_line_length": 50, "alphanum_fraction": 0.7378277154} |
; void *calloc_unlocked(size_t nmemb, size_t size)
SECTION code_clib
SECTION code_alloc_malloc
PUBLIC _calloc_unlocked
EXTERN asm_calloc_unlocked
_calloc_unlocked:
pop af
pop hl
pop bc
push bc
push hl
push af
jp asm_calloc_unlocked
|
||||
TheStack | a347d43da8ba217d04de49c3f80dd36781416f7e | Assemblycode:Assembly | {"size": 1089, "ext": "asm", "max_stars_repo_path": "Miei-sorgenti/old/Terza lezione/slotmachine.asm", "max_stars_repo_name": "DigiOhhh/LabArchitettura2-2017-2018", "max_stars_repo_stars_event_min_datetime": "2019-03-06T13:26:10.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-06T13:26:10.000Z", "max_issues_repo_path": "Miei-sorgenti/new/Terza lezione/Versione 1/slotmachine.asm", "max_issues_repo_name": "DigiOhhh/LabArchitettura2-2017-2018", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Miei-sorgenti/new/Terza lezione/Versione 1/slotmachine.asm", "max_forks_repo_name": "DigiOhhh/LabArchitettura2-2017-2018", "max_forks_repo_forks_event_min_datetime": "2019-03-06T13:25:28.000Z", "max_forks_repo_forks_event_max_datetime": "2019-03-06T13:25:28.000Z"} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 24.75, "max_line_length": 119, "alphanum_fraction": 0.6868686869} | # Utilizzando le syscall rese disponibili dall'emulatore MARS implementare un programma che:
# Richieda all'utente attraverso una finestra di dialogo l'inserimento di un numero intero NUM
# Estragga un numero casuale R nel range [-NUM,NUM], (il seed del generatore di numeri casuali può essere inizializzato
# con un qualsiasi numero intero)
# Sommi R al numero inserito NUM : RESULT = NUM + R
# Mostri all'utente attraverso una nuova finestra di dialogo il nuovo credito dell'utente dopo la scommessa RESULT.
# Il programma dovrà terminare in maniera "pulita" restituendo il controllo al sistema operativo
.data
begin: .asciiz "Inserisci un intero: "
end: .asciiz "Il nuovo credito è: "
.text
.globl main
main:
li $v0, 51
la $a0, begin
syscall
move $s0, $a0 # $s0 <-- NUM
add $t0, $s0, $s0
addi $t0, $t0, 1 # $t0 <-- upper bound
li $v0, 42
li $a0, 0
move $a1, $t0
syscall
move $t0, $a0
sub $t0, $t0, $s0 # Ora R è nell'intervallo [-NUM, NUM]
add $s1, $t0, $s0 # $s1 <-- NUM + R
li $v0, 56
la $a0, end
move $a1, $s1
syscall
li $v0, 10
syscall |
||||
TheStack | 533059f6cdc48f606d6e947a3a325fd993cc9b16 | Assemblycode:Assembly | {"size": 716, "ext": "asm", "max_stars_repo_path": "oeis/098/A098589.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/098/A098589.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/098/A098589.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"} | {"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 42.1176470588, "max_line_length": 500, "alphanum_fraction": 0.7891061453} | ; A098589: a(n) = 3*a(n-1) + 2*a(n-3), with a(0)=1, a(1)=3.
; Submitted by Jamie Morken(w1)
; 1,3,9,29,93,297,949,3033,9693,30977,98997,316377,1011085,3231249,10326501,33001673,105467517,337055553,1077170005,3442445049,11001446253,35158678769,112360926405,359085671721,1147574372701,3667444970913,11720506256181,37456667513945,119704892483661,382555689963345,1222580404917925,3907150999721097,12486564379089981,39904853947105793,127528863840759573,407559720280458681,1302488868735587629,4162524333888282033,13302692442225763461,42513055064148465641,135864213860221960989,434198026465117409889
add $0,1
mov $3,1
lpb $0
sub $0,1
add $1,$4
add $4,$3
mov $3,$2
mov $2,$1
add $1,$4
mov $4,$1
lpe
mov $0,$1
|
||||
TheStack | 4514088d15019797ed72f2a211b8a41a15ed99b7 | Assemblycode:Assembly | {"size": 488, "ext": "asm", "max_stars_repo_path": "programs/oeis/166/A166805.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/166/A166805.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/166/A166805.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 61.0, "max_line_length": 230, "alphanum_fraction": 0.7786885246} | ; A166805: Number of n X 4 1..2 arrays containing at least one of each value, all equal values connected, rows considered as a single number in nondecreasing order, and columns considered as a single number in nondecreasing order.
; 3,13,33,68,124,208,328,493,713,999,1363,1818,2378,3058,3874,4843,5983,7313,8853,10624,12648,14948,17548,20473,23749,27403,31463,35958,40918,46374,52358,58903,66043,73813,82249,91388,101268,111928,123408,135749,148993
add $0,5
mov $1,$0
bin $1,4
sub $1,2
|
||||
TheStack | 344b8fe3ad83256f8e5fa280d773da5f28d927b5 | Assemblycode:Assembly | {"size": 5325, "ext": "asm", "max_stars_repo_path": "audio/music/showmearound.asm", "max_stars_repo_name": "Dev727/ancientplatinum", "max_stars_repo_stars_event_min_datetime": "2019-11-08T07:19:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-20T10:17:54.000Z", "max_issues_repo_path": "audio/music/showmearound.asm", "max_issues_repo_name": "Dev727/ancientplatinum", "max_issues_repo_issues_event_min_datetime": "2020-01-11T17:00:40.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-14T01:27:38.000Z", "max_forks_repo_path": "audio/music/showmearound.asm", "max_forks_repo_name": "Dev727/ancientplatinum", "max_forks_repo_forks_event_min_datetime": "2020-05-28T17:31:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-07T20:49:35.000Z"} | {"max_stars_count": 28, "max_issues_count": 13, "max_forks_count": 22, "avg_line_length": 15.2142857143, "max_line_length": 47, "alphanum_fraction": 0.7106103286} | Music_ShowMeAround:
musicheader 4, 1, Music_ShowMeAround_Ch1
musicheader 1, 2, Music_ShowMeAround_Ch2
musicheader 1, 3, Music_ShowMeAround_Ch3
musicheader 1, 4, Music_ShowMeAround_Ch4
Music_ShowMeAround_Ch1:
tempo 144
volume $77
stereopanning $f
dutycycle $2
notetype $c, $b1
octave 4
note B_, 2
note A_, 2
note G#, 2
note A_, 2
note G#, 2
note F#, 2
note E_, 2
note D_, 2
octave 3
note B_, 4
note G#, 1
note B_, 1
octave 4
note D_, 1
note E_, 1
note G#, 8
Music_ShowMeAround_branch_edc01:
note __, 16
note __, 16
note __, 16
note __, 16
callchannel Music_ShowMeAround_branch_edc98
callchannel Music_ShowMeAround_branch_edc15
callchannel Music_ShowMeAround_branch_edc98
callchannel Music_ShowMeAround_branch_edc15
loopchannel 0, Music_ShowMeAround_branch_edc01
Music_ShowMeAround_branch_edc15:
note __, 4
octave 3
note C#, 1
note __, 5
note D_, 4
note C_, 1
note __, 1
note __, 4
octave 2
note E_, 1
note __, 1
note G#, 1
note __, 1
octave 4
note E_, 1
note __, 1
note E_, 1
note __, 1
note E_, 1
note __, 3
endchannel
Music_ShowMeAround_Ch2:
stereopanning $ff
dutycycle $2
notetype $c, $b1
octave 5
note E_, 2
note D_, 2
note C#, 2
note D_, 2
note C#, 2
octave 4
note B_, 2
note A_, 2
note G#, 2
note E_, 4
note E_, 1
note G#, 1
note B_, 1
octave 5
note D_, 1
note E_, 8
dutycycle $1
Music_ShowMeAround_branch_edc44:
callchannel Music_ShowMeAround_branch_edc98
callchannel Music_ShowMeAround_branch_edc98
callchannel Music_ShowMeAround_branch_edc86
note A_, 4
octave 3
note A_, 2
octave 4
note C#, 2
note E_, 4
note D_, 2
note C#, 2
octave 3
note B_, 4
callchannel Music_ShowMeAround_branch_edc86
note A_, 2
note A_, 2
note G#, 2
note E_, 2
note F#, 2
note G#, 2
note A_, 2
note A_, 2
note A_, 4
callchannel Music_ShowMeAround_branch_edc8e
note A_, 4
octave 5
note C#, 2
octave 4
note A_, 2
note A_, 4
note G#, 1
note G_, 1
note F#, 1
note F_, 1
note E_, 1
note __, 1
note D#, 1
note E_, 1
callchannel Music_ShowMeAround_branch_edc8e
note A_, 2
octave 5
note E_, 2
note D_, 2
octave 4
note B_, 2
note A_, 2
note G#, 2
note A_, 2
note A_, 2
note A_, 4
loopchannel 0, Music_ShowMeAround_branch_edc44
Music_ShowMeAround_branch_edc86:
octave 3
note A_, 2
octave 4
note C#, 2
note E_, 4
note D_, 2
note F#, 2
endchannel
Music_ShowMeAround_branch_edc8e:
octave 5
note C#, 2
octave 4
note A_, 2
note A_, 4
octave 5
note F#, 2
octave 4
note A_, 2
endchannel
Music_ShowMeAround_branch_edc98:
note __, 4
octave 3
note C#, 1
note __, 5
note D_, 4
note C_, 1
note __, 1
note __, 2
note C#, 1
note __, 5
octave 2
note E_, 1
note __, 3
note A#, 2
note B_, 1
note __, 1
endchannel
Music_ShowMeAround_Ch3:
stereopanning $f0
vibrato $10, $22
notetype $6, $25
octave 2
note B_, 1
note __, 3
octave 3
note D_, 1
note __, 3
note E_, 1
note __, 3
note G#, 1
note __, 3
note B_, 1
note __, 3
octave 4
note D_, 1
note __, 3
note E_, 1
note __, 3
note G#, 1
note __, 3
note D_, 2
note __, 6
note D_, 2
octave 3
note B_, 2
note G#, 2
note B_, 2
note E_, 2
note __, 6
intensity $14
octave 2
note B_, 1
note A#, 1
note A_, 1
note G#, 1
note G_, 1
note F_, 1
note E_, 2
intensity $14
Music_ShowMeAround_branch_edcd9:
callchannel Music_ShowMeAround_branch_edcef
callchannel Music_ShowMeAround_branch_edcef
callchannel Music_ShowMeAround_branch_edcef
callchannel Music_ShowMeAround_branch_edd0f
callchannel Music_ShowMeAround_branch_edcef
callchannel Music_ShowMeAround_branch_edd0f
loopchannel 0, Music_ShowMeAround_branch_edcd9
Music_ShowMeAround_branch_edcef:
octave 2
note A_, 2
note __, 6
octave 4
note E_, 2
note __, 2
octave 2
note A_, 2
note __, 2
octave 3
note D_, 2
note __, 2
octave 4
note F#, 8
note D#, 2
note __, 2
octave 2
note A_, 2
note __, 2
octave 4
note E_, 2
note __, 6
octave 2
note A_, 2
note __, 2
octave 4
note D_, 2
note __, 6
note C#, 4
note D_, 2
note __, 2
endchannel
Music_ShowMeAround_branch_edd0f:
octave 2
note A_, 2
note __, 6
octave 4
note E_, 2
note __, 2
octave 2
note A_, 2
note __, 2
octave 3
note D_, 2
note __, 2
octave 4
note F#, 8
note D#, 2
note __, 2
octave 2
note G#, 2
note __, 6
octave 4
note D_, 2
note __, 2
octave 3
note B_, 2
note __, 2
note C#, 2
note __, 2
note E_, 2
note __, 2
octave 2
note A_, 2
note __, 6
endchannel
Music_ShowMeAround_Ch4:
togglenoise $3
notetype $c
note __, 16
note __, 8
note D_, 2
note D#, 2
note F#, 4
Music_ShowMeAround_branch_edd39:
callchannel Music_ShowMeAround_branch_edd4f
callchannel Music_ShowMeAround_branch_edd4f
callchannel Music_ShowMeAround_branch_edd4f
callchannel Music_ShowMeAround_branch_edd5e
callchannel Music_ShowMeAround_branch_edd4f
callchannel Music_ShowMeAround_branch_edd5e
loopchannel 0, Music_ShowMeAround_branch_edd39
Music_ShowMeAround_branch_edd4f:
note D#, 2
note F#, 2
note D_, 2
note G_, 2
note G_, 2
note F#, 4
note D_, 2
note D#, 2
note F#, 4
note D_, 2
note G_, 2
note G_, 2
note D_, 2
note D#, 2
endchannel
Music_ShowMeAround_branch_edd5e:
note D#, 2
note F#, 2
note D_, 2
note G_, 2
note G_, 2
note F#, 4
note D_, 2
note D#, 2
note F#, 4
note D_, 2
note D_, 2
note D_, 2
note D_, 2
note F#, 2
endchannel
|
||||
TheStack | 027fdcf0a6b2ae8e137a44598e7439548598335d | Assemblycode:Assembly | {"size": 661, "ext": "asm", "max_stars_repo_path": "programs/oeis/212/A212680.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/212/A212680.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/212/A212680.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null} | {"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.8857142857, "max_line_length": 197, "alphanum_fraction": 0.5506807867} | ; A212680: Number of (w,x,y,z) with all terms in {1,...,n} and |x-y|=|y-z|+1.
; 0,0,4,18,56,120,228,378,592,864,1220,1650,2184,2808,3556,4410,5408,6528,7812,9234,10840,12600,14564,16698,19056,21600,24388,27378,30632,34104,37860,41850,46144,50688,55556,60690,66168,71928,78052
mov $12,$0
mov $14,$0
lpb $14
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
lpb $11
mov $0,$9
sub $11,1
sub $0,$11
sub $0,1
mov $1,$0
gcd $1,2
mov $3,3
mov $5,3
sub $5,$1
add $3,$5
mul $3,$0
cmp $5,$3
add $5,$3
mov $1,$5
trn $1,3
mul $1,2
add $10,$1
lpe
add $13,$10
lpe
mov $1,$13
|