hexsha stringlengths 40 40 | size int64 6 1.05M | ext stringclasses 3 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 232 | max_stars_repo_name stringlengths 7 106 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 7 | max_stars_count int64 1 33.5k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 232 | max_issues_repo_name stringlengths 7 106 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 7 | max_issues_count int64 1 37.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 232 | max_forks_repo_name stringlengths 7 106 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 7 | max_forks_count int64 1 12.6k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 1.05M | avg_line_length float64 1.16 19.7k | max_line_length int64 2 938k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1bbedcd0e2088f9e0d259487cd10807af7c27c5f | 361 | asm | Assembly | programs/oeis/103/A103128.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/103/A103128.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/103/A103128.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A103128: a(n) = floor(sqrt(2n-1)).
; 1,1,2,2,3,3,3,3,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14
mul $0,2
mov $1,3
lpb $0
sub $0,$1
add $1,2
lpe
div $1,2
mov $0,$1
| 30.083333 | 251 | 0.576177 |
078358e491565cbed08580ebc81684301fc37981 | 85,725 | asm | Assembly | debug/kern.elf.asm | SharpCoder/rpi-kernel | 661f869c429170ec81339dc31afb49ca624c9c3f | [
"MIT"
] | 73 | 2015-01-17T00:32:26.000Z | 2021-12-31T15:58:03.000Z | debug/kern.elf.asm | SharpCoder/rpi-kernel | 661f869c429170ec81339dc31afb49ca624c9c3f | [
"MIT"
] | 3 | 2015-04-19T06:04:13.000Z | 2016-02-28T17:27:35.000Z | debug/kern.elf.asm | SharpCoder/rpi-kernel | 661f869c429170ec81339dc31afb49ca624c9c3f | [
"MIT"
] | 23 | 2015-01-25T01:10:28.000Z | 2021-02-19T04:09:42.000Z |
kernel.elf: file format elf32-littlearm
Disassembly of section .text:
00008000 <init_entry_point>:
8000: e59ff018 ldr pc, [pc, #24] ; 8020 <reset_handler>
8004: e59ff018 ldr pc, [pc, #24] ; 8024 <basic_handler>
8008: e59ff014 ldr pc, [pc, #20] ; 8024 <basic_handler>
800c: e59ff010 ldr pc, [pc, #16] ; 8024 <basic_handler>
8010: e59ff00c ldr pc, [pc, #12] ; 8024 <basic_handler>
8014: e59ff008 ldr pc, [pc, #8] ; 8024 <basic_handler>
8018: e59ff004 ldr pc, [pc, #4] ; 8024 <basic_handler>
801c: e51ff000 ldr pc, [pc, #-0] ; 8024 <basic_handler>
00008020 <reset_handler>:
8020: 00008028 andeq r8, r0, r8, lsr #32
00008024 <basic_handler>:
8024: 0000804c andeq r8, r0, ip, asr #32
00008028 <reset>:
8028: e3a00902 mov r0, #32768 ; 0x8000
802c: e3a01000 mov r1, #0
8030: e8b003fc ldm r0!, {r2, r3, r4, r5, r6, r7, r8, r9}
8034: e8a103fc stmia r1!, {r2, r3, r4, r5, r6, r7, r8, r9}
8038: e8b003fc ldm r0!, {r2, r3, r4, r5, r6, r7, r8, r9}
803c: e8a103fc stmia r1!, {r2, r3, r4, r5, r6, r7, r8, r9}
8040: ea00000c b 8078 <init>
8044: e12fff1e bx lr
00008048 <hang>:
8048: eafffffe b 8048 <hang>
0000804c <arm_interrupt_handler>:
804c: e24ee004 sub lr, lr, #4
8050: e92d401f push {r0, r1, r2, r3, r4, lr}
8054: eb00041a bl 90c4 <irq_handler>
8058: e8fd801f ldm sp!, {r0, r1, r2, r3, r4, pc}^
805c: e12fff1e bx lr
8060: 00001741 andeq r1, r0, r1, asr #14
8064: 61656100 cmnvs r5, r0, lsl #2
8068: 01006962 tsteq r0, r2, ror #18
806c: 0000000d andeq r0, r0, sp
8070: 01080206 tsteq r8, r6, lsl #4
8074: 012c0109 teqeq ip, r9, lsl #2
00008078 <init>:
8078: e3a0d702 mov sp, #524288 ; 0x80000
807c: eb000442 bl 918c <kmain>
8080: eaffffff b 8084 <hang$>
00008084 <hang$>:
8084: eafffffe b 8084 <hang$>
8088: 00001541 andeq r1, r0, r1, asr #10
808c: 61656100 cmnvs r5, r0, lsl #2
8090: 01006962 tsteq r0, r2, ror #18
8094: 0000000b andeq r0, r0, fp
8098: 01080106 tsteq r8, r6, lsl #2
809c: 0000012c andeq r0, r0, ip, lsr #2
000080a0 <_Z3absi>:
80a0: e3500000 cmp r0, #0
80a4: b2600000 rsblt r0, r0, #0
80a8: e12fff1e bx lr
000080ac <_Z15getNumberLengthiiPi>:
80ac: e1a03000 mov r3, r0
80b0: e3a00000 mov r0, #0
80b4: e5820000 str r0, [r2]
80b8: e3a00001 mov r0, #1
80bc: ea000000 b 80c4 <_Z15getNumberLengthiiPi+0x18>
80c0: e1a00002 mov r0, r2
80c4: e0020091 mul r2, r1, r0
80c8: e1520003 cmp r2, r3
80cc: bafffffb blt 80c0 <_Z15getNumberLengthiiPi+0x14>
80d0: e12fff1e bx lr
000080d4 <_Z15getNumberLengthii>:
80d4: e1a03000 mov r3, r0
80d8: e3a00001 mov r0, #1
80dc: ea000000 b 80e4 <_Z15getNumberLengthii+0x10>
80e0: e1a00002 mov r0, r2
80e4: e0020091 mul r2, r1, r0
80e8: e1530002 cmp r3, r2
80ec: cafffffb bgt 80e0 <_Z15getNumberLengthii+0xc>
80f0: e12fff1e bx lr
000080f4 <_Z15getNumberLengthi>:
80f4: e3a03001 mov r3, #1
80f8: ea000000 b 8100 <_Z15getNumberLengthi+0xc>
80fc: e1a03002 mov r3, r2
8100: e0832103 add r2, r3, r3, lsl #2
8104: e1a02082 lsl r2, r2, #1
8108: e1500002 cmp r0, r2
810c: cafffffa bgt 80fc <_Z15getNumberLengthi+0x8>
8110: e1a00003 mov r0, r3
8114: e12fff1e bx lr
00008118 <_Z6divideiiPiS_>:
8118: e3510000 cmp r1, #0
811c: e92d00f0 push {r4, r5, r6, r7}
8120: 0a00001d beq 819c <_Z6divideiiPiS_+0x84>
8124: e3510001 cmp r1, #1
8128: 05820000 streq r0, [r2]
812c: 03a02000 moveq r2, #0
8130: 05832000 streq r2, [r3]
8134: 0a000018 beq 819c <_Z6divideiiPiS_+0x84>
8138: e3a04000 mov r4, #0
813c: e3500000 cmp r0, #0
8140: b2600000 rsblt r0, r0, #0
8144: e1500004 cmp r0, r4
8148: e5824000 str r4, [r2]
814c: e5834000 str r4, [r3]
8150: 0a000011 beq 819c <_Z6divideiiPiS_+0x84>
8154: e3510000 cmp r1, #0
8158: b2611000 rsblt r1, r1, #0
815c: e050c001 subs ip, r0, r1
8160: 4a000010 bmi 81a8 <_Z6divideiiPiS_+0x90>
8164: e061c00c rsb ip, r1, ip
8168: e5925000 ldr r5, [r2]
816c: e2617000 rsb r7, r1, #0
8170: e08c6001 add r6, ip, r1
8174: ea000001 b 8180 <_Z6divideiiPiS_+0x68>
8178: e09c6001 adds r6, ip, r1
817c: 4a000008 bmi 81a4 <_Z6divideiiPiS_+0x8c>
8180: e2844001 add r4, r4, #1
8184: e1540006 cmp r4, r6
8188: e1a00006 mov r0, r6
818c: e08cc007 add ip, ip, r7
8190: e2855001 add r5, r5, #1
8194: bafffff7 blt 8178 <_Z6divideiiPiS_+0x60>
8198: e5825000 str r5, [r2]
819c: e8bd00f0 pop {r4, r5, r6, r7}
81a0: e12fff1e bx lr
81a4: e5825000 str r5, [r2]
81a8: e5830000 str r0, [r3]
81ac: eafffffa b 819c <_Z6divideiiPiS_+0x84>
000081b0 <_Z6divideii>:
81b0: e52de004 push {lr} ; (str lr, [sp, #-4]!)
81b4: e24dd00c sub sp, sp, #12
81b8: e3a0c000 mov ip, #0
81bc: e28d2004 add r2, sp, #4
81c0: e1a0300d mov r3, sp
81c4: e58dc004 str ip, [sp, #4]
81c8: e58dc000 str ip, [sp]
81cc: ebffffd1 bl 8118 <_Z6divideiiPiS_>
81d0: e59d0004 ldr r0, [sp, #4]
81d4: e28dd00c add sp, sp, #12
81d8: e49de004 pop {lr} ; (ldr lr, [sp], #4)
81dc: e12fff1e bx lr
000081e0 <_Z6moduloii>:
81e0: e52de004 push {lr} ; (str lr, [sp, #-4]!)
81e4: e24dd00c sub sp, sp, #12
81e8: e3a0c000 mov ip, #0
81ec: e28d2004 add r2, sp, #4
81f0: e1a0300d mov r3, sp
81f4: e58dc004 str ip, [sp, #4]
81f8: e58dc000 str ip, [sp]
81fc: ebffffc5 bl 8118 <_Z6divideiiPiS_>
8200: e59d0000 ldr r0, [sp]
8204: e28dd00c add sp, sp, #12
8208: e49de004 pop {lr} ; (ldr lr, [sp], #4)
820c: e12fff1e bx lr
00008210 <_Z5allocj>:
8210: e59f30b0 ldr r3, [pc, #176] ; 82c8 <_Z5allocj+0xb8>
8214: e5933000 ldr r3, [r3]
8218: e5d32004 ldrb r2, [r3, #4]
821c: e3520000 cmp r2, #0
8220: e92d0070 push {r4, r5, r6}
8224: e1a05000 mov r5, r0
8228: 0a000003 beq 823c <_Z5allocj+0x2c>
822c: e5933000 ldr r3, [r3]
8230: e5d30004 ldrb r0, [r3, #4]
8234: e3500000 cmp r0, #0
8238: 1afffffb bne 822c <_Z5allocj+0x1c>
823c: e5936008 ldr r6, [r3, #8]
8240: e593100c ldr r1, [r3, #12]
8244: e3a04000 mov r4, #0
8248: e0860101 add r0, r6, r1, lsl #2
824c: e1550004 cmp r5, r4
8250: e2836b01 add r6, r3, #1024 ; 0x400
8254: e5c34404 strb r4, [r3, #1028] ; 0x404
8258: e5830408 str r0, [r3, #1032] ; 0x408
825c: e583540c str r5, [r3, #1036] ; 0x40c
8260: 0a000013 beq 82b4 <_Z5allocj+0xa4>
8264: e245c001 sub ip, r5, #1
8268: e1a02000 mov r2, r0
826c: e3550001 cmp r5, #1
8270: e20c1001 and r1, ip, #1
8274: e4824004 str r4, [r2], #4
8278: e3a0c001 mov ip, #1
827c: 9a00000c bls 82b4 <_Z5allocj+0xa4>
8280: e3510000 cmp r1, #0
8284: 0a000003 beq 8298 <_Z5allocj+0x88>
8288: e3a0c002 mov ip, #2
828c: e155000c cmp r5, ip
8290: e4824004 str r4, [r2], #4
8294: 9a000006 bls 82b4 <_Z5allocj+0xa4>
8298: e1a01002 mov r1, r2
829c: e4814004 str r4, [r1], #4
82a0: e28cc002 add ip, ip, #2
82a4: e155000c cmp r5, ip
82a8: e5824004 str r4, [r2, #4]
82ac: e2812004 add r2, r1, #4
82b0: 8afffff8 bhi 8298 <_Z5allocj+0x88>
82b4: e3a02001 mov r2, #1
82b8: e5836000 str r6, [r3]
82bc: e5c32004 strb r2, [r3, #4]
82c0: e8bd0070 pop {r4, r5, r6}
82c4: e12fff1e bx lr
82c8: 00009d24 andeq r9, r0, r4, lsr #26
000082cc <_Z15init_page_tablev>:
82cc: e59f1018 ldr r1, [pc, #24] ; 82ec <_Z15init_page_tablev+0x20>
82d0: e3a0380f mov r3, #983040 ; 0xf0000
82d4: e3a00000 mov r0, #0
82d8: e3a02aff mov r2, #1044480 ; 0xff000
82dc: e5813000 str r3, [r1]
82e0: e5c30004 strb r0, [r3, #4]
82e4: e5832008 str r2, [r3, #8]
82e8: e12fff1e bx lr
82ec: 00009d24 andeq r9, r0, r4, lsr #26
000082f0 <_Z10irq_enablev>:
82f0: e59f3018 ldr r3, [pc, #24] ; 8310 <_Z10irq_enablev+0x20>
82f4: e3e01000 mvn r1, #0
82f8: e3a020ff mov r2, #255 ; 0xff
82fc: e5831840 str r1, [r3, #2112] ; 0x840
8300: e3a00001 mov r0, #1
8304: e5831850 str r1, [r3, #2128] ; 0x850
8308: e5832860 str r2, [r3, #2144] ; 0x860
830c: e12fff1e bx lr
8310: 2000b000 andcs fp, r0, r0
00008314 <_Z8irq_testv>:
8314: ef0000ff svc 0x000000ff
8318: e12fff1e bx lr
0000831c <_ZN12RaspberryLib5GET32Ej>:
831c: e5900000 ldr r0, [r0]
8320: e12fff1e bx lr
00008324 <_ZN12RaspberryLib5PUT32Ejj>:
8324: e5801000 str r1, [r0]
8328: e12fff1e bx lr
0000832c <_ZN12RaspberryLib4GET4Ej>:
832c: e5d00000 ldrb r0, [r0]
8330: e12fff1e bx lr
00008334 <_ZN12RaspberryLib4PUT4Ejc>:
8334: e5c01000 strb r1, [r0]
8338: e12fff1e bx lr
0000833c <_ZN12RaspberryLib7SetGPIOEjj>:
833c: e59f2094 ldr r2, [pc, #148] ; 83d8 <_ZN12RaspberryLib7SetGPIOEjj+0x9c>
8340: e3510001 cmp r1, #1
8344: e59f3090 ldr r3, [pc, #144] ; 83dc <_ZN12RaspberryLib7SetGPIOEjj+0xa0>
8348: 11a03002 movne r3, r2
834c: e350000a cmp r0, #10
8350: 959f1088 ldrls r1, [pc, #136] ; 83e0 <_ZN12RaspberryLib7SetGPIOEjj+0xa4>
8354: 93a0c001 movls ip, #1
8358: 9a000018 bls 83c0 <_ZN12RaspberryLib7SetGPIOEjj+0x84>
835c: e59f2080 ldr r2, [pc, #128] ; 83e4 <_ZN12RaspberryLib7SetGPIOEjj+0xa8>
8360: e240100b sub r1, r0, #11
8364: e082c291 umull ip, r2, r1, r2
8368: e240000a sub r0, r0, #10
836c: e1a011a2 lsr r1, r2, #3
8370: e350000a cmp r0, #10
8374: e2012001 and r2, r1, #1
8378: e3a0c001 mov ip, #1
837c: 9a000009 bls 83a8 <_ZN12RaspberryLib7SetGPIOEjj+0x6c>
8380: e3520000 cmp r2, #0
8384: 0a000003 beq 8398 <_ZN12RaspberryLib7SetGPIOEjj+0x5c>
8388: e240000a sub r0, r0, #10
838c: e350000a cmp r0, #10
8390: e3a0c002 mov ip, #2
8394: 9a000003 bls 83a8 <_ZN12RaspberryLib7SetGPIOEjj+0x6c>
8398: e2400014 sub r0, r0, #20
839c: e350000a cmp r0, #10
83a0: e28cc002 add ip, ip, #2
83a4: 8afffffb bhi 8398 <_ZN12RaspberryLib7SetGPIOEjj+0x5c>
83a8: e1a0110c lsl r1, ip, #2
83ac: e3a02001 mov r2, #1
83b0: e1a0c20c lsl ip, ip, #4
83b4: e1a0cc12 lsl ip, r2, ip
83b8: e2811202 add r1, r1, #536870912 ; 0x20000000
83bc: e2811602 add r1, r1, #2097152 ; 0x200000
83c0: e0800080 add r0, r0, r0, lsl #1
83c4: e3a02001 mov r2, #1
83c8: e1a00012 lsl r0, r2, r0
83cc: e5810000 str r0, [r1]
83d0: e583c000 str ip, [r3]
83d4: e12fff1e bx lr
83d8: 2020001c eorcs r0, r0, ip, lsl r0
83dc: 20200028 eorcs r0, r0, r8, lsr #32
83e0: 20200000 eorcs r0, r0, r0
83e4: cccccccd stclgt 12, cr12, [ip], {205} ; 0xcd
000083e8 <_ZN12RaspberryLib12CheckCounterEv>:
83e8: e59f3004 ldr r3, [pc, #4] ; 83f4 <_ZN12RaspberryLib12CheckCounterEv+0xc>
83ec: e5930004 ldr r0, [r3, #4]
83f0: e12fff1e bx lr
83f4: 20003000 andcs r3, r0, r0
000083f8 <_ZN12RaspberryLib9WaitQuickEj>:
83f8: e59f3014 ldr r3, [pc, #20] ; 8414 <_ZN12RaspberryLib9WaitQuickEj+0x1c>
83fc: e5932004 ldr r2, [r3, #4]
8400: e0802002 add r2, r0, r2
8404: e5931004 ldr r1, [r3, #4]
8408: e1520001 cmp r2, r1
840c: 8afffffc bhi 8404 <_ZN12RaspberryLib9WaitQuickEj+0xc>
8410: e12fff1e bx lr
8414: 20003000 andcs r3, r0, r0
00008418 <_ZN12RaspberryLib4WaitEj>:
8418: e59f301c ldr r3, [pc, #28] ; 843c <_ZN12RaspberryLib4WaitEj+0x24>
841c: e0801100 add r1, r0, r0, lsl #2
8420: e5932004 ldr r2, [r3, #4]
8424: e0810101 add r0, r1, r1, lsl #2
8428: e0821280 add r1, r2, r0, lsl #5
842c: e593c004 ldr ip, [r3, #4]
8430: e151000c cmp r1, ip
8434: 8afffffc bhi 842c <_ZN12RaspberryLib4WaitEj+0x14>
8438: e12fff1e bx lr
843c: 20003000 andcs r3, r0, r0
00008440 <_ZN12RaspberryLib5BlinkEjj>:
8440: e92d40f8 push {r3, r4, r5, r6, r7, lr}
8444: e2505000 subs r5, r0, #0
8448: 0a000016 beq 84a8 <_ZN12RaspberryLib5BlinkEjj+0x68>
844c: e0810101 add r0, r1, r1, lsl #2
8450: e59f4058 ldr r4, [pc, #88] ; 84b0 <_ZN12RaspberryLib5BlinkEjj+0x70>
8454: e0801100 add r1, r0, r0, lsl #2
8458: e1a06281 lsl r6, r1, #5
845c: e1a07004 mov r7, r4
8460: e3a00010 mov r0, #16
8464: e3a01001 mov r1, #1
8468: ebffffb3 bl 833c <_ZN12RaspberryLib7SetGPIOEjj>
846c: e5942004 ldr r2, [r4, #4]
8470: e0862002 add r2, r6, r2
8474: e5943004 ldr r3, [r4, #4]
8478: e1520003 cmp r2, r3
847c: 8afffffc bhi 8474 <_ZN12RaspberryLib5BlinkEjj+0x34>
8480: e3a00010 mov r0, #16
8484: e3a01000 mov r1, #0
8488: ebffffab bl 833c <_ZN12RaspberryLib7SetGPIOEjj>
848c: e597c004 ldr ip, [r7, #4]
8490: e086200c add r2, r6, ip
8494: e594e004 ldr lr, [r4, #4]
8498: e152000e cmp r2, lr
849c: 8afffffc bhi 8494 <_ZN12RaspberryLib5BlinkEjj+0x54>
84a0: e2555001 subs r5, r5, #1
84a4: 1affffed bne 8460 <_ZN12RaspberryLib5BlinkEjj+0x20>
84a8: e8bd40f8 pop {r3, r4, r5, r6, r7, lr}
84ac: e12fff1e bx lr
84b0: 20003000 andcs r3, r0, r0
000084b4 <_ZN12RaspberryLib7PiFaultEPKc>:
84b4: e3a00004 mov r0, #4
84b8: e3a010c8 mov r1, #200 ; 0xc8
84bc: eaffffdf b 8440 <_ZN12RaspberryLib5BlinkEjj>
000084c0 <_ZN12RaspberryLib12MailboxWriteEcj>:
84c0: e59f303c ldr r3, [pc, #60] ; 8504 <_ZN12RaspberryLib12MailboxWriteEcj+0x44>
84c4: e5932898 ldr r2, [r3, #2200] ; 0x898
84c8: e3520000 cmp r2, #0
84cc: bafffffc blt 84c4 <_ZN12RaspberryLib12MailboxWriteEcj+0x4>
84d0: ee07cf15 mcr 15, 0, ip, cr7, cr5, {0}
84d4: ee07cfd5 mcr 15, 0, ip, cr7, cr5, {6}
84d8: ee07cf9a mcr 15, 0, ip, cr7, cr10, {4}
84dc: ee07cf95 mcr 15, 0, ip, cr7, cr5, {4}
84e0: e59f301c ldr r3, [pc, #28] ; 8504 <_ZN12RaspberryLib12MailboxWriteEcj+0x44>
84e4: e3c1100f bic r1, r1, #15
84e8: e1810000 orr r0, r1, r0
84ec: e58308a0 str r0, [r3, #2208] ; 0x8a0
84f0: ee07cf15 mcr 15, 0, ip, cr7, cr5, {0}
84f4: ee07cfd5 mcr 15, 0, ip, cr7, cr5, {6}
84f8: ee07cf9a mcr 15, 0, ip, cr7, cr10, {4}
84fc: ee07cf95 mcr 15, 0, ip, cr7, cr5, {4}
8500: e12fff1e bx lr
8504: 2000b000 andcs fp, r0, r0
00008508 <_ZN12RaspberryLib12MailboxCheckEc>:
8508: e92d4010 push {r4, lr}
850c: e59f2068 ldr r2, [pc, #104] ; 857c <_ZN12RaspberryLib12MailboxCheckEc+0x74>
8510: e59f4068 ldr r4, [pc, #104] ; 8580 <_ZN12RaspberryLib12MailboxCheckEc+0x78>
8514: e3a01000 mov r1, #0
8518: e5923898 ldr r3, [r2, #2200] ; 0x898
851c: e3130101 tst r3, #1073741824 ; 0x40000000
8520: 1a00000e bne 8560 <_ZN12RaspberryLib12MailboxCheckEc+0x58>
8524: ee07cf15 mcr 15, 0, ip, cr7, cr5, {0}
8528: ee07cfd5 mcr 15, 0, ip, cr7, cr5, {6}
852c: ee07cf9a mcr 15, 0, ip, cr7, cr10, {4}
8530: ee07cf95 mcr 15, 0, ip, cr7, cr5, {4}
8534: e5923880 ldr r3, [r2, #2176] ; 0x880
8538: ee07cf15 mcr 15, 0, ip, cr7, cr5, {0}
853c: ee07cfd5 mcr 15, 0, ip, cr7, cr5, {6}
8540: ee07cf9a mcr 15, 0, ip, cr7, cr10, {4}
8544: ee07cf95 mcr 15, 0, ip, cr7, cr5, {4}
8548: e203c00f and ip, r3, #15
854c: e15c0000 cmp ip, r0
8550: 1afffff0 bne 8518 <_ZN12RaspberryLib12MailboxCheckEc+0x10>
8554: e3c3000f bic r0, r3, #15
8558: e8bd4010 pop {r4, lr}
855c: e12fff1e bx lr
8560: e1510004 cmp r1, r4
8564: 92811001 addls r1, r1, #1
8568: 9affffea bls 8518 <_ZN12RaspberryLib12MailboxCheckEc+0x10>
856c: e59f0010 ldr r0, [pc, #16] ; 8584 <_ZN12RaspberryLib12MailboxCheckEc+0x7c>
8570: ebffffcf bl 84b4 <_ZN12RaspberryLib7PiFaultEPKc>
8574: e3e00000 mvn r0, #0
8578: eafffff6 b 8558 <_ZN12RaspberryLib12MailboxCheckEc+0x50>
857c: 2000b000 andcs fp, r0, r0
8580: 000fffff strdeq pc, [pc], -pc ; <UNPREDICTABLE>
8584: 00009e4c andeq r9, r0, ip, asr #28
00008588 <_ZN12RaspberryLib18AcquireFrameBufferEjj>:
8588: e3a03a02 mov r3, #8192 ; 0x2000
858c: e1a0c001 mov ip, r1
8590: e92d4010 push {r4, lr}
8594: e3a02000 mov r2, #0
8598: e1a0e000 mov lr, r0
859c: e583c004 str ip, [r3, #4]
85a0: e583c00c str ip, [r3, #12]
85a4: e3a0c018 mov ip, #24
85a8: e3a00001 mov r0, #1
85ac: e59f10e4 ldr r1, [pc, #228] ; 8698 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x110>
85b0: e583e000 str lr, [r3]
85b4: e583e008 str lr, [r3, #8]
85b8: e5832010 str r2, [r3, #16]
85bc: e583c014 str ip, [r3, #20]
85c0: e5832018 str r2, [r3, #24]
85c4: e583201c str r2, [r3, #28]
85c8: e5832020 str r2, [r3, #32]
85cc: e5832024 str r2, [r3, #36] ; 0x24
85d0: e5c32028 strb r2, [r3, #40] ; 0x28
85d4: ebffffb9 bl 84c0 <_ZN12RaspberryLib12MailboxWriteEcj>
85d8: e3a00001 mov r0, #1
85dc: ebffffc9 bl 8508 <_ZN12RaspberryLib12MailboxCheckEc>
85e0: e3500000 cmp r0, #0
85e4: 1a00000d bne 8620 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x98>
85e8: e3a02a02 mov r2, #8192 ; 0x2000
85ec: e5923020 ldr r3, [r2, #32]
85f0: e3530000 cmp r3, #0
85f4: 0a000024 beq 868c <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x104>
85f8: e5921010 ldr r1, [r2, #16]
85fc: e3510000 cmp r1, #0
8600: 0a00001e beq 8680 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xf8>
8604: e3530101 cmp r3, #1073741824 ; 0x40000000
8608: e3a0c001 mov ip, #1
860c: 82833103 addhi r3, r3, #-1073741824 ; 0xc0000000
8610: e3a00a02 mov r0, #8192 ; 0x2000
8614: e5c2c028 strb ip, [r2, #40] ; 0x28
8618: e5803020 str r3, [r0, #32]
861c: ea000014 b 8674 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xec>
8620: e3a00001 mov r0, #1
8624: ebffffb7 bl 8508 <_ZN12RaspberryLib12MailboxCheckEc>
8628: e3500000 cmp r0, #0
862c: e59f4068 ldr r4, [pc, #104] ; 869c <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x114>
8630: e3a00001 mov r0, #1
8634: 0a00000a beq 8664 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xdc>
8638: ebffffb2 bl 8508 <_ZN12RaspberryLib12MailboxCheckEc>
863c: e3500000 cmp r0, #0
8640: e2444001 sub r4, r4, #1
8644: 0a000006 beq 8664 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xdc>
8648: e2544001 subs r4, r4, #1
864c: 3affffe5 bcc 85e8 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x60>
8650: e3a00001 mov r0, #1
8654: ebffffab bl 8508 <_ZN12RaspberryLib12MailboxCheckEc>
8658: e3500000 cmp r0, #0
865c: e3a00001 mov r0, #1
8660: 1afffff4 bne 8638 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xb0>
8664: e3540000 cmp r4, #0
8668: 1affffde bne 85e8 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x60>
866c: e59f002c ldr r0, [pc, #44] ; 86a0 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x118>
8670: ebffff8f bl 84b4 <_ZN12RaspberryLib7PiFaultEPKc>
8674: e3a00a02 mov r0, #8192 ; 0x2000
8678: e8bd4010 pop {r4, lr}
867c: e12fff1e bx lr
8680: e59f001c ldr r0, [pc, #28] ; 86a4 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x11c>
8684: ebffff8a bl 84b4 <_ZN12RaspberryLib7PiFaultEPKc>
8688: eafffff9 b 8674 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xec>
868c: e59f0014 ldr r0, [pc, #20] ; 86a8 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0x120>
8690: ebffff87 bl 84b4 <_ZN12RaspberryLib7PiFaultEPKc>
8694: eafffff6 b 8674 <_ZN12RaspberryLib18AcquireFrameBufferEjj+0xec>
8698: 40002000 andmi r2, r0, r0
869c: 0000270f andeq r2, r0, pc, lsl #14
86a0: 00009e78 andeq r9, r0, r8, ror lr
86a4: 00009f10 andeq r9, r0, r0, lsl pc
86a8: 00009ec0 andeq r9, r0, r0, asr #29
000086ac <_ZN11gpu2dCanvas15initFrameBufferEv>:
86ac: e5901004 ldr r1, [r0, #4]
86b0: e92d4010 push {r4, lr}
86b4: e2811101 add r1, r1, #1073741824 ; 0x40000000
86b8: e1a04000 mov r4, r0
86bc: e3a00001 mov r0, #1
86c0: ebffff7e bl 84c0 <_ZN12RaspberryLib12MailboxWriteEcj>
86c4: e3a00001 mov r0, #1
86c8: ebffff8e bl 8508 <_ZN12RaspberryLib12MailboxCheckEc>
86cc: e3500000 cmp r0, #0
86d0: 1afffffb bne 86c4 <_ZN11gpu2dCanvas15initFrameBufferEv+0x18>
86d4: e5943004 ldr r3, [r4, #4]
86d8: e5930020 ldr r0, [r3, #32]
86dc: e3500000 cmp r0, #0
86e0: 0a000009 beq 870c <_ZN11gpu2dCanvas15initFrameBufferEv+0x60>
86e4: e5932010 ldr r2, [r3, #16]
86e8: e3520000 cmp r2, #0
86ec: 01a00002 moveq r0, r2
86f0: 0a000005 beq 870c <_ZN11gpu2dCanvas15initFrameBufferEv+0x60>
86f4: e3500101 cmp r0, #1073741824 ; 0x40000000
86f8: 82800103 addhi r0, r0, #-1073741824 ; 0xc0000000
86fc: e3a0c001 mov ip, #1
8700: e5830020 str r0, [r3, #32]
8704: e5c4c000 strb ip, [r4]
8708: e1a0000c mov r0, ip
870c: e8bd4010 pop {r4, lr}
8710: e12fff1e bx lr
00008714 <_ZN11gpu2dCanvasC1Eb>:
8714: e92d4038 push {r3, r4, r5, lr}
8718: e1a04000 mov r4, r0
871c: e5c41002 strb r1, [r4, #2]
8720: e3a05a02 mov r5, #8192 ; 0x2000
8724: e3a0cb01 mov ip, #1024 ; 0x400
8728: e3510000 cmp r1, #0
872c: e3a01000 mov r1, #0
8730: e5845004 str r5, [r4, #4]
8734: e5c41000 strb r1, [r4]
8738: e3a00c03 mov r0, #768 ; 0x300
873c: e585c000 str ip, [r5]
8740: e585c008 str ip, [r5, #8]
8744: 13a0cc06 movne ip, #1536 ; 0x600
8748: e3a03a02 mov r3, #8192 ; 0x2000
874c: 0585000c streq r0, [r5, #12]
8750: 1585c00c strne ip, [r5, #12]
8754: e5850004 str r0, [r5, #4]
8758: e3a02018 mov r2, #24
875c: e3a05000 mov r5, #0
8760: e1a00004 mov r0, r4
8764: e5832014 str r2, [r3, #20]
8768: e5835018 str r5, [r3, #24]
876c: e583501c str r5, [r3, #28]
8770: e5835010 str r5, [r3, #16]
8774: e5835020 str r5, [r3, #32]
8778: e5835024 str r5, [r3, #36] ; 0x24
877c: ebffffca bl 86ac <_ZN11gpu2dCanvas15initFrameBufferEv>
8780: e1500005 cmp r0, r5
8784: 15c45001 strbne r5, [r4, #1]
8788: e1a00004 mov r0, r4
878c: e8bd4038 pop {r3, r4, r5, lr}
8790: e12fff1e bx lr
00008794 <_ZN11gpu2dCanvasC1Ev>:
8794: e92d4010 push {r4, lr}
8798: e24dd008 sub sp, sp, #8
879c: e1a04000 mov r4, r0
87a0: e3a01001 mov r1, #1
87a4: e1a0000d mov r0, sp
87a8: ebffffd9 bl 8714 <_ZN11gpu2dCanvasC1Eb>
87ac: e1a00004 mov r0, r4
87b0: e28dd008 add sp, sp, #8
87b4: e8bd4010 pop {r4, lr}
87b8: e12fff1e bx lr
000087bc <_ZN11gpu2dCanvas4DrawEv>:
87bc: e5d03000 ldrb r3, [r0]
87c0: e3530000 cmp r3, #0
87c4: e92d4010 push {r4, lr}
87c8: e1a04000 mov r4, r0
87cc: 0a00000d beq 8808 <_ZN11gpu2dCanvas4DrawEv+0x4c>
87d0: e5d00002 ldrb r0, [r0, #2]
87d4: e3500000 cmp r0, #0
87d8: 0a00000a beq 8808 <_ZN11gpu2dCanvas4DrawEv+0x4c>
87dc: e5d4e001 ldrb lr, [r4, #1]
87e0: e594c004 ldr ip, [r4, #4]
87e4: e35e0000 cmp lr, #0
87e8: 059c2004 ldreq r2, [ip, #4]
87ec: 13a02000 movne r2, #0
87f0: e58c201c str r2, [ip, #28]
87f4: e1a00004 mov r0, r4
87f8: ebffffab bl 86ac <_ZN11gpu2dCanvas15initFrameBufferEv>
87fc: e5d42001 ldrb r2, [r4, #1]
8800: e2221001 eor r1, r2, #1
8804: e5c41001 strb r1, [r4, #1]
8808: e8bd4010 pop {r4, lr}
880c: e12fff1e bx lr
00008810 <_ZN11gpu2dCanvas5ClearEj>:
8810: e5d03000 ldrb r3, [r0]
8814: e3530000 cmp r3, #0
8818: e92d05f0 push {r4, r5, r6, r7, r8, sl}
881c: 0a000029 beq 88c8 <_ZN11gpu2dCanvas5ClearEj+0xb8>
8820: e5d05001 ldrb r5, [r0, #1]
8824: e3550000 cmp r5, #0
8828: 0a000028 beq 88d0 <_ZN11gpu2dCanvas5ClearEj+0xc0>
882c: e5903004 ldr r3, [r0, #4]
8830: e5932004 ldr r2, [r3, #4]
8834: e3a0a000 mov sl, #0
8838: e20178ff and r7, r1, #16711680 ; 0xff0000
883c: e2016cff and r6, r1, #65280 ; 0xff00
8840: e3520000 cmp r2, #0
8844: e1a05827 lsr r5, r7, #16
8848: e1a06426 lsr r6, r6, #8
884c: e20170ff and r7, r1, #255 ; 0xff
8850: 13a08000 movne r8, #0
8854: 0a00001b beq 88c8 <_ZN11gpu2dCanvas5ClearEj+0xb8>
8858: e5932000 ldr r2, [r3]
885c: e3520000 cmp r2, #0
8860: 13a01000 movne r1, #0
8864: 1088400a addne r4, r8, sl
8868: 11a0c001 movne ip, r1
886c: 0a000011 beq 88b8 <_ZN11gpu2dCanvas5ClearEj+0xa8>
8870: e5932010 ldr r2, [r3, #16]
8874: e0221294 mla r2, r4, r2, r1
8878: e5933020 ldr r3, [r3, #32]
887c: e7c25003 strb r5, [r2, r3]
8880: e5903004 ldr r3, [r0, #4]
8884: e5933020 ldr r3, [r3, #32]
8888: e0823003 add r3, r2, r3
888c: e5c36001 strb r6, [r3, #1]
8890: e5903004 ldr r3, [r0, #4]
8894: e5933020 ldr r3, [r3, #32]
8898: e0823003 add r3, r2, r3
889c: e5c37002 strb r7, [r3, #2]
88a0: e5903004 ldr r3, [r0, #4]
88a4: e5932000 ldr r2, [r3]
88a8: e28cc001 add ip, ip, #1
88ac: e152000c cmp r2, ip
88b0: e2811003 add r1, r1, #3
88b4: 8affffed bhi 8870 <_ZN11gpu2dCanvas5ClearEj+0x60>
88b8: e5932004 ldr r2, [r3, #4]
88bc: e2888001 add r8, r8, #1
88c0: e1520008 cmp r2, r8
88c4: 8affffe3 bhi 8858 <_ZN11gpu2dCanvas5ClearEj+0x48>
88c8: e8bd05f0 pop {r4, r5, r6, r7, r8, sl}
88cc: e12fff1e bx lr
88d0: e5d0a002 ldrb sl, [r0, #2]
88d4: e5903004 ldr r3, [r0, #4]
88d8: e35a0000 cmp sl, #0
88dc: 1593a004 ldrne sl, [r3, #4]
88e0: 05932004 ldreq r2, [r3, #4]
88e4: 11a0200a movne r2, sl
88e8: eaffffd2 b 8838 <_ZN11gpu2dCanvas5ClearEj+0x28>
000088ec <_ZN11gpu2dCanvas4syncEv>:
88ec: e5d03002 ldrb r3, [r0, #2]
88f0: e3530000 cmp r3, #0
88f4: e92d00f0 push {r4, r5, r6, r7}
88f8: 0a000021 beq 8984 <_ZN11gpu2dCanvas4syncEv+0x98>
88fc: e5903004 ldr r3, [r0, #4]
8900: e5935004 ldr r5, [r3, #4]
8904: e3550000 cmp r5, #0
8908: e5d06001 ldrb r6, [r0, #1]
890c: 13a04000 movne r4, #0
8910: 0a00001b beq 8984 <_ZN11gpu2dCanvas4syncEv+0x98>
8914: e5932000 ldr r2, [r3]
8918: e3520000 cmp r2, #0
891c: 13a02000 movne r2, #0
8920: 11a01002 movne r1, r2
8924: 1a000001 bne 8930 <_ZN11gpu2dCanvas4syncEv+0x44>
8928: ea000012 b 8978 <_ZN11gpu2dCanvas4syncEv+0x8c>
892c: e5935004 ldr r5, [r3, #4]
8930: e593c020 ldr ip, [r3, #32]
8934: e5933010 ldr r3, [r3, #16]
8938: e0855004 add r5, r5, r4
893c: e082700c add r7, r2, ip
8940: e02cc493 mla ip, r3, r4, ip
8944: e0030395 mul r3, r5, r3
8948: e3560000 cmp r6, #0
894c: 17d2c00c ldrbne ip, [r2, ip]
8950: 07d73003 ldrbeq r3, [r7, r3]
8954: 17c7c003 strbne ip, [r7, r3]
8958: 07c2300c strbeq r3, [r2, ip]
895c: e5903004 ldr r3, [r0, #4]
8960: e593c000 ldr ip, [r3]
8964: e2811001 add r1, r1, #1
8968: e15c0001 cmp ip, r1
896c: e2822003 add r2, r2, #3
8970: 8affffed bhi 892c <_ZN11gpu2dCanvas4syncEv+0x40>
8974: e5935004 ldr r5, [r3, #4]
8978: e2844001 add r4, r4, #1
897c: e1540005 cmp r4, r5
8980: 3affffe3 bcc 8914 <_ZN11gpu2dCanvas4syncEv+0x28>
8984: e8bd00f0 pop {r4, r5, r6, r7}
8988: e12fff1e bx lr
0000898c <_ZN11gpu2dCanvas8setPixelEjjj>:
898c: e5d0c001 ldrb ip, [r0, #1]
8990: e35c0000 cmp ip, #0
8994: e92d0030 push {r4, r5}
8998: 1a000015 bne 89f4 <_ZN11gpu2dCanvas8setPixelEjjj+0x68>
899c: e5d05002 ldrb r5, [r0, #2]
89a0: e590c004 ldr ip, [r0, #4]
89a4: e3550000 cmp r5, #0
89a8: 159c5004 ldrne r5, [ip, #4]
89ac: e59c4010 ldr r4, [ip, #16]
89b0: e0852002 add r2, r5, r2
89b4: e0811081 add r1, r1, r1, lsl #1
89b8: e0211294 mla r1, r4, r2, r1
89bc: e59c2020 ldr r2, [ip, #32]
89c0: e1a0c823 lsr ip, r3, #16
89c4: e7c1c002 strb ip, [r1, r2]
89c8: e590c004 ldr ip, [r0, #4]
89cc: e59c2020 ldr r2, [ip, #32]
89d0: e1a0c423 lsr ip, r3, #8
89d4: e0812002 add r2, r1, r2
89d8: e5c2c001 strb ip, [r2, #1]
89dc: e5900004 ldr r0, [r0, #4]
89e0: e5902020 ldr r2, [r0, #32]
89e4: e0811002 add r1, r1, r2
89e8: e5c13002 strb r3, [r1, #2]
89ec: e8bd0030 pop {r4, r5}
89f0: e12fff1e bx lr
89f4: e590c004 ldr ip, [r0, #4]
89f8: e3a05000 mov r5, #0
89fc: eaffffea b 89ac <_ZN11gpu2dCanvas8setPixelEjjj+0x20>
00008a00 <_ZN11gpu2dCanvas8DrawLineEiiiij>:
8a00: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
8a04: e1530001 cmp r3, r1
8a08: e24dd00c sub sp, sp, #12
8a0c: e1a05001 mov r5, r1
8a10: e1a0a003 mov sl, r3
8a14: e1a07000 mov r7, r0
8a18: e1a04002 mov r4, r2
8a1c: e59d8034 ldr r8, [sp, #52] ; 0x34
8a20: da000039 ble 8b0c <_ZN11gpu2dCanvas8DrawLineEiiiij+0x10c>
8a24: e59d6030 ldr r6, [sp, #48] ; 0x30
8a28: e062c006 rsb ip, r2, r6
8a2c: e0613003 rsb r3, r1, r3
8a30: e1a0b08c lsl fp, ip, #1
8a34: e1e0e001 mvn lr, r1
8a38: e063900c rsb r9, r3, ip
8a3c: e063600b rsb r6, r3, fp
8a40: e08e300a add r3, lr, sl
8a44: e203c001 and ip, r3, #1
8a48: e3560000 cmp r6, #0
8a4c: e1a09089 lsl r9, r9, #1
8a50: e58dc004 str ip, [sp, #4]
8a54: da00003d ble 8b50 <_ZN11gpu2dCanvas8DrawLineEiiiij+0x150>
8a58: e2824001 add r4, r2, #1
8a5c: e1a02004 mov r2, r4
8a60: e1a03008 mov r3, r8
8a64: ebffffc8 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8a68: e0866009 add r6, r6, r9
8a6c: e2855001 add r5, r5, #1
8a70: e15a0005 cmp sl, r5
8a74: da000024 ble 8b0c <_ZN11gpu2dCanvas8DrawLineEiiiij+0x10c>
8a78: e59d0004 ldr r0, [sp, #4]
8a7c: e3500000 cmp r0, #0
8a80: 0a00000b beq 8ab4 <_ZN11gpu2dCanvas8DrawLineEiiiij+0xb4>
8a84: e3560000 cmp r6, #0
8a88: da000022 ble 8b18 <_ZN11gpu2dCanvas8DrawLineEiiiij+0x118>
8a8c: e2844001 add r4, r4, #1
8a90: e1a00007 mov r0, r7
8a94: e1a01005 mov r1, r5
8a98: e1a02004 mov r2, r4
8a9c: e1a03008 mov r3, r8
8aa0: ebffffb9 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8aa4: e0866009 add r6, r6, r9
8aa8: e2855001 add r5, r5, #1
8aac: e15a0005 cmp sl, r5
8ab0: da000015 ble 8b0c <_ZN11gpu2dCanvas8DrawLineEiiiij+0x10c>
8ab4: e3560000 cmp r6, #0
8ab8: da00001d ble 8b34 <_ZN11gpu2dCanvas8DrawLineEiiiij+0x134>
8abc: e2844001 add r4, r4, #1
8ac0: e1a00007 mov r0, r7
8ac4: e1a01005 mov r1, r5
8ac8: e1a02004 mov r2, r4
8acc: e1a03008 mov r3, r8
8ad0: ebffffad bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8ad4: e0866009 add r6, r6, r9
8ad8: e2855001 add r5, r5, #1
8adc: e3560000 cmp r6, #0
8ae0: e1a00007 mov r0, r7
8ae4: e1a03008 mov r3, r8
8ae8: e1a01005 mov r1, r5
8aec: da000009 ble 8b18 <_ZN11gpu2dCanvas8DrawLineEiiiij+0x118>
8af0: e2844001 add r4, r4, #1
8af4: e1a02004 mov r2, r4
8af8: e2855001 add r5, r5, #1
8afc: ebffffa2 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8b00: e15a0005 cmp sl, r5
8b04: e0866009 add r6, r6, r9
8b08: caffffe9 bgt 8ab4 <_ZN11gpu2dCanvas8DrawLineEiiiij+0xb4>
8b0c: e28dd00c add sp, sp, #12
8b10: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
8b14: e12fff1e bx lr
8b18: e1a00007 mov r0, r7
8b1c: e1a01005 mov r1, r5
8b20: e1a02004 mov r2, r4
8b24: e1a03008 mov r3, r8
8b28: ebffff97 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8b2c: e086600b add r6, r6, fp
8b30: eaffffdc b 8aa8 <_ZN11gpu2dCanvas8DrawLineEiiiij+0xa8>
8b34: e1a01005 mov r1, r5
8b38: e1a02004 mov r2, r4
8b3c: e1a00007 mov r0, r7
8b40: e1a03008 mov r3, r8
8b44: ebffff90 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8b48: e086600b add r6, r6, fp
8b4c: eaffffe1 b 8ad8 <_ZN11gpu2dCanvas8DrawLineEiiiij+0xd8>
8b50: e1a03008 mov r3, r8
8b54: ebffff8c bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8b58: e086600b add r6, r6, fp
8b5c: eaffffc2 b 8a6c <_ZN11gpu2dCanvas8DrawLineEiiiij+0x6c>
00008b60 <_ZN11gpu2dCanvas13DrawCharacterEiicj>:
8b60: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
8b64: e1a04203 lsl r4, r3, #4
8b68: e24dd054 sub sp, sp, #84 ; 0x54
8b6c: e284b007 add fp, r4, #7
8b70: e58db03c str fp, [sp, #60] ; 0x3c
8b74: e284b008 add fp, r4, #8
8b78: e58db004 str fp, [sp, #4]
8b7c: e284b009 add fp, r4, #9
8b80: e58db008 str fp, [sp, #8]
8b84: e284b00a add fp, r4, #10
8b88: e58db00c str fp, [sp, #12]
8b8c: e284b00b add fp, r4, #11
8b90: e58db010 str fp, [sp, #16]
8b94: e284b00c add fp, r4, #12
8b98: e58db014 str fp, [sp, #20]
8b9c: e284b00d add fp, r4, #13
8ba0: e58db018 str fp, [sp, #24]
8ba4: e2847001 add r7, r4, #1
8ba8: e2846002 add r6, r4, #2
8bac: e2845003 add r5, r4, #3
8bb0: e2848004 add r8, r4, #4
8bb4: e284a005 add sl, r4, #5
8bb8: e2849006 add r9, r4, #6
8bbc: e284b00e add fp, r4, #14
8bc0: e284400f add r4, r4, #15
8bc4: e58db01c str fp, [sp, #28]
8bc8: e58d4000 str r4, [sp]
8bcc: e59fc248 ldr ip, [pc, #584] ; 8e1c <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x2bc>
8bd0: e7dc3203 ldrb r3, [ip, r3, lsl #4]
8bd4: e58d3020 str r3, [sp, #32]
8bd8: e7dcb007 ldrb fp, [ip, r7]
8bdc: e58db024 str fp, [sp, #36] ; 0x24
8be0: e7dc4006 ldrb r4, [ip, r6]
8be4: e58d4028 str r4, [sp, #40] ; 0x28
8be8: e7dc3005 ldrb r3, [ip, r5]
8bec: e58d302c str r3, [sp, #44] ; 0x2c
8bf0: e7dc6008 ldrb r6, [ip, r8]
8bf4: e58d6030 str r6, [sp, #48] ; 0x30
8bf8: e7dc700a ldrb r7, [ip, sl]
8bfc: e58d7034 str r7, [sp, #52] ; 0x34
8c00: e7dca009 ldrb sl, [ip, r9]
8c04: e59d803c ldr r8, [sp, #60] ; 0x3c
8c08: e58da038 str sl, [sp, #56] ; 0x38
8c0c: e7dcb008 ldrb fp, [ip, r8]
8c10: e59d5004 ldr r5, [sp, #4]
8c14: e58db03c str fp, [sp, #60] ; 0x3c
8c18: e59d4008 ldr r4, [sp, #8]
8c1c: e28d300c add r3, sp, #12
8c20: e89302c8 ldm r3, {r3, r6, r7, r9}
8c24: e59da01c ldr sl, [sp, #28]
8c28: e7dcb005 ldrb fp, [ip, r5]
8c2c: e59d8000 ldr r8, [sp]
8c30: e7dc5004 ldrb r5, [ip, r4]
8c34: e7dc4003 ldrb r4, [ip, r3]
8c38: e7dc3006 ldrb r3, [ip, r6]
8c3c: e7dc6007 ldrb r6, [ip, r7]
8c40: e7dc7009 ldrb r7, [ip, r9]
8c44: e7dc900a ldrb r9, [ip, sl]
8c48: e1a0a001 mov sl, r1
8c4c: e59d1020 ldr r1, [sp, #32]
8c50: e7dcc008 ldrb ip, [ip, r8]
8c54: e59d8078 ldr r8, [sp, #120] ; 0x78
8c58: e5cd1040 strb r1, [sp, #64] ; 0x40
8c5c: e59d1024 ldr r1, [sp, #36] ; 0x24
8c60: e5cd1041 strb r1, [sp, #65] ; 0x41
8c64: e59d1028 ldr r1, [sp, #40] ; 0x28
8c68: e5cd1042 strb r1, [sp, #66] ; 0x42
8c6c: e59d102c ldr r1, [sp, #44] ; 0x2c
8c70: e5cd1043 strb r1, [sp, #67] ; 0x43
8c74: e59d1030 ldr r1, [sp, #48] ; 0x30
8c78: e5cd1044 strb r1, [sp, #68] ; 0x44
8c7c: e59d1034 ldr r1, [sp, #52] ; 0x34
8c80: e5cd1045 strb r1, [sp, #69] ; 0x45
8c84: e59d1038 ldr r1, [sp, #56] ; 0x38
8c88: e5cd1046 strb r1, [sp, #70] ; 0x46
8c8c: e59d103c ldr r1, [sp, #60] ; 0x3c
8c90: e5cd304b strb r3, [sp, #75] ; 0x4b
8c94: e5cd1047 strb r1, [sp, #71] ; 0x47
8c98: e5cd704d strb r7, [sp, #77] ; 0x4d
8c9c: e28a1002 add r1, sl, #2
8ca0: e1a07000 mov r7, r0
8ca4: e28a3003 add r3, sl, #3
8ca8: e28d0040 add r0, sp, #64 ; 0x40
8cac: e5cdb048 strb fp, [sp, #72] ; 0x48
8cb0: e5cd5049 strb r5, [sp, #73] ; 0x49
8cb4: e5cd604c strb r6, [sp, #76] ; 0x4c
8cb8: e5cd904e strb r9, [sp, #78] ; 0x4e
8cbc: e5cd404a strb r4, [sp, #74] ; 0x4a
8cc0: e5cdc04f strb ip, [sp, #79] ; 0x4f
8cc4: e2406001 sub r6, r0, #1
8cc8: e1a05002 mov r5, r2
8ccc: e280900f add r9, r0, #15
8cd0: e28ab001 add fp, sl, #1
8cd4: e88d000a stm sp, {r1, r3}
8cd8: ea000010 b 8d20 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1c0>
8cdc: e3140002 tst r4, #2
8ce0: 1a000018 bne 8d48 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1e8>
8ce4: e3140004 tst r4, #4
8ce8: 1a00001d bne 8d64 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x204>
8cec: e3140008 tst r4, #8
8cf0: 1a000022 bne 8d80 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x220>
8cf4: e3140010 tst r4, #16
8cf8: 1a000027 bne 8d9c <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x23c>
8cfc: e3140020 tst r4, #32
8d00: 1a00002c bne 8db8 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x258>
8d04: e3140040 tst r4, #64 ; 0x40
8d08: 1a000031 bne 8dd4 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x274>
8d0c: e1b043a4 lsrs r4, r4, #7
8d10: 1a000036 bne 8df0 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x290>
8d14: e1560009 cmp r6, r9
8d18: e2855001 add r5, r5, #1
8d1c: 0a00003b beq 8e10 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x2b0>
8d20: e5f64001 ldrb r4, [r6, #1]!
8d24: e3140001 tst r4, #1
8d28: 0affffeb beq 8cdc <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x17c>
8d2c: e1a00007 mov r0, r7
8d30: e1a0100a mov r1, sl
8d34: e1a02005 mov r2, r5
8d38: e1a03008 mov r3, r8
8d3c: ebffff12 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8d40: e3140002 tst r4, #2
8d44: 0affffe6 beq 8ce4 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x184>
8d48: e1a00007 mov r0, r7
8d4c: e1a0100b mov r1, fp
8d50: e1a02005 mov r2, r5
8d54: e1a03008 mov r3, r8
8d58: ebffff0b bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8d5c: e3140004 tst r4, #4
8d60: 0affffe1 beq 8cec <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x18c>
8d64: e1a00007 mov r0, r7
8d68: e59d1000 ldr r1, [sp]
8d6c: e1a02005 mov r2, r5
8d70: e1a03008 mov r3, r8
8d74: ebffff04 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8d78: e3140008 tst r4, #8
8d7c: 0affffdc beq 8cf4 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x194>
8d80: e1a00007 mov r0, r7
8d84: e59d1004 ldr r1, [sp, #4]
8d88: e1a02005 mov r2, r5
8d8c: e1a03008 mov r3, r8
8d90: ebfffefd bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8d94: e3140010 tst r4, #16
8d98: 0affffd7 beq 8cfc <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x19c>
8d9c: e1a00007 mov r0, r7
8da0: e28a1004 add r1, sl, #4
8da4: e1a02005 mov r2, r5
8da8: e1a03008 mov r3, r8
8dac: ebfffef6 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8db0: e3140020 tst r4, #32
8db4: 0affffd2 beq 8d04 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1a4>
8db8: e1a00007 mov r0, r7
8dbc: e28a1005 add r1, sl, #5
8dc0: e1a02005 mov r2, r5
8dc4: e1a03008 mov r3, r8
8dc8: ebfffeef bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8dcc: e3140040 tst r4, #64 ; 0x40
8dd0: 0affffcd beq 8d0c <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1ac>
8dd4: e1a00007 mov r0, r7
8dd8: e28a1006 add r1, sl, #6
8ddc: e1a02005 mov r2, r5
8de0: e1a03008 mov r3, r8
8de4: ebfffee8 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8de8: e1b043a4 lsrs r4, r4, #7
8dec: 0affffc8 beq 8d14 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1b4>
8df0: e1a02005 mov r2, r5
8df4: e1a00007 mov r0, r7
8df8: e28a1007 add r1, sl, #7
8dfc: e1a03008 mov r3, r8
8e00: ebfffee1 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8e04: e1560009 cmp r6, r9
8e08: e2855001 add r5, r5, #1
8e0c: 1affffc3 bne 8d20 <_ZN11gpu2dCanvas13DrawCharacterEiicj+0x1c0>
8e10: e28dd054 add sp, sp, #84 ; 0x54
8e14: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
8e18: e12fff1e bx lr
8e1c: 0000951c andeq r9, r0, ip, lsl r5
00008e20 <_ZN11gpu2dCanvas14ClearCharacterEii>:
8e20: e92d4ff8 push {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
8e24: e3a08000 mov r8, #0
8e28: e1a06000 mov r6, r0
8e2c: e1a09001 mov r9, r1
8e30: e1a0b002 mov fp, r2
8e34: e1a07008 mov r7, r8
8e38: e1a04807 lsl r4, r7, #16
8e3c: e1a04844 asr r4, r4, #16
8e40: e3540007 cmp r4, #7
8e44: ca000027 bgt 8ee8 <_ZN11gpu2dCanvas14ClearCharacterEii+0xc8>
8e48: e0844009 add r4, r4, r9
8e4c: e088500b add r5, r8, fp
8e50: e1a01004 mov r1, r4
8e54: e1a02005 mov r2, r5
8e58: e1a00006 mov r0, r6
8e5c: e3a03000 mov r3, #0
8e60: ebfffec9 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8e64: e2872001 add r2, r7, #1
8e68: e1a01802 lsl r1, r2, #16
8e6c: e267a007 rsb sl, r7, #7
8e70: e3510807 cmp r1, #458752 ; 0x70000
8e74: e20aa001 and sl, sl, #1
8e78: e2844001 add r4, r4, #1
8e7c: e1a07821 lsr r7, r1, #16
8e80: ca000017 bgt 8ee4 <_ZN11gpu2dCanvas14ClearCharacterEii+0xc4>
8e84: e35a0000 cmp sl, #0
8e88: 11a01004 movne r1, r4
8e8c: 11a00006 movne r0, r6
8e90: 1a00000a bne 8ec0 <_ZN11gpu2dCanvas14ClearCharacterEii+0xa0>
8e94: e1a01004 mov r1, r4
8e98: e1a00006 mov r0, r6
8e9c: e1a02005 mov r2, r5
8ea0: e3a03000 mov r3, #0
8ea4: ebfffeb8 bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8ea8: e2870001 add r0, r7, #1
8eac: e1a07800 lsl r7, r0, #16
8eb0: e2844001 add r4, r4, #1
8eb4: e1a07827 lsr r7, r7, #16
8eb8: e1a00006 mov r0, r6
8ebc: e1a01004 mov r1, r4
8ec0: e3a03000 mov r3, #0
8ec4: e1a02005 mov r2, r5
8ec8: ebfffeaf bl 898c <_ZN11gpu2dCanvas8setPixelEjjj>
8ecc: e287c001 add ip, r7, #1
8ed0: e1a0380c lsl r3, ip, #16
8ed4: e3530807 cmp r3, #458752 ; 0x70000
8ed8: e2844001 add r4, r4, #1
8edc: e1a07823 lsr r7, r3, #16
8ee0: daffffeb ble 8e94 <_ZN11gpu2dCanvas14ClearCharacterEii+0x74>
8ee4: e3a07008 mov r7, #8
8ee8: e2888001 add r8, r8, #1
8eec: e3580010 cmp r8, #16
8ef0: 1affffd0 bne 8e38 <_ZN11gpu2dCanvas14ClearCharacterEii+0x18>
8ef4: e8bd4ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
8ef8: e12fff1e bx lr
00008efc <_ZN7Console5clearEv>:
8efc: e92d4010 push {r4, lr}
8f00: e3a01000 mov r1, #0
8f04: e1a04000 mov r4, r0
8f08: e3a03001 mov r3, #1
8f0c: e590000c ldr r0, [r0, #12]
8f10: e884000a stm r4, {r1, r3}
8f14: ebfffe3d bl 8810 <_ZN11gpu2dCanvas5ClearEj>
8f18: e594000c ldr r0, [r4, #12]
8f1c: e8bd4010 pop {r4, lr}
8f20: eafffe25 b 87bc <_ZN11gpu2dCanvas4DrawEv>
00008f24 <_ZN7Console7newLineEv>:
8f24: e590c004 ldr ip, [r0, #4]
8f28: e28c1001 add r1, ip, #1
8f2c: e3a02000 mov r2, #0
8f30: e351002d cmp r1, #45 ; 0x2d
8f34: e5801004 str r1, [r0, #4]
8f38: e5802000 str r2, [r0]
8f3c: 912fff1e bxls lr
8f40: eaffffed b 8efc <_ZN7Console5clearEv>
00008f44 <_ZN7Console9printCharEcj>:
8f44: e92d4070 push {r4, r5, r6, lr}
8f48: e3510009 cmp r1, #9
8f4c: e24dd008 sub sp, sp, #8
8f50: e1a06001 mov r6, r1
8f54: e1a04000 mov r4, r0
8f58: e1a05002 mov r5, r2
8f5c: 0a00002a beq 900c <_ZN7Console9printCharEcj+0xc8>
8f60: e351000a cmp r1, #10
8f64: 0a000025 beq 9000 <_ZN7Console9printCharEcj+0xbc>
8f68: e3510008 cmp r1, #8
8f6c: 0a000015 beq 8fc8 <_ZN7Console9printCharEcj+0x84>
8f70: e590c000 ldr ip, [r0]
8f74: e35c0078 cmp ip, #120 ; 0x78
8f78: 8a00002c bhi 9030 <_ZN7Console9printCharEcj+0xec>
8f7c: e5943004 ldr r3, [r4, #4]
8f80: e353002d cmp r3, #45 ; 0x2d
8f84: 8a000025 bhi 9020 <_ZN7Console9printCharEcj+0xdc>
8f88: e594e008 ldr lr, [r4, #8]
8f8c: e5941000 ldr r1, [r4]
8f90: e08e2203 add r2, lr, r3, lsl #4
8f94: e594000c ldr r0, [r4, #12]
8f98: e1a03006 mov r3, r6
8f9c: e08e1181 add r1, lr, r1, lsl #3
8fa0: e58d5000 str r5, [sp]
8fa4: ebfffeed bl 8b60 <_ZN11gpu2dCanvas13DrawCharacterEiicj>
8fa8: e594000c ldr r0, [r4, #12]
8fac: ebfffe02 bl 87bc <_ZN11gpu2dCanvas4DrawEv>
8fb0: e5942000 ldr r2, [r4]
8fb4: e2823001 add r3, r2, #1
8fb8: e5843000 str r3, [r4]
8fbc: e28dd008 add sp, sp, #8
8fc0: e8bd4070 pop {r4, r5, r6, lr}
8fc4: e12fff1e bx lr
8fc8: e5901000 ldr r1, [r0]
8fcc: e3510000 cmp r1, #0
8fd0: 0afffff9 beq 8fbc <_ZN7Console9printCharEcj+0x78>
8fd4: e990000c ldmib r0, {r2, r3}
8fd8: e2411001 sub r1, r1, #1
8fdc: e5841000 str r1, [r4]
8fe0: e590000c ldr r0, [r0, #12]
8fe4: e0831181 add r1, r3, r1, lsl #3
8fe8: e0832202 add r2, r3, r2, lsl #4
8fec: ebffff8b bl 8e20 <_ZN11gpu2dCanvas14ClearCharacterEii>
8ff0: e594000c ldr r0, [r4, #12]
8ff4: e28dd008 add sp, sp, #8
8ff8: e8bd4070 pop {r4, r5, r6, lr}
8ffc: eafffdee b 87bc <_ZN11gpu2dCanvas4DrawEv>
9000: e28dd008 add sp, sp, #8
9004: e8bd4070 pop {r4, r5, r6, lr}
9008: eaffffc5 b 8f24 <_ZN7Console7newLineEv>
900c: e5900000 ldr r0, [r0]
9010: e2803004 add r3, r0, #4
9014: e3530077 cmp r3, #119 ; 0x77
9018: 95843000 strls r3, [r4]
901c: eaffffe6 b 8fbc <_ZN7Console9printCharEcj+0x78>
9020: e1a00004 mov r0, r4
9024: e28dd008 add sp, sp, #8
9028: e8bd4070 pop {r4, r5, r6, lr}
902c: eaffffb2 b 8efc <_ZN7Console5clearEv>
9030: ebffffbb bl 8f24 <_ZN7Console7newLineEv>
9034: eaffffd0 b 8f7c <_ZN7Console9printCharEcj+0x38>
00009038 <_ZN7Console6kprintEPc>:
9038: e92d4038 push {r3, r4, r5, lr}
903c: e1a04001 mov r4, r1
9040: e5d11000 ldrb r1, [r1]
9044: e3510000 cmp r1, #0
9048: e1a05000 mov r5, r0
904c: 0a000005 beq 9068 <_ZN7Console6kprintEPc+0x30>
9050: e1a00005 mov r0, r5
9054: e3e024ff mvn r2, #-16777216 ; 0xff000000
9058: ebffffb9 bl 8f44 <_ZN7Console9printCharEcj>
905c: e5f41001 ldrb r1, [r4, #1]!
9060: e3510000 cmp r1, #0
9064: 1afffff9 bne 9050 <_ZN7Console6kprintEPc+0x18>
9068: e8bd4038 pop {r3, r4, r5, lr}
906c: e12fff1e bx lr
00009070 <_ZN7Console6kprintEPKc>:
9070: eafffff0 b 9038 <_ZN7Console6kprintEPc>
00009074 <_ZN7Console4koutEPKc>:
9074: e92d4070 push {r4, r5, r6, lr}
9078: e59f4040 ldr r4, [pc, #64] ; 90c0 <_ZN7Console4koutEPKc+0x4c>
907c: e1a06001 mov r6, r1
9080: e1a05000 mov r5, r0
9084: e3a0105b mov r1, #91 ; 0x5b
9088: e1a00005 mov r0, r5
908c: e3a028ff mov r2, #16711680 ; 0xff0000
9090: ebffffab bl 8f44 <_ZN7Console9printCharEcj>
9094: e5f41001 ldrb r1, [r4, #1]!
9098: e3510000 cmp r1, #0
909c: 1afffff9 bne 9088 <_ZN7Console4koutEPKc+0x14>
90a0: e1a01006 mov r1, r6
90a4: e1a00005 mov r0, r5
90a8: ebffffe2 bl 9038 <_ZN7Console6kprintEPc>
90ac: e1a00005 mov r0, r5
90b0: e3a0100a mov r1, #10
90b4: e3a028ff mov r2, #16711680 ; 0xff0000
90b8: e8bd4070 pop {r4, r5, r6, lr}
90bc: eaffffa0 b 8f44 <_ZN7Console9printCharEcj>
90c0: 00009f58 andeq r9, r0, r8, asr pc
000090c4 <irq_handler>:
90c4: e92d4008 push {r3, lr}
90c8: e59f303c ldr r3, [pc, #60] ; 910c <irq_handler+0x48>
90cc: e5d32004 ldrb r2, [r3, #4]
90d0: e3520000 cmp r2, #0
90d4: 1a000008 bne 90fc <irq_handler+0x38>
90d8: e59f2030 ldr r2, [pc, #48] ; 9110 <irq_handler+0x4c>
90dc: e5920004 ldr r0, [r2, #4]
90e0: e2801b4e add r1, r0, #79872 ; 0x13800
90e4: e2811080 add r1, r1, #128 ; 0x80
90e8: e5923004 ldr r3, [r2, #4]
90ec: e1510003 cmp r1, r3
90f0: 8afffffc bhi 90e8 <irq_handler+0x24>
90f4: e8bd4008 pop {r3, lr}
90f8: e12fff1e bx lr
90fc: e5930008 ldr r0, [r3, #8]
9100: e59f100c ldr r1, [pc, #12] ; 9114 <irq_handler+0x50>
9104: ebffffda bl 9074 <_ZN7Console4koutEPKc>
9108: eafffff2 b 90d8 <irq_handler+0x14>
910c: 00009d24 andeq r9, r0, r4, lsr #26
9110: 20003000 andcs r3, r0, r0
9114: 00009f60 andeq r9, r0, r0, ror #30
00009118 <_ZN7ConsoleC1EP11gpu2dCanvas>:
9118: e3a02000 mov r2, #0
911c: e3a0300a mov r3, #10
9120: e92d4010 push {r4, lr}
9124: e1a04000 mov r4, r0
9128: e5802000 str r2, [r0]
912c: e980000c stmib r0, {r2, r3}
9130: e580100c str r1, [r0, #12]
9134: ebffff70 bl 8efc <_ZN7Console5clearEv>
9138: e1a00004 mov r0, r4
913c: e8bd4010 pop {r4, lr}
9140: e12fff1e bx lr
00009144 <_Z12print_headerP7Console>:
9144: e92d4010 push {r4, lr}
9148: e59f102c ldr r1, [pc, #44] ; 917c <_Z12print_headerP7Console+0x38>
914c: e1a04000 mov r4, r0
9150: ebffffb8 bl 9038 <_ZN7Console6kprintEPc>
9154: e1a00004 mov r0, r4
9158: e59f1020 ldr r1, [pc, #32] ; 9180 <_Z12print_headerP7Console+0x3c>
915c: ebffffb5 bl 9038 <_ZN7Console6kprintEPc>
9160: e1a00004 mov r0, r4
9164: e59f1018 ldr r1, [pc, #24] ; 9184 <_Z12print_headerP7Console+0x40>
9168: ebffffb2 bl 9038 <_ZN7Console6kprintEPc>
916c: e59f1014 ldr r1, [pc, #20] ; 9188 <_Z12print_headerP7Console+0x44>
9170: e1a00004 mov r0, r4
9174: e8bd4010 pop {r4, lr}
9178: eaffffae b 9038 <_ZN7Console6kprintEPc>
917c: 00009f6c andeq r9, r0, ip, ror #30
9180: 00009fb0 ; <UNDEFINED> instruction: 0x00009fb0
9184: 00009fb8 ; <UNDEFINED> instruction: 0x00009fb8
9188: 00009fc0 andeq r9, r0, r0, asr #31
0000918c <kmain>:
918c: e92d40f0 push {r4, r5, r6, r7, lr}
9190: e24dd01c sub sp, sp, #28
9194: e28d4010 add r4, sp, #16
9198: e3a01000 mov r1, #0
919c: e1a00004 mov r0, r4
91a0: ebfffd5b bl 8714 <_ZN11gpu2dCanvasC1Eb>
91a4: e59f715c ldr r7, [pc, #348] ; 9308 <kmain+0x17c>
91a8: e3a0200a mov r2, #10
91ac: e3a05000 mov r5, #0
91b0: e1a0000d mov r0, sp
91b4: e58d2008 str r2, [sp, #8]
91b8: e58d400c str r4, [sp, #12]
91bc: e58d5000 str r5, [sp]
91c0: e58d5004 str r5, [sp, #4]
91c4: ebffff4c bl 8efc <_ZN7Console5clearEv>
91c8: e28d1000 add r1, sp, #0
91cc: e3a03001 mov r3, #1
91d0: e1a0000d mov r0, sp
91d4: e5871008 str r1, [r7, #8]
91d8: e5c73004 strb r3, [r7, #4]
91dc: ebffffd8 bl 9144 <_Z12print_headerP7Console>
91e0: e1a0000d mov r0, sp
91e4: e59f1120 ldr r1, [pc, #288] ; 930c <kmain+0x180>
91e8: ebffff92 bl 9038 <_ZN7Console6kprintEPc>
91ec: e59f411c ldr r4, [pc, #284] ; 9310 <kmain+0x184>
91f0: e3a06012 mov r6, #18
91f4: e1a0000d mov r0, sp
91f8: e59f1114 ldr r1, [pc, #276] ; 9314 <kmain+0x188>
91fc: ebffff8d bl 9038 <_ZN7Console6kprintEPc>
9200: e594c004 ldr ip, [r4, #4]
9204: e28c0bea add r0, ip, #239616 ; 0x3a800
9208: e2802d06 add r2, r0, #384 ; 0x180
920c: e594e004 ldr lr, [r4, #4]
9210: e152000e cmp r2, lr
9214: e59f50f4 ldr r5, [pc, #244] ; 9310 <kmain+0x184>
9218: 8afffffb bhi 920c <kmain+0x80>
921c: e2566001 subs r6, r6, #1
9220: 1afffff3 bne 91f4 <kmain+0x68>
9224: e1a0000d mov r0, sp
9228: e59f10e8 ldr r1, [pc, #232] ; 9318 <kmain+0x18c>
922c: ebffff81 bl 9038 <_ZN7Console6kprintEPc>
9230: e3a0380f mov r3, #983040 ; 0xf0000
9234: e3a0caff mov ip, #1044480 ; 0xff000
9238: e5873000 str r3, [r7]
923c: e1a0000d mov r0, sp
9240: e59f10d4 ldr r1, [pc, #212] ; 931c <kmain+0x190>
9244: e5c36004 strb r6, [r3, #4]
9248: e583c008 str ip, [r3, #8]
924c: ebffff88 bl 9074 <_ZN7Console4koutEPKc>
9250: e59f00c8 ldr r0, [pc, #200] ; 9320 <kmain+0x194>
9254: e3e02000 mvn r2, #0
9258: e3a040ff mov r4, #255 ; 0xff
925c: e5802840 str r2, [r0, #2112] ; 0x840
9260: e5802850 str r2, [r0, #2128] ; 0x850
9264: e5804860 str r4, [r0, #2144] ; 0x860
9268: e5951004 ldr r1, [r5, #4]
926c: e2813a61 add r3, r1, #397312 ; 0x61000
9270: e2832d2a add r2, r3, #2688 ; 0xa80
9274: e595e004 ldr lr, [r5, #4]
9278: e152000e cmp r2, lr
927c: e59f408c ldr r4, [pc, #140] ; 9310 <kmain+0x184>
9280: 8afffffb bhi 9274 <kmain+0xe8>
9284: e59f1098 ldr r1, [pc, #152] ; 9324 <kmain+0x198>
9288: e1a0000d mov r0, sp
928c: ebffff78 bl 9074 <_ZN7Console4koutEPKc>
9290: e1a0000d mov r0, sp
9294: e59f108c ldr r1, [pc, #140] ; 9328 <kmain+0x19c>
9298: ebffff66 bl 9038 <_ZN7Console6kprintEPc>
929c: e5940004 ldr r0, [r4, #4]
92a0: e280183d add r1, r0, #3997696 ; 0x3d0000
92a4: e2812c09 add r2, r1, #2304 ; 0x900
92a8: e594c004 ldr ip, [r4, #4]
92ac: e152000c cmp r2, ip
92b0: e59f3058 ldr r3, [pc, #88] ; 9310 <kmain+0x184>
92b4: 8afffffb bhi 92a8 <kmain+0x11c>
92b8: ef0000ff svc 0x000000ff
92bc: e593e004 ldr lr, [r3, #4]
92c0: e28e2a61 add r2, lr, #397312 ; 0x61000
92c4: e2821d2a add r1, r2, #2688 ; 0xa80
92c8: e1a02003 mov r2, r3
92cc: e5923004 ldr r3, [r2, #4]
92d0: e1510003 cmp r1, r3
92d4: 8afffffc bhi 92cc <kmain+0x140>
92d8: e1a0000d mov r0, sp
92dc: e59f1048 ldr r1, [pc, #72] ; 932c <kmain+0x1a0>
92e0: ebffff63 bl 9074 <_ZN7Console4koutEPKc>
92e4: e3a01001 mov r1, #1
92e8: e3a00010 mov r0, #16
92ec: ebfffc12 bl 833c <_ZN12RaspberryLib7SetGPIOEjj>
92f0: e1a0000d mov r0, sp
92f4: e59f1034 ldr r1, [pc, #52] ; 9330 <kmain+0x1a4>
92f8: ebffff4e bl 9038 <_ZN7Console6kprintEPc>
92fc: e28dd01c add sp, sp, #28
9300: e8bd40f0 pop {r4, r5, r6, r7, lr}
9304: e12fff1e bx lr
9308: 00009d24 andeq r9, r0, r4, lsr #26
930c: 00009fc4 andeq r9, r0, r4, asr #31
9310: 20003000 andcs r3, r0, r0
9314: 0000a068 andeq sl, r0, r8, rrx
9318: 00009fd0 ldrdeq r9, [r0], -r0
931c: 00009fe0 andeq r9, r0, r0, ror #31
9320: 2000b000 andcs fp, r0, r0
9324: 00009ff8 strdeq r9, [r0], -r8
9328: 0000a014 andeq sl, r0, r4, lsl r0
932c: 0000a038 andeq sl, r0, r8, lsr r0
9330: 0000a050 andeq sl, r0, r0, asr r0
00009334 <_ZN7Console5kbaseElll>:
9334: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
9338: e2524000 subs r4, r2, #0
933c: e24dd02c sub sp, sp, #44 ; 0x2c
9340: e1a0a000 mov sl, r0
9344: e1a07001 mov r7, r1
9348: e1a06003 mov r6, r3
934c: da000053 ble 94a0 <_ZN7Console5kbaseElll+0x16c>
9350: e59f51b4 ldr r5, [pc, #436] ; 950c <_ZN7Console5kbaseElll+0x1d8>
9354: e3510401 cmp r1, #16777216 ; 0x1000000
9358: 21a0b801 lslcs fp, r1, #16
935c: 21a09821 lsrcs r9, r1, #16
9360: 31a09001 movcc r9, r1
9364: e8b5000f ldm r5!, {r0, r1, r2, r3}
9368: e28dc004 add ip, sp, #4
936c: e8ac000f stmia ip!, {r0, r1, r2, r3}
9370: e8950007 ldm r5, {r0, r1, r2}
9374: e1a0300c mov r3, ip
9378: e8a30003 stmia r3!, {r0, r1}
937c: 23a08001 movcs r8, #1
9380: 33a08000 movcc r8, #0
9384: 21a0b82b lsrcs fp, fp, #16
9388: e3580000 cmp r8, #0
938c: e1c320b0 strh r2, [r3]
9390: 1a00004c bne 94c8 <_ZN7Console5kbaseElll+0x194>
9394: e3560000 cmp r6, #0
9398: 0a000045 beq 94b4 <_ZN7Console5kbaseElll+0x180>
939c: e3560000 cmp r6, #0
93a0: ba000040 blt 94a8 <_ZN7Console5kbaseElll+0x174>
93a4: e2466001 sub r6, r6, #1
93a8: e3a09000 mov r9, #0
93ac: e3560000 cmp r6, #0
93b0: d1a05004 movle r5, r4
93b4: da000010 ble 93fc <_ZN7Console5kbaseElll+0xc8>
93b8: e3a03001 mov r3, #1
93bc: e2462001 sub r2, r6, #1
93c0: e1530006 cmp r3, r6
93c4: e0022003 and r2, r2, r3
93c8: e0050494 mul r5, r4, r4
93cc: aa00000a bge 93fc <_ZN7Console5kbaseElll+0xc8>
93d0: e3520000 cmp r2, #0
93d4: 0a000003 beq 93e8 <_ZN7Console5kbaseElll+0xb4>
93d8: e3a03002 mov r3, #2
93dc: e1530006 cmp r3, r6
93e0: e0050594 mul r5, r4, r5
93e4: aa000004 bge 93fc <_ZN7Console5kbaseElll+0xc8>
93e8: e0050594 mul r5, r4, r5
93ec: e2833002 add r3, r3, #2
93f0: e1530006 cmp r3, r6
93f4: e0050594 mul r5, r4, r5
93f8: bafffffa blt 93e8 <_ZN7Console5kbaseElll+0xb4>
93fc: e1540007 cmp r4, r7
9400: a0000794 mulge r0, r4, r7
9404: b1a00007 movlt r0, r7
9408: e1a01005 mov r1, r5
940c: e28d2024 add r2, sp, #36 ; 0x24
9410: e28d3020 add r3, sp, #32
9414: e58d9024 str r9, [sp, #36] ; 0x24
9418: e58d9020 str r9, [sp, #32]
941c: eb000243 bl 9d30 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_>
9420: e59dc020 ldr ip, [sp, #32]
9424: e08c810c add r8, ip, ip, lsl #2
9428: e1a01005 mov r1, r5
942c: e28d2024 add r2, sp, #36 ; 0x24
9430: e28d3020 add r3, sp, #32
9434: e1a00088 lsl r0, r8, #1
9438: e59d8024 ldr r8, [sp, #36] ; 0x24
943c: eb00023b bl 9d30 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_>
9440: e59d1020 ldr r1, [sp, #32]
9444: e0810101 add r0, r1, r1, lsl #2
9448: e28d2024 add r2, sp, #36 ; 0x24
944c: e28d3020 add r3, sp, #32
9450: e1a01005 mov r1, r5
9454: e1a00080 lsl r0, r0, #1
9458: eb000234 bl 9d30 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_>
945c: e1540008 cmp r4, r8
9460: a20830ff andge r3, r8, #255 ; 0xff
9464: a28d2028 addge r2, sp, #40 ; 0x28
9468: a0823003 addge r3, r2, r3
946c: b1a0000a movlt r0, sl
9470: b3a01065 movlt r1, #101 ; 0x65
9474: b3a02cff movlt r2, #65280 ; 0xff00
9478: a1a0000a movge r0, sl
947c: a5531024 ldrbge r1, [r3, #-36] ; 0xffffffdc
9480: a3a028ff movge r2, #16711680 ; 0xff0000
9484: ebfffeae bl 8f44 <_ZN7Console9printCharEcj>
9488: e3560000 cmp r6, #0
948c: ba000005 blt 94a8 <_ZN7Console5kbaseElll+0x174>
9490: e0050598 mul r5, r8, r5
9494: e2466001 sub r6, r6, #1
9498: e0657007 rsb r7, r5, r7
949c: eaffffc2 b 93ac <_ZN7Console5kbaseElll+0x78>
94a0: e59f1068 ldr r1, [pc, #104] ; 9510 <_ZN7Console5kbaseElll+0x1dc>
94a4: ebfffee3 bl 9038 <_ZN7Console6kprintEPc>
94a8: e28dd02c add sp, sp, #44 ; 0x2c
94ac: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
94b0: e12fff1e bx lr
94b4: e1a00007 mov r0, r7
94b8: e1a01004 mov r1, r4
94bc: eb000247 bl 9de0 <_ZN4Math13getDigitCountIlEET_S1_S1_>
94c0: e2406001 sub r6, r0, #1
94c4: eaffffb4 b 939c <_ZN7Console5kbaseElll+0x68>
94c8: e1a01004 mov r1, r4
94cc: e1a00009 mov r0, r9
94d0: eb000242 bl 9de0 <_ZN4Math13getDigitCountIlEET_S1_S1_>
94d4: e1a02004 mov r2, r4
94d8: e2403001 sub r3, r0, #1
94dc: e1a01009 mov r1, r9
94e0: e1a0000a mov r0, sl
94e4: ebffff92 bl 9334 <_ZN7Console5kbaseElll>
94e8: e1a01004 mov r1, r4
94ec: e1a0000b mov r0, fp
94f0: eb00023a bl 9de0 <_ZN4Math13getDigitCountIlEET_S1_S1_>
94f4: e1a0100b mov r1, fp
94f8: e2403001 sub r3, r0, #1
94fc: e1a02004 mov r2, r4
9500: e1a0000a mov r0, sl
9504: ebffff8a bl 9334 <_ZN7Console5kbaseElll>
9508: eaffffe6 b 94a8 <_ZN7Console5kbaseElll+0x174>
950c: 00009e30 andeq r9, r0, r0, lsr lr
9510: 0000a06c andeq sl, r0, ip, rrx
00009514 <_ZN7Console5kbaseEll>:
9514: e3a03000 mov r3, #0
9518: eaffff85 b 9334 <_ZN7Console5kbaseElll>
0000951c <_ZL19kernel_default_font>:
...
972c: 08000000 stmdaeq r0, {} ; <UNPREDICTABLE>
9730: 08080808 stmdaeq r8, {r3, fp}
9734: 08080008 stmdaeq r8, {r3}
9738: 00000000 andeq r0, r0, r0
973c: 14000000 strne r0, [r0], #-0
9740: 00141414 andseq r1, r4, r4, lsl r4
...
974c: 48480000 stmdami r8, {}^ ; <UNPREDICTABLE>
9750: 2424fe68 strtcs pc, [r4], #-3688 ; 0xfffff198
9754: 1212147f andsne r1, r2, #2130706432 ; 0x7f000000
9758: 00000000 andeq r0, r0, r0
975c: 10000000 andne r0, r0, r0
9760: 1c12927c lfmne f1, 1, [r2], {124} ; 0x7c
9764: 7c929070 ldcvc 0, cr9, [r2], {112} ; 0x70
9768: 00001010 andeq r1, r0, r0, lsl r0
976c: 06000000 streq r0, [r0], -r0
9770: 38460909 stmdacc r6, {r0, r3, r8, fp}^
9774: 60909066 addsvs r9, r0, r6, rrx
9778: 00000000 andeq r0, r0, r0
977c: 38000000 stmdacc r0, {} ; <UNPREDICTABLE>
9780: 920c0404 andls r0, ip, #4, 8 ; 0x4000000
9784: bc46a2b2 sfmlt f2, 3, [r6], {178} ; 0xb2
9788: 00000000 andeq r0, r0, r0
978c: 08000000 stmdaeq r0, {} ; <UNPREDICTABLE>
9790: 00080808 andeq r0, r8, r8, lsl #16
...
979c: 10103000 andsne r3, r0, r0
97a0: 08080808 stmdaeq r8, {r3, fp}
97a4: 10100808 andsne r0, r0, r8, lsl #16
97a8: 00000020 andeq r0, r0, r0, lsr #32
97ac: 08080c00 stmdaeq r8, {sl, fp}
97b0: 10101010 andsne r1, r0, r0, lsl r0
97b4: 08081010 stmdaeq r8, {r4, ip}
97b8: 0000000c andeq r0, r0, ip
97bc: 10000000 andne r0, r0, r0
97c0: d6387c92 ; <UNDEFINED> instruction: 0xd6387c92
97c4: 00000010 andeq r0, r0, r0, lsl r0
...
97d0: 7f080808 svcvc 0x00080808
97d4: 00080808 andeq r0, r8, r8, lsl #16
...
97e4: 18180000 ldmdane r8, {} ; <UNPREDICTABLE>
97e8: 00000408 andeq r0, r0, r8, lsl #8
...
97f4: 0000001c andeq r0, r0, ip, lsl r0
...
9804: 18180000 ldmdane r8, {} ; <UNPREDICTABLE>
9808: 00000000 andeq r0, r0, r0
980c: 40000000 andmi r0, r0, r0
9810: 10102020 andsne r2, r0, r0, lsr #32
9814: 04080818 streq r0, [r8], #-2072 ; 0xfffff7e8
9818: 00000204 andeq r0, r0, r4, lsl #4
981c: 38000000 stmdacc r0, {} ; <UNPREDICTABLE>
9820: 92828244 addls r8, r2, #68, 4 ; 0x40000004
9824: 38448282 stmdacc r4, {r1, r7, r9, pc}^
9828: 00000000 andeq r0, r0, r0
982c: 1c000000 stcne 0, cr0, [r0], {-0}
9830: 10101010 andsne r1, r0, r0, lsl r0
9834: 7c101010 ldcvc 0, cr1, [r0], {16}
9838: 00000000 andeq r0, r0, r0
983c: 7c000000 stcvc 0, cr0, [r0], {-0}
9840: 408080c2 addmi r8, r0, r2, asr #1
9844: fe041830 mcr2 8, 0, r1, cr4, cr0, {1}
9848: 00000000 andeq r0, r0, r0
984c: 7c000000 stcvc 0, cr0, [r0], {-0}
9850: 38c08082 stmiacc r0, {r1, r7, pc}^
9854: 7cc280c0 stclvc 0, cr8, [r2], {192} ; 0xc0
9858: 00000000 andeq r0, r0, r0
985c: 60000000 andvs r0, r0, r0
9860: 44485850 strbmi r5, [r8], #-2128 ; 0xfffff7b0
9864: 4040fe42 submi pc, r0, r2, asr #28
9868: 00000000 andeq r0, r0, r0
986c: 7e000000 cdpvc 0, 0, cr0, cr0, cr0, {0}
9870: c03e0202 eorsgt r0, lr, r2, lsl #4
9874: 3cc28080 stclcc 0, cr8, [r2], {128} ; 0x80
9878: 00000000 andeq r0, r0, r0
987c: 78000000 stmdavc r0, {} ; <UNPREDICTABLE>
9880: c67a0284 ldrbtgt r0, [sl], -r4, lsl #5
9884: 78c48282 stmiavc r4, {r1, r7, r9, pc}^
9888: 00000000 andeq r0, r0, r0
988c: fe000000 cdp2 0, 0, cr0, cr0, cr0, {0}
9890: 20204040 eorcs r4, r0, r0, asr #32
9894: 04081810 streq r1, [r8], #-2064 ; 0xfffff7f0
9898: 00000000 andeq r0, r0, r0
989c: 7c000000 stcvc 0, cr0, [r0], {-0}
98a0: 7c828282 sfmvc f0, 1, [r2], {130} ; 0x82
98a4: 7c868282 sfmvc f0, 1, [r6], {130} ; 0x82
98a8: 00000000 andeq r0, r0, r0
98ac: 3c000000 stccc 0, cr0, [r0], {-0}
98b0: c6828246 strgt r8, [r2], r6, asr #4
98b4: 3c4280bc mcrrcc 0, 11, r8, r2, cr12
...
98c0: 00181800 andseq r1, r8, r0, lsl #16
98c4: 18180000 ldmdane r8, {} ; <UNPREDICTABLE>
...
98d0: 00181800 andseq r1, r8, r0, lsl #16
98d4: 18180000 ldmdane r8, {} ; <UNPREDICTABLE>
98d8: 00000408 andeq r0, r0, r8, lsl #8
98dc: 00000000 andeq r0, r0, r0
98e0: 0e708000 cdpeq 0, 7, cr8, cr0, cr0, {0}
98e4: 0080700e addeq r7, r0, lr
...
98f0: 00fe0000 rscseq r0, lr, r0
98f4: 0000fe00 andeq pc, r0, r0, lsl #28
...
9900: e01c0200 ands r0, ip, r0, lsl #4
9904: 00021ce0 andeq r1, r2, r0, ror #25
9908: 00000000 andeq r0, r0, r0
990c: 1c000000 stcne 0, cr0, [r0], {-0}
9910: 08102022 ldmdaeq r0, {r1, r5, sp}
9914: 08080008 stmdaeq r8, {r3}
9918: 00000000 andeq r0, r0, r0
991c: 78000000 stmdavc r0, {} ; <UNPREDICTABLE>
9920: 92e284cc rscls r8, r2, #204, 8 ; 0xcc000000
9924: 04e29292 strbteq r9, [r2], #658 ; 0x292
9928: 0000780c andeq r7, r0, ip, lsl #16
992c: 10000000 andne r0, r0, r0
9930: 44282828 strtmi r2, [r8], #-2088 ; 0xfffff7d8
9934: 82c67c44 sbchi r7, r6, #68, 24 ; 0x4400
9938: 00000000 andeq r0, r0, r0
993c: 7e000000 cdpvc 0, 0, cr0, cr0, cr0, {0}
9940: 7e828282 cdpvc 2, 8, cr8, cr2, cr2, {4}
9944: 7e828282 cdpvc 2, 8, cr8, cr2, cr2, {4}
9948: 00000000 andeq r0, r0, r0
994c: 78000000 stmdavc r0, {} ; <UNPREDICTABLE>
9950: 02020284 andeq r0, r2, #132, 4 ; 0x40000008
9954: 78840202 stmvc r4, {r1, r9}
9958: 00000000 andeq r0, r0, r0
995c: 3e000000 cdpcc 0, 0, cr0, cr0, cr0, {0}
9960: 82828242 addhi r8, r2, #536870916 ; 0x20000004
9964: 3e428282 cdpcc 2, 4, cr8, cr2, cr2, {4}
9968: 00000000 andeq r0, r0, r0
996c: fe000000 cdp2 0, 0, cr0, cr0, cr0, {0}
9970: fe020202 cdp2 2, 0, cr0, cr2, cr2, {0}
9974: fe020202 cdp2 2, 0, cr0, cr2, cr2, {0}
9978: 00000000 andeq r0, r0, r0
997c: fe000000 cdp2 0, 0, cr0, cr0, cr0, {0}
9980: fe020202 cdp2 2, 0, cr0, cr2, cr2, {0}
9984: 02020202 andeq r0, r2, #536870912 ; 0x20000000
9988: 00000000 andeq r0, r0, r0
998c: 78000000 stmdavc r0, {} ; <UNPREDICTABLE>
9990: c2020284 andgt r0, r2, #132, 4 ; 0x40000008
9994: 78848282 stmvc r4, {r1, r7, r9, pc}
9998: 00000000 andeq r0, r0, r0
999c: 82000000 andhi r0, r0, #0
99a0: fe828282 cdp2 2, 8, cr8, cr2, cr2, {4}
99a4: 82828282 addhi r8, r2, #536870920 ; 0x20000008
99a8: 00000000 andeq r0, r0, r0
99ac: 3e000000 cdpcc 0, 0, cr0, cr0, cr0, {0}
99b0: 08080808 stmdaeq r8, {r3, fp}
99b4: 3e080808 cdpcc 8, 0, cr0, cr8, cr8, {0}
99b8: 00000000 andeq r0, r0, r0
99bc: 38000000 stmdacc r0, {} ; <UNPREDICTABLE>
99c0: 20202020 eorcs r2, r0, r0, lsr #32
99c4: 1c222020 stcne 0, cr2, [r2], #-128 ; 0xffffff80
99c8: 00000000 andeq r0, r0, r0
99cc: 42000000 andmi r0, r0, #0
99d0: 0e0a1222 cdpeq 2, 0, cr1, cr10, cr2, {1}
99d4: 42222212 eormi r2, r2, #536870913 ; 0x20000001
99d8: 00000000 andeq r0, r0, r0
99dc: 02000000 andeq r0, r0, #0
99e0: 02020202 andeq r0, r2, #536870912 ; 0x20000000
99e4: fe020202 cdp2 2, 0, cr0, cr2, cr2, {0}
99e8: 00000000 andeq r0, r0, r0
99ec: c6000000 strgt r0, [r0], -r0
99f0: aaaaaac6 bge feab4510 <_ZZN7Console5kbaseElllE3C.0+0xfeaaa6e0>
99f4: 82828292 addhi r8, r2, #536870921 ; 0x20000009
99f8: 00000000 andeq r0, r0, r0
99fc: 86000000 strhi r0, [r0], -r0
9a00: 928a8a86 addls r8, sl, #548864 ; 0x86000
9a04: c2c2a2a2 sbcgt sl, r2, #536870922 ; 0x2000000a
9a08: 00000000 andeq r0, r0, r0
9a0c: 38000000 stmdacc r0, {} ; <UNPREDICTABLE>
9a10: 82828244 addhi r8, r2, #68, 4 ; 0x40000004
9a14: 38448282 stmdacc r4, {r1, r7, r9, pc}^
9a18: 00000000 andeq r0, r0, r0
9a1c: 7e000000 cdpvc 0, 0, cr0, cr0, cr0, {0}
9a20: c28282c2 addgt r8, r2, #536870924 ; 0x2000000c
9a24: 0202027e andeq r0, r2, #-536870905 ; 0xe0000007
9a28: 00000000 andeq r0, r0, r0
9a2c: 38000000 stmdacc r0, {} ; <UNPREDICTABLE>
9a30: 82828244 addhi r8, r2, #68, 4 ; 0x40000004
9a34: 78448282 stmdavc r4, {r1, r7, r9, pc}^
9a38: 00004060 andeq r4, r0, r0, rrx
9a3c: 7e000000 cdpvc 0, 0, cr0, cr0, cr0, {0}
9a40: 7e8282c2 cdpvc 2, 8, cr8, cr2, cr2, {6}
9a44: 02828242 addeq r8, r2, #536870916 ; 0x20000004
9a48: 00000000 andeq r0, r0, r0
9a4c: 7c000000 stcvc 0, cr0, [r0], {-0}
9a50: 7c060286 sfmvc f0, 4, [r6], {134} ; 0x86
9a54: 7dc280c0 stclvc 0, cr8, [r2, #768] ; 0x300
9a58: 00000000 andeq r0, r0, r0
9a5c: 7f000000 svcvc 0x00000000
9a60: 08080808 stmdaeq r8, {r3, fp}
9a64: 08080808 stmdaeq r8, {r3, fp}
9a68: 00000000 andeq r0, r0, r0
9a6c: 82000000 andhi r0, r0, #0
9a70: 82828282 addhi r8, r2, #536870920 ; 0x20000008
9a74: 7c828282 sfmvc f0, 1, [r2], {130} ; 0x82
9a78: 00000000 andeq r0, r0, r0
9a7c: 82000000 andhi r0, r0, #0
9a80: 444444c6 strbmi r4, [r4], #-1222 ; 0xfffffb3a
9a84: 10282828 eorne r2, r8, r8, lsr #16
9a88: 00000000 andeq r0, r0, r0
9a8c: 81000000 tsthi r0, r0
9a90: 5a5a8181 bpl 16aa09c <_ZZN7Console5kbaseElllE3C.0+0x16a026c>
9a94: 6666665a ; <UNDEFINED> instruction: 0x6666665a
9a98: 00000000 andeq r0, r0, r0
9a9c: c6000000 strgt r0, [r0], -r0
9aa0: 10382844 eorsne r2, r8, r4, asr #16
9aa4: 82446c28 subhi r6, r4, #40, 24 ; 0x2800
9aa8: 00000000 andeq r0, r0, r0
9aac: 41000000 tstmi r0, r0
9ab0: 08141422 ldmdaeq r4, {r1, r5, sl, ip}
9ab4: 08080808 stmdaeq r8, {r3, fp}
9ab8: 00000000 andeq r0, r0, r0
9abc: fe000000 cdp2 0, 0, cr0, cr0, cr0, {0}
9ac0: 102060c0 eorne r6, r0, r0, asr #1
9ac4: fe060c08 cdp2 12, 0, cr0, cr6, cr8, {0}
9ac8: 00000000 andeq r0, r0, r0
9acc: 08083800 stmdaeq r8, {fp, ip, sp}
9ad0: 08080808 stmdaeq r8, {r3, fp}
9ad4: 08080808 stmdaeq r8, {r3, fp}
9ad8: 00000038 andeq r0, r0, r8, lsr r0
9adc: 02000000 andeq r0, r0, #0
9ae0: 08080404 stmdaeq r8, {r2, sl}
9ae4: 20101018 andscs r1, r0, r8, lsl r0
9ae8: 00004020 andeq r4, r0, r0, lsr #32
9aec: 10101c00 andsne r1, r0, r0, lsl #24
9af0: 10101010 andsne r1, r0, r0, lsl r0
9af4: 10101010 andsne r1, r0, r0, lsl r0
9af8: 0000001c andeq r0, r0, ip, lsl r0
9afc: 08000000 stmdaeq r0, {} ; <UNPREDICTABLE>
9b00: 00632214 rsbeq r2, r3, r4, lsl r2
...
9b18: 007f0000 rsbseq r0, pc, r0
9b1c: 10080000 andne r0, r8, r0
...
9b30: 40443800 submi r3, r4, r0, lsl #16
9b34: 5c62427c sfmpl f4, 2, [r2], #-496 ; 0xfffffe10
9b38: 00000000 andeq r0, r0, r0
9b3c: 02020200 andeq r0, r2, #0, 4
9b40: 42663e02 rsbmi r3, r6, #2, 28
9b44: 3e664242 cdpcc 2, 6, cr4, cr6, cr2, {2}
...
9b50: 02443800 subeq r3, r4, #0, 16
9b54: 38440202 stmdacc r4, {r1, r9}^
9b58: 00000000 andeq r0, r0, r0
9b5c: 40404000 submi r4, r0, r0
9b60: 42667c40 rsbmi r7, r6, #64, 24 ; 0x4000
9b64: 7c664242 sfmvc f4, 2, [r6], #-264 ; 0xfffffef8
...
9b70: 42663c00 rsbmi r3, r6, #0, 24
9b74: 3c46027e sfmcc f0, 2, [r6], {126} ; 0x7e
9b78: 00000000 andeq r0, r0, r0
9b7c: 08083000 stmdaeq r8, {ip, sp}
9b80: 08083e08 stmdaeq r8, {r3, r9, sl, fp, ip, sp}
9b84: 08080808 stmdaeq r8, {r3, fp}
...
9b90: 42667c00 rsbmi r7, r6, #0, 24
9b94: 5c664242 sfmpl f4, 2, [r6], #-264 ; 0xfffffef8
9b98: 00384440 eorseq r4, r8, r0, asr #8
9b9c: 02020200 andeq r0, r2, #0, 4
9ba0: 42463a02 submi r3, r6, #8192 ; 0x2000
9ba4: 42424242 submi r4, r2, #536870916 ; 0x20000004
9ba8: 00000000 andeq r0, r0, r0
9bac: 00000800 andeq r0, r0, r0, lsl #16
9bb0: 08080e00 stmdaeq r8, {r9, sl, fp}
9bb4: 3e080808 cdpcc 8, 0, cr0, cr8, cr8, {0}
9bb8: 00000000 andeq r0, r0, r0
9bbc: 00001000 andeq r1, r0, r0
9bc0: 10101c00 andsne r1, r0, r0, lsl #24
9bc4: 10101010 andsne r1, r0, r0, lsl r0
9bc8: 000e1010 andeq r1, lr, r0, lsl r0
9bcc: 02020200 andeq r0, r2, #0, 4
9bd0: 0a122202 beq 4923e0 <_ZZN7Console5kbaseElllE3C.0+0x4885b0>
9bd4: 4222120e eormi r1, r2, #-536870912 ; 0xe0000000
9bd8: 00000000 andeq r0, r0, r0
9bdc: 08080e00 stmdaeq r8, {r9, sl, fp}
9be0: 08080808 stmdaeq r8, {r3, fp}
9be4: 70080808 andvc r0, r8, r8, lsl #16
...
9bf0: 9292fe00 addsls pc, r2, #0, 28
9bf4: 92929292 addsls r9, r2, #536870921 ; 0x20000009
...
9c00: 42463a00 submi r3, r6, #0, 20
9c04: 42424242 submi r4, r2, #536870916 ; 0x20000004
...
9c10: 42663c00 rsbmi r3, r6, #0, 24
9c14: 3c664242 sfmcc f4, 2, [r6], #-264 ; 0xfffffef8
...
9c20: 42663e00 rsbmi r3, r6, #0, 28
9c24: 3e664242 cdpcc 2, 6, cr4, cr6, cr2, {2}
9c28: 00020202 andeq r0, r2, r2, lsl #4
9c2c: 00000000 andeq r0, r0, r0
9c30: 42667c00 rsbmi r7, r6, #0, 24
9c34: 5c664242 sfmpl f4, 2, [r6], #-264 ; 0xfffffef8
9c38: 00404040 subeq r4, r0, r0, asr #32
9c3c: 00000000 andeq r0, r0, r0
9c40: 044c3c00 strbeq r3, [ip], #-3072 ; 0xfffff400
9c44: 04040404 streq r0, [r4], #-1028 ; 0xfffffbfc
...
9c50: 02423c00 subeq r3, r2, #0, 24
9c54: 3c42403c mcrrcc 0, 3, r4, r2, cr12
9c58: 00000000 andeq r0, r0, r0
9c5c: 08000000 stmdaeq r0, {} ; <UNPREDICTABLE>
9c60: 08087e08 stmdaeq r8, {r3, r9, sl, fp, ip, sp, lr}
9c64: 70080808 andvc r0, r8, r8, lsl #16
...
9c70: 42424200 submi r4, r2, #0, 4
9c74: 5c624242 sfmpl f4, 2, [r2], #-264 ; 0xfffffef8
...
9c80: 24664200 strbtcs r4, [r6], #-512 ; 0xfffffe00
9c84: 18183c24 ldmdane r8, {r2, r5, sl, fp, ip, sp}
...
9c90: 5a818100 bpl fe06a098 <_ZZN7Console5kbaseElllE3C.0+0xfe060268>
9c94: 24245a5a strtcs r5, [r4], #-2650 ; 0xfffff5a6
...
9ca0: 18246600 stmdane r4!, {r9, sl, sp, lr}
9ca4: 66241818 ; <UNDEFINED> instruction: 0x66241818
...
9cb0: 24444200 strbcs r4, [r4], #-512 ; 0xfffffe00
9cb4: 10182824 andsne r2, r8, r4, lsr #16
9cb8: 000c0810 andeq r0, ip, r0, lsl r8
9cbc: 00000000 andeq r0, r0, r0
9cc0: 20407e00 subcs r7, r0, r0, lsl #28
9cc4: 7e020418 cfmvdlrvc mvd2, r0
9cc8: 00000000 andeq r0, r0, r0
9ccc: 08083800 stmdaeq r8, {fp, ip, sp}
9cd0: 08060808 stmdaeq r6, {r3, fp}
9cd4: 08080808 stmdaeq r8, {r3, fp}
9cd8: 00000030 andeq r0, r0, r0, lsr r0
9cdc: 08080800 stmdaeq r8, {fp}
9ce0: 08080808 stmdaeq r8, {r3, fp}
9ce4: 08080808 stmdaeq r8, {r3, fp}
9ce8: 00000808 andeq r0, r0, r8, lsl #16
9cec: 08080e00 stmdaeq r8, {r9, sl, fp}
9cf0: 08300808 ldmdaeq r0!, {r3, fp}
9cf4: 08080808 stmdaeq r8, {r3, fp}
9cf8: 00000006 andeq r0, r0, r6
9cfc: 00000000 andeq r0, r0, r0
9d00: 9c000000 stcls 0, cr0, [r0], {-0}
9d04: 00000062 andeq r0, r0, r2, rrx
9d08: 00000000 andeq r0, r0, r0
9d0c: ffffffff ; <UNDEFINED> instruction: 0xffffffff
9d10: ffffffff ; <UNDEFINED> instruction: 0xffffffff
9d14: ffffffff ; <UNDEFINED> instruction: 0xffffffff
9d18: ffffffff ; <UNDEFINED> instruction: 0xffffffff
9d1c: ffffffff ; <UNDEFINED> instruction: 0xffffffff
9d20: ffffffff ; <UNDEFINED> instruction: 0xffffffff
00009d24 <rootPageTable>:
9d24: 00000000 andeq r0, r0, r0
00009d28 <use_irq_console>:
9d28: 00000000 andeq r0, r0, r0
00009d2c <irq_console>:
9d2c: 00000000 andeq r0, r0, r0
00009d30 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_>:
9d30: e1b0cfa0 lsrs ip, r0, #31
9d34: e92d01f0 push {r4, r5, r6, r7, r8}
9d38: e1a08fa1 lsr r8, r1, #31
9d3c: 12600000 rsbne r0, r0, #0
9d40: e3580000 cmp r8, #0
9d44: 12611000 rsbne r1, r1, #0
9d48: e3510000 cmp r1, #0
9d4c: 0a00001e beq 9dcc <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0x9c>
9d50: e1500001 cmp r0, r1
9d54: ba000017 blt 9db8 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0x88>
9d58: e3a04000 mov r4, #0
9d5c: e5824000 str r4, [r2]
9d60: e5834000 str r4, [r3]
9d64: e5925000 ldr r5, [r2]
9d68: e2617000 rsb r7, r1, #0
9d6c: e0614000 rsb r4, r1, r0
9d70: e0844007 add r4, r4, r7
9d74: e0846001 add r6, r4, r1
9d78: e1510006 cmp r1, r6
9d7c: e2855001 add r5, r5, #1
9d80: dafffffa ble 9d70 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0x40>
9d84: e0010195 mul r1, r5, r1
9d88: e0610000 rsb r0, r1, r0
9d8c: e5825000 str r5, [r2]
9d90: e5830000 str r0, [r3]
9d94: e5920000 ldr r0, [r2]
9d98: e35c0000 cmp ip, #0
9d9c: 12600000 rsbne r0, r0, #0
9da0: 15820000 strne r0, [r2]
9da4: e3580000 cmp r8, #0
9da8: 12600000 rsbne r0, r0, #0
9dac: 15820000 strne r0, [r2]
9db0: e8bd01f0 pop {r4, r5, r6, r7, r8}
9db4: e12fff1e bx lr
9db8: e3a0c000 mov ip, #0
9dbc: e582c000 str ip, [r2]
9dc0: e5830000 str r0, [r3]
9dc4: e5920000 ldr r0, [r2]
9dc8: eafffff8 b 9db0 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0x80>
9dcc: e3e01000 mvn r1, #0
9dd0: e5821000 str r1, [r2]
9dd4: e5831000 str r1, [r3]
9dd8: e5920000 ldr r0, [r2]
9ddc: eafffff3 b 9db0 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0x80>
00009de0 <_ZN4Math13getDigitCountIlEET_S1_S1_>:
9de0: e92d4030 push {r4, r5, lr}
9de4: e3500000 cmp r0, #0
9de8: e24dd00c sub sp, sp, #12
9dec: e3a04000 mov r4, #0
9df0: e1a05001 mov r5, r1
9df4: e58d4004 str r4, [sp, #4]
9df8: e58d4000 str r4, [sp]
9dfc: da000007 ble 9e20 <_ZN4Math13getDigitCountIlEET_S1_S1_+0x40>
9e00: e1a01005 mov r1, r5
9e04: e28d2004 add r2, sp, #4
9e08: e1a0300d mov r3, sp
9e0c: ebffffc7 bl 9d30 <_ZN4Math6divideIlEET_S1_S1_PS1_S2_>
9e10: e59d0004 ldr r0, [sp, #4]
9e14: e3500000 cmp r0, #0
9e18: e2844001 add r4, r4, #1
9e1c: cafffff7 bgt 9e00 <_ZN4Math13getDigitCountIlEET_S1_S1_+0x20>
9e20: e1a00004 mov r0, r4
9e24: e28dd00c add sp, sp, #12
9e28: e8bd4030 pop {r4, r5, lr}
9e2c: e12fff1e bx lr
00009e30 <_ZZN7Console5kbaseElllE3C.0>:
9e30: 33323130 teqcc r2, #48, 2
9e34: 37363534 ; <UNDEFINED> instruction: 0x37363534
9e38: 42413938 submi r3, r1, #56, 18 ; 0xe0000
9e3c: 46454443 strbmi r4, [r5], -r3, asr #8
9e40: 4a494847 bmi 125bf64 <_ZZN7Console5kbaseElllE3C.0+0x1252134>
9e44: 4e4d4c4b cdpmi 12, 4, cr4, cr13, cr11, {2}
9e48: 0000504f andeq r5, r0, pc, asr #32
9e4c: 6f727245 svcvs 0x00727245
9e50: 43202e72 teqmi r0, #1824 ; 0x720
9e54: 75637269 strbvc r7, [r3, #-617]! ; 0xfffffd97
9e58: 2072616c rsbscs r6, r2, ip, ror #2
9e5c: 706f6f6c rsbvc r6, pc, ip, ror #30
9e60: 65686320 strbvs r6, [r8, #-800]! ; 0xfffffce0
9e64: 6e696b63 vnmulvs.f64 d22, d9, d19
9e68: 6f662067 svcvs 0x00662067
9e6c: 74732072 ldrbtvc r2, [r3], #-114 ; 0xffffff8e
9e70: 73757461 cmnvc r5, #1627389952 ; 0x61000000
9e74: 0000002e andeq r0, r0, lr, lsr #32
9e78: 6f727245 svcvs 0x00727245
9e7c: 54202172 strtpl r2, [r0], #-370 ; 0xfffffe8e
9e80: 6d206568 cfstr32vs mvfx6, [r0, #-416]! ; 0xfffffe60
9e84: 626c6961 rsbvs r6, ip, #1589248 ; 0x184000
9e88: 6420786f strtvs r7, [r0], #-2159 ; 0xfffff791
9e8c: 276e6469 strbcs r6, [lr, -r9, ror #8]!
9e90: 65722074 ldrbvs r2, [r2, #-116]! ; 0xffffff8c
9e94: 6e727574 mrcvs 5, 3, r7, cr2, cr4, {3}
9e98: 73206120 teqvc r0, #32, 2
9e9c: 61746975 cmnvs r4, r5, ror r9
9ea0: 20656c62 rsbcs r6, r5, r2, ror #24
9ea4: 756c6176 strbvc r6, [ip, #-374]! ; 0xfffffe8a
9ea8: 6e692065 cdpvs 0, 6, cr2, cr9, cr5, {3}
9eac: 74206120 strtvc r6, [r0], #-288 ; 0xfffffee0
9eb0: 6c656d69 stclvs 13, cr6, [r5], #-420 ; 0xfffffe5c
9eb4: 616d2079 smcvs 53769 ; 0xd209
9eb8: 72656e6e rsbvc r6, r5, #1760 ; 0x6e0
9ebc: 0000002e andeq r0, r0, lr, lsr #32
9ec0: 6f727245 svcvs 0x00727245
9ec4: 54202172 strtpl r2, [r0], #-370 ; 0xfffffe8e
9ec8: 66206568 strtvs r6, [r0], -r8, ror #10
9ecc: 656d6172 strbvs r6, [sp, #-370]! ; 0xfffffe8e
9ed0: 66667562 strbtvs r7, [r6], -r2, ror #10
9ed4: 72207265 eorvc r7, r0, #1342177286 ; 0x50000006
9ed8: 72757465 rsbsvc r7, r5, #1694498816 ; 0x65000000
9edc: 2064656e rsbcs r6, r4, lr, ror #10
9ee0: 69207369 stmdbvs r0!, {r0, r3, r5, r6, r8, r9, ip, sp, lr}
9ee4: 6c61766e stclvs 6, cr7, [r1], #-440 ; 0xfffffe48
9ee8: 202e6469 eorcs r6, lr, r9, ror #8
9eec: 726f6241 rsbvc r6, pc, #268435460 ; 0x10000004
9ef0: 676e6974 ; <UNDEFINED> instruction: 0x676e6974
9ef4: 61726620 cmnvs r2, r0, lsr #12
9ef8: 7562656d strbvc r6, [r2, #-1389]! ; 0xfffffa93
9efc: 72656666 rsbvc r6, r5, #106954752 ; 0x6600000
9f00: 71636120 cmnvc r3, r0, lsr #2
9f04: 69736975 ldmdbvs r3!, {r0, r2, r4, r5, r6, r8, fp, sp, lr}^
9f08: 6e6f6974 mcrvs 9, 3, r6, cr15, cr4, {3}
9f0c: 00000000 andeq r0, r0, r0
9f10: 6f727245 svcvs 0x00727245
9f14: 54202172 strtpl r2, [r0], #-370 ; 0xfffffe8e
9f18: 70206568 eorvc r6, r0, r8, ror #10
9f1c: 68637469 stmdavs r3!, {r0, r3, r5, r6, sl, ip, sp, lr}^
9f20: 74657220 strbtvc r7, [r5], #-544 ; 0xfffffde0
9f24: 656e7275 strbvs r7, [lr, #-629]! ; 0xfffffd8b
9f28: 73692064 cmnvc r9, #100 ; 0x64
9f2c: 766e6920 strbtvc r6, [lr], -r0, lsr #18
9f30: 64696c61 strbtvs r6, [r9], #-3169 ; 0xfffff39f
9f34: 6241202e subvs r2, r1, #46 ; 0x2e
9f38: 6974726f ldmdbvs r4!, {r0, r1, r2, r3, r5, r6, r9, ip, sp, lr}^
9f3c: 6620676e strtvs r6, [r0], -lr, ror #14
9f40: 656d6172 strbvs r6, [sp, #-370]! ; 0xfffffe8e
9f44: 66667562 strbtvs r7, [r6], -r2, ror #10
9f48: 61207265 teqvs r0, r5, ror #4
9f4c: 69757163 ldmdbvs r5!, {r0, r1, r5, r6, r8, ip, sp, lr}^
9f50: 69746973 ldmdbvs r4!, {r0, r1, r4, r5, r6, r8, fp, sp, lr}^
9f54: 002e6e6f eoreq r6, lr, pc, ror #28
9f58: 4e4f445b mcrmi 4, 2, r4, cr15, cr11, {2}
9f5c: 00095d45 andeq r5, r9, r5, asr #26
9f60: 45544e49 ldrbmi r4, [r4, #-3657] ; 0xfffff1b7
9f64: 50555252 subspl r5, r5, r2, asr r2
9f68: 00000054 andeq r0, r0, r4, asr r0
9f6c: 636c6557 cmnvs ip, #364904448 ; 0x15c00000
9f70: 20656d6f rsbcs r6, r5, pc, ror #26
9f74: 4d206f74 stcmi 15, cr6, [r0, #-464]! ; 0xfffffe30
9f78: 66646e69 strbtvs r6, [r4], -r9, ror #28
9f7c: 6579616c ldrbvs r6, [r9, #-364]! ; 0xfffffe94
9f80: 61202c72 teqvs r0, r2, ror ip
9f84: 73756320 cmnvc r5, #32, 6 ; 0x80000000
9f88: 206d6f74 rsbcs r6, sp, r4, ror pc
9f8c: 70736172 rsbsvc r6, r3, r2, ror r1
9f90: 72726562 rsbsvc r6, r2, #411041792 ; 0x18800000
9f94: 69702079 ldmdbvs r0!, {r0, r3, r4, r5, r6, sp}^
9f98: 72656b20 rsbvc r6, r5, #32, 22 ; 0x8000
9f9c: 206c656e rsbcs r6, ip, lr, ror #10
9fa0: 74697277 strbtvc r7, [r9], #-631 ; 0xfffffd89
9fa4: 206e6574 rsbcs r6, lr, r4, ror r5
9fa8: 43206e69 teqmi r0, #1680 ; 0x690
9fac: 000a2b2b andeq r2, sl, fp, lsr #22
9fb0: 6c697542 cfstr64vs mvdx7, [r9], #-264 ; 0xfffffef8
9fb4: 00203a64 eoreq r3, r0, r4, ror #20
9fb8: 2e302e30 mrccs 14, 1, r2, cr0, cr0, {1}
9fbc: 00323236 eorseq r3, r2, r6, lsr r2
9fc0: 000a0a0a andeq r0, sl, sl, lsl #20
9fc4: 74696157 strbtvc r6, [r9], #-343 ; 0xfffffea9
9fc8: 3a676e69 bcc 19e5974 <_ZZN7Console5kbaseElllE3C.0+0x19dbb44>
9fcc: 00000020 andeq r0, r0, r0, lsr #32
9fd0: 54535b0a ldrbpl r5, [r3], #-2826 ; 0xfffff4f6
9fd4: 49545241 ldmdbmi r4, {r0, r6, r9, ip, lr}^
9fd8: 0a5d474e beq 175bd18 <_ZZN7Console5kbaseElllE3C.0+0x1751ee8>
9fdc: 0000000a andeq r0, r0, sl
9fe0: 74696e49 strbtvc r6, [r9], #-3657 ; 0xfffff1b7
9fe4: 696c6169 stmdbvs ip!, {r0, r3, r5, r6, r8, sp, lr}^
9fe8: 2064657a rsbcs r6, r4, sl, ror r5
9fec: 65676170 strbvs r6, [r7, #-368]! ; 0xfffffe90
9ff0: 62617420 rsbvs r7, r1, #32, 8 ; 0x20000000
9ff4: 0000656c andeq r6, r0, ip, ror #10
9ff8: 65746e49 ldrbvs r6, [r4, #-3657]! ; 0xfffff1b7
9ffc: 70757272 rsbsvc r7, r5, r2, ror r2
a000: 65762074 ldrbvs r2, [r6, #-116]! ; 0xffffff8c
a004: 726f7463 rsbvc r7, pc, #1660944384 ; 0x63000000
a008: 4e452073 mcrmi 0, 2, r2, cr5, cr3, {3}
a00c: 454c4241 strbmi r4, [ip, #-577] ; 0xfffffdbf
a010: 00000044 andeq r0, r0, r4, asr #32
a014: 756f6241 strbvc r6, [pc, #-577]! ; 9ddb <_ZN4Math6divideIlEET_S1_S1_PS1_S2_+0xab>
a018: 6f742074 svcvs 0x00742074
a01c: 72687420 rsbvc r7, r8, #32, 8 ; 0x20000000
a020: 6120776f teqvs r0, pc, ror #14
a024: 5753206e ldrbpl r2, [r3, -lr, rrx]
a028: 78652049 stmdavc r5!, {r0, r3, r6, sp}^
a02c: 74706563 ldrbtvc r6, [r0], #-1379 ; 0xfffffa9d
a030: 2e6e6f69 cdpcs 15, 6, cr6, cr14, cr9, {3}
a034: 000a2e2e andeq r2, sl, lr, lsr #28
a038: 20495753 subcs r5, r9, r3, asr r7
a03c: 65637845 strbvs r7, [r3, #-2117]! ; 0xfffff7bb
a040: 6f697470 svcvs 0x00697470
a044: 6854206e ldmdavs r4, {r1, r2, r3, r5, r6, sp}^
a048: 6e776f72 mrcvs 15, 3, r6, cr7, cr2, {3}
a04c: 00000000 andeq r0, r0, r0
a050: 654b0a0a strbvs r0, [fp, #-2570] ; 0xfffff5f6
a054: 6c656e72 stclvs 14, cr6, [r5], #-456 ; 0xfffffe38
a058: 75687320 strbvc r7, [r8, #-800]! ; 0xfffffce0
a05c: 6e697474 mcrvs 4, 3, r7, cr9, cr4, {3}
a060: 6f642067 svcvs 0x00642067
a064: 2e2e6e77 mcrcs 14, 1, r6, cr14, cr7, {3}
a068: 0000002e andeq r0, r0, lr, lsr #32
a06c: 6f727265 svcvs 0x00727265
a070: 55203a72 strpl r3, [r0, #-2674]! ; 0xfffff58e
a074: 7075736e rsbsvc r7, r5, lr, ror #6
a078: 74726f70 ldrbtvc r6, [r2], #-3952 ; 0xfffff090
a07c: 62206465 eorvs r6, r0, #1694498816 ; 0x65000000
a080: 20657361 rsbcs r7, r5, r1, ror #6
a084: 6d206e69 stcvs 14, cr6, [r0, #-420]! ; 0xfffffe5c
a088: 65687461 strbvs r7, [r8, #-1121]! ; 0xfffffb9f
a08c: 6974616d ldmdbvs r4!, {r0, r2, r3, r5, r6, r8, sp, lr}^
a090: 206c6163 rsbcs r6, ip, r3, ror #2
a094: 7265706f rsbvc r7, r5, #111 ; 0x6f
a098: 6f697461 svcvs 0x00697461
a09c: 000a2e6e andeq r2, sl, lr, ror #28
a0a0: 3a434347 bcc 10dadc4 <_ZZN7Console5kbaseElllE3C.0+0x10d0f94>
a0a4: 6f532820 svcvs 0x00532820
a0a8: 65637275 strbvs r7, [r3, #-629]! ; 0xfffffd8b
a0ac: 47207972 ; <UNDEFINED> instruction: 0x47207972
a0b0: 4c202b2b stcmi 11, cr2, [r0], #-172 ; 0xffffff54
a0b4: 20657469 rsbcs r7, r5, r9, ror #8
a0b8: 30313032 eorscc r3, r1, r2, lsr r0
a0bc: 2d39302e ldccs 0, cr3, [r9, #-184]! ; 0xffffff48
a0c0: 20293135 eorcs r3, r9, r5, lsr r1
a0c4: 2e352e34 mrccs 14, 1, r2, cr5, cr4, {1}
a0c8: 33410031 movtcc r0, #4145 ; 0x1031
a0cc: 61000000 tstvs r0, r0
a0d0: 69626165 stmdbvs r2!, {r0, r2, r5, r6, r8, sp, lr}^
a0d4: 00290100 eoreq r0, r9, r0, lsl #2
a0d8: 41050000 tstmi r5, r0
a0dc: 54374d52 ldrtpl r4, [r7], #-3410 ; 0xfffff2ae
a0e0: 2d494d44 stclcs 13, cr4, [r9, #-272] ; 0xfffffef0
a0e4: 02060053 andeq r0, r6, #83 ; 0x53
a0e8: 01090108 tsteq r9, r8, lsl #2
a0ec: 01140412 tsteq r4, r2, lsl r4
a0f0: 03170115 tsteq r7, #1073741829 ; 0x40000005
a0f4: 01190118 tsteq r9, r8, lsl r1
a0f8: 021e011a andseq r0, lr, #-2147483642 ; 0x80000006
a0fc: Address 0x0000a0fc is out of bounds.
| 41.253609 | 94 | 0.635871 |
aee8f8b8114d15529b2f31d50e8261b770e66b2c | 3,934 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2713.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2713.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2713.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r9
push %rbp
push %rdx
push %rsi
// Store
lea addresses_WC+0xb79b, %r12
nop
nop
sub $6013, %rdx
movw $0x5152, (%r12)
nop
nop
dec %r12
// Faulty Load
lea addresses_WC+0xb79b, %rbp
nop
nop
nop
nop
inc %r10
mov (%rbp), %rsi
lea oracles, %r11
and $0xff, %rsi
shlq $12, %rsi
mov (%r11,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rbp
pop %r9
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'52': 21829}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 69.017544 | 2,999 | 0.661413 |
c71cf4fe309858ffad540b95a53c0b6968c0c04d | 182 | asm | Assembly | programs/oeis/136/A136725.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/136/A136725.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/136/A136725.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A136725: Primitive dimensions of Hadamard matrices.
; 1,2,12,20,28,36,44,52,60,68,76,84,92,100
mov $1,$0
mul $0,8
sub $0,5
sub $1,1
mul $1,2
mov $2,2
trn $2,$1
trn $0,$2
add $0,1
| 14 | 53 | 0.637363 |
a859040e0b4b4dbf1c2d20f133eff6b671bf7cd6 | 596 | asm | Assembly | ch06/32 bit/Section_6_7_1.asm | William0Friend/my_masm | e8073266c03c01424ad84b9ed9cf13e9da1eabb1 | [
"Apache-2.0"
] | null | null | null | ch06/32 bit/Section_6_7_1.asm | William0Friend/my_masm | e8073266c03c01424ad84b9ed9cf13e9da1eabb1 | [
"Apache-2.0"
] | null | null | null | ch06/32 bit/Section_6_7_1.asm | William0Friend/my_masm | e8073266c03c01424ad84b9ed9cf13e9da1eabb1 | [
"Apache-2.0"
] | null | null | null | ; MASM Decision Directives (Section_6_7_1.asm)
; Examples from Sections 6.7.1 (Creating IF Statements)
; and 6.7.2 (Signed and Unsigned Comparisons)
INCLUDE IRVINE32.inc
INCLUDE macros.inc
.data
val1 DWORD 5
val2 SDWORD -1
result DWORD 0
.code
main PROC
; Example 1
mov eax,6
.IF eax > val1
mov result,1
.ENDIF
; Example 2
mov eax,6
.IF eax > val2
mov result,1
.ENDIF
; Example 3
mov eax,6
mov ebx,val2
.IF eax > ebx
mov result,1
.ENDIF
exit
main ENDP
END main | 14.190476 | 56 | 0.575503 |
61c0711ce0312cbfc6088f9aab80b95ffc970881 | 42 | asm | Assembly | Examples/pl0-1.asm | NotFounds/pl0dash-run | d62422127825e5afce3c510a0880d1fb0b0b6b7e | [
"MIT"
] | null | null | null | Examples/pl0-1.asm | NotFounds/pl0dash-run | d62422127825e5afce3c510a0880d1fb0b0b6b7e | [
"MIT"
] | null | null | null | Examples/pl0-1.asm | NotFounds/pl0dash-run | d62422127825e5afce3c510a0880d1fb0b0b6b7e | [
"MIT"
] | null | null | null | LOAD A,1
PUSH A
POP A
PRINT A
PRINTLN
END
| 6 | 8 | 0.738095 |
31aa89f326cdd0c23a39c8c63004db454a545dc6 | 2,436 | asm | Assembly | programs/oeis/047/A047928.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/047/A047928.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/047/A047928.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A047928: a(n) = n*(n-1)^2*(n-2).
; 0,12,72,240,600,1260,2352,4032,6480,9900,14520,20592,28392,38220,50400,65280,83232,104652,129960,159600,194040,233772,279312,331200,390000,456300,530712,613872,706440,809100,922560,1047552,1184832,1335180,1499400,1678320,1872792,2083692,2311920,2558400,2824080,3109932,3416952,3746160,4098600,4475340,4877472,5306112,5762400,6247500,6762600,7308912,7887672,8500140,9147600,9831360,10552752,11313132,12113880,12956400,13842120,14772492,15748992,16773120,17846400,18970380,20146632,21376752,22662360,24005100,25406640,26868672,28392912,29981100,31635000,33356400,35147112,37008972,38943840,40953600,43040160,45205452,47451432,49780080,52193400,54693420,57282192,59961792,62734320,65601900,68566680,71630832,74796552,78066060,81441600,84925440,88519872,92227212,96049800,99990000,104050200,108232812,112540272,116975040,121539600,126236460,131068152,136037232,141146280,146397900,151794720,157339392,163034592,168883020,174887400,181050480,187375032,193863852,200519760,207345600,214344240,221518572,228871512,236406000,244125000,252031500,260128512,268419072,276906240,285593100,294482760,303578352,312883032,322399980,332132400,342083520,352256592,362654892,373281720,384140400,395234280,406566732,418141152,429960960,442029600,454350540,466927272,479763312,492862200,506227500,519862800,533771712,547957872,562424940,577176600,592216560,607548552,623176332,639103680,655334400,671872320,688721292,705885192,723367920,741173400,759305580,777768432,796565952,815702160,835181100,855006840,875183472,895715112,916605900,937860000,959481600,981474912,1003844172,1026593640,1049727600,1073250360,1097166252,1121479632,1146194880,1171316400,1196848620,1222795992,1249162992,1275954120,1303173900,1330826880,1358917632,1387450752,1416430860,1445862600,1475750640,1506099672,1536914412,1568199600,1599960000,1632200400,1664925612,1698140472,1731849840,1766058600,1800771660,1835993952,1871730432,1907986080,1944765900,1982074920,2019918192,2058300792,2097227820,2136704400,2176735680,2217326832,2258483052,2300209560,2342511600,2385394440,2428863372,2472923712,2517580800,2562840000,2608706700,2655186312,2702284272,2750006040,2798357100,2847342960,2896969152,2947241232,2998164780,3049745400,3101988720,3154900392,3208486092,3262751520,3317702400,3373344480,3429683532,3486725352,3544475760,3602940600,3662125740,3722037072,3782680512,3844062000,3906187500
add $0,1
pow $0,2
mov $1,$0
mul $1,$0
sub $1,$0
| 270.666667 | 2,351 | 0.878489 |
dfe744aa76b590011baf437c56f913ff4d2c3e37 | 258 | asm | Assembly | programs/oeis/142/A142702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/142/A142702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/142/A142702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A142702: Period 4: repeat [5, 2, 5, 8].
; 5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8,5,2,5,8
add $0,3
gcd $0,4
mod $0,4
mul $0,3
add $0,2
| 28.666667 | 169 | 0.515504 |
6d1d08c97df74a9f2bbb83797cdf46fb094db52f | 7,228 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1690.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1690.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1690.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x733e, %r8
nop
nop
nop
sub %rsi, %rsi
movb $0x61, (%r8)
nop
nop
nop
and $47091, %rax
lea addresses_D_ht+0xc8be, %rdx
nop
nop
nop
cmp $4048, %r14
mov (%rdx), %esi
nop
nop
nop
nop
nop
sub $5081, %r8
lea addresses_WC_ht+0x18720, %r9
nop
nop
sub %rbp, %rbp
movb $0x61, (%r9)
nop
xor $32815, %rax
lea addresses_D_ht+0x12d3e, %rax
nop
nop
cmp $22746, %rbp
movw $0x6162, (%rax)
nop
nop
nop
nop
sub %rax, %rax
lea addresses_UC_ht+0x1ec26, %rdx
nop
nop
nop
and %r14, %r14
mov $0x6162636465666768, %rax
movq %rax, (%rdx)
nop
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_WC_ht+0x1a7be, %r9
nop
nop
nop
and %r14, %r14
mov $0x6162636465666768, %rdx
movq %rdx, %xmm3
vmovups %ymm3, (%r9)
nop
nop
nop
sub $27385, %r8
lea addresses_normal_ht+0x1ddd5, %r8
nop
nop
nop
and $33613, %rdx
movb (%r8), %r14b
nop
nop
nop
nop
nop
sub $11077, %rbp
lea addresses_WT_ht+0x9d3e, %rsi
lea addresses_normal_ht+0xd464, %rdi
nop
nop
nop
nop
sub $39375, %r14
mov $113, %rcx
rep movsq
nop
nop
add $65034, %rcx
lea addresses_WT_ht+0x1513e, %r14
cmp $20770, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%r14)
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0x1c13e, %rbp
nop
nop
xor %rsi, %rsi
mov (%rbp), %r14w
nop
nop
nop
cmp $4737, %r9
lea addresses_WT_ht+0x183c6, %rsi
lea addresses_WC_ht+0x15f3e, %rdi
nop
nop
nop
and $56666, %rax
mov $44, %rcx
rep movsw
nop
nop
add %r14, %r14
lea addresses_D_ht+0x15cbe, %rsi
lea addresses_WT_ht+0xcc3e, %rdi
nop
nop
nop
xor %rbp, %rbp
mov $59, %rcx
rep movsq
nop
nop
nop
xor $38358, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %r9
push %rcx
push %rsi
// Load
lea addresses_normal+0x15d1e, %r15
nop
nop
nop
nop
nop
add %rsi, %rsi
movb (%r15), %r9b
nop
xor $21940, %r13
// Faulty Load
lea addresses_US+0xc53e, %r15
cmp %rcx, %rcx
mov (%r15), %r13w
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 33.775701 | 2,999 | 0.65689 |
4ca8f48ac0fac07bf07a56f127f30e974a2a1fcc | 581 | asm | Assembly | Microprocessor/loops.asm | Nmane1612/Nihar-Mane | aa4db52a384f706a431c994e4e12d8e5e0cd8402 | [
"Apache-2.0"
] | 3 | 2019-12-27T06:07:37.000Z | 2020-07-01T08:51:32.000Z | Microprocessor/loops.asm | Nihar16/Personal-Repository | 0d319eeb8dbfa3f7c3eb8501829939ecd6923464 | [
"MIT"
] | null | null | null | Microprocessor/loops.asm | Nihar16/Personal-Repository | 0d319eeb8dbfa3f7c3eb8501829939ecd6923464 | [
"MIT"
] | null | null | null | name "loops"
org 100h
mov bx, 0 ; total step counter
mov cx, 5
k1: add bx, 1
mov al, '1'
mov ah, 0eh
int 10h
push cx
mov cx, 5
k2: add bx, 1
mov al, '2'
mov ah, 0eh
int 10h
push cx
mov cx, 5
k3: add bx, 1
mov al, '3'
mov ah, 0eh
int 10h
loop k3 ; internal in internal loop.
pop cx
loop k2 ; internal loop.
pop cx
loop k1 ; external loop.
; wait any key...
mov ah, 1
int 21h
ret
| 16.138889 | 49 | 0.432014 |
8bf7ad925ac19ad1053f2dfd23f0f016c809bd38 | 443 | asm | Assembly | oeis/099/A099027.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/099/A099027.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/099/A099027.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A099027: Sum [k=0..n, n-k AND NOT k].
; Submitted by Simon Strandgaard
; 0,1,2,6,6,11,16,28,24,29,34,50,54,71,88,120,104,105,106,126,126,147,168,212,208,229,250,298,318,367,416,496,448,433,418,438,422,443,464,524,504,525,546,610,630,695,760,872,840,857,874,942,958,1027,1096
mov $4,$0
mov $5,$0
lpb $4
mov $0,$5
sub $4,1
sub $0,$4
add $2,$0
mov $3,$0
pow $0,3
lpb $0
dif $0,8
sub $2,$3
lpe
add $1,$2
lpe
mov $0,$1
| 21.095238 | 203 | 0.609481 |
6b3494cbf265b4cd30d2ed5f4307220c91137622 | 182 | asm | Assembly | data/pokemon/dex_entries/mawile.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/dex_entries/mawile.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/dex_entries/mawile.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db "DECEIVER@" ; species name
db "It chomps with its"
next "gaping mouth. Its"
next "huge jaws are"
page "actually steel"
next "horns that have"
next "been transformed.@"
| 18.2 | 30 | 0.681319 |
cd4848011575d94097b834d6856fa5f6920fd2ef | 801 | asm | Assembly | oeis/250/A250758.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/250/A250758.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/250/A250758.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A250758: Number of (3+1) X (n+1) 0..2 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing x(i,j)+x(i-1,j) in the j direction.
; Submitted by Jamie Morken(s1.)
; 332,756,1353,2123,3066,4182,5471,6933,8568,10376,12357,14511,16838,19338,22011,24857,27876,31068,34433,37971,41682,45566,49623,53853,58256,62832,67581,72503,77598,82866,88307,93921,99708,105668,111801,118107,124586,131238,138063,145061,152232,159576,167093,174783,182646,190682,198891,207273,215828,224556,233457,242531,251778,261198,270791,280557,290496,300608,310893,321351,331982,342786,353763,364913,376236,387732,399401,411243,423258,435446,447807,460341,473048,485928,498981,512207,525606
add $0,2
mov $2,$0
mul $2,2
mov $0,$2
mov $3,87
mul $3,$2
sub $3,17
mul $3,2
sub $3,$2
mul $0,$3
div $0,8
add $0,3
| 47.117647 | 496 | 0.7603 |
c7dce7122eea17d32e3ba054c07417e3fde8ce9e | 122 | asm | Assembly | 3_2.asm | EduardaSRBastos/Assembly-2020 | 65fd798bd2b9a4f4520256f71aac7bd91398a7fd | [
"MIT"
] | null | null | null | 3_2.asm | EduardaSRBastos/Assembly-2020 | 65fd798bd2b9a4f4520256f71aac7bd91398a7fd | [
"MIT"
] | null | null | null | 3_2.asm | EduardaSRBastos/Assembly-2020 | 65fd798bd2b9a4f4520256f71aac7bd91398a7fd | [
"MIT"
] | null | null | null | TRAS:
MOV AH, 9
LEA DX, LINHA1
INT 21H
MOV AH, 1
INT 21H
JMP TRAS
RET
LINHA1 DB 13,10, "CARREGUE NUMA TECLA : $"
END | 8.133333 | 42 | 0.663934 |
c8b02a83e727807a399b933422d99c5aab63de66 | 191 | asm | Assembly | Engine Hacks/MSS/asm/Growth Getters/Get_Hp_Growth.asm | sme23/MekkahRestrictedHackComp1 | 1cc9d2fec557424f358b6bfa21f9f3bb6faf2978 | [
"CC0-1.0"
] | 3 | 2020-06-15T14:22:38.000Z | 2020-06-28T19:44:52.000Z | Wizardry/ModularHooks/GrowthGetters/Get_Hp_Growth.asm | sme23/Smefile | 24a90acff5d652f0619b896b5498042fbbdd69ff | [
"CC0-1.0"
] | null | null | null | Wizardry/ModularHooks/GrowthGetters/Get_Hp_Growth.asm | sme23/Smefile | 24a90acff5d652f0619b896b5498042fbbdd69ff | [
"CC0-1.0"
] | null | null | null | .thumb
.org 0x0
@r0=battle struct or char data ptr
ldr r1,[r0]
ldrb r1,[r1,#28] @hp growth
mov r2,#10 @index of hp boost
ldr r3,Extra_Growth_Boosts
bx r3
.align
Extra_Growth_Boosts:
@
| 13.642857 | 34 | 0.712042 |
dddbb3866cf30bf88db9c46c2a99956ab9458b13 | 3,012 | asm | Assembly | Hardware/register_defines.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 9 | 2021-09-29T22:08:15.000Z | 2022-03-23T05:35:43.000Z | Hardware/register_defines.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 1 | 2022-01-21T12:35:42.000Z | 2022-01-21T17:47:24.000Z | Hardware/register_defines.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 1 | 2022-01-15T10:13:49.000Z | 2022-01-15T10:13:49.000Z | IO_LAYER2_PORT EQU $123B
IO_EXT_BANK_PORT EQU $DFFD ; 57341
IO_BANK_PORT EQU $7FFD ; 32765
REGISTER_NUMBER_PORT EQU $243B
REGISTER_VALUE_PORT EQU $253B
SPRITE_SLOT_PORT EQU $303B
SPRITE_INFO_PORT EQU $0057
SPRITE_PATTERN_UPLOAD_PORT EQU $005B
MACHINE_ID_REGISTER EQU 0
VERSION_REGISTER EQU 1
RESET_REGISTER EQU 2
MACHINE_TYPE_REGISTER EQU 3
PAGE_RAM_REGISTER EQU 4
PERIPHERAL_1_REGISTER EQU 5
PERIPHERAL_2_REGISTER EQU 6
TURBO_MODE_REGISTER EQU 7
PERIPHERAL_3_REGISTER EQU 8
ANTI_BRICK_SYSTEM_REGISTER EQU 10
LAYER2_RAM_PAGE_REGISTER EQU 18
LAYER2_RAM_SHADOW_REGISTER EQU 19
TRANSPARENCY_COLOUR_REGISTER EQU 20
SPRITE_LAYERS_SYSTEM_REGISTER EQU 21
LAYER2_OFFSET_X_REGISTER EQU 22
LAYER2_OFFSET_Y_REGISTER EQU 23
CLIP_WINDOW_LAYER2_REGISTER EQU 24
CLIP_WINDOW_SPRITES_REGISTER EQU 25
CLIP_WINDOW_ULA_REGISTER EQU 26
CLIP_WINDOW_CONTROL_REGISTER EQU 28
ACTIVE_VIDEO_LINE_MSB_REGISTER EQU 30
ACTIVE_VIDEO_LINE_LSB_REGISTER EQU 31
LINE_INTERRUPT_CONTROL_REGISTER EQU 34
LINE_INTERRUPT_VALUE_LSB_REGISTER EQU 35
KEYMAP_HIGH_ADDRESS_REGISTER EQU 40
KEYMAP_LOW_ADDRESS_REGISTER EQU 41
KEYMAP_HIGH_DATA_REGISTER EQU 42
KEYMAP_LOW_DATA_REGISTER EQU 43
DAC_B_MIRROR_REGISTER EQU 44
DAC_AB_MIRROR_REGISTER EQU 45
DAC_C_MORROR_REGISTER EQU 46
TILEMAP_OFFSET_XMSB_REGISTER EQU 47
TILEMAP_OFFSET_XLSB_REGISTER EQU 48
TILEMAP_OFFSET_YMSB_REGISTER EQU 49
LORES_OFFSET_X_REGISTER EQU 50
LORES_OFFSET_Y_REGISTER EQU 51
SPRITE_PORT_INDEX_REGISTER EQU 52
SPRITE_PORT_ATTR0_REGISTER EQU 53
SPRITE_PORT_ATTR1_REGISTER EQU 54
SPRITE_PORT_ATTR2_REGISTER EQU 55
SPRITE_PORT_ATTR3_REGISTER EQU 56
SPRITE_PORT_ATTR4_REGISTER EQU 57
PALETTE_INDEX_REGISTER EQU 64
PALETTE_VALUE_8BIT_REGISTER EQU 65
PALETTE_FORMAT_REGISTER EQU 66
PALETTE_CONTROL_REGISTER EQU 67
PALETTE_VALUE_9BIT_REGISTER EQU 68
MMU_SLOT_0_REGISTER EQU 80
MMU_SLOT_1_REGISTER EQU 81
MMU_SLOT_2_REGISTER EQU 82
MMU_SLOT_3_REGISTER EQU 83
MMU_SLOT_4_REGISTER EQU 84
MMU_SLOT_5_REGISTER EQU 85
MMU_SLOT_6_REGISTER EQU 86
MMU_SLOT_7_REGISTER EQU 87
COPPER_DATA_REGISTER EQU 96
COPPER_CONTROL_LOW_REGISTER EQU 97
COPPER_CONTROL_HIGH_REGISTER EQU 98
DISPLAY_CONTROL_1_REGISTER EQU 105
LAYER_2_CONTROL_REGISTER EQU 112
LAYER_2_X_OFFSET_MSB_REGISTER EQU 113
DEBUG_LEDS_REGISTER EQU 255
GetNextReg: MACRO register
push bc
ld bc,$243B
ld a,register
out (c),a
inc b
in a,(c)
pop bc
ENDM
| 36.289157 | 58 | 0.684927 |
a3fbd28fc93875f38bf9eb33fc4ffbbe9b5ea967 | 462 | asm | Assembly | tests/lorenz/common/printhb.asm | rheit/yam6502 | 6e999758d816020139a64a10ec0ca2304e81b959 | [
"MIT"
] | null | null | null | tests/lorenz/common/printhb.asm | rheit/yam6502 | 6e999758d816020139a64a10ec0ca2304e81b959 | [
"MIT"
] | null | null | null | tests/lorenz/common/printhb.asm | rheit/yam6502 | 6e999758d816020139a64a10ec0ca2304e81b959 | [
"MIT"
] | null | null | null | ; this file is part of the C64 Emulator Test Suite. public domain, no copyright
; print hex byte in Akku
printhb
.block
pha
lsr a
lsr a
lsr a
lsr a
jsr printhn
pla
and #$0f
printhn
ora #$30
cmp #$3a
bcc printhn0
adc #6
printhn0
jsr cbmk_bsout
rts
.bend
| 18.48 | 79 | 0.409091 |
55b44083d8e9c7429eb741b72e0f1b6ac73bf134 | 528 | asm | Assembly | nasm assembly/library/print_string.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/library/print_string.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null | nasm assembly/library/print_string.asm | AI-Factor-y/NASM-library | 5141901352a47b73e716e27d628bb719f1891092 | [
"Apache-2.0"
] | null | null | null |
print_array_string:
;; usage
;-----------
; 1: base address of string to print is stored in ebx
section .bss
temp_print_str : resb 1
section .text
push rax
push rbx
push rcx
printing:
mov al, byte[ebx]
mov byte[temp_print_str], al
cmp byte[temp_print_str], 0 ;; checks if the character is NULL character
je end_printing
push rbx
mov eax, 4
mov ebx, 1
mov ecx, temp_print_str
mov edx, 1
int 80h
pop rbx
inc ebx
jmp printing
end_printing:
pop rcx
pop rbx
pop rax
ret
| 14.27027 | 74 | 0.659091 |
d21eb131b00cbe4d9858f42db44b84f7f0d386d9 | 1,564 | asm | Assembly | programs/oeis/264/A264938.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/264/A264938.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/264/A264938.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A264938: a(n) = n*(2*n-1) + floor(n/3).
; 0,1,6,16,29,46,68,93,122,156,193,234,280,329,382,440,501,566,636,709,786,868,953,1042,1136,1233,1334,1440,1549,1662,1780,1901,2026,2156,2289,2426,2568,2713,2862,3016,3173,3334,3500,3669,3842,4020,4201,4386,4576,4769,4966,5168,5373,5582,5796,6013,6234,6460,6689,6922,7160,7401,7646,7896,8149,8406,8668,8933,9202,9476,9753,10034,10320,10609,10902,11200,11501,11806,12116,12429,12746,13068,13393,13722,14056,14393,14734,15080,15429,15782,16140,16501,16866,17236,17609,17986,18368,18753,19142,19536,19933,20334,20740,21149,21562,21980,22401,22826,23256,23689,24126,24568,25013,25462,25916,26373,26834,27300,27769,28242,28720,29201,29686,30176,30669,31166,31668,32173,32682,33196,33713,34234,34760,35289,35822,36360,36901,37446,37996,38549,39106,39668,40233,40802,41376,41953,42534,43120,43709,44302,44900,45501,46106,46716,47329,47946,48568,49193,49822,50456,51093,51734,52380,53029,53682,54340,55001,55666,56336,57009,57686,58368,59053,59742,60436,61133,61834,62540,63249,63962,64680,65401,66126,66856,67589,68326,69068,69813,70562,71316,72073,72834,73600,74369,75142,75920,76701,77486,78276,79069,79866,80668,81473,82282,83096,83913,84734,85560,86389,87222,88060,88901,89746,90596,91449,92306,93168,94033,94902,95776,96653,97534,98420,99309,100202,101100,102001,102906,103816,104729,105646,106568,107493,108422,109356,110293,111234,112180,113129,114082,115040,116001,116966,117936,118909,119886,120868,121853,122842,123836
mov $1,$0
div $1,3
mov $2,$0
mov $3,$0
sub $0,1
mul $0,$2
add $1,$0
mov $4,$3
mul $4,$3
add $1,$4
| 111.714286 | 1,422 | 0.793478 |
c72a9fba996ba635acca525f302e172940d9c786 | 145 | asm | Assembly | programs/oeis/004/A004052.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/004/A004052.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/004/A004052.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A004052: The coding-theoretic function A(n,14,8).
; 1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4
mov $1,$0
add $1,$0
sub $1,3
div $1,11
add $1,1
| 16.111111 | 51 | 0.586207 |
37147d4ffeb8ac6665d614f0396a6e007a7312aa | 5,460 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2528.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2528.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2528.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xac06, %rdx
nop
and %rbp, %rbp
mov $0x6162636465666768, %rbx
movq %rbx, %xmm1
vmovups %ymm1, (%rdx)
nop
nop
nop
nop
inc %r14
lea addresses_WT_ht+0x4b88, %r8
nop
sub %r13, %r13
movl $0x61626364, (%r8)
nop
sub $7296, %r14
lea addresses_WT_ht+0x1b988, %r13
nop
nop
nop
nop
nop
add $35018, %r15
mov $0x6162636465666768, %rdx
movq %rdx, (%r13)
nop
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_D_ht+0x1508, %r13
nop
nop
and $35380, %rdx
mov (%r13), %r15w
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_A_ht+0x19588, %rdx
nop
nop
nop
add %r15, %r15
vmovups (%rdx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r13
nop
nop
sub $13633, %r13
lea addresses_UC_ht+0x11dc8, %rsi
lea addresses_WC_ht+0x2988, %rdi
nop
nop
and %r14, %r14
mov $108, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %rax
push %rbx
push %rdi
// Faulty Load
lea addresses_WC+0x1f188, %rdi
clflush (%rdi)
nop
nop
nop
cmp %r11, %r11
mov (%rdi), %r8d
lea oracles, %r11
and $0xff, %r8
shlq $12, %r8
mov (%r11,%r8,1), %r8
pop %rdi
pop %rbx
pop %rax
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': True, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'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
*/
| 40.746269 | 2,999 | 0.659707 |
31782f57570b622099dad6547926057de10478df | 1,348 | asm | Assembly | SLIDE_Debugging.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | 2 | 2018-12-23T17:19:34.000Z | 2019-08-23T16:15:57.000Z | SLIDE_Debugging.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | null | null | null | SLIDE_Debugging.asm | XlogicX/CactusCon2017 | d4cc716169dc8c6c2956c57079eb64342d5432bf | [
"BSD-2-Clause"
] | null | null | null | %include 'textmode.h'
call draw_border
mov di, 160 * 2 + 8 ;where to place cursor
mov si, line01 ;fetch the text
mov ah, 0x0A ;color
call slide_line
mov di, 160 * 4 + 16 ;where to place cursor
mov si, line02 ;fetch the text
call slide_line
mov di, 160 * 6 + 16 ;where to place cursor
mov si, line03 ;fetch the text
call slide_line
mov di, 160 * 8 + 16 ;where to place cursor
mov si, line04 ;fetch the text
call slide_line
mov di, 160 * 10 + 24 ;where to place cursor
mov si, line05 ;fetch the text
call slide_line
mov di, 160 * 12 + 24 ;where to place cursor
mov si, line06 ;fetch the text
call slide_line
mov di, 160 * 14 + 24 ;where to place cursor
mov si, line07 ;fetch the text
call slide_line
mov di, 160 * 16 + 24 ;where to place cursor
mov si, line08 ;fetch the text
call slide_line
jmp endloop
endloop:
jmp endloop
%include 'slide_frame.h'
%include 'pause.h'
line01 db 0x1F, 0x07, ' Debugging Boot Sector Images:'
line02 db 0x0F, 0x07, ' Using objdump'
line03 db 0x17, 0x07, ' Attaching qemu to gdb'
line04 db 0x15, 0x07, ' Actually using gdb:'
line05 db 0x0A, 0x07, ' Stepping'
line06 db 0x0D, 0x07, ' Breakpoints'
line07 db 0x19, 0x07, ' Show Registers & Memory'
line08 db 0x0D, 0x07, ' Disassemble'
titlemessage db 0x09, 'Debugging'
;BIOS sig and padding
times 510-($-$$) db 0
dw 0xAA55 | 22.847458 | 54 | 0.70178 |
58f228354ed0b40fb03a218ded1d89247f751562 | 5,832 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0xca.log_21829_1820.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0xca.log_21829_1820.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0xca.log_21829_1820.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x18e72, %rsi
lea addresses_UC_ht+0x4c72, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
inc %r12
mov $18, %rcx
rep movsl
nop
nop
nop
nop
cmp $8374, %r11
lea addresses_A_ht+0x8272, %r15
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%r15)
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0x1972, %rcx
nop
nop
nop
nop
nop
sub $3992, %r15
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
movups %xmm1, (%rcx)
nop
nop
dec %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rbx
// Store
lea addresses_UC+0x5872, %rax
inc %r11
mov $0x5152535455565758, %r10
movq %r10, %xmm0
movaps %xmm0, (%rax)
add %r11, %r11
// Store
lea addresses_normal+0x1e5ae, %r11
nop
nop
nop
nop
and $12758, %r14
movl $0x51525354, (%r11)
nop
nop
nop
xor %r13, %r13
// Store
lea addresses_normal+0xd93a, %r13
cmp %rbx, %rbx
mov $0x5152535455565758, %r14
movq %r14, %xmm1
movups %xmm1, (%r13)
inc %rax
// Store
lea addresses_WT+0x18ef2, %r10
nop
nop
add $65260, %r14
movw $0x5152, (%r10)
nop
nop
nop
add $7571, %r14
// Faulty Load
lea addresses_UC+0x5872, %rax
clflush (%rax)
nop
nop
nop
nop
xor %r10, %r10
vmovaps (%rax), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r14
lea oracles, %r11
and $0xff, %r14
shlq $12, %r14
mov (%r11,%r14,1), %r14
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_UC'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 32, 'NT': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}}
{'00': 73, '58': 21756}
58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 38.368421 | 2,999 | 0.659122 |
be6159061cfbde51735bf16a514ffc009073360f | 5,019 | asm | Assembly | Landlords/server.asm | ThssSE/Landlords | e851758789e72b00b907b25d96cae4ee5c11469a | [
"MIT"
] | 2 | 2020-10-06T11:22:56.000Z | 2021-05-29T12:17:25.000Z | Landlords/server.asm | JL-Cheng/Landlords | 819b84b053febb84b009fdba1226655cb558db02 | [
"MIT"
] | null | null | null | Landlords/server.asm | JL-Cheng/Landlords | 819b84b053febb84b009fdba1226655cb558db02 | [
"MIT"
] | 1 | 2018-11-11T16:12:23.000Z | 2018-11-11T16:12:23.000Z | ; #########################################################################
; 文件:
; server.asm
;
; 功能:
; 完成服务器的各种信息处理操作
;
; #########################################################################
TITLE LandLordServer (server.asm)
include server.inc
.code
;-----------------------------------------------------
initServer PROC USES eax ebx
; 函数功能 : 初始化socket,绑定到TCP端口并开始监听。等到玩家连入socket,当所有玩家连入后,发送消息至客户端。
; 返回值 : null
;-----------------------------------------------------
invoke WSAStartup, wsaVersion, addr wsaData
.if eax ;the call is unsuccessful
invoke ExitProcess, 0
.endif
;create socket
invoke socket, AF_INET, SOCK_STREAM, 0
.if eax != INVALID_SOCKET
mov hListenSock, eax
.else
invoke WSAGetLastError
.endif
;fulfill sockInfo
invoke RtlZeroMemory, addr hListenSockAddr, SIZEOF hListenSockAddr ;use zero to fill the block
invoke htons, TCP_PORT ;convert the ip value to network byte order(big endiant)
mov hListenSockAddr.sin_port, ax
mov hListenSockAddr.sin_family, AF_INET
mov hListenSockAddr.sin_addr, INADDR_ANY ;set host
;bind sock to listen ip:host, port:TCP_PORT
invoke bind, hListenSock, addr hListenSockAddr, SIZEOF hListenSockAddr
.if eax ;bind error
invoke crt_printf, addr szErrBindStr
invoke ExitProcess, 0
.endif
invoke listen, hListenSock, 5 ;max connected num
;wait player to connect
mov ebx, 0
.while bl < gameSock
invoke accept, hListenSock, NULL, NULL ; sockaddr, socklen not needed
.continue .if eax == INVALID_SOCKET
mov connectedSockList[ebx * 4], eax
invoke crt_printf, addr szConnectStr, bl, eax
inc bl
.endw
ret
initServer ENDP
;-----------------------------------------------------
listenSocket PROC
; 函数功能 : 监听客户端事件,传输发送至所有客户端
; 返回值 : null
;-----------------------------------------------------
pushad
;给每个client编号
mov ebx, 0
lea esi,my_game
.while bl < gameSock
mov (GamePack PTR [esi]).now_player,bl
invoke sendPack, connectedSockList[ebx * 4], addr my_game
inc bl
.endw
;开始游戏并发牌
invoke GameStart,addr my_game
invoke SendCard,addr my_game
mov ebx, 0
mov (GamePack PTR [esi]).now_player,0
.while bl < gameSock
invoke sendPack, connectedSockList[ebx * 4], addr my_game
inc bl
.endw
;叫地主
mov ebx, 0
mov (GamePack PTR [esi]).status,game_GetLandlord
mov (GamePack PTR [esi]).now_player,0
.while bl < gameSock
invoke sendPack, connectedSockList[ebx * 4], addr my_game
invoke recvPack, connectedSockList[ebx * 4], addr my_game
inc bl
mov (GamePack PTR [esi]).now_player,bl
.endw
;设置地主并发地主牌
invoke SetLandlord,addr my_game
invoke SendLandlordCard,addr my_game
mov ebx, 0
mov (GamePack PTR [esi]).now_player,0
.while bl < gameSock
invoke sendPack, connectedSockList[ebx * 4], addr my_game
inc bl
mov (GamePack PTR [esi]).now_player,bl
.endw
;游戏进行中:不断循环
mov (GamePack PTR [esi]).now_player,0
.while TRUE
;安排游戏状态
invoke GamePlaying,addr my_game
mov al,(GamePack PTR [esi]).status
;若游戏已经结束
.if al == game_GameOver
;通知所有玩家
mov ebx, 0
.while bl < gameSock
invoke sendPack, connectedSockList[ebx * 4], addr my_game
inc bl
.endw
.break
.endif
;若游戏仍在继续
mov ebx, 0
lea esi,my_game
mov bl,(GamePack PTR [esi]).now_player
invoke sendPack, connectedSockList[ebx * 4], addr my_game
invoke recvPack, connectedSockList[ebx * 4], addr my_game
mov ebx, 0
.while bl < gameSock
mov al,(GamePack PTR [esi]).now_player
.if bl!=al
invoke sendPack, connectedSockList[ebx * 4], addr my_game
.endif
inc bl
.endw
.endw
;游戏结束
invoke GameOver,addr my_game
popad
ret
listenSocket ENDP
;-----------------------------------------------------
recvPack PROC USES ecx ebx,
_hSock:DWORD, ;socket to recv
_pack: PTR GamePack
; 函数功能 : 接收数据包
; 返回值 : null
;-----------------------------------------------------
mov eax, SOCKET_ERROR
.repeat
invoke recv, _hSock, _pack, SIZEOF GamePack, 0
.until eax != SOCKET_ERROR
ret
recvPack ENDP
;-----------------------------------------------------
;-----------------------------------------------------
sendPack PROC USES ebx eax ecx,
_hSock:DWORD, ;socket to send
_packAddr:PTR GamePack ;packet address
; 函数功能 : 发送数据包
; 返回值 : null
;-----------------------------------------------------
mov eax, SOCKET_ERROR
.repeat
invoke send, _hSock, _packAddr, SIZEOF GamePack, 0
.until eax != SOCKET_ERROR
ret
sendPack ENDP
;-----------------------------------------------------
server_main PROC
invoke crt_printf, addr szInitSockNumStr
invoke initServer
.while 1
invoke listenSocket
;收到准备信号
pushad
mov ebx, 0
.while bl < gameSock
invoke recvPack, connectedSockList[ebx * 4], addr my_game
inc bl
.endw
lea esi,my_game
mov al,game_NoStart
mov (GamePack PTR [esi]).status,al
popad
.endw
invoke closesocket, hListenSock
invoke WSACleanup
invoke ExitProcess, NULL
server_main ENDP
END ;server_main | 23.129032 | 99 | 0.608687 |
302964a529c61fd8fc8c465468936a0765d12d62 | 2,790 | asm | Assembly | sources/ippcp/asm_intel64_gas_converted/linux/pic/n0/singlecpu/pcppurgeblkm7as.asm | ymarkovitch/ipp-crypto | ac8f1c443cc79e9f2f8508f8c707c9ed0caa22c8 | [
"Apache-2.0"
] | null | null | null | sources/ippcp/asm_intel64_gas_converted/linux/pic/n0/singlecpu/pcppurgeblkm7as.asm | ymarkovitch/ipp-crypto | ac8f1c443cc79e9f2f8508f8c707c9ed0caa22c8 | [
"Apache-2.0"
] | null | null | null | sources/ippcp/asm_intel64_gas_converted/linux/pic/n0/singlecpu/pcppurgeblkm7as.asm | ymarkovitch/ipp-crypto | ac8f1c443cc79e9f2f8508f8c707c9ed0caa22c8 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# 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.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
.p2align 6, 0x90
.globl PurgeBlock
.type PurgeBlock, @function
PurgeBlock:
movslq %esi, %rcx
xor %rax, %rax
sub $(8), %rcx
jl .Ltest_purgegas_1
.Lpurge8gas_1:
movq %rax, (%rdi)
add $(8), %rdi
sub $(8), %rcx
jge .Lpurge8gas_1
.Ltest_purgegas_1:
add $(8), %rcx
jz .Lquitgas_1
.Lpurge1gas_1:
movb %al, (%rdi)
add $(1), %rdi
sub $(1), %rcx
jg .Lpurge1gas_1
.Lquitgas_1:
ret
.Lfe1:
.size PurgeBlock, .Lfe1-(PurgeBlock)
| 37.2 | 80 | 0.636918 |
970dd37673dde495b3eeaaf82bcf02b7761d9c51 | 664 | asm | Assembly | oeis/162/A162484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/162/A162484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/162/A162484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A162484: a(1) = 2, a(2) = 8; a(n) = 2 a(n - 1) + a(n - 2) - 4*(n mod 2).
; 2,8,14,36,82,200,478,1156,2786,6728,16238,39204,94642,228488,551614,1331716,3215042,7761800,18738638,45239076,109216786,263672648,636562078,1536796804,3710155682,8957108168,21624372014,52205852196,126036076402,304278005000,734592086398,1773462177796,4281516441986,10336495061768,24954506565518,60245508192804,145445522951122,351136554095048,847718631141214,2046573816377476,4940866263896162,11928306344169800,28797478952235758,69523264248641316,167844007449518386,405211279147678088
mov $1,$0
mod $0,2
add $0,3
seq $1,78057 ; Expansion of (1+x)/(1-2*x-x^2).
sub $1,3
add $0,$1
mul $0,2
| 60.363636 | 484 | 0.786145 |
d74d0cc680bb1d64315b9e407a527ac8ec437435 | 16,672 | asm | Assembly | EC/devenv/Memory/prac.asm | stkw0/cuddly-computing-machine | ff01edcc92b12494ede9107b8bfffe32d1e12fe2 | [
"Unlicense"
] | null | null | null | EC/devenv/Memory/prac.asm | stkw0/cuddly-computing-machine | ff01edcc92b12494ede9107b8bfffe32d1e12fe2 | [
"Unlicense"
] | null | null | null | EC/devenv/Memory/prac.asm | stkw0/cuddly-computing-machine | ff01edcc92b12494ede9107b8bfffe32d1e12fe2 | [
"Unlicense"
] | null | null | null | .586
.MODEL FLAT, C
; Funcions definides en C
printChar_C PROTO C, value:SDWORD
printInt_C PROTO C, value:SDWORD
clearscreen_C PROTO C
clearArea_C PROTO C, value:SDWORD, value1: SDWORD
printMenu_C PROTO C
gotoxy_C PROTO C, value:SDWORD, value1: SDWORD
getch_C PROTO C
printBoard_C PROTO C, value: DWORD
initialPosition_C PROTO C
.code
public C posCurScreenP1, getMoveP1, moveCursorP1, movContinuoP1, openP1, openContinuousP1
extern C opc: SDWORD, row:SDWORD, col: BYTE, carac: BYTE, carac2: BYTE, mineField: BYTE, taulell: BYTE, indexMat: SDWORD
extern C rowCur: SDWORD, colCur: BYTE, rowScreen: SDWORD, colScreen: SDWORD, RowScreenIni: SDWORD, ColScreenIni: SDWORD
extern C rowIni: SDWORD, colIni: BYTE, indexMatIni: SDWORD
extern C neighbours: SDWORD, marks: SDWORD, endGame: SDWORD
;****************************************************************************************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Situar el cursor en una fila i una columna de la pantalla
; en funció de la fila i columna indicats per les variables colScreen i rowScreen
; cridant a la funció gotoxy_C.
;
; Variables utilitzades:
; Cap
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;gotoxy:
gotoxy proc
push ebp
mov ebp, esp
pushad
; Quan cridem la funció gotoxy_C(int row_num, int col_num) des d'assemblador
; els paràmetres s'han de passar per la pila
mov eax, [colScreen]
push eax
mov eax, [rowScreen]
push eax
call gotoxy_C
pop eax
pop eax
popad
leave
ret
gotoxy endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Mostrar un caràcter, guardat a la variable carac
; en la pantalla en la posició on està el cursor,
; cridant a la funció printChar_C.
;
; Variables utilitzades:
; carac : variable on està emmagatzemat el caracter a treure per pantalla
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;printch:
printch proc
push ebp
mov ebp, esp
;guardem l'estat dels registres del processador perqué
;les funcions de C no mantenen l'estat dels registres.
pushad
; Quan cridem la funció printch_C(char c) des d'assemblador,
; el paràmetre (carac) s'ha de passar per la pila.
xor eax,eax
mov al, [carac]
push eax
call printChar_C
pop eax
popad
leave
ret
printch endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Llegir un caràcter de teclat
; cridant a la funció getch_C
; i deixar-lo a la variable carac2.
;
; Variables utilitzades:
; carac2 : Variable on s'emmagatzema el caracter llegit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;getch:
getch proc
push ebp
mov ebp, esp
;push eax
pushad
call getch_C
mov [carac2],al
;pop eax
popad
leave
ret
getch endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Posicionar el cursor a la pantalla, dins el tauler, en funció de
; les variables (row) fila (int) i (col) columna (char), a partir dels
; valors de les constants RowScreenIni i ColScreenIni.
; Primer cal restar 1 a row (fila) per a que quedi entre 0 i 7
; i convertir el char de la columna (A..H) a un número entre 0 i 7.
; Per calcular la posició del cursor a pantalla (rowScreen) i
; (colScreen) utilitzar aquestes fórmules:
; rowScreen=rowScreenIni+(row*2)
; colScreen=colScreenIni+(col*4)
; Per a posicionar el cursor cridar a la subrutina gotoxy.
;
; Variables utilitzades:
; row : fila per a accedir a la matriu mineField/taulell
; col : columna per a accedir a la matriu mineField/taulell
; rowScreen : fila on volem posicionar el cursor a la pantalla.
; colScreen : columna on volem posicionar el cursor a la pantalla.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;posCurScreenP1:
posCurScreenP1 proc
push ebp
mov ebp, esp
mov ebx, [row]
dec ebx
mov [row], ebx
shl ebx, 1
add ebx, [rowScreenIni]
mov [rowScreen], ebx
xor ebx, ebx
mov bl, [col]
sub bl, 'A'
mov [col], bl
shl bl, 2
add ebx, [colScreenIni]
mov [colScreen], ebx
call gotoxy
leave
ret
posCurScreenP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Llegir un caràcter de teclat
; cridant a la subrutina getch
; Verificar que solament es pot introduir valors entre 'i' i 'l',
; o les tecles espai ' ', 'm' o 's' i deixar-lo a la variable carac2.
;
; Variables utilitzades:
; carac2 : Variable on s'emmagatzema el caràcter llegit
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;getMoveP1:
getMoveP1 proc
push ebp
mov ebp, esp
read_again:
call getch
mov al, [carac2]
cmp al, ' '
je ok
cmp al, 'm'
je ok
cmp al, 's'
je ok
cmp al, 'i'
jl read_again
cmp al, 'l'
jg read_again
ok:
leave
ret
getMoveP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Actualitzar les variables (rowCur) i (colCur) en funció de
; la tecla premuda que tenim a la variable (carac2)
; (i: amunt, j:esquerra, k:avall, l:dreta).
; Comprovar que no sortim del taulell, (rowCur) i (colCur) només poden
; prendre els valors [1..8] i [0..7]. Si al fer el moviment es surt
; del tauler, no fer el moviment.
; No posicionar el cursor a la pantalla, es fa a posCurScreenP1.
;
; Variables utilitzades:
; carac2 : caràcter llegit de teclat
; 'i': amunt, 'j':esquerra, 'k':avall, 'l':dreta
; rowCur : fila del cursor a la matriu mineField.
; colCur : columna del cursor a la matriu mineField.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;moveCursorP1: proc endp
moveCursorP1 proc
push ebp
mov ebp, esp
mov al, [carac2]
cmp al, 'i'
je move_up
cmp al, 'k'
je move_down
cmp al, 'j'
je move_left
cmp al, 'l'
je move_right
jmp bye
move_up:
cmp [rowCur], 1
jle bye
dec [rowCur]
jmp bye
move_down:
cmp [rowCur], 8
jge bye
inc [rowCur]
jmp bye
move_left:
cmp [colCur], 0+'A'
jle bye
dec [colCur]
jmp bye
move_right:
cmp [colCur], 7+'A'
jge bye
inc [colCur]
jmp bye
bye:
leave
ret
moveCursorP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subrutina que implementa el moviment continuo.
;
; Variables utilitzades:
; carac2 : variable on s’emmagatzema el caràcter llegit
; rowCur : Fila del cursor a la matriu mineField
; colCur : Columna del cursor a la matriu mineField
; row : Fila per a accedir a la matriu mineField
; col : Columna per a accedir a la matriu mineField
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;movContinuoP1: proc endp
movContinuoP1 proc
push ebp
mov ebp, esp
next_move:
call getMoveP1
cmp [carac2], 's'
je bye
cmp [carac2], ' '
je bye
cmp [carac2], 'm'
je bye
call moveCursorP1
mov ebx, [rowCur]
mov al, [colCur]
mov [row], ebx
mov [col], al
call posCurScreenP1
jmp next_move
bye:
leave
ret
movContinuoP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Calcular l'índex per a accedir a les matrius en assemblador.
; mineField[row][col] en C, és [mineField+indexMat] en assemblador.
; on indexMat = row*8 + col (col convertir a número).
;
; Variables utilitzades:
; row : fila per a accedir a la matriu mineField
; col : columna per a accedir a la matriu mineField
; indexMat : índex per a accedir a la matriu mineField
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;calcIndexP1: proc endp
calcIndexP1 proc
push ebp
mov ebp, esp
push ebx
xor ebx, ebx
mov eax, [row]
mov bl, [col]
;shr bl, 2
shl eax, 3
add eax, ebx
mov [indexMat], eax
bye:
pop ebx
leave
ret
calcIndexP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Obrim una casella de la matriu mineField
; En primer lloc calcular la posició de la matriu corresponent a la
; posició que ocupa el cursor a la pantalla, cridant a la
; subrutina calcIndexP1.
; En cas de que la casella no estigui oberta ni marcada mostrar:
; - 'X' si hi ha una mina
; - 'm' si volem marcar la casella
; - el numero de veïns si obrim una casella sense mina
; En cas de que la casella estigui marcada mostrar:
; - ' ' si volem desmarcar la casella
; Mostrarem el contingut de la casella criant a la subrutina printch. L'índex per
; a accedir a la matriu mineField, el calcularem cridant a la subrutina calcIndexP1.
; No es pot obrir una casella que ja tenim oberta o marcada.
; Cada vegada que marquem/desmarquem una casella, actualitzar el número de marques restants
; cridant a la subrutina updateMarks.
; Si obrim una casella amb mina actualitzar el valor endGame a -1.
; Finalment, per al nivell avançat, si obrim una casella sense mina y amb
; 0 mines al voltant, cridarem a la subrutina openBorders del nivell avançat.
;
; Variables utilitzades:
; row : fila per a accedir a la matriu mineField
; rowCur : fila actual del cursor a la matriu
; col : columna per a accedir a la matriu mineField
; colCur : columna actual del cursor a la matriu
; indexMat : Índex per a accedir a la matriu mineField
; mineField : Matriu 8x8 on tenim les posicions de les mines.
; carac : caràcter per a escriure a pantalla.
; taulell : Matriu en la que anem indicant els valors de les nostres tirades
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;openP1: proc endp
openP1 proc
push ebp
mov ebp, esp
call calcIndexP1
mov eax, [indexMat]
cmp [carac2], ' '
je desmarcar
cmp [carac2], 'm'
je marcar
jmp bye
marcar:
; no marks left to be used
cmp [taulell + eax], 'm'
je undo_mark
cmp [marks], 0
jle bye
mov [taulell + eax], 'm'
mov [carac], 'm'
call printch
jmp bye
undo_mark:
cmp [marks], 9
jge bye
mov [taulell + eax], ' '
mov [carac], ' '
call printch
jmp bye
desmarcar:
;mov bl, [mineField + eax]
;cmp bl, 0
;je no_minas
;add bl, '0'
;mov [carac], bl
;call printch
call countMines
jmp bye
no_minas:
mov [carac], '0'
call printch
bye:
call updateMarks
leave
ret
openP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subrutina que implementa l’obertura continua de caselles. S’ha d’utilitzar
; la tecla espai per a obrir una casella i la 's' per a sortir.
; Per a cada moviment introduït comprovar si hem guanyat el joc cridant a
; la subrutina checkWin, o bé si hem perdut el joc (endGame!=0).
;
; Variables utilitzades:
; carac2 : Caràcter introduït per l’usuari
; rowCur : Fila del cursor a la matriu mineField
; colCur : Columna del cursor a la matriu mineField
; row : Fila per a accedir a la matriu mineFieldf
; col : Columna per a accedir a la matriu mineField
; endGame : flag per indicar si hem perdut (0=no hem perdut, 1=hem perdut)
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;openContinuousP1:proc endp
openContinuousP1 proc
push ebp
mov ebp, esp
repetir:
call movContinuoP1
call openP1
cmp [carac2], 's'
je bye
jmp repetir
bye:
leave
ret
openContinuousP1 endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Modificar el nombre de marques encara disponibles.
; Recórrer el taullel per comptar les marques posades ('m') i restar aquest valor a les inicials (9).
; Imprimir el nou valor a la posició indicada (rowScreen = 3, colScreen = 57), tenint
; en compte que hi haurem de sumar el valor '0' pel format ASCII.
;
; Variables utilitzades:
; taulell : Matriu en la que anem indicant els valors de les nostres tirades
; rowScreen : Fila de la pantalla
; colScreen : Columna de la pantalla
; marks : Nombre de mines no marcades
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
updateMarks proc
push ebp
mov ebp, esp
xor ecx, ecx
mov [marks], 9
bucle:
cmp ecx, 64
je bye
xor eax, eax
;mov eax, [indexMat]
cmp [taulell + ecx], 'm'
lahf ; load flags into AH ← EFLAGS(SF:ZF:0:AF:0:PF:1:CF);
shr eax, 14
and eax, 01b
; if ZF == 1 then EAX = 1
sub [marks], eax
inc ecx
jmp bucle
bye:
mov [rowScreen], 3
mov [colScreen], 57
call gotoxy
mov ebx, [marks]
add ebx, '0'
mov [carac], bl
call printch
leave
ret
updateMarks endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Comptar el nombre de mines a les cel·les veïnes (les vuit del voltant).
; S'ha de comprovar que no accedim a posicions de fora el mineField per comptar les mines.
; Guardar el nombre de mines de les cel·les a la variable neighbours.
;
; Variables utilitzades:
; taulell : Matriu en la que anem indicant els valors de les nostres tirades
; mineField : Matriu 8x8 on tenim les posicions de les mines.
; neighbours : Caràcter introduït per l’usuari
; col : Fila del cursor a la matriu mineField
; row : Columna del cursor a la matriu mineField
; indexMat : Índex per a accedir a la matriu mineField
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
countMines proc
push ebp
mov ebp, esp
;esqDalt dalt dretDalt
;esq dret
;esqBaix baix dretBaix
; mines counter
xor edx, edx
xor ecx, ecx
xor ebx,ebx; flags
; 0b0(no left) 0(no right) 0(no up) 0(no dowm)
cmp [col], 0
jne skip_1
or ebx, 1000b
skip_1:
cmp [col], 7
jne skip_2
or ebx, 100b
skip_2:
cmp [row], 0
jne skip_3
or ebx, 10b
skip_3:
cmp [row], 7
jl skip_4
or ebx, 1b
skip_4:
call cmp_leftUp
call cmp_leftMid
call cmp_leftBelow
call cmp_rightUp
call cmp_rightMid
call cmp_rightBelow
call cmp_up
call cmp_down
jmp end_count
cmp_leftUp:
test ebx, 1010b
jnz exit_0
dec [col]
dec [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
inc [row]
inc [col]
exit_0:
ret
cmp_leftMid:
test ebx, 1000b
jnz exit_1
dec [col]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
inc [col]
exit_1:
ret
cmp_leftBelow:
test ebx, 1001b
jnz exit_2
dec [col]
inc [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
inc [col]
dec [row]
exit_2:
ret
cmp_rightUp:
test ebx, 0110b
jnz exit_3
inc [col]
dec [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
dec [col]
inc [row]
exit_3:
ret
cmp_rightMid:
test ebx, 0100b
jnz exit_4
inc [col]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
dec [col]
exit_4:
ret
cmp_rightBelow:
test ebx, 0101b
jnz exit_5
inc [col]
inc [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
dec [col]
dec [row]
exit_5:
ret
cmp_up:
test ebx, 10b
jnz exit_6
dec [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
inc [row]
exit_6:
ret
cmp_down:
test ebx, 1b
jnz exit_7
inc [row]
call calcIndexP1
mov eax, [indexMat]
mov cl, [mineField + eax]
add edx, ecx
dec [row]
exit_7:
ret
end_count:
add edx, '0'
mov [carac], dl
call printch
leave
ret
countMines endp
END
COMMENT @
extern "C" char mineField[8][8] = {
{ 1,0,0,0,0,0,0,0 },
{ 0,0,0,1,0,0,1,0 },
{ 0,0,0,0,0,0,0,0 },
{ 0,1,0,0,0,1,0,0 },
{ 0,0,0,0,0,0,0,0 },
{ 0,0,0,1,0,1,0,0 },
{ 0,0,0,0,0,0,0,0 },
{ 0,1,0,0,1,0,0,0 }
@
| 23.187761 | 121 | 0.56274 |
69eea31b239ad6120cebeaff073f5ba81fd37768 | 3,212 | asm | Assembly | dino/lcs/123p/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/123p/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/123p/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
004D94 move.l D1, (A1)+
004D96 dbra D0, $4d94
00614A move.b D0, ($3334,A5)
00614E move.b D0, ($34b4,A5)
006152 move.b D0, ($3634,A5)
006156 tst.b ($518,A5)
006168 move.b #$1, ($c0,A0)
00616E rts [123p+ C0]
00BF0C tst.b ($3334,A5)
00BF10 beq $bf14
00BF1A tst.b ($34b4,A5)
00BF1E beq $bf22
00BF28 tst.b ($3634,A5)
00BF2C beq $bf30 [123p+ C0]
0199AC tst.b ($c0,A6)
0199B0 beq $199c2 [123p+ C0]
0199D4 tst.b ($c0,A6)
0199D8 beq $199f0 [123p+ C0]
01AFC0 tst.b ($c0,A6)
01AFC4 beq $1afca [123p+ C0]
01DA56 clr.b ($3334,A5)
01DA5A clr.b ($34b4,A5) [123p+ C0]
01DA5E clr.b ($3634,A5)
01DA62 rts [123p+ C0]
01E0AE tst.b ($c0,A6)
01E0B2 beq $1e0be [123p+ C0]
01E28C tst.b ($c0,A6)
01E290 beq $1e2a0 [123p+ C0]
01E584 tst.b ($c0,A6) [123p+ DA]
01E588 beq $1e59c [123p+ C0]
01E5A8 tst.b ($c0,A6) [123p+ A8]
01E5AC beq $1e5c6 [123p+ C0]
01E606 move.b D0, ($c0,A1)
01E60A move.b D0, ($c0,A2)
01E60E move.b D0, ($c0,A3)
01E612 tst.b ($0,A1)
01E648 move.b #$1, ($c0,A0)
01E64E rts [123p+ C0]
08C1D4 clr.b ($3334,A5)
08C1D8 clr.b ($34b4,A5)
08C1DC clr.b ($3634,A5)
08C1E0 move.l #$4000000, ($4,A6)
08C262 move.b #$1, ($3334,A5) [etc+A8]
08C268 tst.b ($33f4,A5) [123p+ C0]
08C27E move.b #$1, ($34b4,A5) [etc+A8]
08C284 tst.b ($3574,A5) [123p+ C0]
08C29A move.b #$1, ($3634,A5) [etc+A8]
08C2A0 rts [123p+ C0]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 48.666667 | 350 | 0.628269 |
485ee3533b7c9377562f0a3bf797faf7b97518b2 | 5,038 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2355.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2355.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2355.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x14776, %r9
nop
nop
nop
add %r8, %r8
mov $0x6162636465666768, %r10
movq %r10, %xmm2
vmovups %ymm2, (%r9)
xor %rax, %rax
lea addresses_normal_ht+0x1226a, %r15
nop
nop
nop
cmp $62686, %r10
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
movups %xmm2, (%r15)
nop
nop
nop
nop
inc %r10
lea addresses_WT_ht+0x1642a, %rsi
lea addresses_UC_ht+0x116ea, %rdi
nop
nop
nop
xor $5239, %r8
mov $58, %rcx
rep movsb
nop
and %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_UC+0xf6ea, %rsi
lea addresses_WT+0x1e1ea, %rdi
nop
add %r13, %r13
mov $22, %rcx
rep movsb
nop
nop
sub %rsi, %rsi
// Faulty Load
lea addresses_UC+0xf6ea, %r9
nop
nop
nop
sub $46382, %rbp
vmovups (%r9), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %r10
lea oracles, %rbp
and $0xff, %r10
shlq $12, %r10
mov (%rbp,%r10,1), %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT', 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': 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
*/
| 45.8 | 2,999 | 0.662168 |
c6d7fa1ec0f356a209cb7ce8c85cd88165a4a50a | 26,468 | asm | Assembly | aom_dsp/x86/intrapred_sse2.asm | negge/aom | a81e821f8820c4405b7713d9b467537907921f0b | [
"BSD-2-Clause"
] | null | null | null | aom_dsp/x86/intrapred_sse2.asm | negge/aom | a81e821f8820c4405b7713d9b467537907921f0b | [
"BSD-2-Clause"
] | null | null | null | aom_dsp/x86/intrapred_sse2.asm | negge/aom | a81e821f8820c4405b7713d9b467537907921f0b | [
"BSD-2-Clause"
] | null | null | null | ;
; Copyright (c) 2016, Alliance for Open Media. All rights reserved
;
; This source code is subject to the terms of the BSD 2 Clause License and
; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
; was not distributed with this source code in the LICENSE file, you can
; obtain it at www.aomedia.org/license/software. If the Alliance for Open
; Media Patent License 1.0 was not distributed with this source code in the
; PATENTS file, you can obtain it at www.aomedia.org/license/patent.
;
;
%include "third_party/x86inc/x86inc.asm"
SECTION_RODATA
pb_1: times 16 db 1
pw_4: times 8 dw 4
pw_8: times 8 dw 8
pw_16: times 8 dw 16
pw_32: times 8 dw 32
dc_128: times 16 db 128
pw2_4: times 8 dw 2
pw2_8: times 8 dw 4
pw2_16: times 8 dw 8
pw2_32: times 8 dw 16
SECTION .text
; ------------------------------------------
; input: x, y, z, result
;
; trick from pascal
; (x+2y+z+2)>>2 can be calculated as:
; result = avg(x,z)
; result -= xor(x,z) & 1
; result = avg(result,y)
; ------------------------------------------
%macro X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 4
pavgb %4, %1, %3
pxor %3, %1
pand %3, [GLOBAL(pb_1)]
psubb %4, %3
pavgb %4, %2
%endmacro
INIT_XMM sse2
cglobal d45_predictor_4x4, 3, 4, 4, dst, stride, above, goffset
GET_GOT goffsetq
movq m0, [aboveq]
DEFINE_ARGS dst, stride, temp
psrldq m1, m0, 1
psrldq m2, m0, 2
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m1, m2, m3
; store 4 lines
movd [dstq ], m3
psrlq m3, 8
movd [dstq+strideq ], m3
lea dstq, [dstq+strideq*2]
psrlq m3, 8
movd [dstq ], m3
psrlq m3, 8
movd [dstq+strideq ], m3
psrlq m0, 56
movd tempq, m0
mov [dstq+strideq+3], tempb
RESTORE_GOT
RET
INIT_XMM sse2
cglobal d45_predictor_8x8, 3, 4, 4, dst, stride, above, goffset
GET_GOT goffsetq
movu m1, [aboveq]
pslldq m0, m1, 1
psrldq m2, m1, 1
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m1, m2, m3
punpckhbw m0, m0 ; 7 7
punpcklwd m0, m0 ; 7 7 7 7
punpckldq m0, m0 ; 7 7 7 7 7 7 7 7
punpcklqdq m3, m0 ; -1 0 1 2 3 4 5 6 7 7 7 7 7 7 7 7
; store 4 lines
psrldq m3, 1
movq [dstq ], m3
psrldq m3, 1
movq [dstq+strideq ], m3
psrldq m3, 1
movq [dstq+strideq*2], m3
psrldq m3, 1
movq [dstq+stride3q ], m3
lea dstq, [dstq+strideq*4]
; store next 4 lines
psrldq m3, 1
movq [dstq ], m3
psrldq m3, 1
movq [dstq+strideq ], m3
psrldq m3, 1
movq [dstq+strideq*2], m3
psrldq m3, 1
movq [dstq+stride3q ], m3
RESTORE_GOT
RET
INIT_XMM sse2
cglobal d207_predictor_4x4, 4, 4, 5, dst, stride, unused, left, goffset
GET_GOT goffsetq
movd m0, [leftq] ; abcd [byte]
punpcklbw m4, m0, m0 ; aabb ccdd
punpcklwd m4, m4 ; aaaa bbbb cccc dddd
psrldq m4, 12 ; dddd
punpckldq m0, m4 ; abcd dddd
psrldq m1, m0, 1 ; bcdd
psrldq m2, m0, 2 ; cddd
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m1, m2, m3 ; a2bc b2cd c3d d
pavgb m1, m0 ; ab, bc, cd, d [byte]
punpcklbw m1, m3 ; ab, a2bc, bc, b2cd, cd, c3d, d, d
movd [dstq ], m1
psrlq m1, 16 ; bc, b2cd, cd, c3d, d, d
movd [dstq+strideq], m1
lea dstq, [dstq+strideq*2]
psrlq m1, 16 ; cd, c3d, d, d
movd [dstq ], m1
movd [dstq+strideq], m4 ; d, d, d, d
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_predictor_4x4, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
movd m2, [leftq]
movd m0, [aboveq]
pxor m1, m1
punpckldq m0, m2
psadbw m0, m1
paddw m0, [GLOBAL(pw_4)]
psraw m0, 3
pshuflw m0, m0, 0x0
packuswb m0, m0
movd [dstq ], m0
movd [dstq+strideq], m0
lea dstq, [dstq+strideq*2]
movd [dstq ], m0
movd [dstq+strideq], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_left_predictor_4x4, 2, 5, 2, dst, stride, above, left, goffset
movifnidn leftq, leftmp
GET_GOT goffsetq
pxor m1, m1
movd m0, [leftq]
psadbw m0, m1
paddw m0, [GLOBAL(pw2_4)]
psraw m0, 2
pshuflw m0, m0, 0x0
packuswb m0, m0
movd [dstq ], m0
movd [dstq+strideq], m0
lea dstq, [dstq+strideq*2]
movd [dstq ], m0
movd [dstq+strideq], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_top_predictor_4x4, 3, 5, 2, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
movd m0, [aboveq]
psadbw m0, m1
paddw m0, [GLOBAL(pw2_4)]
psraw m0, 2
pshuflw m0, m0, 0x0
packuswb m0, m0
movd [dstq ], m0
movd [dstq+strideq], m0
lea dstq, [dstq+strideq*2]
movd [dstq ], m0
movd [dstq+strideq], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_predictor_8x8, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
movq m0, [aboveq]
movq m2, [leftq]
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
psadbw m0, m1
psadbw m2, m1
paddw m0, m2
paddw m0, [GLOBAL(pw_8)]
psraw m0, 4
punpcklbw m0, m0
pshuflw m0, m0, 0x0
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_top_predictor_8x8, 3, 5, 2, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
movq m0, [aboveq]
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
psadbw m0, m1
paddw m0, [GLOBAL(pw2_8)]
psraw m0, 3
punpcklbw m0, m0
pshuflw m0, m0, 0x0
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_left_predictor_8x8, 2, 5, 2, dst, stride, above, left, goffset
movifnidn leftq, leftmp
GET_GOT goffsetq
pxor m1, m1
movq m0, [leftq]
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
psadbw m0, m1
paddw m0, [GLOBAL(pw2_8)]
psraw m0, 3
punpcklbw m0, m0
pshuflw m0, m0, 0x0
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_128_predictor_4x4, 2, 5, 1, dst, stride, above, left, goffset
GET_GOT goffsetq
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
movd m0, [GLOBAL(dc_128)]
movd [dstq ], m0
movd [dstq+strideq ], m0
movd [dstq+strideq*2], m0
movd [dstq+stride3q ], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_128_predictor_8x8, 2, 5, 1, dst, stride, above, left, goffset
GET_GOT goffsetq
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
movq m0, [GLOBAL(dc_128)]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_predictor_16x16, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [aboveq]
mova m2, [leftq]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 4
psadbw m0, m1
psadbw m2, m1
paddw m0, m2
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw_16)]
psraw m0, 5
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq+strideq ], m0
mova [dstq+strideq*2], m0
mova [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_top_predictor_16x16, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [aboveq]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 4
psadbw m0, m1
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw2_16)]
psraw m0, 4
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq+strideq ], m0
mova [dstq+strideq*2], m0
mova [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_left_predictor_16x16, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [leftq]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 4
psadbw m0, m1
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw2_16)]
psraw m0, 4
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq+strideq ], m0
mova [dstq+strideq*2], m0
mova [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_128_predictor_16x16, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 4
mova m0, [GLOBAL(dc_128)]
.loop:
mova [dstq ], m0
mova [dstq+strideq ], m0
mova [dstq+strideq*2], m0
mova [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
RET
INIT_XMM sse2
cglobal dc_predictor_32x32, 4, 5, 5, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [aboveq]
mova m2, [aboveq+16]
mova m3, [leftq]
mova m4, [leftq+16]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 8
psadbw m0, m1
psadbw m2, m1
psadbw m3, m1
psadbw m4, m1
paddw m0, m2
paddw m0, m3
paddw m0, m4
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw_32)]
psraw m0, 6
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq +16], m0
mova [dstq+strideq ], m0
mova [dstq+strideq +16], m0
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m0
mova [dstq+stride3q ], m0
mova [dstq+stride3q +16], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_top_predictor_32x32, 4, 5, 5, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [aboveq]
mova m2, [aboveq+16]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 8
psadbw m0, m1
psadbw m2, m1
paddw m0, m2
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw2_32)]
psraw m0, 5
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq +16], m0
mova [dstq+strideq ], m0
mova [dstq+strideq +16], m0
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m0
mova [dstq+stride3q ], m0
mova [dstq+stride3q +16], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_left_predictor_32x32, 4, 5, 5, dst, stride, above, left, goffset
GET_GOT goffsetq
pxor m1, m1
mova m0, [leftq]
mova m2, [leftq+16]
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 8
psadbw m0, m1
psadbw m2, m1
paddw m0, m2
movhlps m2, m0
paddw m0, m2
paddw m0, [GLOBAL(pw2_32)]
psraw m0, 5
pshuflw m0, m0, 0x0
punpcklqdq m0, m0
packuswb m0, m0
.loop:
mova [dstq ], m0
mova [dstq +16], m0
mova [dstq+strideq ], m0
mova [dstq+strideq +16], m0
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m0
mova [dstq+stride3q ], m0
mova [dstq+stride3q +16], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
REP_RET
INIT_XMM sse2
cglobal dc_128_predictor_32x32, 4, 5, 3, dst, stride, above, left, goffset
GET_GOT goffsetq
DEFINE_ARGS dst, stride, stride3, lines4
lea stride3q, [strideq*3]
mov lines4d, 8
mova m0, [GLOBAL(dc_128)]
.loop:
mova [dstq ], m0
mova [dstq +16], m0
mova [dstq+strideq ], m0
mova [dstq+strideq +16], m0
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m0
mova [dstq+stride3q ], m0
mova [dstq+stride3q +16], m0
lea dstq, [dstq+strideq*4]
dec lines4d
jnz .loop
RESTORE_GOT
RET
INIT_XMM sse2
cglobal v_predictor_4x4, 3, 3, 1, dst, stride, above
movd m0, [aboveq]
movd [dstq ], m0
movd [dstq+strideq], m0
lea dstq, [dstq+strideq*2]
movd [dstq ], m0
movd [dstq+strideq], m0
RET
INIT_XMM sse2
cglobal v_predictor_8x8, 3, 3, 1, dst, stride, above
movq m0, [aboveq]
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
movq [dstq ], m0
movq [dstq+strideq ], m0
movq [dstq+strideq*2], m0
movq [dstq+stride3q ], m0
RET
INIT_XMM sse2
cglobal v_predictor_16x16, 3, 4, 1, dst, stride, above
mova m0, [aboveq]
DEFINE_ARGS dst, stride, stride3, nlines4
lea stride3q, [strideq*3]
mov nlines4d, 4
.loop:
mova [dstq ], m0
mova [dstq+strideq ], m0
mova [dstq+strideq*2], m0
mova [dstq+stride3q ], m0
lea dstq, [dstq+strideq*4]
dec nlines4d
jnz .loop
REP_RET
INIT_XMM sse2
cglobal v_predictor_32x32, 3, 4, 2, dst, stride, above
mova m0, [aboveq]
mova m1, [aboveq+16]
DEFINE_ARGS dst, stride, stride3, nlines4
lea stride3q, [strideq*3]
mov nlines4d, 8
.loop:
mova [dstq ], m0
mova [dstq +16], m1
mova [dstq+strideq ], m0
mova [dstq+strideq +16], m1
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m1
mova [dstq+stride3q ], m0
mova [dstq+stride3q +16], m1
lea dstq, [dstq+strideq*4]
dec nlines4d
jnz .loop
REP_RET
INIT_XMM sse2
cglobal h_predictor_4x4, 2, 4, 4, dst, stride, line, left
movifnidn leftq, leftmp
movd m0, [leftq]
punpcklbw m0, m0
punpcklbw m0, m0
pshufd m1, m0, 0x1
movd [dstq ], m0
movd [dstq+strideq], m1
pshufd m2, m0, 0x2
lea dstq, [dstq+strideq*2]
pshufd m3, m0, 0x3
movd [dstq ], m2
movd [dstq+strideq], m3
RET
INIT_XMM sse2
cglobal h_predictor_8x8, 2, 5, 3, dst, stride, line, left
movifnidn leftq, leftmp
mov lineq, -2
DEFINE_ARGS dst, stride, line, left, stride3
lea stride3q, [strideq*3]
movq m0, [leftq ]
punpcklbw m0, m0 ; l1 l1 l2 l2 ... l8 l8
.loop:
pshuflw m1, m0, 0x0 ; l1 l1 l1 l1 l1 l1 l1 l1
pshuflw m2, m0, 0x55 ; l2 l2 l2 l2 l2 l2 l2 l2
movq [dstq ], m1
movq [dstq+strideq], m2
pshuflw m1, m0, 0xaa
pshuflw m2, m0, 0xff
movq [dstq+strideq*2], m1
movq [dstq+stride3q ], m2
pshufd m0, m0, 0xe ; [63:0] l5 l5 l6 l6 l7 l7 l8 l8
inc lineq
lea dstq, [dstq+strideq*4]
jnz .loop
REP_RET
INIT_XMM sse2
cglobal h_predictor_16x16, 2, 5, 3, dst, stride, line, left
movifnidn leftq, leftmp
mov lineq, -4
DEFINE_ARGS dst, stride, line, left, stride3
lea stride3q, [strideq*3]
.loop:
movd m0, [leftq]
punpcklbw m0, m0
punpcklbw m0, m0 ; l1 to l4 each repeated 4 times
pshufd m1, m0, 0x0 ; l1 repeated 16 times
pshufd m2, m0, 0x55 ; l2 repeated 16 times
mova [dstq ], m1
mova [dstq+strideq ], m2
pshufd m1, m0, 0xaa
pshufd m2, m0, 0xff
mova [dstq+strideq*2], m1
mova [dstq+stride3q ], m2
inc lineq
lea leftq, [leftq+4 ]
lea dstq, [dstq+strideq*4]
jnz .loop
REP_RET
INIT_XMM sse2
cglobal h_predictor_32x32, 2, 5, 3, dst, stride, line, left
movifnidn leftq, leftmp
mov lineq, -8
DEFINE_ARGS dst, stride, line, left, stride3
lea stride3q, [strideq*3]
.loop:
movd m0, [leftq]
punpcklbw m0, m0
punpcklbw m0, m0 ; l1 to l4 each repeated 4 times
pshufd m1, m0, 0x0 ; l1 repeated 16 times
pshufd m2, m0, 0x55 ; l2 repeated 16 times
mova [dstq ], m1
mova [dstq+16 ], m1
mova [dstq+strideq ], m2
mova [dstq+strideq+16 ], m2
pshufd m1, m0, 0xaa
pshufd m2, m0, 0xff
mova [dstq+strideq*2 ], m1
mova [dstq+strideq*2+16], m1
mova [dstq+stride3q ], m2
mova [dstq+stride3q+16 ], m2
inc lineq
lea leftq, [leftq+4 ]
lea dstq, [dstq+strideq*4]
jnz .loop
REP_RET
INIT_XMM sse2
cglobal tm_predictor_4x4, 4, 4, 5, dst, stride, above, left
pxor m1, m1
movq m0, [aboveq-1]; [63:0] tl t1 t2 t3 t4 x x x
punpcklbw m0, m1
pshuflw m2, m0, 0x0 ; [63:0] tl tl tl tl [word]
psrldq m0, 2
psubw m0, m2 ; [63:0] t1-tl t2-tl t3-tl t4-tl [word]
movd m2, [leftq]
punpcklbw m2, m1
pshuflw m4, m2, 0x0 ; [63:0] l1 l1 l1 l1 [word]
pshuflw m3, m2, 0x55 ; [63:0] l2 l2 l2 l2 [word]
paddw m4, m0
paddw m3, m0
packuswb m4, m4
packuswb m3, m3
movd [dstq ], m4
movd [dstq+strideq], m3
lea dstq, [dstq+strideq*2]
pshuflw m4, m2, 0xaa
pshuflw m3, m2, 0xff
paddw m4, m0
paddw m3, m0
packuswb m4, m4
packuswb m3, m3
movd [dstq ], m4
movd [dstq+strideq], m3
RET
INIT_XMM sse2
cglobal tm_predictor_8x8, 4, 4, 5, dst, stride, above, left
pxor m1, m1
movd m2, [aboveq-1]
movq m0, [aboveq]
punpcklbw m2, m1
punpcklbw m0, m1 ; t1 t2 t3 t4 t5 t6 t7 t8 [word]
pshuflw m2, m2, 0x0 ; [63:0] tl tl tl tl [word]
DEFINE_ARGS dst, stride, line, left
mov lineq, -4
punpcklqdq m2, m2 ; tl tl tl tl tl tl tl tl [word]
psubw m0, m2 ; t1-tl t2-tl ... t8-tl [word]
movq m2, [leftq]
punpcklbw m2, m1 ; l1 l2 l3 l4 l5 l6 l7 l8 [word]
.loop
pshuflw m4, m2, 0x0 ; [63:0] l1 l1 l1 l1 [word]
pshuflw m3, m2, 0x55 ; [63:0] l2 l2 l2 l2 [word]
punpcklqdq m4, m4 ; l1 l1 l1 l1 l1 l1 l1 l1 [word]
punpcklqdq m3, m3 ; l2 l2 l2 l2 l2 l2 l2 l2 [word]
paddw m4, m0
paddw m3, m0
packuswb m4, m3
movq [dstq ], m4
movhps [dstq+strideq], m4
lea dstq, [dstq+strideq*2]
psrldq m2, 4
inc lineq
jnz .loop
REP_RET
INIT_XMM sse2
cglobal tm_predictor_16x16, 4, 5, 8, dst, stride, above, left
pxor m1, m1
mova m2, [aboveq-16];
mova m0, [aboveq] ; t1 t2 ... t16 [byte]
punpckhbw m2, m1 ; [127:112] tl [word]
punpckhbw m4, m0, m1
punpcklbw m0, m1 ; m0:m4 t1 t2 ... t16 [word]
DEFINE_ARGS dst, stride, line, left, stride8
mov lineq, -8
pshufhw m2, m2, 0xff
mova m3, [leftq] ; l1 l2 ... l16 [byte]
punpckhqdq m2, m2 ; tl repeated 8 times [word]
psubw m0, m2
psubw m4, m2 ; m0:m4 t1-tl t2-tl ... t16-tl [word]
punpckhbw m5, m3, m1
punpcklbw m3, m1 ; m3:m5 l1 l2 ... l16 [word]
lea stride8q, [strideq*8]
.loop:
pshuflw m6, m3, 0x0
pshuflw m7, m5, 0x0
punpcklqdq m6, m6 ; l1 repeated 8 times [word]
punpcklqdq m7, m7 ; l8 repeated 8 times [word]
paddw m1, m6, m0
paddw m6, m4 ; m1:m6 ti-tl+l1 [i=1,15] [word]
psrldq m5, 2
packuswb m1, m6
mova [dstq ], m1
paddw m1, m7, m0
paddw m7, m4 ; m1:m7 ti-tl+l8 [i=1,15] [word]
psrldq m3, 2
packuswb m1, m7
mova [dstq+stride8q], m1
inc lineq
lea dstq, [dstq+strideq]
jnz .loop
REP_RET
INIT_XMM sse2
cglobal tm_predictor_32x32, 4, 4, 8, dst, stride, above, left
pxor m1, m1
movd m2, [aboveq-1]
mova m0, [aboveq]
mova m4, [aboveq+16]
punpcklbw m2, m1
punpckhbw m3, m0, m1
punpckhbw m5, m4, m1
punpcklbw m0, m1
punpcklbw m4, m1
pshuflw m2, m2, 0x0
DEFINE_ARGS dst, stride, line, left
mov lineq, -16
punpcklqdq m2, m2
add leftq, 32
psubw m0, m2
psubw m3, m2
psubw m4, m2
psubw m5, m2
.loop:
movd m2, [leftq+lineq*2]
pxor m1, m1
punpcklbw m2, m1
pshuflw m7, m2, 0x55
pshuflw m2, m2, 0x0
punpcklqdq m2, m2
punpcklqdq m7, m7
paddw m6, m2, m3
paddw m1, m2, m0
packuswb m1, m6
mova [dstq ], m1
paddw m6, m2, m5
paddw m1, m2, m4
packuswb m1, m6
mova [dstq+16 ], m1
paddw m6, m7, m3
paddw m1, m7, m0
packuswb m1, m6
mova [dstq+strideq ], m1
paddw m6, m7, m5
paddw m1, m7, m4
packuswb m1, m6
mova [dstq+strideq+16], m1
lea dstq, [dstq+strideq*2]
inc lineq
jnz .loop
REP_RET
| 30.634259 | 80 | 0.47888 |
d9f0f1a2e6717c3d5edc275861e665e26fdc5e01 | 1,668 | asm | Assembly | savefile/maps/3B30_LostWoodsSubA.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 35 | 2018-04-01T06:55:28.000Z | 2021-05-09T19:09:42.000Z | savefile/maps/3B30_LostWoodsSubA.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 4 | 2018-04-01T15:32:55.000Z | 2019-02-23T20:46:49.000Z | savefile/maps/3B30_LostWoodsSubA.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 12 | 2018-04-01T15:48:09.000Z | 2021-01-27T10:22:33.000Z | SECTION "Map_3B30", ROM0[$B800]
Map_3B30_Header:
hdr_tileset 0
hdr_dimensions 7, 7
hdr_pointers_a Map_3B30_Blocks, Map_3B30_TextPointers
hdr_pointers_b Map_3B30_Script, Map_3B30_Objects
hdr_pointers_c Map_3B30_InitScript, Map_3B30_RAMScript
hdr_palette $06
hdr_music MUSIC_DUNGEON2, AUDIO_3
hdr_connection NORTH, $0000, 0, 0
hdr_connection SOUTH, $3B22, 7, 1
hdr_connection WEST, $3A3E, 0, 0
hdr_connection EAST, $0000, 0, 0
Map_3B30_Objects:
hdr_border $0f
hdr_warp_count 0
hdr_sign_count 0
hdr_object_count 1
hdr_object SPRITE_FISHER, 7, 6, STAY, NONE, $01
Map_3B30_RAMScript:
rs_write_1 $c770, $7a
rs_write_1 $c77d, $7a
rs_end
Map_3B30_Blocks:
db $0b,$0b,$0b,$0b,$0b,$0b,$0b
db $0b,$62,$6c,$6c,$6c,$63,$0b
db $0b,$6d,$7a,$7a,$7a,$6e,$0b
db $0b,$6d,$7a,$7a,$7a,$6e,$0b
db $0b,$6d,$7a,$7a,$7a,$6e,$0b
db $0b,$50,$52,$7a,$52,$4f,$0b
db $0b,$0b,$0f,$7a,$0f,$0b,$0b
Map_3B30_TextPointers:
dw Map_3B30_TX1
Map_3B30_InitScript:
ret
Map_3B30_ChangeDirFlag:
db 32
Map_3B30_Script:
ld a, [Map_3B30_ChangeDirFlag]
and a
ret z
ld a, 4
ld [$c109], a
ld hl, Map_3B30_ChangeDirFlag
dec [hl]
ret
Map_3B30_TX1:
TX_ASM
jp EnhancedTextOnly
text "I once heard that this"
next "place was supposed to be"
cont "filled with treasure."
para "However, when I got here,"
next "there was completely"
cont "nothing!"
para "I guess someone must have"
next "found this place before me."
done
| 24.895522 | 63 | 0.621703 |
28ed9dde72a637326bd1046e8f54ac1be4387d79 | 6,626 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1839.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1839.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1839.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1cdde, %r15
nop
nop
xor %r9, %r9
vmovups (%r15), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rax
nop
nop
nop
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x1de, %rax
nop
nop
nop
nop
inc %r11
movb (%rax), %dl
nop
nop
nop
dec %rdx
lea addresses_A_ht+0x1236a, %rsi
lea addresses_normal_ht+0x185de, %rdi
nop
nop
nop
xor %r11, %r11
mov $43, %rcx
rep movsb
nop
inc %rdx
lea addresses_A_ht+0x9f4e, %rax
nop
nop
nop
nop
cmp %r8, %r8
mov (%rax), %rcx
nop
nop
nop
sub %rcx, %rcx
lea addresses_WT_ht+0x482e, %r11
nop
nop
nop
sub $43941, %rsi
mov $0x6162636465666768, %r8
movq %r8, %xmm0
vmovups %ymm0, (%r11)
nop
add $53980, %rdx
lea addresses_UC_ht+0x7abe, %rcx
nop
nop
nop
and $15320, %rsi
movups (%rcx), %xmm1
vpextrq $0, %xmm1, %r15
sub $59773, %r9
lea addresses_D_ht+0x1131e, %rdx
nop
xor %r9, %r9
movb (%rdx), %r11b
nop
nop
nop
nop
xor $4271, %r9
lea addresses_WT_ht+0x9596, %rdx
nop
nop
nop
nop
nop
add $27623, %rax
movb $0x61, (%rdx)
nop
nop
nop
nop
nop
add $13753, %r11
lea addresses_normal_ht+0x10de, %rsi
lea addresses_A_ht+0x1aa4a, %rdi
xor $24535, %rax
mov $16, %rcx
rep movsq
xor $13219, %rdi
lea addresses_WT_ht+0x1edde, %r15
and $10926, %rsi
movw $0x6162, (%r15)
nop
nop
nop
nop
xor %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rdi
// Store
lea addresses_D+0x1932b, %r11
nop
and %rax, %rax
mov $0x5152535455565758, %r9
movq %r9, (%r11)
nop
nop
inc %r9
// Faulty Load
lea addresses_UC+0xb1de, %r9
nop
cmp $29438, %rdi
mov (%r9), %r11w
lea oracles, %rax
and $0xff, %r11
shlq $12, %r11
mov (%rax,%r11,1), %r11
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': True, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 36.811111 | 2,999 | 0.655297 |
1853204521132ae69b10910354e499126ca066b3 | 399 | asm | Assembly | programs/oeis/023/A023585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/023/A023585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/023/A023585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A023585: Least prime divisor of 2*prime(n)-1.
; 3,5,3,13,3,5,3,37,3,3,61,73,3,5,3,3,3,11,7,3,5,157,3,3,193,3,5,3,7,3,11,3,3,277,3,7,313,5,3,3,3,19,3,5,3,397,421,5,3,457,3,3,13,3,3,3,3,541,7,3,5,3,613,3,5,3,661,673,3,17,3,3,733,5,757,3,3,13,3,19,3,29,3,5,877,3,3,11,3,5,3,3,7,3,997,3,3,3,5,23
seq $0,40 ; The prime numbers.
sub $0,1
seq $0,90368 ; a(1) = 1; for n>1, smallest divisor > 1 of 2n-1.
| 57 | 245 | 0.606516 |
f946d59b46d06218cff225bd72d2d6d771226648 | 462 | asm | Assembly | programs/oeis/135/A135533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/135/A135533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/135/A135533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A135533: Guy Steele's sequence GS(4,6) (see A135416).
; 1,2,3,3,5,4,7,4,7,6,11,5,9,8,15,5,9,8,15,7,13,12,23,6,11,10,19,9,17,16,31,6,11,10,19,9,17,16,31,8,15,14,27,13,25,24,47,7,13,12,23,11,21,20,39,10,19,18,35,17,33,32,63,7,13,12,23,11,21,20,39,10,19,18,35,17,33,32,63,9,17,16,31,15,29,28,55,14,27,26,51,25,49,48,95,8,15,14,27,13
add $0,1
mov $2,79503
lpb $0
lpb $0
dif $0,2
add $1,$2
lpe
sub $0,1
mul $2,2
lpe
div $1,79503
add $1,1
mov $0,$1
| 27.176471 | 275 | 0.606061 |
a5101ab073b147f390558fb79eb8f70aeb124999 | 853 | asm | Assembly | oeis/198/A198279.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/198/A198279.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/198/A198279.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A198279: Number of 2n X 4 0..2 arrays with values 0..2 introduced in row major order and each element equal to exactly two horizontal and vertical neighbors.
; Submitted by Christian Krause
; 1,4,14,52,190,700,2574,9476,34878,128396,472654,1739988,6405438,23580508,86807566,319567268,1176432574,4330837036,15943242574,58692346740,216065933246,795410139132,2928167715854,10779553536580,39683100749118,146086614806220,537793131681358,1979794335538708,7288277555386430,26830559503633564,98772160885611022,363612982602986212,1338579615268487358,4927754156592047468,18140692380812787534,66781886757695298740,245846206158857602750,905041172346623409468,3331755801483788850702
add $0,1
lpb $0
sub $0,1
add $4,$1
add $4,$1
add $1,$3
add $3,$1
add $5,$2
add $1,$5
add $1,1
mov $2,$3
add $2,$4
mov $5,$4
add $5,1
lpe
mov $0,$2
add $0,1
| 38.772727 | 479 | 0.787808 |
25a5548eebc1a4f7cc53c13497c0c05877f094cf | 5,412 | asm | Assembly | src/io-3dos.asm | RandomAmbersky/sword-of-ianna-zx | 9cfc020ef80dde34d7d2a21736c0c04256d785aa | [
"Apache-2.0"
] | 1 | 2019-02-11T21:15:04.000Z | 2019-02-11T21:15:04.000Z | src/io-3dos.asm | RandomAmbersky/sword-of-ianna-zx | 9cfc020ef80dde34d7d2a21736c0c04256d785aa | [
"Apache-2.0"
] | null | null | null | src/io-3dos.asm | RandomAmbersky/sword-of-ianna-zx | 9cfc020ef80dde34d7d2a21736c0c04256d785aa | [
"Apache-2.0"
] | 1 | 2019-02-07T23:42:21.000Z | 2019-02-07T23:42:21.000Z | ; Generic I/O
level_data: dw 0, 10848 ; level 1
dw 10848, 12123 ; level 2
dw 22971, 12159 ; level 3
dw 35130, 12685 ; level 4
dw 47815, 14356 ; level 5
dw 62171, 13925 ; level 6
dw 0, 11783 ; level 7 (file 2)
dw 11783, 12116 ; level 8 (file 2)
dw 23899, 3926 ; level 0 (attract mode, file 2)
dw 27825, 8662 ; level 9 (easter egg)
sprite_data: dw 0, 2193 ; skeleton
dw 2193, 2023 ; orc
dw 4216, 2225 ; mummy
dw 6441, 2312 ; troll
dw 8753, 499 ; rock
dw 9252, 2455 ; knight
dw 11707, 2620 ; dal gurak
dw 14327, 2486 ; golem
dw 16813, 2186 ; ogre
dw 18999, 2186 ; minotaur
dw 21185, 2124 ; demon
dw 23309, 1281 ; golem - sup
dw 24590, 1315 ; ogre - sup
dw 25905, 1766 ; minotaur - sup
dw 27671, 1091 ; demon - sup
intro_data: dw 0, 1498 ; intro - frame
dw 1498, 4131 ; intro - screens
dw 5629, 3082 ; end - screens
dw 8711, 1814; end - credits
dw 10525, 2630 ; music - intro
dw 13155, 2052 ; music - end
dw 15207, 462 ; music - credits
; Load level from disk
; Will *always* place stuff in RAM Page 1, at $c000
; INPUT:
; - A: level to load
IO_LoadLevel:
call IO_loading
cp 6
jr c, IO_LoadLevel_file1
ld ix, filename_2
jr IO_LoadLevel_common
IO_LoadLevel_file1:
ld ix, filename
IO_LoadLevel_common:
ld hl, level_data
call IO_getdata
ld hl, $C000 ; load at $C000
ld a, 1 ; and store in RAMBank1
; call IO_Load
; ret
jp IO_Load
IO_getdata:
add a, a
add a, a
ld e, a
ld d, 0
add hl, de ; hl points to the offset
ld c, (hl)
inc hl
ld b, (hl) ; BC holds the offset to load
inc hl
ld e, (hl)
inc hl
ld d, (hl) ; DE holds the size
ret
; Print a string on screen, not controlling line breaks
; INPUT:
; IY: pointer to string
; B: X in chars
; C: Y in chars
print_string_3dos:
ld a, (iy+0)
and a
ret z ; return on NULL
push iy
push bc
call print_char
pop bc
pop iy
inc iy
inc b
jr nz, print_string_3dos
ret
; Load sprite from disk
; Will *always* place stuff in RAM page 4
; INPUT:
; - A: sprite to load
; - (current_spraddr): where to load
;
; RETURNS:
; - BC: number of bytes loaded
IO_LoadSprite:
ld hl, sprite_data
call IO_getdata
ld hl, (current_spraddr) ; load address
ld a, 4 ; and store in RAMBank4
ld ix, filename_spr
push de
call IO_Load
pop bc
ret
; Load intro screen pack from from disk
; Will *always* place stuff in RAM page 0, address $AC80
; INPUT:
; - A: screen pack to load
IO_LoadIntro:
call IO_loading
ld hl, intro_data
call IO_getdata
xor a ; Page 0
ld hl, $AC80 ; buffer
ld ix, filename_intro
jp IO_Load
; call IO_Load
; ret
; Load intro music
; Will *always* place stuff in RAM page 3, address $CC00
; INPUT:
; - A: music to load (for now, just 4)
IO_LoadIntroMusic:
call IO_loading
ld hl, intro_data
call IO_getdata
ld a, 3 ; Page 3
ld hl, $CB72 ; buffer
ld ix, filename_intro
jp IO_Load
loading_string_en: db "LOADING...",0
loading_string: db "CARGANDO...",0
IO_loading:
push af
ld a, (language)
and a
jr z, IO_loading_spanish
ld iy, loading_string_en
jr IO_loading_common
IO_loading_spanish:
ld iy, loading_string
IO_loading_common:
ld bc, $0B0C
call print_string_3dos
ld a, 7
ld hl, 16384+6144+12*32+11
ld de, 16384+6144+12*32+11+1
ld (hl), a
ld bc, 10
ldir
pop af
ret
; Input/output functions for +3DOS, using plain files
; +3DOS constants
DOS_EST_1346 equ $13F
DOS_OPEN equ $106
DOS_READ equ $112
DOS_CLOSE equ $109
DOS_MOTOR_OFF equ $19c
DOS_EST_POS equ $136
; Set the proper environment for +3DOS
; This means: IM1, RAM7, save previous RAM bank
previous_rambank: db 0
filename: db "IANNA.DAT",$ff
filename_2: db "IANNA2.DAT",$ff
filename_spr: db "IANNA.SPR",$ff
filename_intro: db "INTRO.BIN",$ff
DOS_Setenv:
ld A, ($5B5C)
ld (previous_rambank), a
di
ld b, 7
call setrambank_p3
im 1
LD IY, 5C3Ah ; re-establish the IY pointer (must be done!)
ei
ret
; Restore the previous environment
; This means: IM2, previous RAM bank and screen
DOS_RestoreEnv:
di
ld a, (previous_rambank)
ld b, a
call setrambank_p3
ei
ld a, 0xbf
ld hl, 0x8000
ld de, ISR
; call SetIM2
; ret
jp SetIM2
; Load from +3 file
; INPUT:
; - HL: destination
; - A: page for destination
; - DE: number of bytes to load
; - BC: offset in file
; - IX: filename
IO_Load:
push hl
push de
push af
push bc
call DOS_Setenv
ld hl, $0000
ld de, $0000
call DOS_EST_1346
JP NC, 0 ; reset if failed
push ix
pop hl ; file name
ld bc, $0001 ; File handle 0, exclusive read
ld de, $0002 ; Open, place pointer after header
call DOS_OPEN ; open file
jp nc, 0 ; reset if open failed (change into something better!!!)
; go to offset
pop bc
ld h, b
ld l, c
ld e, 0 ; WARNING: this is only allowing up to 64K file offsets. If we need more than that, redesign it!
ld b, 0 ; file descriptor 0
call DOS_EST_POS
JP NC, 0 ; reset if failed
pop af
ld c, a ; load to RAM BANK specified in A
ld b, $00 ; b=file descriptor 0
pop de ; DE = number of bytes to load
pop hl ; destination
call DOS_READ ; read bytes
ld b, 0
call DOS_CLOSE ; close file
call DOS_MOTOR_OFF ; disconnect drive motor
jp DOS_RestoreEnv
; call DOS_RestoreEnv
; ret
| 20.19403 | 106 | 0.65133 |
22cc6b181963b1e551b9e174e0ec4bcba4e8734c | 548 | asm | Assembly | oeis/264/A264825.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/264/A264825.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/264/A264825.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A264825: Centered 18-gonal (or octadecagonal) primes.
; Submitted by Simon Strandgaard
; 19,109,181,271,379,811,991,2161,3079,4159,4969,5851,7309,8929,10099,10711,13339,17029,21169,22051,23869,25759,26731,28729,32941,34039,37441,38611,39799,48619,58321,59779,67339,70489,72091,89101,90901,102079,109891,117991,122149
mov $2,332202
lpb $2
mov $3,$5
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,18
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
lpe
mov $0,$5
add $0,1
| 27.4 | 229 | 0.70438 |
847be239e55c282770cd20c6895ba5e4ee297535 | 351 | asm | Assembly | programs/oeis/329/A329516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/329/A329516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/329/A329516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A329516: G.f. = (x^4 - x^3 - 3*x^2 - 2*x - 1)/(x - 1).
; 1,3,6,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
mov $1,$0
mul $1,2
add $1,2
mov $2,$0
add $2,1
mov $3,$0
mul $0,$2
lpb $3
mov $1,7
add $3,$0
mod $3,4
lpe
sub $1,1
| 20.647059 | 171 | 0.478632 |
9add1e58ff4becf886b24c36472a9bcdc02bef4e | 764 | asm | Assembly | programs/oeis/186/A186322.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/186/A186322.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/186/A186322.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A186322: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) after g(j) when f(i)=g(j), where f and g are the squares and heptagonal numbers. Complement of A186323.
; 2,3,5,6,8,10,11,13,15,16,18,19,21,23,24,26,28,29,31,32,34,36,37,39,41,42,44,46,47,49,50,52,54,55,57,59,60,62,63,65,67,68,70,72,73,75,77,78,80,81,83,85,86,88,90,91,93,94,96,98,99,101,103,104,106,108,109,111,112,114,116,117,119,121,122,124,126,127,129,130,132,134,135,137,139,140,142,143,145,147,148,150,152,153,155,157,158,160,161,163
mov $1,$0
mov $3,$0
add $0,7
mov $2,$0
mov $5,1
add $5,$1
lpb $2
mov $6,$5
lpb $5
mov $5,$4
pow $6,2
lpe
mov $0,5
mov $1,5
mov $5,1
lpb $6
add $1,1
add $5,$0
trn $6,$5
lpe
mov $2,1
lpe
sub $1,2
add $1,$3
sub $1,2
| 26.344828 | 335 | 0.620419 |
90dfabdce567f279e3e5e6b25f78b3f2e64fd9b7 | 592 | asm | Assembly | oeis/139/A139173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/139/A139173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/139/A139173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A139173: a(n) = n!/3 - 1.
; 1,7,39,239,1679,13439,120959,1209599,13305599,159667199,2075673599,29059430399,435891455999,6974263295999,118562476031999,2134124568575999,40548366802943999,810967336058879999,17030314057236479999,374666909259202559999,8617338912961658879999,206816133911079813119999,5170403347776995327999999,134430487042201878527999999,3629623150139450720255999999,101629448203904620167167999999,2947253997913233984847871999999,88417619937397019545436159999999,2740946218059307605908520959999999
add $0,3
mov $1,2
lpb $0
mul $1,$0
sub $0,1
lpe
div $1,6
sub $1,1
mov $0,$1
| 45.538462 | 482 | 0.85473 |
cc9fc27be6d1b5740ebc674ee15ca48d8a52bb25 | 3,719 | asm | Assembly | Palmtree.Math.Core.Sint/vs_build/x64_Release/pmc_initialize.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Sint/vs_build/x64_Release/pmc_initialize.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Sint/vs_build/x64_Release/pmc_initialize.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
include listing.inc
INCLUDELIB OLDNAMES
PUBLIC ??_C@_0BM@ONKLCLPJ@Palmtree?4Math?4Core?4Uint?4dll@ ; `string'
PUBLIC ??_C@_0BE@LMKJAMNH@PMC_UINT_Initialize@ ; `string'
EXTRN __imp_FreeLibrary:PROC
EXTRN __imp_GetProcAddress:PROC
EXTRN __imp_LoadLibraryA:PROC
COMM ep_uint:BYTE:0238H
_DATA ENDS
; COMDAT ??_C@_0BE@LMKJAMNH@PMC_UINT_Initialize@
CONST SEGMENT
??_C@_0BE@LMKJAMNH@PMC_UINT_Initialize@ DB 'PMC_UINT_Initialize', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BM@ONKLCLPJ@Palmtree?4Math?4Core?4Uint?4dll@
CONST SEGMENT
??_C@_0BM@ONKLCLPJ@Palmtree?4Math?4Core?4Uint?4dll@ DB 'Palmtree.Math.Cor'
DB 'e.Uint.dll', 00H ; `string'
CONST ENDS
PUBLIC PMC_SINT_Initialize
entry_points DB 0420H DUP (?)
initialized DD 01H DUP (?)
ALIGN 8
hLib_UINT DQ 01H DUP (?)
fp_PMC_UINT_Initialize DQ 01H DUP (?)
_BSS ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_SINT_Initialize DD imagerel $LN103@PMC_SINT_I
DD imagerel $LN103@PMC_SINT_I+151
DD imagerel $unwind$PMC_SINT_Initialize
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$0$PMC_SINT_Initialize DD imagerel $LN103@PMC_SINT_I+151
DD imagerel $LN103@PMC_SINT_I+279
DD imagerel $chain$0$PMC_SINT_Initialize
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$1$PMC_SINT_Initialize DD imagerel $LN103@PMC_SINT_I+279
DD imagerel $LN103@PMC_SINT_I+1356
DD imagerel $chain$1$PMC_SINT_Initialize
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$SelfCheck DD imagerel SelfCheck
DD imagerel SelfCheck+74
DD imagerel $unwind$SelfCheck
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$LoadUINTLIbrary DD imagerel LoadUINTLIbrary
DD imagerel LoadUINTLIbrary+98
DD imagerel $unwind$LoadUINTLIbrary
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$CopyUINTEntryPointStructure DD imagerel CopyUINTEntryPointStructure
DD imagerel CopyUINTEntryPointStructure+35
DD imagerel $unwind$CopyUINTEntryPointStructure
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_ZERO_MEMORY_BYTE DD imagerel _ZERO_MEMORY_BYTE
DD imagerel _ZERO_MEMORY_BYTE+23
DD imagerel $unwind$_ZERO_MEMORY_BYTE
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_COPY_MEMORY_64 DD imagerel _COPY_MEMORY_64
DD imagerel _COPY_MEMORY_64+35
DD imagerel $unwind$_COPY_MEMORY_64
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_COPY_MEMORY_32 DD imagerel _COPY_MEMORY_32
DD imagerel _COPY_MEMORY_32+32
DD imagerel $unwind$_COPY_MEMORY_32
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_COPY_MEMORY_BYTE DD imagerel _COPY_MEMORY_BYTE
DD imagerel _COPY_MEMORY_BYTE+32
DD imagerel $unwind$_COPY_MEMORY_BYTE
; COMDAT xdata
xdata SEGMENT
$unwind$_COPY_MEMORY_BYTE DD 040a01H
DD 02740aH
DD 016405H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_COPY_MEMORY_32 DD 040a01H
DD 02740aH
DD 016405H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_COPY_MEMORY_64 DD 040a01H
DD 02740aH
DD 016405H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_ZERO_MEMORY_BYTE DD 020501H
DD 017405H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$CopyUINTEntryPointStructure DD 040a01H
DD 02740aH
DD 016405H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$LoadUINTLIbrary DD 010401H
DD 04204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$SelfCheck DD 020601H
DD 070023206H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$chain$1$PMC_SINT_Initialize DD 021H
DD imagerel $LN103@PMC_SINT_I
DD imagerel $LN103@PMC_SINT_I+151
DD imagerel $unwind$PMC_SINT_Initialize
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$chain$0$PMC_SINT_Initialize DD 020521H
DD 0a6405H
DD imagerel $LN103@PMC_SINT_I
DD imagerel $LN103@PMC_SINT_I+151
DD imagerel $unwind$PMC_SINT_Initialize
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_SINT_Initialize DD 020601H
DD 070027206H
END
| 24.959732 | 80 | 0.820113 |
5964288ea30909373bf6fc8c370f49abd86929a3 | 827 | asm | Assembly | res/include/printBin.asm | Pusty/F0i | 0dc717b7669e62295727ec0a7c65bfeb4b100a1d | [
"BSL-1.0"
] | null | null | null | res/include/printBin.asm | Pusty/F0i | 0dc717b7669e62295727ec0a7c65bfeb4b100a1d | [
"BSL-1.0"
] | null | null | null | res/include/printBin.asm | Pusty/F0i | 0dc717b7669e62295727ec0a7c65bfeb4b100a1d | [
"BSL-1.0"
] | null | null | null | %ifndef PRINT_BIN
%define PRINT_BIN
%include "include/printChar.asm"
printBin: ;prints least significant byte of si in binary notation
mov bh, 0x00 ;page 0
mov bl, 0x07 ;text attribute
mov cx, si ;makes a working copy of si into bx
xor dh,dh;setcounter cl to 0
.nextDig: ;for (int i=0;i<8;i++)
mov ch, cl ; copy bl to bh to work with it
push bx
push cx
mov cl, 7
shr ch, cl ;make hsb to lsb
mov bl, ch
pop cx
mov ch, bl
pop bx
and ch,00000001b
add ch, '0' ;make an '0' or '1' out of it
mov al, ch ;saves bh into al for the print function
call printChar ;prints the char
shl cl,1;shift to the next bit
inc dh ;incement the counter
cmp dh,8 ;if we havent print all 8 digits...
jl printBin.nextDig ;...loop
mov al, 'b' ;print postfix 'b'
call printChar ;prints the char
ret
%endif | 25.84375 | 65 | 0.680774 |
89a5eb625d6759fc116acb3a286135a573dedaa9 | 50 | asm | Assembly | tests/comment/3.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 414 | 2016-10-14T22:39:20.000Z | 2022-03-30T07:52:44.000Z | tests/comment/3.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 100 | 2018-03-22T16:12:24.000Z | 2022-03-26T09:19:23.000Z | tests/comment/3.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 47 | 2017-06-29T15:12:13.000Z | 2022-03-10T04:50:51.000Z | ; = 0x000203
#d8 0 ;*
#d8 1, comment
*;
#d8 2, 3 | 10 | 16 | 0.5 |
39517f07df5a2229a53a951f61bb6f4f39cb815d | 594 | asm | Assembly | libsrc/msx/msx_type.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/msx/msx_type.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/msx/msx_type.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ;
; MSX specific routines
; by Stefano Bodrato, 08/11/2007
;
; int msx_type();
;
; The int result is 1 or two, depending on the MSX hardware being used
;
; $Id: msx_type.asm,v 1.5 2016-06-16 19:30:25 dom Exp $
;
SECTION code_clib
PUBLIC msx_type
PUBLIC _msx_type
msx_type:
_msx_type:
ld a,($FAF8) ; running on MSX1?
and a
ld hl,1
ret z ; yes
ld h,3
ld a,($7d63) ; BASIC SubVersion string
sub 45
ld l,a
ret z ; 3 = SVI-318
ld a,($7db0)
cp $5d
ret z ; 4 = SVI-328
inc l ; 5 = SVI-328 MKII
cp $3e
ret z
ld l,2
ret ; 2 = MSX2 (zero flag is reset)
| 14.85 | 70 | 0.616162 |
0964d7bdd42a66af8ea7d4d3166d7d3743bb81e7 | 533 | asm | Assembly | sk/sfx/36.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | sk/sfx/36.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | sk/sfx/36.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | Sound_36_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_36_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $02
smpsHeaderSFXChannel cPSG2, Sound_36_PSG2, $00, $00
smpsHeaderSFXChannel cPSG1, Sound_36_PSG1, $FE, $00
; PSG1 Data
Sound_36_PSG1:
dc.b nRst, $01
; PSG2 Data
Sound_36_PSG2:
smpsPSGvoice sTone_0D
dc.b nBb3, $01, nRst, nBb3, nRst, $03
Sound_36_Loop00:
dc.b nBb3, $01, nRst, $01
smpsLoop $00, $0B, Sound_36_Loop00
smpsStop
; Song seems to not use any FM voices
Sound_36_Voices:
| 20.5 | 52 | 0.731707 |
4a58749f736e3f56eb3550c21e4528d30bd68151 | 467 | asm | Assembly | programs/oeis/162/A162762.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/162/A162762.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/162/A162762.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A162762: Minimal number of floors an elevator must move to transport n passengers initially waiting at floors i = 1, ..., n to their destinations, floor n+1-i (= n, ..., 1), if the elevator can transport at most C = 2 persons at a time and starts at floor 1, and no one may get off the elevator before reaching their destination.
; 0,2,4,6,8,14,18,22,26,34,40,46,52,62,70,78,86
mov $2,$0
lpb $0
sub $0,3
add $1,$2
mov $2,$0
trn $0,1
lpe
mul $1,2
mov $0,$1
| 35.923077 | 331 | 0.678801 |
055c8f32f1ba14bb3163ae219c673587a0edcaf9 | 7,226 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1197.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1197.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1197.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xa834, %rax
nop
nop
nop
nop
nop
add $60497, %rcx
mov (%rax), %r14w
nop
nop
nop
and %r14, %r14
lea addresses_A_ht+0x8f86, %rdi
nop
nop
nop
nop
nop
sub $28843, %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm5
vmovups %ymm5, (%rdi)
nop
sub $62664, %r9
lea addresses_WC_ht+0xf29e, %rsi
lea addresses_D_ht+0x9e46, %rdi
nop
nop
nop
nop
sub $20714, %r9
mov $14, %rcx
rep movsb
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_WT_ht+0x9b02, %rcx
nop
and %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
movups %xmm3, (%rcx)
nop
and %rdi, %rdi
lea addresses_normal_ht+0xc2c2, %rax
nop
cmp $39927, %r9
movb $0x61, (%rax)
nop
nop
nop
nop
add $46372, %rcx
lea addresses_WC_ht+0xa1a6, %rcx
nop
dec %rdi
mov (%rcx), %r10w
nop
nop
nop
cmp $30177, %rsi
lea addresses_D_ht+0x138a6, %r14
nop
nop
nop
cmp %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
and $0xffffffffffffffc0, %r14
movntdq %xmm4, (%r14)
nop
nop
cmp $49521, %rdi
lea addresses_A_ht+0xd3a6, %rdi
nop
nop
nop
dec %r9
movw $0x6162, (%rdi)
nop
nop
nop
lfence
lea addresses_D_ht+0xc70e, %r14
nop
nop
nop
nop
inc %rdi
movl $0x61626364, (%r14)
nop
and %rax, %rax
lea addresses_WT_ht+0x56c0, %r14
xor %rdi, %rdi
movb (%r14), %r9b
nop
nop
add $3320, %r9
lea addresses_A_ht+0x127a6, %rsi
lea addresses_WC_ht+0x13ba6, %rdi
nop
nop
nop
sub %r13, %r13
mov $75, %rcx
rep movsb
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x1256e, %r10
nop
nop
nop
and $47249, %r13
movl $0x61626364, (%r10)
nop
nop
nop
nop
sub $17244, %r9
lea addresses_WC_ht+0x4bc2, %r13
nop
nop
nop
nop
nop
and $29908, %rsi
and $0xffffffffffffffc0, %r13
vmovaps (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
nop
nop
nop
nop
nop
and %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %rax
push %rbx
push %rcx
push %rdx
// Faulty Load
lea addresses_UC+0xffa6, %rcx
clflush (%rcx)
nop
lfence
movb (%rcx), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 8, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 33.924883 | 2,999 | 0.657902 |
6febcff00b94841795f8f8d9c6038ea03a56dde5 | 409 | asm | Assembly | programs/oeis/136/A136305.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/136/A136305.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/136/A136305.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A136305: Transform of A000027 by the T_{1,2} transformation (see link).
; 3,8,20,47,109,253,588,1367,3178,7388,17175,39927,92819,215778,501623,1166132,2710928,6302143,14650705,34058757,79177004,184064203,427897358,994740672,2312491503,5375890523,12497429235,29052998162,67540026539,157011512528
mov $1,3
mov $2,5
lpb $0
sub $0,1
trn $3,1
add $3,$2
add $2,$1
add $1,$3
add $2,$3
sub $2,$3
lpe
| 27.266667 | 222 | 0.728606 |
e2b323a173b3c6ab770beae26be2cae0036398de | 4,466 | asm | Assembly | Assembly/Microprocessor/DigitScrolling-DotMatrix.asm | TashreefMuhammad/University_Miscellaneous_Codes | 8ac444f51dfdbfeee5f0af54944df0ed3a52e832 | [
"MIT"
] | 3 | 2021-08-28T16:42:57.000Z | 2022-03-20T15:04:08.000Z | Assembly/Microprocessor/DigitScrolling-DotMatrix.asm | TashreefMuhammad/University_Miscellaneous_Codes | 8ac444f51dfdbfeee5f0af54944df0ed3a52e832 | [
"MIT"
] | null | null | null | Assembly/Microprocessor/DigitScrolling-DotMatrix.asm | TashreefMuhammad/University_Miscellaneous_Codes | 8ac444f51dfdbfeee5f0af54944df0ed3a52e832 | [
"MIT"
] | null | null | null |
; ******************************************************
; * EXPERIMENT No.: 2 *
; * GROUP NO. : 1 *
; * TOPIC : Displaying the digit "1" scrolling *
; bottom to top using 8x8 dot matrix *
; ******************************************************
CODE SEGMENT
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
PPIC_C EQU 1EH ; control register
PPIC EQU 1CH ; c port
PPIB EQU 1AH
PPIA EQU 18H
ORG 1000H
MOV AL,10000000B
OUT PPIC_C,AL
MOV AL,11111111B
OUT PPIA,AL
L1: MOV SI,OFFSET FONT
MOV BL,16 ; Font No.
L3: MOV BH,50 ; Display time
L2: PUSH SI
CALL SCAN
POP SI
DEC BH
JNZ L2
ADD SI,8
DEC BL
JNZ L3
JMP L1
SCAN PROC NEAR
MOV AH,00000001B
SCAN1: MOV AL,BYTE PTR CS:[SI]
OUT PPIA,AL
NOT AL
OUT PPIB,AL
MOV AL,AH
OUT PPIC,AL
CALL TIMER
INC SI
CLC
ROL AH,1
JNC SCAN1
RET
SCAN ENDP
TIMER : MOV CX,300
TIMER1: NOP
NOP
NOP
NOP
LOOP TIMER1
RET
FONT: DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
FONT1: DB 11111111B
DB 11111111B
DB 11111111B
DB 11111111B
DB 11111110B
DB 11111111B
DB 11111111B
DB 11111111B
FONT2: DB 11111111B
DB 11111111B
DB 11111111B
DB 11111110B
DB 11111100B
DB 11111111B
DB 11111111B
DB 11111111B
FONT3: DB 11111111B
DB 11111111B
DB 11111110B
DB 11111101B
DB 11111000B
DB 11111111B
DB 11111111B
DB 11111111B
FONT4: DB 11111111B
DB 11111111B
DB 11111101B
DB 11111011B
DB 11110000B
DB 11111111B
DB 11111111B
DB 11111111B
FONT5: DB 11111111B
DB 11111111B
DB 11111011B
DB 11110111B
DB 11100000B
DB 11111111B
DB 11111111B
DB 11111111B
FONT6: DB 11111111B
DB 11111111B
DB 11110111B
DB 11101111B
DB 11000000B
DB 11111111B
DB 11111111B
DB 11111111B
FONT7: DB 11111111B
DB 11111111B
DB 11101111B
DB 11011111B
DB 10000000B
DB 11111111B
DB 11111111B
DB 11111111B
FONT8: DB 11111111B
DB 11111111B
DB 11011110B
DB 10111110B
DB 00000000B
DB 11111110B
DB 11111110B
DB 11111111B
FONT9: DB 11111111B
DB 11111111B
DB 10111101B
DB 01111101B
DB 00000001B
DB 11111101B
DB 11111101B
DB 11111111B
FONT10: DB 11111111B
DB 11111111B
DB 01111011B
DB 11111011B
DB 00000011B
DB 11111011B
DB 11111011B
DB 11111111B
FONT11: DB 11111111B
DB 11111111B
DB 11110111B
DB 11110111B
DB 00000111B
DB 11110111B
DB 11110111B
DB 11111111B
FONT12: DB 11111111B
DB 11111111B
DB 11101111B
DB 11101111B
DB 00001111B
DB 11101111B
DB 11101111B
DB 11111111B
FONT13: DB 11111111B
DB 11111111B
DB 11011111B
DB 11011111B
DB 00011111B
DB 11011111B
DB 11011111B
DB 11111111B
FONT14: DB 11111111B
DB 11111111B
DB 10111111B
DB 10111111B
DB 00111111B
DB 10111111B
DB 10111111B
DB 11111111B
FONT15: DB 11111111B
DB 11111111B
DB 01111111B
DB 01111111B
DB 01111111B
DB 01111111B
DB 01111111B
DB 11111111B
CODE ENDS
END | 21.266667 | 56 | 0.452082 |
c4ac6d50659cd170fb97948f35595b21e63b6446 | 278 | asm | Assembly | programs/oeis/169/A169585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/169/A169585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/169/A169585.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A169585: A000004 preceded by 1, 3.
; 1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
pow $0,2
mov $1,3
bin $1,$0
mov $0,$1
| 34.75 | 201 | 0.52518 |
c9e21753c9e32a75aee086b0ef036746f82155b9 | 451 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccixp_slong2ds_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccixp_slong2ds_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccixp_slong2ds_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; float __slong2fs_callee(signed long sl)
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sdccixp_slong2ds_callee
EXTERN am48_double32, cm48_sdccixp_m482d
cm48_sdccixp_slong2ds_callee:
; signed long to double
;
; enter : stack = signed long sl, ret
;
; exit : dehl = sdcc_float(sl)
;
; uses : af, bc, de, hl, bc', de', hl'
pop af
pop hl
pop de
push af
call am48_double32
jp cm48_sdccixp_m482d
| 15.551724 | 42 | 0.685144 |
5934428f020faaf6998ccf0e967a326c7f120116 | 1,310 | asm | Assembly | programs/oeis/179/A179805.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/179/A179805.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/179/A179805.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A179805: a(0) = 1, a(1) = 3, a(2) = 6; a(n), n>2 = 2*a(n-1) - a(n-2). a(n), n>2 = a(n-1) + 9.
; 1,3,6,15,24,33,42,51,60,69,78,87,96,105,114,123,132,141,150,159,168,177,186,195,204,213,222,231,240,249,258,267,276,285,294,303,312,321,330,339,348,357,366,375,384,393,402,411,420,429,438,447,456,465,474,483,492,501,510,519,528,537,546,555,564,573,582,591,600,609,618,627,636,645,654,663,672,681,690,699,708,717,726,735,744,753,762,771,780,789,798,807,816,825,834,843,852,861,870,879,888,897,906,915,924,933,942,951,960,969,978,987,996,1005,1014,1023,1032,1041,1050,1059,1068,1077,1086,1095,1104,1113,1122,1131,1140,1149,1158,1167,1176,1185,1194,1203,1212,1221,1230,1239,1248,1257,1266,1275,1284,1293,1302,1311,1320,1329,1338,1347,1356,1365,1374,1383,1392,1401,1410,1419,1428,1437,1446,1455,1464,1473,1482,1491,1500,1509,1518,1527,1536,1545,1554,1563,1572,1581,1590,1599,1608,1617,1626,1635,1644,1653,1662,1671,1680,1689,1698,1707,1716,1725,1734,1743,1752,1761,1770,1779,1788,1797,1806,1815,1824,1833,1842,1851,1860,1869,1878,1887,1896,1905,1914,1923,1932,1941,1950,1959,1968,1977,1986,1995,2004,2013,2022,2031,2040,2049,2058,2067,2076,2085,2094,2103,2112,2121,2130,2139,2148,2157,2166,2175,2184,2193,2202,2211,2220,2229
mov $1,1
lpb $0,1
sub $0,1
mov $1,$2
mul $1,2
trn $1,6
add $2,3
add $1,$2
lpe
| 100.769231 | 1,122 | 0.724427 |
a2e062993cfd21c92f958245b5ac4afdb7925eac | 425 | asm | Assembly | programs/oeis/052/A052975.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/052/A052975.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/052/A052975.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A052975: Expansion of (1-2*x)*(1-x)/(1-5*x+6*x^2-x^3).
; 1,2,6,19,61,197,638,2069,6714,21794,70755,229725,745889,2421850,7863641,25532994,82904974,269190547,874055885,2838041117,9215060822,29921113293,97153242650,315454594314,1024274628963,3325798821581,10798800928441,35063486341682,113850424959345,369670007675074,1200310974960982,3897385253713811
mul $0,2
cal $0,28495 ; Expansion of (1-x^2)/(1-x-2*x^2+x^3).
mov $1,$0
| 60.714286 | 294 | 0.781176 |
3ff52b8ceaf378ca56e20dc9fe4f90d7eb825832 | 290 | asm | Assembly | oeis/290/A290768.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/290/A290768.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/290/A290768.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A290768: a(n) = 3/2*(n^2 - n + 2).
; 3,6,12,21,33,48,66,87,111,138,168,201,237,276,318,363,411,462,516,573,633,696,762,831,903,978,1056,1137,1221,1308,1398,1491,1587,1686,1788,1893,2001,2112,2226,2343,2463,2586,2712,2841,2973,3108,3246,3387,3531,3678
add $0,1
bin $0,2
mul $0,3
add $0,3
| 36.25 | 215 | 0.686207 |
694456a23f0f26eccc68bb22fc7c7334a49a1b66 | 702 | nasm | Assembly | MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm | kokweich/slimbootloader | 6fd1141c75a33894e3a7937dbc55859e4a6dacae | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | 9 | 2021-07-26T17:02:51.000Z | 2021-12-30T10:49:46.000Z | MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm | kokweich/slimbootloader | 6fd1141c75a33894e3a7937dbc55859e4a6dacae | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm | kokweich/slimbootloader | 6fd1141c75a33894e3a7937dbc55859e4a6dacae | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | ;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; ReadPmc.Asm
;
; Abstract:
;
; AsmReadPmc function
;
; Notes:
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; AsmReadPmc (
; IN UINT32 PmcIndex
; );
;------------------------------------------------------------------------------
global ASM_PFX(AsmReadPmc)
ASM_PFX(AsmReadPmc):
mov ecx, [esp + 4]
rdpmc
ret
| 21.272727 | 79 | 0.347578 |
5b5b7585e52d88aa12336595fd031673afffd32e | 700 | asm | Assembly | oeis/232/A232228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/232/A232228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/232/A232228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A232228: a(1)=1; thereafter a(n) = 2^(number of bits in binary expansion of a(n-1)) + 1 + a(n-1).
; Submitted by Jon Maiga
; 1,4,13,30,63,128,385,898,1923,3972,8069,16262,32647,65416,130953,262026,524171,1048460,2097037,4194190,8388495,16777104,33554321,67108754,134217619,268435348,536870805,1073741718,2147483543,4294967192,8589934489,17179869082,34359738267,68719476636,137438953373,274877906846,549755813791,1099511627680,2199023255457,4398046511010,8796093022115,17592186044324,35184372088741,70368744177574,140737488355239,281474976710568,562949953421225,1125899906842538,2251799813685163,4503599627370412
lpb $0
sub $0,1
seq $2,4755 ; Binary expansion starts 11.
lpe
mov $0,$2
add $0,1
| 63.636364 | 488 | 0.814286 |
bb4e201ea4763cba457baffddd6cc5f6abb39626 | 31,913 | asm | Assembly | avx512/aes_cbc_enc_vaes_avx512.asm | kevintraynor/intel-ipsec-mb | 5d5dc8686a2d748453115efc236e7cf56f1ba3fc | [
"BSD-3-Clause"
] | null | null | null | avx512/aes_cbc_enc_vaes_avx512.asm | kevintraynor/intel-ipsec-mb | 5d5dc8686a2d748453115efc236e7cf56f1ba3fc | [
"BSD-3-Clause"
] | null | null | null | avx512/aes_cbc_enc_vaes_avx512.asm | kevintraynor/intel-ipsec-mb | 5d5dc8686a2d748453115efc236e7cf56f1ba3fc | [
"BSD-3-Clause"
] | null | null | null | ;;
;; Copyright (c) 2019-2020, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;; * Neither the name of Intel Corporation nor the names of its contributors
;; may be used to endorse or promote products derived from this software
;; without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
;;; routines to do 128/192/256 bit CBC AES encrypt
%include "include/os.asm"
%include "mb_mgr_datastruct.asm"
%include "include/reg_sizes.asm"
%include "include/clear_regs.asm"
struc STACK
_gpr_save: resq 3
endstruc
%define GPR_SAVE_AREA rsp + _gpr_save
%ifdef LINUX
%define arg1 rdi
%define arg2 rsi
%define arg3 rcx
%define arg4 rdx
%else
%define arg1 rcx
%define arg2 rdx
%define arg3 rdi
%define arg4 rsi
%endif
%define ARG arg1
%define LEN arg2
%define IA0 rax
%define IA1 rbx
%define IA2 arg3
%define IA3 arg4
%define IA4 rbp
%define IA5 r8
%define IA6 r9
%define IA7 r10
%define IA8 r11
%define IA9 r13
%define IA10 r14
%define IA11 r15
%define IA12 r12
%define ZIV00_03 zmm8
%define ZIV04_07 zmm9
%define ZIV08_11 zmm10
%define ZIV12_15 zmm11
%define ZT0 zmm16
%define ZT1 zmm17
%define ZT2 zmm18
%define ZT3 zmm19
%define ZT4 zmm20
%define ZT5 zmm21
%define ZT6 zmm22
%define ZT7 zmm23
%define ZT8 zmm24
%define ZT9 zmm25
%define ZT10 zmm26
%define ZT11 zmm27
%define ZT12 zmm28
%define ZT13 zmm29
%define ZT14 zmm30
%define ZT15 zmm31
%define ZT16 zmm12
%define ZT17 zmm13
%define ZT18 zmm14
%define ZT19 zmm15
%define TAB_A0B0A1B1 zmm6
%define TAB_A2B2A3B3 zmm7
;; Save registers states
%macro FUNC_SAVE 0
sub rsp, STACK_size
mov [GPR_SAVE_AREA + 8*0], rbp
%ifndef LINUX
mov [GPR_SAVE_AREA + 8*1], rsi
mov [GPR_SAVE_AREA + 8*2], rdi
%endif
%endmacro
;; Restore register states
%macro FUNC_RESTORE 0
;; XMMs are saved at a higher level
mov rbp, [GPR_SAVE_AREA + 8*0]
%ifndef LINUX
mov rsi, [GPR_SAVE_AREA + 8*1]
mov rdi, [GPR_SAVE_AREA + 8*2]
%endif
add rsp, STACK_size
vzeroupper
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Transpose macro - executes 4x4 transpose of 4 ZMM registers
; in: L0B0-3 out: B0L0-3
; L1B0-3 B1L0-3
; L2B0-3 B2L0-3
; L3B0-3 B3L0-3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro TRANSPOSE_4x4 8
%define %%IN_OUT_0 %1
%define %%IN_OUT_1 %2
%define %%IN_OUT_2 %3
%define %%IN_OUT_3 %4
%define %%ZTMP_0 %5
%define %%ZTMP_1 %6
%define %%ZTMP_2 %7
%define %%ZTMP_3 %8
vmovdqa64 %%ZTMP_0, TAB_A0B0A1B1
vmovdqa64 %%ZTMP_1, %%ZTMP_0
vmovdqa64 %%ZTMP_2, TAB_A2B2A3B3
vmovdqa64 %%ZTMP_3, %%ZTMP_2
vpermi2q %%ZTMP_0, %%IN_OUT_0, %%IN_OUT_1
vpermi2q %%ZTMP_1, %%IN_OUT_2, %%IN_OUT_3
vpermi2q %%ZTMP_2, %%IN_OUT_0, %%IN_OUT_1
vpermi2q %%ZTMP_3, %%IN_OUT_2, %%IN_OUT_3
vshufi64x2 %%IN_OUT_0, %%ZTMP_0, %%ZTMP_1, 0x44
vshufi64x2 %%IN_OUT_2, %%ZTMP_2, %%ZTMP_3, 0x44
vshufi64x2 %%IN_OUT_1, %%ZTMP_0, %%ZTMP_1, 0xee
vshufi64x2 %%IN_OUT_3, %%ZTMP_2, %%ZTMP_3, 0xee
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; LOAD_STORE - loads/stores 1-4 blocks (16 bytes) for 4 lanes into ZMM registers
; - Loads 4 blocks by default
; - Pass %%MASK_REG argument to load/store 1-3 blocks (optional)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro LOAD_STORE_x4 15-16
%define %%LANE_A %1 ; [in] lane index to load/store (numerical)
%define %%LANE_B %2 ; [in] lane index to load/store (numerical)
%define %%LANE_C %3 ; [in] lane index to load/store (numerical)
%define %%LANE_D %4 ; [in] lane index to load/store (numerical)
%define %%DATA_PTR %5 ; [in] GP reg with ptr to lane input table
%define %%OFFSET %6 ; [in] GP reg input/output buffer offset
%define %%ZDATA0 %7 ; [in/out] ZMM reg to load/store data
%define %%ZDATA1 %8 ; [in/out] ZMM reg to load/store data
%define %%ZDATA2 %9 ; [in/out] ZMM reg to load/store data
%define %%ZDATA3 %10 ; [in/out] ZMM reg to load/store data
%define %%GP0 %11 ; [clobbered] tmp GP reg
%define %%GP1 %12 ; [clobbered] tmp GP reg
%define %%GP2 %13 ; [clobbered] tmp GP reg
%define %%GP3 %14 ; [clobbered] tmp GP reg
%define %%LOAD_STORE %15 ; [in] string value to select LOAD or STORE
%define %%MASK_REG %16 ; [in] mask reg used for load/store mask
%define %%NUM_ARGS %0
mov %%GP0, [%%DATA_PTR + 8*(%%LANE_A)]
mov %%GP1, [%%DATA_PTR + 8*(%%LANE_B)]
mov %%GP2, [%%DATA_PTR + 8*(%%LANE_C)]
mov %%GP3, [%%DATA_PTR + 8*(%%LANE_D)]
%if %%NUM_ARGS <= 15 ;; %%MASK_REG not set, assume 4 block load/store
%ifidn %%LOAD_STORE, LOAD
vmovdqu8 %%ZDATA0, [%%GP0 + %%OFFSET]
vmovdqu8 %%ZDATA1, [%%GP1 + %%OFFSET]
vmovdqu8 %%ZDATA2, [%%GP2 + %%OFFSET]
vmovdqu8 %%ZDATA3, [%%GP3 + %%OFFSET]
%else ; STORE8
vmovdqu8 [%%GP0 + %%OFFSET], %%ZDATA0
vmovdqu8 [%%GP1 + %%OFFSET], %%ZDATA1
vmovdqu8 [%%GP2 + %%OFFSET], %%ZDATA2
vmovdqu8 [%%GP3 + %%OFFSET], %%ZDATA3
%endif
%else ;; %%MASK_REG argument passed - 1, 2, or 3 block load/store
%ifidn %%LOAD_STORE, LOAD
vmovdqu8 %%ZDATA0{%%MASK_REG}{z}, [%%GP0 + %%OFFSET]
vmovdqu8 %%ZDATA1{%%MASK_REG}{z}, [%%GP1 + %%OFFSET]
vmovdqu8 %%ZDATA2{%%MASK_REG}{z}, [%%GP2 + %%OFFSET]
vmovdqu8 %%ZDATA3{%%MASK_REG}{z}, [%%GP3 + %%OFFSET]
%else ; STORE
vmovdqu8 [%%GP0 + %%OFFSET]{%%MASK_REG}, %%ZDATA0
vmovdqu8 [%%GP1 + %%OFFSET]{%%MASK_REG}, %%ZDATA1
vmovdqu8 [%%GP2 + %%OFFSET]{%%MASK_REG}, %%ZDATA2
vmovdqu8 [%%GP3 + %%OFFSET]{%%MASK_REG}, %%ZDATA3
%endif
%endif ;; %%NUM_ARGS
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; AESENC_ROUNDS_x16 macro
; - 16 lanes, 1 block per lane
; - performs AES encrypt rounds 1-NROUNDS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro AESENC_ROUNDS_x16 5
%define %%L00_03 %1 ; [in/out] ZMM with lane 0-3 blocks
%define %%L04_07 %2 ; [in/out] ZMM with lane 4-7 blocks
%define %%L08_11 %3 ; [in/out] ZMM with lane 8-11 blocks
%define %%L12_15 %4 ; [in/out] ZMM with lane 12-15 blocks
%define %%NROUNDS %5 ; [in] number of aes rounds
%define %%KP ARG + _aesarg_key_tab
%define K00_03_OFFSET 0
%define K04_07_OFFSET 64
%define K08_11_OFFSET 128
%define K12_15_OFFSET 192
%assign ROUND 1
%rep (%%NROUNDS + 1)
%if ROUND <= %%NROUNDS
;; rounds 1 to 9/11/13
vaesenc %%L00_03, %%L00_03, [%%KP + K00_03_OFFSET + ROUND * (16*16)]
vaesenc %%L04_07, %%L04_07, [%%KP + K04_07_OFFSET + ROUND * (16*16)]
vaesenc %%L08_11, %%L08_11, [%%KP + K08_11_OFFSET + ROUND * (16*16)]
vaesenc %%L12_15, %%L12_15, [%%KP + K12_15_OFFSET + ROUND * (16*16)]
%else
;; the last round
vaesenclast %%L00_03, %%L00_03, [%%KP + K00_03_OFFSET + ROUND * (16*16)]
vaesenclast %%L04_07, %%L04_07, [%%KP + K04_07_OFFSET + ROUND * (16*16)]
vaesenclast %%L08_11, %%L08_11, [%%KP + K08_11_OFFSET + ROUND * (16*16)]
vaesenclast %%L12_15, %%L12_15, [%%KP + K12_15_OFFSET + ROUND * (16*16)]
%endif
%assign ROUND (ROUND + 1)
%endrep
%endmacro ; AESENC_ROUNDS_x16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENCRYPT_16_PARALLEL - Encode all blocks up to multiple of 4
; - Operation
; - loop encrypting %%LENGTH bytes of input data
; - each loop encrypts 4 blocks across 16 lanes
; - stop when %%LENGTH is less than 64 bytes (4 blocks)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro ENCRYPT_16_PARALLEL 32
%define %%ZIV00_03 %1 ;; [in] lane 0-3 IVs
%define %%ZIV04_07 %2 ;; [in] lane 4-7 IVs
%define %%ZIV08_11 %3 ;; [in] lane 8-11 IVs
%define %%ZIV12_15 %4 ;; [in] lane 12-15 IVs
%define %%LENGTH %5 ;; [in/out] GP register with length in bytes
%define %%NROUNDS %6 ;; [in] Number of AES rounds; numerical value
%define %%IDX %7 ;; [clobbered] GP reg to maintain idx
%define %%B0L00_03 %8 ;; [clobbered] tmp ZMM register
%define %%B0L04_07 %9 ;; [clobbered] tmp ZMM register
%define %%B0L08_11 %10 ;; [clobbered] tmp ZMM register
%define %%B0L12_15 %11 ;; [clobbered] tmp ZMM register
%define %%B1L00_03 %12 ;; [clobbered] tmp ZMM register
%define %%B1L04_07 %13 ;; [clobbered] tmp ZMM register
%define %%B1L08_11 %14 ;; [clobbered] tmp ZMM register
%define %%B1L12_15 %15 ;; [clobbered] tmp ZMM register
%define %%B2L00_03 %16 ;; [clobbered] tmp ZMM register
%define %%B2L04_07 %17 ;; [clobbered] tmp ZMM register
%define %%B2L08_11 %18 ;; [clobbered] tmp ZMM register
%define %%B2L12_15 %19 ;; [clobbered] tmp ZMM register
%define %%B3L00_03 %20 ;; [clobbered] tmp ZMM register
%define %%B3L04_07 %21 ;; [clobbered] tmp ZMM register
%define %%B3L08_11 %22 ;; [clobbered] tmp ZMM register
%define %%B3L12_15 %23 ;; [clobbered] tmp ZMM register
%define %%ZTMP0 %24 ;; [clobbered] tmp ZMM register
%define %%ZTMP1 %25 ;; [clobbered] tmp ZMM register
%define %%ZTMP2 %26 ;; [clobbered] tmp ZMM register
%define %%ZTMP3 %27 ;; [clobbered] tmp ZMM register
%define %%TMP0 %28 ;; [clobbered] tmp GP register
%define %%TMP1 %29 ;; [clobbered] tmp GP register
%define %%TMP2 %30 ;; [clobbered] tmp GP register
%define %%TMP3 %31 ;; [clobbered] tmp GP register
%define %%CBC_MAC %32 ;; CBC-MAC flag
%define %%IN ARG + _aesarg_in
%define %%OUT ARG + _aesarg_out
%define %%KP ARG + _aesarg_key_tab
%define K00_03_OFFSET 0
%define K04_07_OFFSET 64
%define K08_11_OFFSET 128
%define K12_15_OFFSET 192
;; check for at least 4 blocks
cmp %%LENGTH, 64
jl %%encrypt_16_done
xor %%IDX, %%IDX
;; skip length check on first loop
jmp %%encrypt_16_first
%%encrypt_16_start:
cmp %%LENGTH, 64
jl %%encrypt_16_end
%%encrypt_16_first:
;; load 4 plaintext blocks for lanes 0-3
LOAD_STORE_x4 0, 1, 2, 3, %%IN, %%IDX, %%B0L00_03, %%B1L00_03, \
%%B2L00_03, %%B3L00_03, %%TMP0, %%TMP1, %%TMP2, %%TMP3, LOAD
TRANSPOSE_4x4 %%B0L00_03, %%B1L00_03, %%B2L00_03, %%B3L00_03, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 4-7
LOAD_STORE_x4 4, 5, 6, 7, %%IN, %%IDX, %%B0L04_07, %%B1L04_07, \
%%B2L04_07, %%B3L04_07, %%TMP0, %%TMP1, %%TMP2, %%TMP3, LOAD
TRANSPOSE_4x4 %%B0L04_07, %%B1L04_07, %%B2L04_07, %%B3L04_07, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 8-11
LOAD_STORE_x4 8, 9, 10, 11, %%IN, %%IDX, %%B0L08_11, %%B1L08_11, \
%%B2L08_11, %%B3L08_11, %%TMP0, %%TMP1, %%TMP2, %%TMP3, LOAD
TRANSPOSE_4x4 %%B0L08_11, %%B1L08_11, %%B2L08_11, %%B3L08_11, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 12-15
LOAD_STORE_x4 12, 13, 14, 15, %%IN, %%IDX, %%B0L12_15, %%B1L12_15, \
%%B2L12_15, %%B3L12_15, %%TMP0, %%TMP1, %%TMP2, %%TMP3, LOAD
TRANSPOSE_4x4 %%B0L12_15, %%B1L12_15, %%B2L12_15, %%B3L12_15, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; xor first plaintext block with IV and round zero key
vpternlogq %%B0L00_03, %%ZIV00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B0L04_07, %%ZIV04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B0L08_11, %%ZIV08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B0L12_15, %%ZIV12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 0 lanes
AESENC_ROUNDS_x16 %%B0L00_03, %%B0L04_07, %%B0L08_11, %%B0L12_15, %%NROUNDS
;; xor plaintext block with last cipher block and round zero key
vpternlogq %%B1L00_03, %%B0L00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B1L04_07, %%B0L04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B1L08_11, %%B0L08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B1L12_15, %%B0L12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 1 lanes
AESENC_ROUNDS_x16 %%B1L00_03, %%B1L04_07, %%B1L08_11, %%B1L12_15, %%NROUNDS
;; xor plaintext block with last cipher block and round zero key
vpternlogq %%B2L00_03, %%B1L00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B2L04_07, %%B1L04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B2L08_11, %%B1L08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B2L12_15, %%B1L12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 2 lanes
AESENC_ROUNDS_x16 %%B2L00_03, %%B2L04_07, %%B2L08_11, %%B2L12_15, %%NROUNDS
;; xor plaintext block with last cipher block and round zero key
vpternlogq %%B3L00_03, %%B2L00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B3L04_07, %%B2L04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B3L08_11, %%B2L08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B3L12_15, %%B2L12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 3 lanes
AESENC_ROUNDS_x16 %%B3L00_03, %%B3L04_07, %%B3L08_11, %%B3L12_15, %%NROUNDS
;; store last cipher block
vmovdqa64 %%ZIV00_03, %%B3L00_03
vmovdqa64 %%ZIV04_07, %%B3L04_07
vmovdqa64 %%ZIV08_11, %%B3L08_11
vmovdqa64 %%ZIV12_15, %%B3L12_15
;; Don't write back ciphertext for CBC-MAC
%if %%CBC_MAC == 0
;; write back cipher text for lanes 0-3
TRANSPOSE_4x4 %%B0L00_03, %%B1L00_03, %%B2L00_03, %%B3L00_03, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 0, 1, 2, 3, %%OUT, %%IDX, %%B0L00_03, %%B1L00_03, \
%%B2L00_03, %%B3L00_03, %%TMP0, %%TMP1, %%TMP2, %%TMP3, STORE
;; write back cipher text for lanes 4-7
TRANSPOSE_4x4 %%B0L04_07, %%B1L04_07, %%B2L04_07, %%B3L04_07, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 4, 5, 6, 7, %%OUT, %%IDX, %%B0L04_07, %%B1L04_07, \
%%B2L04_07, %%B3L04_07, %%TMP0, %%TMP1, %%TMP2, %%TMP3, STORE
;; write back cipher text for lanes 8-11
TRANSPOSE_4x4 %%B0L08_11, %%B1L08_11, %%B2L08_11, %%B3L08_11, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 8, 9, 10, 11, %%OUT, %%IDX, %%B0L08_11, %%B1L08_11, \
%%B2L08_11, %%B3L08_11, %%TMP0, %%TMP1, %%TMP2, %%TMP3, STORE
;; write back cipher text for lanes 12-15
TRANSPOSE_4x4 %%B0L12_15, %%B1L12_15, %%B2L12_15, %%B3L12_15, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 12, 13, 14, 15, %%OUT, %%IDX, %%B0L12_15, %%B1L12_15, \
%%B2L12_15, %%B3L12_15, %%TMP0, %%TMP1, %%TMP2, %%TMP3, STORE
%endif ;; !CBC_MAC
sub %%LENGTH, 64
add %%IDX, 64
jmp %%encrypt_16_start
%%encrypt_16_end:
;; update in/out pointers
vpbroadcastq %%ZTMP2, %%IDX
vpaddq %%ZTMP0, %%ZTMP2, [%%IN]
vpaddq %%ZTMP1, %%ZTMP2, [%%IN + 64]
vmovdqa64 [%%IN], %%ZTMP0
vmovdqa64 [%%IN + 64], %%ZTMP1
%if %%CBC_MAC == 0 ;; skip out pointer update for CBC_MAC
vpaddq %%ZTMP0, %%ZTMP2, [%%OUT]
vpaddq %%ZTMP1, %%ZTMP2, [%%OUT + 64]
vmovdqa64 [%%OUT], %%ZTMP0
vmovdqa64 [%%OUT + 64], %%ZTMP1
%endif ;; !CBC_MAC
%%encrypt_16_done:
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENCRYPT_16_FINAL Encodes final blocks (less than 4) across 16 lanes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro ENCRYPT_16_FINAL 32
%define %%ZIV00_03 %1 ;; [in] lane 0-3 IVs
%define %%ZIV04_07 %2 ;; [in] lane 4-7 IVs
%define %%ZIV08_11 %3 ;; [in] lane 8-11 IVs
%define %%ZIV12_15 %4 ;; [in] lane 12-15 IVs
%define %%NROUNDS %5 ;; [in] Number of AES rounds; numerical value
%define %%IDX %6 ;; [clobbered] GP reg to maintain idx
%define %%B0L00_03 %7 ;; [clobbered] tmp ZMM register
%define %%B0L04_07 %8 ;; [clobbered] tmp ZMM register
%define %%B0L08_11 %9 ;; [clobbered] tmp ZMM register
%define %%B0L12_15 %10 ;; [clobbered] tmp ZMM register
%define %%B1L00_03 %11 ;; [clobbered] tmp ZMM register
%define %%B1L04_07 %12 ;; [clobbered] tmp ZMM register
%define %%B1L08_11 %13 ;; [clobbered] tmp ZMM register
%define %%B1L12_15 %14 ;; [clobbered] tmp ZMM register
%define %%B2L00_03 %15 ;; [clobbered] tmp ZMM register
%define %%B2L04_07 %16 ;; [clobbered] tmp ZMM register
%define %%B2L08_11 %17 ;; [clobbered] tmp ZMM register
%define %%B2L12_15 %18 ;; [clobbered] tmp ZMM register
%define %%B3L00_03 %19 ;; [clobbered] tmp ZMM register
%define %%B3L04_07 %20 ;; [clobbered] tmp ZMM register
%define %%B3L08_11 %21 ;; [clobbered] tmp ZMM register
%define %%B3L12_15 %22 ;; [clobbered] tmp ZMM register
%define %%ZTMP0 %23 ;; [clobbered] tmp ZMM register
%define %%ZTMP1 %24 ;; [clobbered] tmp ZMM register
%define %%ZTMP2 %25 ;; [clobbered] tmp ZMM register
%define %%ZTMP3 %26 ;; [clobbered] tmp ZMM register
%define %%TMP0 %27 ;; [clobbered] tmp GP register
%define %%TMP1 %28 ;; [clobbered] tmp GP register
%define %%TMP2 %29 ;; [clobbered] tmp GP register
%define %%TMP3 %30 ;; [clobbered] tmp GP register
%define %%NUM_BLKS %31 ;; [in] number of blocks (numerical value)
%define %%CBC_MAC %32 ;; CBC_MAC flag
%define %%IN ARG + _aesarg_in
%define %%OUT ARG + _aesarg_out
%define %%KP ARG + _aesarg_key_tab
%define K00_03_OFFSET 0
%define K04_07_OFFSET 64
%define K08_11_OFFSET 128
%define K12_15_OFFSET 192
%if %%NUM_BLKS == 1
mov %%TMP0, 0x0000_0000_0000_ffff
kmovq k1, %%TMP0
%elif %%NUM_BLKS == 2
mov %%TMP0, 0x0000_0000_ffff_ffff
kmovq k1, %%TMP0
%elif %%NUM_BLKS == 3
mov %%TMP0, 0x0000_ffff_ffff_ffff
kmovq k1, %%TMP0
%endif
xor %%IDX, %%IDX
;; load 4 plaintext blocks for lanes 0-3
LOAD_STORE_x4 0, 1, 2, 3, %%IN, %%IDX, %%B0L00_03, %%B1L00_03, \
%%B2L00_03, %%B3L00_03, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, LOAD, k1
TRANSPOSE_4x4 %%B0L00_03, %%B1L00_03, %%B2L00_03, %%B3L00_03, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 4-7
LOAD_STORE_x4 4, 5, 6, 7, %%IN, %%IDX, %%B0L04_07, %%B1L04_07, \
%%B2L04_07, %%B3L04_07, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, LOAD, k1
TRANSPOSE_4x4 %%B0L04_07, %%B1L04_07, %%B2L04_07, %%B3L04_07, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 8-11
LOAD_STORE_x4 8, 9, 10, 11, %%IN, %%IDX, %%B0L08_11, %%B1L08_11, \
%%B2L08_11, %%B3L08_11, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, LOAD, k1
TRANSPOSE_4x4 %%B0L08_11, %%B1L08_11, %%B2L08_11, %%B3L08_11, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; load 4 plaintext blocks for lanes 12-15
LOAD_STORE_x4 12, 13, 14, 15, %%IN, %%IDX, %%B0L12_15, %%B1L12_15, \
%%B2L12_15, %%B3L12_15, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, LOAD, k1
TRANSPOSE_4x4 %%B0L12_15, %%B1L12_15, %%B2L12_15, %%B3L12_15, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
;; xor plaintext block with IV and round zero key
vpternlogq %%B0L00_03, %%ZIV00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B0L04_07, %%ZIV04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B0L08_11, %%ZIV08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B0L12_15, %%ZIV12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 0 lanes
AESENC_ROUNDS_x16 %%B0L00_03, %%B0L04_07, %%B0L08_11, %%B0L12_15, %%NROUNDS
%if %%NUM_BLKS == 1
;; store last cipher block
vmovdqa64 %%ZIV00_03, %%B0L00_03
vmovdqa64 %%ZIV04_07, %%B0L04_07
vmovdqa64 %%ZIV08_11, %%B0L08_11
vmovdqa64 %%ZIV12_15, %%B0L12_15
%endif
%if %%NUM_BLKS >= 2
;; xor plaintext block with last cipher block and round zero key
vpternlogq %%B1L00_03, %%B0L00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B1L04_07, %%B0L04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B1L08_11, %%B0L08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B1L12_15, %%B0L12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 1 lanes
AESENC_ROUNDS_x16 %%B1L00_03, %%B1L04_07, %%B1L08_11, %%B1L12_15, %%NROUNDS
%endif
%if %%NUM_BLKS == 2
;; store last cipher block
vmovdqa64 %%ZIV00_03, %%B1L00_03
vmovdqa64 %%ZIV04_07, %%B1L04_07
vmovdqa64 %%ZIV08_11, %%B1L08_11
vmovdqa64 %%ZIV12_15, %%B1L12_15
%endif
%if %%NUM_BLKS >= 3
;; xor plaintext block with last cipher block and round zero key
vpternlogq %%B2L00_03, %%B1L00_03, [%%KP + K00_03_OFFSET], 0x96
vpternlogq %%B2L04_07, %%B1L04_07, [%%KP + K04_07_OFFSET], 0x96
vpternlogq %%B2L08_11, %%B1L08_11, [%%KP + K08_11_OFFSET], 0x96
vpternlogq %%B2L12_15, %%B1L12_15, [%%KP + K12_15_OFFSET], 0x96
;; encrypt block 2 lanes
AESENC_ROUNDS_x16 %%B2L00_03, %%B2L04_07, %%B2L08_11, %%B2L12_15, %%NROUNDS
%endif
%if %%NUM_BLKS == 3
;; store last cipher block
vmovdqa64 %%ZIV00_03, %%B2L00_03
vmovdqa64 %%ZIV04_07, %%B2L04_07
vmovdqa64 %%ZIV08_11, %%B2L08_11
vmovdqa64 %%ZIV12_15, %%B2L12_15
%endif
;; Don't write back ciphertext for CBC-MAC
%if %%CBC_MAC == 0
;; write back cipher text for lanes 0-3
TRANSPOSE_4x4 %%B0L00_03, %%B1L00_03, %%B2L00_03, %%B3L00_03, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 0, 1, 2, 3, %%OUT, %%IDX, %%B0L00_03, %%B1L00_03, \
%%B2L00_03, %%B3L00_03, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, STORE, k1
;; write back cipher text for lanes 4-7
TRANSPOSE_4x4 %%B0L04_07, %%B1L04_07, %%B2L04_07, %%B3L04_07, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 4, 5, 6, 7, %%OUT, %%IDX, %%B0L04_07, %%B1L04_07, \
%%B2L04_07, %%B3L04_07, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, STORE, k1
;; write back cipher text for lanes 8-11
TRANSPOSE_4x4 %%B0L08_11, %%B1L08_11, %%B2L08_11, %%B3L08_11, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 8, 9, 10, 11, %%OUT, %%IDX, %%B0L08_11, %%B1L08_11, \
%%B2L08_11, %%B3L08_11, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, STORE, k1
;; write back cipher text for lanes 12-15
TRANSPOSE_4x4 %%B0L12_15, %%B1L12_15, %%B2L12_15, %%B3L12_15, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
LOAD_STORE_x4 12, 13, 14, 15, %%OUT, %%IDX, %%B0L12_15, %%B1L12_15, \
%%B2L12_15, %%B3L12_15, %%TMP0, %%TMP1, %%TMP2, \
%%TMP3, STORE, k1
%endif ;; !CBC_MAC
;; update in/out pointers
mov %%IDX, %%NUM_BLKS
shl %%IDX, 4
vpbroadcastq %%ZTMP2, %%IDX
vpaddq %%ZTMP0, %%ZTMP2, [%%IN]
vpaddq %%ZTMP1, %%ZTMP2, [%%IN + 64]
vmovdqa64 [%%IN], %%ZTMP0
vmovdqa64 [%%IN + 64], %%ZTMP1
%if %%CBC_MAC == 0 ;; skip out pointer update for CBC-MAC
vpaddq %%ZTMP0, %%ZTMP2, [%%OUT]
vpaddq %%ZTMP1, %%ZTMP2, [%%OUT + 64]
vmovdqa64 [%%OUT], %%ZTMP0
vmovdqa64 [%%OUT + 64], %%ZTMP1
%endif ;; !CBC_MAC
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CBC_ENC Encodes given data.
; Requires the input data be at least 1 block (16 bytes) long
; Input: Number of AES rounds
;
; First encrypts block up to multiple of 4
; Then encrypts final blocks (less than 4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro CBC_ENC 2
%define %%ROUNDS %1
%define %%CBC_MAC %2
;; load transpose tables
vmovdqa64 TAB_A0B0A1B1, [rel A0B0A1B1]
vmovdqa64 TAB_A2B2A3B3, [rel A2B2A3B3]
;; load IV's per lane
vmovdqa64 ZIV00_03, [ARG + _aesarg_IV + 16*0]
vmovdqa64 ZIV04_07, [ARG + _aesarg_IV + 16*4]
vmovdqa64 ZIV08_11, [ARG + _aesarg_IV + 16*8]
vmovdqa64 ZIV12_15, [ARG + _aesarg_IV + 16*12]
ENCRYPT_16_PARALLEL ZIV00_03, ZIV04_07, ZIV08_11, ZIV12_15, \
LEN, %%ROUNDS, IA12, ZT0, ZT1, ZT2, ZT3, ZT4, ZT5, \
ZT6, ZT7, ZT8, ZT9, ZT10, ZT11, ZT12, ZT13, ZT14, \
ZT15, ZT16, ZT17, ZT18, ZT19, IA2, IA3, IA4, IA5, \
%%CBC_MAC
;; get num remaining blocks
shr LEN, 4
and LEN, 3
je %%_cbc_enc_done
cmp LEN, 1
je %%_final_blocks_1
cmp LEN, 2
je %%_final_blocks_2
%%_final_blocks_3:
ENCRYPT_16_FINAL ZIV00_03, ZIV04_07, ZIV08_11, ZIV12_15, \
%%ROUNDS, IA12, ZT0, ZT1, ZT2, ZT3, ZT4, ZT5, ZT6, ZT7, \
ZT8, ZT9, ZT10, ZT11, ZT12, ZT13, ZT14, ZT15, ZT16, ZT17, \
ZT18, ZT19, IA2, IA3, IA4, IA5, 3, %%CBC_MAC
jmp %%_cbc_enc_done
%%_final_blocks_1:
ENCRYPT_16_FINAL ZIV00_03, ZIV04_07, ZIV08_11, ZIV12_15, \
%%ROUNDS, IA12, ZT0, ZT1, ZT2, ZT3, ZT4, ZT5, ZT6, ZT7, \
ZT8, ZT9, ZT10, ZT11, ZT12, ZT13, ZT14, ZT15, ZT16, ZT17, \
ZT18, ZT19, IA2, IA3, IA4, IA5, 1, %%CBC_MAC
jmp %%_cbc_enc_done
%%_final_blocks_2:
ENCRYPT_16_FINAL ZIV00_03, ZIV04_07, ZIV08_11, ZIV12_15, \
%%ROUNDS, IA12, ZT0, ZT1, ZT2, ZT3, ZT4, ZT5, ZT6, ZT7, \
ZT8, ZT9, ZT10, ZT11, ZT12, ZT13, ZT14, ZT15, ZT16, ZT17, \
ZT18, ZT19, IA2, IA3, IA4, IA5, 2, %%CBC_MAC
%%_cbc_enc_done:
;; store IV's per lane
vmovdqa64 [ARG + _aesarg_IV + 16*0], ZIV00_03
vmovdqa64 [ARG + _aesarg_IV + 16*4], ZIV04_07
vmovdqa64 [ARG + _aesarg_IV + 16*8], ZIV08_11
vmovdqa64 [ARG + _aesarg_IV + 16*12], ZIV12_15
%endmacro
section .data
;;;;;;;;;;;;;;;;;;
; Transpose tables
;;;;;;;;;;;;;;;;;;
default rel
align 64
A0B0A1B1:
dq 0x0, 0x1, 0x8, 0x9, 0x2, 0x3, 0xa, 0xb
align 64
A2B2A3B3:
dq 0x4, 0x5, 0xc, 0xd, 0x6, 0x7, 0xe, 0xf
section .text
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; void aes_cbc_enc_128_vaes_avx512(AES_ARGS *args, uint64_t len_in_bytes);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(aes_cbc_enc_128_vaes_avx512,function,internal)
aes_cbc_enc_128_vaes_avx512:
FUNC_SAVE
CBC_ENC 9, 0
FUNC_RESTORE
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif ;; SAFE_DATA
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; void aes_cbc_enc_192_vaes_avx512(AES_ARGS *args, uint64_t len_in_bytes);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(aes_cbc_enc_192_vaes_avx512,function,internal)
aes_cbc_enc_192_vaes_avx512:
FUNC_SAVE
CBC_ENC 11, 0
FUNC_RESTORE
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif ;; SAFE_DATA
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; void aes_cbc_enc_256_vaes_avx512(AES_ARGS *args, uint64_t len_in_bytes);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(aes_cbc_enc_256_vaes_avx512,function,internal)
aes_cbc_enc_256_vaes_avx512:
FUNC_SAVE
CBC_ENC 13, 0
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; void aes128_cbc_mac_vaes_avx512(AES_ARGS *args, uint64_t len_in_bytes);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(aes128_cbc_mac_vaes_avx512,function,internal)
aes128_cbc_mac_vaes_avx512:
FUNC_SAVE
CBC_ENC 9, 1
FUNC_RESTORE
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif ;; SAFE_DATA
ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
| 41.66188 | 89 | 0.537023 |
c210b7d2a57665eb595312981fb1b4fd21cfd526 | 426 | asm | Assembly | pwnlib/shellcraft/templates/thumb/android/remap_file_pages.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/thumb/android/remap_file_pages.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/thumb/android/remap_file_pages.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.aarch64.linux import syscall
%>
<%page args="start, size, prot, pgoff, flags"/>
<%docstring>
Invokes the syscall remap_file_pages. See 'man 2 remap_file_pages' for more information.
Arguments:
start(void): start
size(size_t): size
prot(int): prot
pgoff(size_t): pgoff
flags(int): flags
</%docstring>
${syscall('SYS_remap_file_pages', start, size, prot, pgoff, flags)}
| 23.666667 | 89 | 0.692488 |
1dcdc90c4a226a0f66ac0690fbfa4a7455d3dc9c | 1,058 | asm | Assembly | maps/WhirlIslandLugiaChamber.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | maps/WhirlIslandLugiaChamber.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | maps/WhirlIslandLugiaChamber.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | object_const_def ; object_event constants
const WHIRLISLANDLUGIACHAMBER_LUGIA
WhirlIslandLugiaChamber_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_OBJECTS, .Lugia
.Lugia:
checkevent EVENT_FOUGHT_LUGIA
iftrue .NoAppear
checkitem SILVER_WING
iftrue .Appear
sjump .NoAppear
.Appear:
appear WHIRLISLANDLUGIACHAMBER_LUGIA
return
.NoAppear:
disappear WHIRLISLANDLUGIACHAMBER_LUGIA
return
Lugia:
faceplayer
opentext
writetext LugiaText
cry LUGIA
pause 15
closetext
setevent EVENT_FOUGHT_LUGIA
loadvar VAR_BATTLETYPE, BATTLETYPE_FORCEITEM
loadwildmon LUGIA, 60
startbattle
disappear WHIRLISLANDLUGIACHAMBER_LUGIA
reloadmapafterbattle
end
LugiaText:
text "Gyaaas!"
done
WhirlIslandLugiaChamber_MapEvents:
db 0, 0 ; filler
db 1 ; warp events
warp_event 9, 13, WHIRL_ISLAND_B2F, 3
db 0 ; coord events
db 0 ; bg events
db 1 ; object events
object_event 9, 5, SPRITE_LUGIA, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, Lugia, EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA
| 18.892857 | 155 | 0.804348 |
e4cee74956dfedc54cade92cc01af0435615e242 | 2,665 | asm | Assembly | data/tilesets/underground_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/tilesets/underground_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/tilesets/underground_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | tilecoll WALL, WALL, WALL, WALL ; 00
tilecoll WALL, WALL, WALL, WALL ; 01
tilecoll FLOOR, LADDER, FLOOR, FLOOR ; 02
tilecoll FLOOR, LADDER, FLOOR, FLOOR ; 03
tilecoll WALL, WALL, WALL, FLOOR ; 04
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 05
tilecoll WALL, FLOOR, WALL, FLOOR ; 06
tilecoll FLOOR, FLOOR, PIT, PIT ; 07
tilecoll WALL, WALL, WALL, FLOOR ; 08
tilecoll WALL, WALL, FLOOR, FLOOR ; 09
tilecoll WALL, WALL, FLOOR, WALL ; 0a
tilecoll WALL, WALL, WALL, WALL ; 0b
tilecoll WALL, FLOOR, WALL, FLOOR ; 0c
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0d
tilecoll FLOOR, WALL, FLOOR, WALL ; 0e
tilecoll FLOOR, FLOOR, FLOOR, WARP_PANEL ; 0f
tilecoll WALL, FLOOR, WALL, WALL ; 10
tilecoll FLOOR, FLOOR, WALL, WALL ; 11
tilecoll FLOOR, WALL, WALL, WALL ; 12
tilecoll WALL, WALL, FLOOR, FLOOR ; 13
tilecoll FLOOR, FLOOR, WALL, WALL ; 14
tilecoll FLOOR, FLOOR, WALL, WALL ; 15
tilecoll WALL, FLOOR, WALL, WALL ; 16
tilecoll FLOOR, WALL, WALL, WALL ; 17
tilecoll FLOOR, WALL, FLOOR, WALL ; 18
tilecoll WALL, FLOOR, WALL, FLOOR ; 19
tilecoll FLOOR, WALL, FLOOR, WALL ; 1a
tilecoll WALL, FLOOR, WALL, FLOOR ; 1b
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 1c
tilecoll WALL, WALL, FLOOR, FLOOR ; 1d
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 1e
tilecoll WALL, WALL, FLOOR, FLOOR ; 1f
tilecoll WALL, WALL, FLOOR, FLOOR ; 20
tilecoll FLOOR, FLOOR, FLOOR, WALL ; 21
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 22
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 23
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 24
tilecoll WALL, WARP_CARPET_UP, FLOOR, FLOOR ; 25
tilecoll WARP_CARPET_UP, WALL, FLOOR, FLOOR ; 26
tilecoll FLOOR, WARP_CARPET_RIGHT, FLOOR, WARP_CARPET_RIGHT ; 27
tilecoll WARP_CARPET_LEFT, FLOOR, WARP_CARPET_LEFT, FLOOR ; 28
tilecoll FLOOR, WALL, FLOOR, WALL ; 29
tilecoll WALL, FLOOR, WALL, FLOOR ; 2a
tilecoll WALL, WALL, WALL, WALL ; 2b
tilecoll WALL, WALL, WALL, WALL ; 2c
tilecoll WALL, WALL, WALL, WALL ; 2d
tilecoll WARP_CARPET_DOWN, WARP_CARPET_DOWN, WALL, WALL ; 2e
tilecoll WALL, WALL, WALL, WALL ; 2f
tilecoll WALL, WALL, WALL, WALL ; 30
tilecoll WALL, WALL, WALL, WALL ; 31
tilecoll WALL, WALL, WALL, WALL ; 32
tilecoll WALL, WALL, WALL, WALL ; 33
tilecoll WALL, WALL, WALL, WALL ; 34
tilecoll WALL, WALL, WALL, WALL ; 35
tilecoll WALL, FLOOR, WALL, FLOOR ; 36
tilecoll FLOOR, WALL, FLOOR, WALL ; 37
tilecoll WALL, WALL, WALL, WALL ; 38
tilecoll WALL, WALL, WALL, WALL ; 39
tilecoll WALL, WALL, WALL, WALL ; 3a
tilecoll WALL, WALL, WALL, WALL ; 3b
tilecoll WALL, WALL, WALL, WALL ; 3c
tilecoll WALL, WALL, BOOKSHELF, BOOKSHELF ; 3d
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3e
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3f
| 41 | 65 | 0.71182 |
c56b7c209256f80d753dfffd7a150eae41e4fd86 | 372 | asm | Assembly | oeis/015/A015506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/015/A015506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/015/A015506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A015506: a(1)=1, a(n) = sum_{k=1}^{k=n-1} (5^k-1)/4 a(k).
; Submitted by Jon Maiga
; 1,1,7,224,35168,27501376,107447876032,2098671914657024,204950003169660992768,100073397447688408870744576,244319893042568615235897903058432,2982420752607212448380293251367177293824
sub $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
mul $2,5
add $2,2
mul $1,$2
sub $2,1
lpe
mov $0,$1
| 23.25 | 181 | 0.715054 |
09ebe8a1149998e5ba5b802a098e3c520e00fc65 | 366 | asm | Assembly | programs/oeis/046/A046898.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/046/A046898.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/046/A046898.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A046898: Partial sums of A046897.
; 1,4,8,11,17,29,37,40,53,71,83,95,109,133,157,160,178,217,237,255,287,323,347,359,390,432,472,496,526,598,630,633,681,735,783,822,860,920,976,994,1036,1132,1176,1212,1290,1362,1410,1422,1479,1572
lpb $0
mov $2,$0
sub $0,1
seq $2,46897 ; Sum of divisors of n that are not divisible by 4.
add $1,$2
lpe
add $1,1
mov $0,$1
| 30.5 | 196 | 0.685792 |
3159ee489649342cb740b3e4b7f78b47bc2c08f0 | 802 | asm | Assembly | oeis/205/A205187.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/205/A205187.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/205/A205187.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A205187: Number of (n+1)X2 0..1 arrays with the number of clockwise edge increases in every 2X2 subblock differing from each horizontal or vertical neighbor
; Submitted by Jamie Morken(s1)
; 16,24,48,72,144,216,432,648,1296,1944,3888,5832,11664,17496,34992,52488,104976,157464,314928,472392,944784,1417176,2834352,4251528,8503056,12754584,25509168,38263752,76527504,114791256,229582512,344373768,688747536,1033121304,2066242608,3099363912,6198727824,9298091736,18596183472,27894275208,55788550416,83682825624,167365651248,251048476872,502096953744,753145430616,1506290861232,2259436291848,4518872583696,6778308875544,13556617751088,20334926626632,40669853253264,61004779879896
mov $1,$0
mod $0,2
add $0,1
div $1,2
mov $2,3
pow $2,$1
mul $0,$2
add $0,$2
mul $0,3
sub $0,6
div $0,3
mul $0,8
add $0,16
| 44.555556 | 487 | 0.809227 |
a689e82dbbce1e8c2639cc32dc281b317bcbe8b2 | 396 | asm | Assembly | libsrc/stdio/ansi/sprinter/f_ansi_dline.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/stdio/ansi/sprinter/f_ansi_dline.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/sprinter/f_ansi_dline.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;
; Spectrum C Library
;
; ANSI Video handling for ZX Spectrum
;
; Clean a text line
;
; Stefano Bodrato - Apr. 2000
;
; in: A = text row number
;
;
; $Id: f_ansi_dline.asm,v 1.2 2002/10/10 22:03:26 dom Exp $
;
XLIB ansi_del_line
; a = line
.ansi_del_line
ld d,a ;y cooard
ld e,0 ;x coord
ld h,1 ;height
ld l,80 ;width
ld b,7 ;colour
ld a,0
ld c,$56 ;CLEAR
rst $10
ret
| 13.2 | 59 | 0.618687 |
87f1bb8e7c09f59ffc2f96d5278dbad1e49a5637 | 1,767 | asm | Assembly | src/rst.asm | TypeDefinition/NautiBuoy | 25e998158366b424fa1d003c335c036d399985b3 | [
"MIT"
] | 2 | 2021-05-14T13:18:59.000Z | 2021-08-02T08:41:43.000Z | src/rst.asm | TypeDefinition/NautiBuoy | 25e998158366b424fa1d003c335c036d399985b3 | [
"MIT"
] | null | null | null | src/rst.asm | TypeDefinition/NautiBuoy | 25e998158366b424fa1d003c335c036d399985b3 | [
"MIT"
] | null | null | null | INCLUDE "./src/include/hardware.inc"
; $0000 - $003F: Restart Commands (RST)
/* Restart Commands, or "rst" commands, jumps to an address and execute code until encountering a return command.
They are only capable of going to a few preset addresses.
Those addresses are $0000, $0008, $0010, $0018, $0020, $0028, $0030 and $0038. */
SECTION "RST $0000", ROM0[$0000]
ret
/* Set data in memory to a certain value.
For small data sets, up to size 256.
@param a Value to set to.
@param b Number of bytes to set. (MUST BE 1 OR GREATER!)
@param hl Destination address.
@destroy af, b, hl */
SECTION "RST $0008", ROM0[$0008]
MemSetSmall::
ld [hli], a
dec b
jr nz, MemSetSmall
ret
; Waits for the next VBlank beginning.
; Requires the VBlank handler to be able to trigger, otherwise will loop infinitely.
; This means IME should be set, the VBlank interrupt should be selected in IE, and the LCD should be turned on.
; WARNING: Be careful if calling this with IME reset (`di`), if this was compiled
; with the `-h` flag, then a hardware bug is very likely to cause this routine to go horribly wrong.
; Note: the VBlank handler recognizes being called from this function (through `hVBlankFlag`),
; and does not try to save registers if so. To be safe, consider all registers to be destroyed.
; @destroy af, bc, de, hl (The VBlank handler stops preserving anything when executed from this function.)
SECTION "RST $0010", ROM0[$0010]
WaitVBlank::
ld a, $01
ldh [hWaitVBlankFlag], a
.wait
halt
jr .wait
SECTION "RST $0018", ROM0[$0018]
ret
SECTION "RST $0020", ROM0[$0020]
ret
SECTION "RST $0028", ROM0[$0028]
ret
SECTION "RST $0030", ROM0[$0030]
ret
SECTION "RST $0038", ROM0[$0038]
ret | 33.980769 | 114 | 0.692134 |
1f88333a36e21a388cb68c9aab4b0c68e3f64b84 | 92 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/cosh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/cosh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/cosh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC cosh
EXTERN cm48_sccz80_cosh
defc cosh = cm48_sccz80_cosh
| 10.222222 | 28 | 0.836957 |
d7be37b5351f9fbcd28448be384249d9a8bd50eb | 598 | asm | Assembly | oeis/051/A051188.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/051/A051188.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/051/A051188.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A051188: Sept-factorial numbers.
; 1,7,98,2058,57624,2016840,84707280,4150656720,232436776320,14643516908160,1025046183571200,78928556134982400,6629998715338521600,603329883095805465600,59126328543388935628800,6208264497055838241024000,695325623670253882994688000,82743749216760212076367872000,10425712401311786721622351872000,1386619749374467633975772798976000,194126764912425468756608191856640000,28536634442126543907221404202926080000,4394641704087487761712096247250616320000,707537314358085529635647495807349227520000
mov $1,2
lpb $0
sub $0,1
add $2,7
mul $1,$2
lpe
div $1,2
mov $0,$1
| 49.833333 | 488 | 0.881271 |
69d430a7b30ba4f1b2bb5e5865dd5034f914a4c1 | 381 | asm | Assembly | programs/oeis/054/A054074.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/054/A054074.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/054/A054074.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A054074: Position of n-th 1 in A054073.
; 1,2,5,8,13,18,24,32,40,50,60,71,84,97,112,127,144,161,179,199,219,241,263,286,311,336,363,390,419,448,478,510,542,576,610,645,682,719,758,797,837,879,921,965,1009,1055,1101,1148,1197
lpb $0
mov $1,$0
pow $0,2
seq $1,286905 ; Positions of 1 in A286903; complement of A286904.
add $1,$0
mov $0,0
lpe
div $1,2
add $1,1
mov $0,$1
| 27.214286 | 184 | 0.671916 |
b62c667484e319b5239d810128e51322c68afa55 | 8,931 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xca.log_21829_1050.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xca.log_21829_1050.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xca.log_21829_1050.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x13d99, %rsi
lea addresses_D_ht+0x1a129, %rdi
nop
nop
nop
nop
nop
cmp %rdx, %rdx
mov $50, %rcx
rep movsw
nop
inc %rbp
lea addresses_D_ht+0x1b5a0, %r14
nop
inc %rbp
movw $0x6162, (%r14)
nop
nop
nop
dec %rdx
lea addresses_normal_ht+0x3ac1, %rsi
lea addresses_WT_ht+0xac0d, %rdi
nop
add $51744, %r9
mov $51, %rcx
rep movsl
sub %r9, %r9
lea addresses_A_ht+0x11a29, %rsi
lea addresses_A_ht+0xe729, %rdi
nop
nop
inc %r9
mov $41, %rcx
rep movsb
nop
add $44833, %rcx
lea addresses_normal_ht+0x12a91, %rbp
nop
nop
nop
xor $12605, %rsi
mov (%rbp), %rdx
nop
nop
nop
nop
nop
xor $30730, %rbp
lea addresses_UC_ht+0xe29, %rsi
nop
nop
nop
nop
cmp $60728, %rdx
movl $0x61626364, (%rsi)
sub %r9, %r9
lea addresses_normal_ht+0xc3, %rsi
lea addresses_D_ht+0x19809, %rdi
nop
nop
nop
nop
xor $33370, %rax
mov $110, %rcx
rep movsb
nop
nop
nop
nop
nop
lfence
lea addresses_D_ht+0x4879, %rsi
lea addresses_A_ht+0x7b29, %rdi
nop
nop
cmp $35436, %r14
mov $8, %rcx
rep movsb
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0x4c29, %rdi
nop
nop
nop
nop
and $5821, %r14
mov (%rdi), %si
inc %r14
lea addresses_normal_ht+0x1452d, %rsi
lea addresses_A_ht+0x1e829, %rdi
nop
nop
nop
nop
sub %r14, %r14
mov $32, %rcx
rep movsl
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x429, %rsi
lea addresses_A_ht+0x18569, %rdi
nop
nop
nop
sub $29011, %rbp
mov $11, %rcx
rep movsl
nop
nop
nop
xor $275, %rax
lea addresses_normal_ht+0xae29, %rcx
dec %r9
movw $0x6162, (%rcx)
nop
nop
nop
nop
xor $14794, %rdi
lea addresses_D_ht+0x6929, %rsi
lea addresses_D_ht+0x17629, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $17, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
// Store
mov $0x2d511b0000000629, %r15
nop
nop
and $12025, %rsi
mov $0x5152535455565758, %rdi
movq %rdi, (%r15)
xor $48190, %rsi
// Store
lea addresses_PSE+0x26a9, %rsi
nop
nop
nop
nop
nop
cmp %r9, %r9
movb $0x51, (%rsi)
nop
nop
nop
xor %r8, %r8
// Store
mov $0x2531070000000d41, %rsi
nop
add %r10, %r10
mov $0x5152535455565758, %r9
movq %r9, %xmm3
vmovups %ymm3, (%rsi)
nop
nop
and $26685, %rcx
// Load
lea addresses_A+0x3a29, %rcx
xor $24873, %r15
movups (%rcx), %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
dec %r10
// Load
lea addresses_normal+0x11739, %rdi
nop
nop
nop
nop
nop
sub $3200, %r15
movaps (%rdi), %xmm6
vpextrq $0, %xmm6, %r8
nop
nop
nop
nop
nop
add %rdi, %rdi
// Store
lea addresses_WT+0x5a99, %rcx
nop
add $7312, %r10
mov $0x5152535455565758, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
nop
and %r8, %r8
// Faulty Load
mov $0x2d511b0000000629, %r8
nop
nop
nop
and $64715, %rcx
mov (%r8), %r15d
lea oracles, %rsi
and $0xff, %r15
shlq $12, %r15
mov (%rsi,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': True, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': True, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': True, 'AVXalign': False, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 3}}
{'00': 346, '58': 21483}
58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 30.274576 | 2,999 | 0.655582 |
056bc2dd2c96baeb67c439feed70ac9870367398 | 3,848 | asm | Assembly | graphics/minigamesplashes/minigamesplashes.asm | Dimedime-d/kptranslation | 62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a | [
"CC-BY-4.0"
] | 3 | 2020-10-25T07:13:17.000Z | 2021-11-02T15:47:14.000Z | graphics/minigamesplashes/minigamesplashes.asm | Dimedime-d/kptranslation | 62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a | [
"CC-BY-4.0"
] | 5 | 2021-03-01T02:45:02.000Z | 2021-12-15T03:33:28.000Z | graphics/minigamesplashes/minigamesplashes.asm | Dimedime-d/kptranslation | 62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a | [
"CC-BY-4.0"
] | null | null | null | ; This file was automatically generated by formatsplashes.py
.macro pad
.word 0x00 :: .align
.endmacro
; minigame splash struct array at 0x2E6D4 (16 bytes each)
; 1st dword (4 bytes) - palette pointer
; 2nd dword - tileset pointer (compressed)
; 3rd dword - compressed tileset size
; 4th dword - tilemap pointer (compressed)
; 0x02E6D4 ~ 0x02E6F4 - 2 blank entries
; 0x02E6F4 - crossfire palette would be here
.org 0x0802E6F8
.word @crossfireTiles
.word @crossfireTilesEnd - @crossfireTiles
.word @crossfireMap
.org 0x0802E708
.word @starTiles
.word @starTilesEnd - @starTiles
.word @starMap
.org 0x0802E718
.word @bounceTiles
.word @bounceTilesEnd - @bounceTiles
.word @bounceMap
.org 0x0802E738
.word @dotsTiles
.word @dotsTilesEnd - @dotsTiles
.word @dotsMap
.org 0x0802E748
.word @grassTiles
.word @grassTilesEnd - @grassTiles
.word @grassMap
.org 0x0802E758
.word @iceTiles
.word @iceTilesEnd - @iceTiles
.word @iceMap
.org 0x0802E768
.word @skyTiles
.word @skyTilesEnd - @skyTiles
.word @skyMap
.org 0x0802E798
.word @fallTiles
.word @fallTilesEnd - @fallTiles
.word @fallMap
.org 0x0802E7A8
.word @magnetTiles
.word @magnetTilesEnd - @magnetTiles
.word @magnetMap
.org 0x0802E7B8
.word @raceTiles
.word @raceTilesEnd - @raceTiles
.word @raceMap
.org 0x0802E7C8
.word @shootTiles
.word @shootTilesEnd - @shootTiles
.word @shootMap
.org 0x0802E7D8
.word @twinTiles
.word @twinTilesEnd - @twinTiles
.word @twinMap
.autoregion
.align
@crossfireTiles:
.incbin "graphics\minigamesplashes\dumps\crossfireTiles.dmp" :: @crossfireTilesEnd: :: pad
@crossfireMap:
.incbin "graphics\minigamesplashes\dumps\crossfireMap.dmp" :: pad
@starTiles:
.incbin "graphics\minigamesplashes\dumps\starTiles.dmp" :: @starTilesEnd: :: pad
@starMap:
.incbin "graphics\minigamesplashes\dumps\starMap.dmp" :: pad
@bounceTiles:
.incbin "graphics\minigamesplashes\dumps\bounceTiles.dmp" :: @bounceTilesEnd: :: pad
@bounceMap:
.incbin "graphics\minigamesplashes\dumps\bounceMap.dmp" :: pad
@dotsTiles:
.incbin "graphics\minigamesplashes\dumps\dotsTiles.dmp" :: @dotsTilesEnd: :: pad
@dotsMap:
.incbin "graphics\minigamesplashes\dumps\dotsMap.dmp" :: pad
@grassTiles:
.incbin "graphics\minigamesplashes\dumps\grassTiles.dmp" :: @grassTilesEnd: :: pad
@grassMap:
.incbin "graphics\minigamesplashes\dumps\grassMap.dmp" :: pad
@iceTiles:
.incbin "graphics\minigamesplashes\dumps\iceTiles.dmp" :: @iceTilesEnd: :: pad
@iceMap:
.incbin "graphics\minigamesplashes\dumps\iceMap.dmp" :: pad
@skyTiles:
.incbin "graphics\minigamesplashes\dumps\skyTiles.dmp" :: @skyTilesEnd: :: pad
@skyMap:
.incbin "graphics\minigamesplashes\dumps\skyMap.dmp" :: pad
@fallTiles:
.incbin "graphics\minigamesplashes\dumps\fallTiles.dmp" :: @fallTilesEnd: :: pad
@fallMap:
.incbin "graphics\minigamesplashes\dumps\fallMap.dmp" :: pad
@magnetTiles:
.incbin "graphics\minigamesplashes\dumps\magnetTiles.dmp" :: @magnetTilesEnd: :: pad
@magnetMap:
.incbin "graphics\minigamesplashes\dumps\magnetMap.dmp" :: pad
@raceTiles:
.incbin "graphics\minigamesplashes\dumps\raceTiles.dmp" :: @raceTilesEnd: :: pad
@raceMap:
.incbin "graphics\minigamesplashes\dumps\raceMap.dmp" :: pad
@shootTiles:
.incbin "graphics\minigamesplashes\dumps\shootTiles.dmp" :: @shootTilesEnd: :: pad
@shootMap:
.incbin "graphics\minigamesplashes\dumps\shootMap.dmp" :: pad
@twinTiles:
.incbin "graphics\minigamesplashes\dumps\twinTiles.dmp" :: @twinTilesEnd: :: pad
@twinMap:
.incbin "graphics\minigamesplashes\dumps\twinMap.dmp" :: pad
.endautoregion | 27.884058 | 94 | 0.695166 |
093410ca997cbd5c0d89817ad2bc31b8ed5f3bf9 | 83,705 | asm | Assembly | base/mvdm/dpmi/dxmain.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/dpmi/dxmain.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/dpmi/dxmain.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | PAGE ,132
TITLE DXMAIN.ASM -- Main Module for Dos Extender
; Copyright (c) Microsoft Corporation 1988-1991. All Rights Reserved.
;****************************************************************
;* *
;* DXMAIN.ASM - Dos Extender Main Module *
;* *
;****************************************************************
;* *
;* Module Description: *
;* *
;* This module contains the main routines for the Dos *
;* Extender. This is based on code written for Microsoft *
;* by Murray Sargent of Scroll Systems from Tucson Arizona. *
;* *
;* The Dos Extender provides support to allows specially *
;* written programs to run in protected mode mode on the *
;* 80286 and 80386 under MS-DOS. The following areas of *
;* support are provided to accomplish this: *
;* *
;* Program Loading and Initialization *
;* This involves creating a program segment prefix and *
;* then loading and relocating the exe file. When *
;* loading an exe for protected mode operation, it is *
;* necessary to create segment descriptors for all *
;* segments used by the program and to then substitute *
;* the corresponding selectors when fixing up the segment *
;* references in the code. *
;* *
;* Dos Function Call Support *
;* Since Dos must execute in real mode, it is necessary *
;* to perform mode switching into real mode and the back *
;* to protected mode when the application makes Dos calls. *
;* Also, any far pointers that are parameters to the *
;* function must be converted from the selector:offset *
;* form that the application uses to a segment:offset form *
;* that Dos can use, with the corresponding data being *
;* buffered from the application's extended memory address *
;* space to Dos's real mode address space. *
;* *
;* Other Interrupt Support *
;* Hardware interrupts are processed in real mode, and *
;* so the Dos Extender performs mode switching on each *
;* interrupt. Also other system resources (such as the *
;* mouse driver and the bios) are entered through software *
;* interrupts, and require the same kind of buffering *
;* and parameter translation that the Dos functions *
;* require. *
;* *
;* Extended Memory Management *
;* The protected mode application has access to the full *
;* address space of the machine, and a memory manager is *
;* provided that duplicates the functions of the Dos *
;* memory manager over the entire address space of the *
;* machine. *
;* *
;****************************************************************
;* Revision History: *
;* *
;* 08/08/90 earleh DOSX and Client privilege ring determined *
;* by equate in pmdefs.inc *
;* 03/23/90 davidw Added the reflecting of it 23h, ^C. *
;* 11/09/89 jimmat Added more IOCTL 0Dh support for Windows. *
;* 10/11/89 jimmat Changed hooking of Int 1,2,3 under a *
;* debugger to work better with CVW. *
;* 07/28/89 jimmat Fixed Int 21h/56h (Rename), fixed Int 21 *
;* calls that just returned a pointer. *
;* 06/07/89 jimmat Fixed length of FCB moves and special *
;* case hooking Int 1Eh. *
;* 05/30/89 jimmat Completed Int 21h/5Ah processing. *
;* 04/25/89 jimmat Added support for undocumented INT 21h *
;* 5Fh/05 DOS call. *
;* 04/12/89 jimmat Allow one level of nested DOS calls to *
;* support PM critical error handlers *
;* 04/10/89 jimmat Supported INT 21h/5Eh & 5Fh--also small *
;* clean-up of the dosentry/dosexit code. *
;* 04/05/89 jimmat Fixed MOVDAT FCB length check. *
;* 04/04/89 jimmat Stop reflecting real mode software ints *
;* to protect mode. This is how Windows/386 *
;* works, and it fixes a problem with DOS *
;* networks since the real mode redirector *
;* expects to have access to the DOS stack, *
;* not a DOS extender interrupt stack frame. *
;* 03/28/89 jimmat Incorporated bug fixes from GeneA *
;* 03/17/89 jimmat Some code clean-up and debugging checks *
;* 03/15/89 jimmat Minor changes to run child in ring 1 *
;* 02/22/89 (GeneA): removed dead code and data left over *
;* from the Murray Sargent/SST days. *
;* 02/22/89 (GeneA): moved handlers for all interrupts but *
;* Int 21h to DXINTR.ASM. Fixed problem with re-entrancy *
;* caused when the other interrupts were executed while *
;* in DOS. (int 15h was causing the specific problem). *
;* 02/14/89 (GeneA): fixed bug in IntExitMisc. Was storing *
;* return value in rmrg.xes, changed to pmrg.xes. *
;* 02/10/89 (GeneA): changed Dos Extender from small model to *
;* medium model. *
;* 12/01/88 (GeneA): Changed name of mentry and mexit to *
;* IntEntryMouse and IntExitMouse. Added functions *
;* IntEntryMisc and IntExitMisc to handle entry and *
;* exit processing for BIOS INT 15h. *
;* 11/20/88 (GeneA): modified DFSetVector so that is checks to *
;* see if a vector has already been hooked before saving *
;* the old value in the real mode interrupt vector shadow *
;* buffer. *
;* 09/15/88 (GeneA): created by extracting code from the *
;* SST debugger modules DOSXTND.ASM, VIRTMD.ASM, *
;* VRTUTIL.ASM, and INTERRPT.ASM *
;* *
;****************************************************************
.286p
.287
; -------------------------------------------------------
; INCLUDE FILE DEFINITIONS
; -------------------------------------------------------
.xlist
.sall
include segdefs.inc
include gendefs.inc
include pmdefs.inc
include intmac.inc
include bop.inc
include dpmi.inc
include hostdata.inc
.list
; -------------------------------------------------------
; GENERAL SYMBOL DEFINITIONS
; -------------------------------------------------------
; STKSTR -- stack layout structure for user registers in the pmrg and
; rmrg arrays in the data segment DXDATA. pmrg is an exact replica of the pm
; user registers on entry to the Dos Extender (DE). rmrg is a translated
; version used to communicate with the real-mode world. The rmrg array is
; initially set equal to the pm user values by the instructions push ds, push
; es, pusha. The pmrg array es and ds are inevitably set equal to the pm user
; values and its general register values are defined if data translations may be
; required (int-10/21).
stkstr struc ;Level-0 Stack structure. bp is set = sp here
xdi dw ?
xsi dw ?
xbp dw ?
xasp dw ? ;Alternate sp
xbx dw ?
xdx dw ?
xcx dw ?
xax dw ? ;pusha pushes xax to xdi
xes dw ?
xds dw ?
stkstr ends
; -------------------------------------------------------
; This structure describes the EXEC parameter block used
; by MS-DOS function 4Bh.
execblk struc ;INT-21 ah=4bh EXEC parameter block
evrnmt dw ? ;Paragraph of environment string to be passed
cmdptr dd ? ;Ptr to command line to be placed at PSP+80h
fcb1ptr dd ? ;Ptr to default FCB to be passed at PSP+5ch
fcb2ptr dd ? ;Ptr to default FCB to be passed at PSP+6ch
xsssp dd ? ;Initial program stack ss:sp
xcsip dd ? ;Program entry point cs:ip
execblk ends
; -------------------------------------------------------
; EXTERNAL SYMBOL DEFINITIONS
; -------------------------------------------------------
extrn gtpara:NEAR
extrn GetSegmentAddress:NEAR
extrn EnterRealMode:NEAR
extrn EnterProtectedMode:NEAR
extrn SelOff2SegOff:NEAR
extrn ParaToLDTSelector:NEAR
extrn NSetSegmentDscr:FAR
extrn ChildTerminationHandler:NEAR
; -------------------------------------------------------
; DATA SEGMENT DEFINITIONS
; -------------------------------------------------------
DXDATA segment
extrn selGDT:WORD
extrn segPSPChild:WORD
extrn npXfrBuf1:WORD
extrn rgbXfrBuf0:BYTE
IFDEF WOW_x86
extrn FastBop:FWORD
ENDIF
extrn segDXCode:word
extrn segCurrentHostData:word
; -------------------------------------------------------
; General DOS EXTENDER Variables
; -------------------------------------------------------
pmdta dw 2 dup(?) ;PM DTA. Used for getting dir info
EntryFlag db -1 ;Flag to check for nested DOS interrupts
rcount dw ? ;Remaining requested file byte count to read/write
ccount dw ? ;Current count of total read/written
;=======================================================================
;Keep from here thru Iend in the following order:
align 2
Ibegin label byte ;start of PMIntrDos nested 'Instance' data
dw 128 dup(?) ;Extra stack for real mode
rmrg stkstr <> ;Corresponding real-mode set
rmivip dw ? ;Real-mode interrupt-vector offset
rmivcs dw ? ;Real-mode interrupt-vector segment
rmivfl dw ? ;Real-mode interrupt flags to be used
rmroff dw ? ;Real-mode return address offset
rmrseg dw ? ;Real-mode return address segment
rmflags dw ? ;flags
pmrg stkstr <> ;Protected-mode user registers
public pmusrss, pmusrsp
pmusrsp dw ? ;PM user sp
pmusrss dw ? ;PM user ss
enxseg dw ? ;transfer segment used on dos function exit
Iend label byte ;end of PMIntrDos nested 'Instance' data
;=======================================================================
ILENGTH equ Iend - Ibegin ;length of instance data
Isave db ILENGTH dup (?) ;instance data save area
DXDATA ends
; -------------------------------------------------------
; CODE SEGMENT VARIABLES
; -------------------------------------------------------
DXCODE segment
extrn segDXData:WORD
extrn selDgroup:WORD
DXCODE ends
DXPMCODE segment
extrn selDgroupPM:WORD
extrn segDXCodePM:WORD
extrn segDXDataPM:WORD
; -------------------------------------------------------
; Dos Function Parameter Tables
; -------------------------------------------------------
; The Dos Extender provides parameter buffering and translation
; on entry to and exit from Dos system calls. The following table
; is used to describe the operations to be performed for this process.
; The basic idea is that there is an entry parameter code and an
; exit paramter code. This code describes whether any data buffering
; is necessary. If buffering is necessary, it describes the nature of
; the data being transferred (e.g. ASCIIZ string, FCB, etc.) which is
; used to determine the transfer length. The entry/exit code also
; describes which temporary buffer to use for the transfer, and which
; user register (e.g. DS:DX, ES:BX, etc) points to the data to transfer.
;
; The data transfers described by this table is sufficient to handle
; the majority of the Dos system calls. However, any Dos call which
; requires the transfer of more than one buffer of data, or which requires
; that additional processing be performed other than simply copying a
; buffer is handled with special case code.
; The following symbols define various parts of the entry/exit codes
; used in the parameter table.
; Nibble 0 of a transfer word is a code that specifies the length of the
; transfer as follows:
; 0 no xfer
; 1 FCB to/from (f,10,11,12,13,16,17,23,24,29
; 2 PTR$ from (1b,1c,34)
; 3 ASCZ to/from (39,3a,3b,3c,3d,41,43,4b,4e,56
; 5a,5b)
; 4 DOLLAR terminated to DOS (9)
; 5 AX$ from (3f)
; 6 CX$ to/from (3f,40,44)
; 7 KEYBUF to/from DOS (a)
; 8 Country INFO (34) to/from (38)
; 9 EXTERR (22) to (5d)
; a DIRectory (64) from (47)
; b EXEC parm (14) to (4b)
; c file MATCH (43) to/from (4e,4f)
; d CMND line (128) to (29)
; e PALETTE (17) to (int-10/1002)
; f VBIOS (64) from (int-10/1b)
;
;
; Nibble 1 specifies the segment value transferred as follows (DOS entries
; affected are listed in parentheses):
;
; Segment ptr
;
; 0 none
; 1 ds:dx to/from DOS (9,a,f,10,11,12,13,14,16,17,21,22,23,24,25,27
; 28,39,3a,3b,3c,3d,3f,40,41,43,44,4b,4e,4f,56
; 5a,5b)
; 2 DTA to/from (11,12,14,15,21,22,27,28,4e)
; 3 ds:bx from (1b,1c) (Allocation table info)
; 4 ds:si to/from (29,47) (Parse FN, get dir)
; 5 es:di to/from (29,56) (Parse FN, rename)
; 6 es:bx to/from (2f,35,4b) (Get DTA, intvct, EXEC)
; 7 es to (49,4a) (RAM allocation)
;
; Byte 1 (high byte) on has meanings:
;
; bit 0 = 1 (A0) use small data area 0 (limited to 60h bytes)
; bit 1 = 1 (A1) use large area 1 (4K)
; bit 2 = 1 (RP) Real/Protect mode transfer needed (for int 21 ah = 3f/40)
; bit 7 = 1/0 (EX) exitcd/entrycd
entrycd record EnArea:4,EnSegCod:4,EnLenCod:4
exitcd record ExArea:8,ExSegCod:4,ExLenCod:4
;Length codes:
FCB equ 1
PTR$ equ 2 ;only supports DSBX & ESBX for now (and DSSI if DBCS)
ASCZ equ 3
DOL equ 4
AX$ equ 5
CX$ equ 6
KYB equ 7
INFO equ 8 ;Constant length transfers from here down vvvvvvvv
EXTERR equ 9
DIR equ 0Ah
EXEC equ 0Bh
MTCH equ 0Ch
CMD equ 0Dh
PALETTE equ 0Eh
VBIOS equ 0Fh ;Constant length transfers from here up ^^^^^^^^^^
;Segment codes:
DSDX equ 1
DTA equ 2
DSBX equ 3
DSSI equ 4
ESDI equ 5 ;Also used by int-10/ah=1bh
ESBX equ 6 ;Also used by int-10/ah=1ch
ES$ equ 7
ESDX equ 8 ;Used by int-10/ah=10,12, int-33/ah=22,23
ESBP equ 9 ;Used by int-10/ah=11,13
;RAM area codes:
A0 equ 1
A1 equ 2
RP equ 4
EX equ 80h
pmrmxfr entrycd <> ;0 - Program Terminate
exitcd <>
entrycd <> ;1 - Keyboard Input
exitcd <>
entrycd <> ;2 - Display output
exitcd <>
entrycd <> ;3 - Auxiliary Input
exitcd <>
entrycd <> ;4 - Auxiliary Output
exitcd <>
entrycd <> ;5 - Printer Output
exitcd <>
entrycd <> ;6 - Direct Console I/O
exitcd <>
entrycd <> ;7 - Direct Console Input Without Echo
exitcd <>
entrycd <> ;8 - Console Input Without Echo
exitcd <>
entrycd <A1,DSDX,DOL> ;9 - Print string
exitcd <>
entrycd <A1,DSDX,KYB> ;0A - Buffered Keyboard Input
exitcd <EX+A0,DSDX,KYB>
entrycd <> ;0B - Check Standard Input Status
exitcd <>
entrycd <> ;0C - Clear Kbd Buffer and Invoke Kbd Function
exitcd <>
entrycd <> ;0D - Disk Reset
exitcd <>
entrycd <> ;0E - Select Disk
exitcd <>
entrycd <> ;0F - Open File ** Unsupported! **
exitcd <>
entrycd <> ;10 - Close File ** Unsupported! **
exitcd <>
entrycd <A0,DSDX,FCB> ;11 - Search for First Entry
exitcd <EX+A1,DTA,FCB>
entrycd <A0,DSDX,FCB> ;12 - Search for Next Entry
exitcd <EX+A1,DTA,FCB>
entrycd <A0,DSDX,FCB> ;13 - Delete File
exitcd <>
entrycd <> ;14 - Sequential Read ** Unsupported! **
exitcd <>
entrycd <> ;15 - Sequential Write ** Unsupported! **
exitcd <>
entrycd <> ;16 - Create File ** Unsupported! **
exitcd <>
entrycd <A0,DSDX,FCB> ;17 - Rename File
exitcd <>
entrycd <> ;18 - Used Internally by DOS
exitcd <>
entrycd <> ;19 - Current Disk
exitcd <>
entrycd <A1,DSDX,> ;1A - Set Disk Transfer Address
exitcd <>
entrycd <> ;1B - Allocation Table Info
exitcd <,DSBX,PTR$>
entrycd <> ;1C - Alloc Table Info for Specific Device
exitcd <,DSBX,PTR$>
entrycd <> ;1D - Used Internally by DOS
exitcd <>
entrycd <> ;1E - Used Internally by DOS
exitcd <>
entrycd <> ;1F - Used Internally by DOS
exitcd <>
entrycd <> ;20 - Used Internally by DOS
exitcd <>
entrycd <> ;21 - Random Read ** Unsupported! **
exitcd <>
entrycd <> ;22 - Random Write ** Unsupported! **
exitcd <>
entrycd <> ;23 - File Size ** Unsupported! **
exitcd <>
entrycd <> ;24 - Set Relative Record Field ** Unsupported! **
exitcd <>
entrycd <,DSDX,> ;25 - Set Interrupt Vector (0/ds:dx/0)
exitcd <>
entrycd <,DSDX,> ;26 - Create new PSP
exitcd <>
entrycd <> ;27 - Random Block Read ** Unsupported! **
exitcd <>
entrycd <> ;28 - Random Block Write ** Unsupported! **
exitcd <>
entrycd <A0,DSSI,ASCZ> ;29 - Parse Filename
exitcd <EX+A1,ESDI,FCB>
entrycd <> ;2A - Get Date
exitcd <>
entrycd <> ;2B - Set Date
exitcd <>
entrycd <> ;2C - Get Time
exitcd <>
entrycd <> ;2D - Set Time
exitcd <>
entrycd <> ;2E - Set/Reset Verify Switch
exitcd <>
entrycd <> ;2F - Get Disk Transfer Address
exitcd <EX+A0,ESBX,>
entrycd <> ;30 - Get DOS Version Number
exitcd <>
entrycd <> ;31 - Terminate and Stay Resident
exitcd <>
entrycd <> ;32 - Get Drive Parameter Block
exitcd <,DSBX,PTR$>
entrycd <> ;33 - Ctrl-Break Check
exitcd <>
entrycd <> ;34 - Get InDOS flag address
exitcd <,ESBX,PTR$>
entrycd <> ;35 - Get Interrupt Vector
exitcd <EX,ESBX,>
entrycd <> ;36 - Get Disk Free Space
exitcd <>
entrycd <> ;37 - Used Internally by DOS
exitcd <>
entrycd <A1,DSDX,> ;38 - Set/Get Country Dependent Info
exitcd <EX+A1,DSDX,INFO>
entrycd <A0,DSDX,ASCZ> ;39 - MKDIR
exitcd <>
entrycd <A0,DSDX,ASCZ> ;3A - RMDIR
exitcd <>
entrycd <A0,DSDX,ASCZ> ;3B - CHDIR
exitcd <>
entrycd <A0,DSDX,ASCZ> ;3C - Create a File
exitcd <>
entrycd <A0,DSDX,ASCZ> ;3D - Open a File
exitcd <>
entrycd <> ;3E - Close a File Handle
exitcd <>
entrycd <RP,DSDX,> ;3F - Read from a File or Device
exitcd <EX+RP,DSDX,AX$>
entrycd <RP,DSDX,CX$> ;40 - Write to a File or Device
exitcd <>
entrycd <A0,DSDX,ASCZ> ;41 - Delete a File from a Specified Directory
exitcd <>
entrycd <> ;42 - Move File Read/Write Pointer
exitcd <>
entrycd <A0,DSDX,ASCZ> ;43 - Change File Mode
exitcd <>
entrycd <> ;44 - I/O Control for Devices
exitcd <> ;See ioctlw for write
entrycd <> ;45 - Duplicate a File Handle
exitcd <>
entrycd <> ;46 - Force a Duplicate of a File Handle
exitcd <>
entrycd <A0,DSSI,> ;47 - Get Current Directory
exitcd <EX+A0,DSSI,ASCZ>
entrycd <> ;48 - Allocate Memory
exitcd <>
entrycd <,ES$,> ;49 - Free Allocated Memory
exitcd <>
entrycd <,ES$,> ;4A - Modify Allocated Memory Blocks
exitcd <>
entrycd <A0,DSDX,ASCZ> ;4B - Load or Execute a Program (EXEC)
exitcd <>
entrycd <> ;4C - Terminate a Process
exitcd <>
entrycd <> ;4D - Get Return Code of a Sub-process
exitcd <>
entrycd <A0,DSDX,ASCZ> ;4E - Find First Matching File
exitcd <EX+A1,DTA, MTCH>
entrycd <A1,DTA,MTCH> ;4F - Find Next Matching File
exitcd <EX+A1,DTA, MTCH>
entrycd <,ESBX,> ;50 - Set current PSP (code restores bx)
exitcd <>
entrycd <> ;51 - Get current PSP
exitcd <>
entrycd <> ;52 - Get Pointer to SysInit Variables
exitcd <,ESBX,PTR$>
entrycd <A1,DSSI,DIR> ;53 - Set Drive Parameter Block
exitcd <>
entrycd <> ;54 - Get Verify Setting
exitcd <>
entrycd <,DSDX,> ;55 - Duplicate PSP
exitcd <>
entrycd <A0,DSDX,ASCZ> ;56 - Rename a File
exitcd <>
entrycd <> ;57 - Get/Set a File's Date and Time
exitcd <>
entrycd <> ;58 - Get/Set Allocation Strategy
exitcd <>
entrycd <> ;59 - Get Extended Error
exitcd <>
entrycd <A0,DSDX,ASCZ> ;5A - Create Temporary File
exitcd <EX+A0,DSDX,ASCZ>
entrycd <A0,DSDX,ASCZ> ;5B - Create New File
exitcd <>
entrycd <> ;5C - Lock/Unlock File Access
exitcd <>
entrycd <A0,DSDX,EXTERR> ;5D - Used Internally by DOS
exitcd <>
entrycd <> ;5E - Network Machine Name/Printer Setup
exitcd <>
entrycd <> ;5F - Get/Make Assign-List Entry
exitcd <>
entrycd <> ;60 - Used Internally by DOS
exitcd <>
entrycd <> ;61 - Used Internally by DOS
exitcd <>
entrycd <> ;62 - Get PSP Address
exitcd <>
entrycd <> ;63 - Get Lead Byte Table ** Unsupported! **
exitcd <>
entrycd <> ;64 - Used Internally by DOS
exitcd <>
entrycd <> ;65 - Get Extended Country Info
exitcd <EX+A1,ESDI,CX$>; ** Only Partially Supported **
entrycd <> ;66 - Get/Set Code Page
exitcd <>
entrycd <> ;67 - Set Handle Count
exitcd <>
entrycd <> ;68 - Commit File
exitcd <>
entrycd <> ;69 - Used Internally by DOS
exitcd <>
entrycd <> ;6A - Used Internally by DOS
exitcd <>
entrycd <> ;6B - Used Internally by DOS
exitcd <>
entrycd <A0,DSSI,ASCZ> ;6C - Extended Open File
exitcd <>
MaxInt21 equ 06Ch ;max supported Int 21h function
UnSupported entrycd <> ;for unsupported DOS calls
exitcd <>
if DEBUG ;------------------------------------------------------------
; Table of partially supported/unsupported/unknown Int 21h functions
ifdef DBCS
tblBad21 db 18h,1Dh,1Eh,1Fh,20h,37h,5Dh,60h,61h
db 64h,65h,6Ah,6Bh,0
else
tblBad21 db 18h,1Dh,1Eh,1Fh,20h,37h,5Dh,60h,61h,63h
db 64h,65h,6Ah,6Bh,0
endif
endif ;DEBUG --------------------------------------------------------
;
; For compatibility with WIN386, the following FCB calls are failed
; unconditionally.
;
MIN_REAL_BAD_21 equ 0fh
MAX_REAL_BAD_21 equ 28h
tblRealBad21 db 0fh,10h,14h,15h,16h,21h,22h,23h,24h,27h,28h,0
; Special codes for special INT 21h functions
int215E entrycd <A0,DSDX,> ;5E/00 - Get Machine Name
exitcd <EX+A0,DSDX,ASCZ>
entrycd <A0,DSDX,ASCZ> ;5E/01 - Set Machine name
exitcd <>
entrycd <A0,DSSI,CX$> ;5E/02 - Set Printer Setup Str
exitcd <>
entrycd <A0,ESDI,> ;5E/03 - Get Printer Setup Str
exitcd <EX+A0,ESDI,CX$>
int215F02 entrycd <A0,DSSI> ;5F/02 - Get Redir List Entry
exitcd <EX+A0,DSSI,ASCZ>
entrycd <A0,DSSI,ASCZ> ;5F/03 - Set Redir List Entry
exitcd <>
entrycd <A0,DSSI,ASCZ> ;5F/04 - Cancel Redirection
exitcd <>
entrycd <A0,DSSI> ;5F/05 - Get Redir List Entry
exitcd <EX+A0,DSSI,ASCZ>
ifdef DBCS
int2163 entrycd <> ;63/00 - Get Lead Byte Table Entry
exitcd <,DSSI,PTR$>
endif ; DBCS
int21esdi entrycd <A1,ESDI,ASCZ> ;56 & 5F/02&03&05 eXtra buffer
exitcd <EX+A1,ESDI,ASCZ>
;
; We only use the entry code from the following. If we don't
; we trash the stack in applications like borland c++
;
int21pfn entrycd <A1,ESDI,FCB> ;29, fcb buffer
exitcd <>
; Additional tables for run time support associated with register
; translation and buffering.
; 8 9 a b c d e f
; INFO EXTERR DIR EXEC MATCH CMND PALETTE VBIOS
mvcnt db 34, 22, 40h, 0Eh, 43, 80h, 17, 64
; 1 2 3 4 5 6 7 8 9
; DSDX, DTA, DSBX, DSSI, ESDI, ESBX, ES$, esdx, esbp
regoffs dw xdx, 0, xbx, xsi, xdi, xbx, 0, xdx, xbp
DXPMCODE ends
; -------------------------------------------------------
subttl Main Program
page
; -------------------------------------------------------
; MAIN PROGRAM
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrDos -- This function is the main handler for int 21h calls
; that require special case processing. Most interrupts
; go through the interrupt reflector (PMIntrReflector in
; dxintr.asm). DOS int 21h interrupts are vectored here.
;
; This routine performs any register manipulation, data buffering
; etc. needed to pass the interrupt parameters from the
; protected mode caller to the real mode handler. Register
; manipulation and data transfers can occur either on entry
; to the interrupt handler or on exit from the interrupt
; handler (to fix up return values.)
;
; Input: normal registers for Dos calls
; Output: normal register returns for Dos calls
; Errors: normal Dos errors
; Uses: In general, all registers are preserved. For interrupts where
; register translation or buffering occurs, some registers may
; be changed, depending on the interrupt and its parameters.
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrDos
PMIntrDos proc far
push ds
push ax
mov ax,SEL_DXDATA OR STD_RING
mov ds,ax
assume ds:DGROUP
mov ax,ss
mov pmusrss,ax
mov ax,sp
add ax,4
mov pmusrsp,ax
pop ax
FBOP BOP_DPMI,XlatInt21Call,FastBop
; If we get here, the api wasn't translated. The translation code will
; simulate the iret
assume ds:nothing
NotXlated:
cld ;Code assumes direction flag is cleared
; Save PM user ds, es, and flags, and switch to DOS extender stack
push ax ;Save caller's AX
push bp
mov bp,sp ;[bp] = bp ax ip cs fl - 286 int gates assumed
; 0 2 4 6 8
push es
mov es,selDgroupPM ;Address our DGROUP
assume es:DGROUP
; Check for nested DOS interrupts--this code was written with the assumption
; that we would never be reentered, but it turns out that we may need to
; support nested DOS calls from a critical error handler. If this is one
; of those ultra-rare occasions, save our previous 'instance' data in Isave.
inc EntryFlag ;The normal case will be to jump
jz @f
push cx ;Being reentered, save last instance data
push di
push si
mov cx,ILENGTH ;NOTE!!! The next movs has
mov si,offset DGROUP:Ibegin ; an es override, if ints
mov di,offset DGROUP:Isave ; are enabled, an interrupt
rep movs byte ptr [di],byte ptr es:[si] ; on this instr can 'forget'
; about the es override with
pop si ; some processors
pop di
pop cx
@@:
; Start saving callers state.
mov pmrg.xds,ds ;Save PM user ds
mov ax,[bp+8] ;Get ax = flags when int occurred
mov rmflags,ax ;Store flags for real-mode handler
pop pmrg.xes ;Save PM user es
pop bp
pop ax ;Recover user ax. [sp] = ip cs fl
; At this point all general registers (but not ES) have the user's values
push es ;Address DGROUP, user's DS already
pop ds ; saved in pmrg.xds
assume ds:DGROUP
mov pmusrss,ss ;Save PM user stack ptr
mov pmusrsp,sp ;[sp] = ds ip cs fl
; 0 2 4 6
mov pmrg.xsi,si ;Save PM si since need to use before pusha
push ds ;Switch to rmrg stack for this routine
pop ss
mov sp,offset DGROUP:rmflags ;PM flags already on stack
FSTI ;We don't really need interrupts disabled
; Setup iret frames for iret'ing to real-mode handler and for that handler
; returning to the DOS extender
pop si ;Get rmflags
and si,not 4100h ;Kill NT, TF
push si ;Push flags for iret to BackFromDOS
push segDXCodePM ;Push return cs:ip for iret
push offset BackFromDOS
and si,not 0200h ;Kill IF
push si ;Push flags for iret to real-mode handler
sub sp,4 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
mov ax,SEL_RMIVT OR STD_RING
mov es,ax
mov ax,es:[21h*4]
mov [bp + 2],ax
mov ax,es:[21h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
; Setup protected mode and real mode copies of registers.
mov si,pmrg.xsi ;Restore si
push ds ;Save space for real mode ds
push es ; and es
pusha ;Save user general registers
mov si,offset DGROUP:rmrg ;Copy user values to PM set for
mov di,offset DGROUP:pmrg ; reference (real-mode set may change)
mov cx,8 ;8 general registers (es and ds already stored)
rep movsw
mov ax,segDXDataPM ;ax = DOS extender real-mode dgroup segment
mov rmrg.xds,ax ;Default real-mode data segments
mov rmrg.xes,ax ; (dosentry may change them)
mov ax,rmrg.xax
if DEBUG ;------------------------------------------------------------
; Check for partially supported/unsupported/unknown DOS calls
cmp ah,0DCh ;krnl286 is doing this now, quit
jz goodfunc ; complaining about it
cmp ax,5D0Ah ;Set Extended Error is the only
jz goodfunc ;5Dh function handled properly!
cmp ah,MaxInt21 ;is the request within our range?
ja badfunc
mov bx,offset DXPMCODE:tblBad21
@@:
cmp ah,cs:[bx]
jb goodfunc
jz badfunc
inc bx
jmp short @b
badfunc: Trace_Out "Possible Unsupported DOS Call! AX=#AX"
goodfunc:
endif ;DEBUG --------------------------------------------------------
; Check for FCB calls that we fail unconditionally (because WIN386 does.)
cmp ah,MIN_REAL_BAD_21
jb goodfunc1
cmp ah,MAX_REAL_BAD_21
ja goodfunc1
mov bx,offset DXPMCODE:tblRealBad21
@@:
cmp ah,cs:[bx]
je badfunc1
inc bx
cmp byte ptr cs:[bx],0
jz goodfunc1 ; Ran off end of table.
jmp short @b
badfunc1:
if DEBUG
Debug_Out "Unsupported DOS Call! AX=#AX"
endif ;DEBUG
or byte ptr rmflags,1 ; Set CF
call xfrflg
jmp LeaveDOSExtender
goodfunc1:
; int 21 entry register translations and data transfers
cmp ah,00h ;old style DOS Exit call?
jnz @f
call DosExitCall ;sets CY if it handles the call, otherwise
jnc @f ; do it normally...
jmp LeaveDOSExtender
@@:
;
; Handle terminate specially. We mess with the PSP here to set
; up a terminate vector we like. We don't do anything special for
; TSR (31h)
;
cmp ah,4ch ; terminate?
jnz @f
call TerminateProcess
@@:
cmp ah, 5dh ; check for unsupported 5d codes
jnz short @f
cmp al, 0ah
jz short @f
jmp LeaveDOSExtender
@@:
mov rcount,0 ;Default no remaining bytes to read/write
mov ccount,0 ;No bytes read or written yet
cmp ah,3Fh ;If read
jz @f
cmp ah,40h ; or write,
jnz TransferLoop
@@:
mov cx,pmrg.xcx ; initialize remaining count = requested value
mov rcount,cx
; Start of loop for doing large read/write transfers
TransferLoop:
call dosentry ;Do selector translations, data buffering
; Come here after entry register translations and data transfers are complete
SwitchToRealMode ;Switch back to real mode. ds = es = rm dgroup
;Stack is at same place in memory
; Set registers to possibly translated values and iret to real-mode DOS.
; DOS then irets to BackFromDOS.
popa ;Set appropriate general register values
pop es
pop ds
public GoingToDOS
GoingToDOS: ;for debugging, etc.
iret ;invoke real mode DOS
assume ds:NOTHING, es:NOTHING, ss:NOTHING
; Return here from real-mode interrupt handler (DOS)
public BackFromDOS
BackFromDOS:
pushf ;Save return flags (to rmflags)
cld ; (better safe than sorry)
push cs ;Push return cs:ip for multiple xfers
push offset BackFromDOS
sub sp,2*3 ;Bypass room for iret to interrupt handler
; (to keep stack layout the same as on entry)
push ds ;Save register set
push es
pusha
mov ds,segDXData
assume ds:DGROUP
; "push" iret frame for real mode int 21 rtn in case we need to do it again
mov ax,rmflags
and ax,not 4300h ;Kill NT, TF, and IF
mov rmivfl,ax
xor ax,ax
mov es,ax
mov ax,word ptr es:[21h*4+2]
mov rmivcs,ax
mov ax,word ptr es:[21h*4]
mov rmivip,ax
; Switch back to protected mode
SwitchToProtectedMode ;Switch back to protected mode
assume ds:DGROUP,es:DGROUP
FSTI ;Don't need ints disabled
call xfrflg ;Transfer relevant return flags over to pm iret frame
mov ax,pmrg.xax ;Recover AX from caller
; Perform any int-21 selector translations, data buffering
call dosexit
; Check for large xfers (Read File 3Fh, Write File 40h, some IOCTL 44h)
cmp rcount,0 ;Read/write more bytes?
jz TransferDone
mov cx,rmrg.xax ;Maybe. cx = count transferred (if 3Fh or 40h)
mov ax,pmrg.xax ;Restore entry code
mov rmrg.xax,ax
cmp ah,40h ;Write?
jnz @f
sub rcount,cx ;Yes. Written all originally requested?
jz TransferDone
cmp cx,rmrg.xcx ; No. Written all last specified?
jz @f ; Yes. Go do some more
mov ax,ccount ;A large write has failed! ccount has already
sub ax,rmrg.xcx ; been updated assuming success, back out the
add ax,cx ; attempted xfer amount, and add in
jmp short TransferCount ; the actual, then split
@@:
jmp TransferLoop ;Yep (or 3Fh or 44h). Do another xfer
TransferDone:
mov ax,ccount ;Multiple count xfer?
or ax,ax
jz LeaveDOSExtender
TransferCount:
mov rmrg.xax,ax ;Yes update return amount
mov ax,pmrg.xcx
mov rmrg.xcx,ax ;Restore initial request count
; Restore possibly translated registers and to return to pm caller
public LeaveDOSExtender
LeaveDOSExtender:
popa ;Restore possibly changed user registers
mov ss,pmusrss ;Restore pm user stack
mov sp,pmusrsp
assume ss:NOTHING
push pmrg.xds ;push user seg regs on user stack
push pmrg.xes
dec EntryFlag ;dec nested entry flag - normal case is to jmp
jnz NotNested
;If this was a nested DOS call (from
push cx ; a critical error handler), restore
push si ; the state for the prior DOS call
push di ; which is still in progress
mov cx,ds ;make darn sure es -> DGROUP
mov es,cx
cld ;NOTE: we need to retreive
mov cx,ILENGTH ; all current user registers
mov di,offset DGROUP:Ibegin ; before moving this data
mov si,offset DGROUP:Isave
rep movsb
pop di
pop si
pop cx
NotNested:
pop es ;restore user seg regs
pop ds
assume ds:NOTHING,es:NOTHING
public DOSXiret
DOSXiret: ;for debugging, etc.
iret ;return to caller
PMIntrDos endp
; -------------------------------------------------------
; DOSENTRY -- This function performs buffering and register
; translation for entry into MS-DOS functions.
;
; Input: AX: AX value at time of INT 21h
; Output:
; Errors:
; Uses:
assume ds:DGROUP,es:DGROUP,ss:DGROUP
dosentry:
cmp ah,26h ;Create new PSP?
jnz @f
mov si,rmrg.xdx ;yes, translate selector to paragraph
call gtpara
mov rmrg.xdx,ax
return
@@:
cmp ah,53h ;Set drive parameter block?
jnz @f
push ax
mov si,pmrg.xes ;int 21h/53h has an extra parameter in ES:BP
call gtpara ; we change the selector to a segment, but
mov rmrg.xes,ax ; the segment had better already be in
pop ax ; conventional memory
jmp short dentr2b
@@:
cmp ah,50h ;Set current PSP?
jnz dentr1
mov si,rmrg.xbx ;Yes. Translate selector to paragraph
call gtpara
mov rmrg.xbx,ax
return
dentr1: cmp ah,55h ;Duplicate PSP?
jnz dentr2
mov si,rmrg.xbx ;Translate selector bx to paragraph
call gtpara
mov rmrg.xbx,ax
mov si,rmrg.xdx ; and dx also
call gtpara
mov rmrg.xdx,ax
return
dentr2:
cmp ah,56h ;Rename?
jnz dentr2a
push ax ;rename has a second ASCIIZ buffer
push pmrg.xes ; pointed to by es:di -- move that
pop enxseg ; now, the ds:dx one below
mov ax,int21esdi
call gtarea ;let the 'standard' gtarea/movdat
mov dx,enxseg ; routines take care of it
call movdat
pop ax
jmp short dentr2b
dentr2a:
cmp ah,5Fh ;Get/Make Assign-List Entry?
jne dentr2a1
call net5Fenter ; Yes, may require extra buffering
jmp short dentr2b
dentr2a1:
cmp ah,29h ; parse filename?
jne dentr2b
push ax
push pmrg.xes
pop enxseg
mov ax,int21pfn
call gtarea
mov dx,enxseg
call movdat
pop ax
;; jmp short dentr2b
dentr2b:
call GetEntryCd ;ax = func entry code, di = ptr to entry cd
or ax,ax ;Entry code specify something to do?
rz
cmp byte ptr pmrg.xax+1,1Ah ;Store DTA?
jnz dentr3
mov pmdta,dx ; Yes. Save it for data returns
push pmrg.xds
pop pmdta+2
jmp short dentr4
dentr3: cmp byte ptr pmrg.xax+1,4Bh ;EXEC program?
callz dosxec
; DENTR4 - enter with ax = entrycd/exitcd. Translate ptr's for real-
; mode calls and transfer any data indicated.
dentr4: push pmrg.xds
pop enxseg
call gtarea ;Get es:di = area for transfer
rz ;Something to xfer?
mov dx,enxseg ;Yes. Fall thru to movdat
errnz <movdat-$>
; -------------------------------------------------------
; MOVDAT -- This routine performs the buffer transfer
; for entry into or exit from an MS-DOS function. The data
; is copied from DX:SI to ES:DI. The code in CX determines
; the type of data being transferred, which is used to determine
; the length.
;
; Input: DX:SI - far pointer to source buffer
; ES:DI - far pointer to destination buffer
; CX - transfer length code
; Output: none
; Errors: none
; Uses: AX, BX, CS, SI, DI modified
assume ds:DGROUP,es:NOTHING,ss:DGROUP
public movdat
movdat:
push ds
mov bx,cx ;Simple count?
sub bl,INFO
jc movda2
cmp bl,PALETTE-INFO ;Yes. Use pm es?
jc movda0
mov dx,pmrg.xes ;Yes
movda0: mov cl,mvcnt[bx] ;cx = count
movda1: mov ds,dx
if DEBUG ;------------------------------------------------------------
push ax
mov ax,es
lsl ax,ax
sub ax,di
jc movbad
cmp ax,cx
jnc @f
movbad:
Debug_Out "Movdat: copy beyond end of dest seg!"
@@:
pop ax
endif ;DEBUG --------------------------------------------------------
movd1a: rep movsb ;Move data
pop ds
return
movda2: cmp cl,CX$ ;Use pmrg.xcx?
jnz movda3
mov cx,rmrg.xcx ;cx usually = pmrg.xcx, but in any event
; cx < CB_XFRBUF1
movd21: add ccount,cx
jmp short movda1
movda3: mov ah,0
cmp cl,ASCZ
jz movda4
cmp cl,DOL
jnz movda5
mov ah,"$"
movda4: mov ds,dx
movd42: lodsb
stosb
cmp al,ah
jnz movd42
pop ds
return
movda5: cmp cl,AX$ ;Use rmrg.xax?
jnz movda6
mov cx,rmrg.xax ;Yes (only occurs for ah=3fh - read - on exit)
jmp short movd21
movda6:
cmp cl,FCB
jnz movda7
mov ds,dx
mov cl,byte ptr ds:[si]
cmp cl,0ffh ;standard or extended FCB?
mov cx,37 ;standard FCB len
jnz movd1a
mov cx,44 ;extended FCB len
jmp short movd1a
movda7: ;KYB remains
pop ds
return
; -------------------------------------------------------
; DOSEXIT -- This function is called on exit from the MS-DOS
; functions to perform any data buffering and register translation
; needed.
;
; Input: AX: AX value at time of INT 21h
; Output:
; Errors:
; Uses:
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public dosexit
dosexit:
cmp ah,51h ;Get current PSP?
jz dose0a
cmp ah,62h ;Get PSP address?
jnz dose00
dose0a:
mov ax,rmrg.xbx ;Yes. Translate segment to selector
mov bx,STD_DATA
call ParaToLDTSelector
mov rmrg.xbx,ax
return
dose00: cmp ah,2fh ;Get current DTA?
jnz dose01
mov ax,pmdta ;Yes. Load PM DTA into caller's registers
mov rmrg.xbx,ax
mov ax,pmdta+2
verr ax ; if the dta selector is no longer valid,
jz @f ; return the NULL selector instead (so we
xor ax,ax ; don't GP fault in DOSX).
@@: mov pmrg.xes,ax
return
dose01: cmp ah,55h ;Duplicate PSP?
jnz dosex1
mov ax,rmrg.xbx ;Yes, translate segments to selectors
mov bx,STD_DATA
call ParaToLDTSelector
mov rmrg.xbx,ax
mov ax,rmrg.xdx
mov bx,STD_DATA
call ParaToLDTSelector
mov rmrg.xdx,ax
return
dosex1: cmp ah,56h ;Rename?
jnz dosex2
push pmrg.xdi ;Rename has a second pointer in ES:DI--we
pop rmrg.xdi ; need to restore DI here, DX below
jmp short dosex3
dosex2: cmp ah,5Fh ;Get/Make Assign-List Entry?
callz net5Fexit ; Yes, extra buffering may be needed
dosex3:
call GetEntryCd ;ax=func entry code, di=ptr to entry code
call rstreg ;Restore entry register?
jz dosex6
cmp byte ptr pmrg.xax+1,29h ;Yes, Parse filename?
jnz dosex4
add ax,rmrg.xsi ;Yes. Increment past string
sub ax,offset DGROUP:rgbXfrBuf0 ; that was parsed
push pmrg.xdi
pop rmrg.xdi ;Restore pm di (for es:di ptr)
dosex4: mov word ptr rmrg[si],ax ;Restore register
cmp byte ptr pmrg.xax+1,4Bh ;EXEC program
jnz dosex6
push di
mov di,pmrg.xbx ;Yes, restore bx too (dx restored above)
mov rmrg.xbx,di ;es and ds are restored automatically
cmp byte ptr pmrg.xax,1 ;INT-21/4b01h (undocumented debug)?
jnz @f
mov si,npXfrBuf1 ;Yes. Pass back user ss:sp and cs:ip
lea si,[si].xsssp
lea di,[di].xsssp
mov es,pmrg.xes
movsw ;Move ss:sp
movsw
movsw ;Move cs:ip
movsw
@@:
pop di
dosex6: mov ax,cs:[di+2] ;Exit xfer?
or ax,ax
rz
dosex7: call CheckStatus ;Check the DOS return status to see if the
rnz ; data should be transfered back to PM
mov cx,ax ;Is a pointer being returned? (no data
and cl,0fh ; transfer)
cmp cl,PTR$
jnz dosex8
shr al,4 ; yes, isolate pointer type
mov si,offset rmrg.xds
mov di,offset pmrg.xds
cmp al,DSBX
jz dosex7a
ifdef DBCS ; for function 63h (Get Lead Byte)
cmp al,DSSI
jz dosex7a
endif ; DBCS
mov si,offset rmrg.xes
mov di,offset pmrg.xes
dosex7a:
mov ax,[si] ; get a selector for the segment, and
mov bx,STD_DATA ; setup to return it to caller
call ParaToLDTSelector
mov [di],ax
return
dosex8:
push pmrg.xds
pop enxseg
call gtarea ;Get area for xfer from PM to DOS
rz ;Something to move?
xchg si,di ;Turn pointers around
mov dx,ds ;dx:si -> DOS xfer area in dgroup
mov es,enxseg ;es:di -> PM-caller data area
jmp movdat ;Yes
; -------------------------------------------------------
; DosExitCall -- Special processing for DOS exit call service (Int 21h/00h)
;
; This procedure handles the obsolete Int 21h/00h terminate process
; call in a special slimy way for Windows. Instead of doing a 00h
; DOS call in real mode, it hacks up the parent's PSP and does a 4Ch
; that causes control to return to the extender, who then RETURNS TO
; THE CALLER!!! The caller must then do appropriate set PSP calls, etc.
; This was implemented so pMode Windows kernel could have DOS clean up
; after a Windows app terminates, but still have kernel get control
; back.
;
; Note: This code assumes that the Parent PID field contains a
; SELECTOR!
;
; Note^2: If for some reason it's the DOS Extender's child that's 1800doing
; the terminate call, we let it go through normally.
;
; Input: none
; Output: CY set if exit call processed by this routine, clear otherwise
; Errors:
; Uses: none
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public DosExitCall
DosExitCall proc near
push ax
push bx
push dx
push es
SwitchToRealMode ;much of this is easier in real mode
FSTI ;allow interrupts
mov ah,51h ;get PSP of current task
pushf
FCLI
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov [bp + 6],word ptr (offset dec_10)
mov ax,es:[21h*4]
mov [bp + 2],ax
mov ax,es:[21h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
dec_10: cmp bx,segPSPChild ;is this our child terminating?
jnz @f ;if not, go process the call ourselves
jmp decTermChild ; yes...
@@:
FCLI ;we want to preserve the current
xor ax,ax ; rMode Int 24h handler across this
mov es,ax ; exit call (the terminating PSP
mov ax,es:[24h*4] ; has the pMode handler address).
mov dx,es:[24h*4+2] ; So get the current Int 24h handler
FSTI ; address from the rMode IDT.
mov es,bx ;address terminating PSP
assume es:PSPSEG
mov word ptr [lpfnInt24],ax ;point PSP to same Int 24h
mov word ptr [lpfnInt24+2],dx ; handler
mov ax,offset DXCODE:decTermHandler ;point PSP to our termination
mov word ptr [lpfnParent],ax ; handler
mov word ptr [lpfnParent+2],cs
push es
mov ax,segParentPSP ;Windows has the PSP's parent
push ax ; field as a selector, we need the seg
mov dx, [segEnviron]
push dx
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
FSTI
pop ax ;get selector for environment
or ax,ax ; NULL selector (krnl386 does this)
jnz @f
xor bx,bx ; zero environment segment
jmp dec_HaveEnvSeg
@@:
call GetSegmentAddress
test bx,0fff0h ; >1mb?
jz @f ; no
xor bx,bx ; yes, zero environment segment
xor dx,dx
@@:
shr dx, 4
shl bx, 12
or bx, dx ;seg of environment
dec_HaveEnvSeg:
pop ax ;get parent psp off stack
push bx ;save seg of environment
call GetSegmentAddress ;returns BX:DX = lma of segment
shr dx,4
shl bx,12
or bx,dx ;bx now = seg of parent psp
SwitchToRealMode ;back to the shadows again...
FSTI
pop cx ;seg of environment
pop dx ;terminating PSP segment from stack
mov es,bx ;address the parent's PSP
assume es:PSPSEG
mov ax,sp
sub ax,12*2 ;some magic for DOS
mov word ptr [lpStack],ax ;set our stack in parent's PSP
mov word ptr [lpStack+2],ss
mov es,dx ;(re)address terminating PSP
assume es:PSPSEG
mov [segEnviron], cx
mov segParentPSP,bx ;real DOS doesn't like selectors in
; parent PSP field, zap it to segment
mov ax,pmrg.xax ;terminate the process
mov ah,4Ch ; with a 4Ch DOS call
pushf
FCLI
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset decTermHandler
mov ax,es:[21h*4]
mov [bp + 2],ax
mov ax,es:[21h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
assume ds:NOTHING,es:NOTHING,ss:NOTHING ;play it safe
decTermHandler: ;should return back here
push ss
pop ds
SwitchToProtectedMode ;back to pMode
assume ds:DGROUP,es:DGROUP
FSTI
les bx,dword ptr pmusrsp ;es:bx -> ip cs flag
and byte ptr es:[bx+2*2],not 1 ;clear CY in caller's flags
stc ;exit call has been processed
dec90:
pop es
pop dx
pop bx
pop ax
ret
EndHighSegment
BeginLowSegment
decTermChild:
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
FSTI
clc
jmp short dec90
DosExitCall endp
; -------------------------------------------------------
; net5Fenter -- Additional entry processing for INT 21h/5Fh
; functions.
;
; INT 21h/5Fh subfunctions 2, 3, and 5 have two buffers of data to
; transfer. The normal DOSENTRY processing only does one, so we
; setup the other buffer here.
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public net5Fenter
net5Fenter proc near
cmp al,2 ;This routine only works on
rc ; subfunctions 2, 3, and 5
cmp al,4
rz
cmp al,6
rnc
push ax
mov ax,int21esdi ;entry code for INT 21h/5Fh extra buff
call gtarea ;let gtarea set it up
pop ax
cmp al,3 ;Make redirection function?
rnz
; 5F/03 needs a buffer copied down to A1, but it's non standard in that
; the buffer contains two (count'em 2) asciiz strings
push ax
push cx
push ds
mov ds,pmrg.xes ;user's ES:DI -> buffer, gtarea sets
xor ah,ah ; up our si to have user's di
mov cl,2
@@: lodsb ;copy one asciiz string
stosb
cmp al,ah
jnz @b
dec cl ; and then the other
jnz @b
pop ds
pop cx
pop ax
return
net5Fenter endp
; -------------------------------------------------------
; net5Fexit -- Additional exit processing for INT 21h/5Fh
; functions.
;
; INT 21h/5Fh subfunctions 2, 3, & 5 have 2 buffers of data to transfer.
; The normal DOSENTRY processing only does one, so do the other
; buffer here.
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public net5Fexit
net5Fexit proc near
cmp al,2 ;This routine only works on
rc ; subfunctions 2, 3 and 5
cmp al,4
rz
cmp al,6
rnc
push pmrg.xdi ;Restore protected mode DI register
pop rmrg.xdi
cmp al,2 ;Get redirection function?
jz @f
cmp al,5
rnz
@@:
; 5F/02 & 05 need a buffer copied from A1
test byte ptr rmflags,1 ;Success? (carry flag)
rnz ; No, don't transfer anything
push ax
mov ax,int21esdi+2 ;exit code for int 21/5F extra buffer
push pmrg.xes
pop enxseg
call gtarea ;let gtarea setup the move
xchg si,di
mov dx,ds
mov es,enxseg
call movdat ; and let movdat move it
pop ax
return
net5Fexit endp
; -------------------------------------------------------
; RSTREG -- This function sets up to restore the original
; protected-mode registers. This cleans up after register
; translations performed when going into the or returning
; from an MS-DOS call. On entry, AX contains the entry code
; value from the entry/exit operations table. If this code
; implies that a register needs to be restored this function
; will return with NZ true and AX = original register value
; and SI pointing to the appropriate location in the PMRG array.
; If no register needs to be restored, return with Z true.
;
; Input: AX - entry code value
; Output: NZ true if register needs to be restores
; AX - register value to restore
; SI - pointer into PMRG to the register image
; ZR true if no restoration needed
; Errors: none
; Uses: AX, SI modified
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public rstreg
rstreg: or ax,ax
rz
shr ax,3
and ax,1Eh
rz
cmp al,2*DTA ;DTA?
rz
xchg si,ax ;No. Restore appropriate register, e.g., dx
mov si,regoffs[si-2]
mov ax,word ptr pmrg[si]
return
; -------------------------------------------------------
; GTAREA -- This function examines the entry code/exit code
; parameter and determines if any data transfer needs to be
; performed. If so, it sets up pointers and length codes for
; the transfer.
; There are two transfer buffers used. The A0 buffer is 60h bytes
; long and the A1 buffer is CB_XFRBUF1 bytes (about 4k) long.
;
; Input: AX - entry code/exit code
; Output: NZ true if something needs to be transferred
; SI - offset of source pointer
; DI - offset of destination pointer
; ENXSEG - segment for caller's buffer
; (source on entry, destination on exit)
; CX - transfer length/type code
; Errors: none
; Uses: AX, CX, SI, DI, ES modified
; ENXSEG modified
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public gtarea
gtarea:
test ah,RP ;Real/PM xfer (ah = 3f/40)?
jz gtare2
mov si,pmrg.xds ;Yes. *si:pmrg.xdx = pm caller's xfer area
and si,SELECTOR_INDEX
test ah,EX ;Exit call?
jz gtare1
push es
push ax
mov es,selGDT
mov al,es:[si].adrBaseHigh
mov ah,es:[si].adrbBaseHi386
test ax,0FFF0h ; check for transfer to extended
; memory
pop ax
pop es
jnz @f
jmp gtar54
@@:
mov cx,rmrg.xax ;Yes. cx = amount read/written
sub rcount,cx ;Update remaining count
cmp cx,rmrg.xcx ;All that was requested?
jnc gtare3
mov rcount,0 ;No: done
jmp short gtare3
gtare1: push ax ;Read/Write entry
mov ax,si
mov dx,pmrg.xdx ;ax:dx = selector:offset of buffer
call SelOff2SegOff ;translate to seg:off if in conventional mem
jnz gtar12
mov rmrg.xds,ax ;store corresponding paragraph
mov rmrg.xdx,dx ; and offset
pop ax
jmp short gtar54 ;No more setup needed
gtar12: pop ax ;XRAM/RRAM read/write entry
mov cx,rcount ;Try to xfer remaining amount
cmp cx,CB_XFRBUF1 ;Too much to fit in buffer?
jbe gtar14
mov cx,CB_XFRBUF1 ;Yes, only transfer a buffer size
gtar14: mov rmrg.xcx,cx
jmp short gtare3
gtare2: test ah,A0+A1 ;xfer area?
jz gtare4
gtare3: mov di,offset DGROUP:rgbXfrBuf0 ;Point at small buffer (90h bytes)
test ah,1 ;Area 0 (small area) ?
jnz gtare4
mov di,npXfrBuf1 ;No. Point at large buffer (4K)
gtare4: push ax ;Store ptr to communication area for DOS
mov si,di
shr al,3 ;Get al = 2 * data ptr type, e.g., DSDX (ds:dx)
and al,1Eh ;al = word offset for data ptr type
jz gtare7
cmp al,2*DTA ;DOS Data Transfer Area?
jnz gtare5
mov si,pmdta ;Yes, load DTA offset
push pmdta+2 ;and the segment
pop enxseg
jmp short gtare7
gtare5: cmp al,2*ES$
jnz gtare6
test ah,80h ;INT-21 49/4A. Ignore exit call
mov ax,0
jnz gtar52
mov si,pmrg.xes ;Entry call. si = RAM xfer selector
call gtpara ;Get paragraph given by [si].gdt
jnz gtar52 ;XRAM?
mov rmrg.xes,ax ;No, store RRAM paragraph
gtar52: pop cx ;Kill saved ptr
gtar54: xor cx,cx ;RZ with zero count, i.e., no RM/PM xfer needed
mov rcount,cx
return
gtare6: test ah,80h ;Entry?
cbw
push ax
xchg di,ax ;Save real-mode area offset
mov di,regoffs[di-2] ;di = offset of saved register value
mov si,word ptr pmrg[di] ;si = saved value
jnz gtar62
mov word ptr rmrg[di],ax ;Entry. Store real-mode area offset
cmp byte ptr pmrg.xax+1,29h ;Parse filename?
jnz gtar62
mov cx,npXfrBuf1 ;Yes. Use npXfrBuf1 for FCB info
mov word ptr rmrg.xdi,cx
gtar62: xchg di,ax ;Restore di = real-mode area offset
pop ax
cmp ax,ESDI*2
jne gtare7
push pmrg.xes
pop enxseg
gtare7: pop cx ;Recover entrycd/exitcd
and cx,0Fh ;RNZ if something to xfer
rz ;No
mov dx,pmrg.xds ;Xfer needed. dx = original XRAM data selector
cmp cl,AX$ ;Use rmrg.xax?
jz gtare8
cmp cl,CX$ ;Use pmrg.xcx?
rnz ;No, just RNZ
;Return dx:0 = pmrg.xds:si+ccount, where dx is a scratch selector
;and si = 0. This ensures that dx:si can address a bufferful of bytes
;without overflowing si (sort of like a huge ptr).
gtare8: xchg ax,si ;ax = original offset
mov si,dx ;si = pmrg.xds (PM data selector)
and si,SELECTOR_INDEX
xor dx,dx ;dxax = original offset in 32-bit form
add ax,ccount
adc dx,0 ;dxax += ccount (current xfer count)
push es
mov es,selGDT ;Point at GDT
add ax,es:[si].adrBaseLow
adc dl,es:[si].adrBaseHigh ;dxax absolute XRAM address
adc dh,es:[si].adrbBaseHi386
mov si,SEL_DOSSCR
cCall NSetSegmentDscr,<si,dx,ax,0,0ffffh,STD_DATA>
pop es
; original code... changed to line below to fix file read problem.
; may cause other bugs.....
; mov dx,si ;Return scratch selector with 0 offset since
;
or si,SELECTOR_TI
mov enxseg,si ;Return scratch selector with 0 offset since
xor si,si ; it points directly to the transfer location
or sp,sp ;RNZ to indicate xfer needed
return
; -------------------------------------------------------
; GetEntryCd -- This routine puts the entry code for the
; DOS function into ax.
;
; Input: AH - MS-DOS function number
; Output: AX - entry code for function
; DI - address of entry code returned
;
; Errors: none
; Uses: AX, DI modified
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public GetEntryCd
GetEntryCd proc near
push bx
cmp ah,MaxInt21 ;Check for unsupported DOS call
jbe @f
mov di,offset DXPMCODE:Unsupported
jmp gec90
@@:
mov di,offset DXPMCODE:pmrmxfr
ifdef DBCS
cmp ah,63h ;Get Lead Byte Table?
jnz gec10
if DEBUG ;------------------------------------------------------------
cmp al,2
jbe gec15
Debug_Out "Int 21h/63h Unsupported Function (#AX)"
jmp short gec80
gec15:
endif ;DEBUG --------------------------------------------------------
cmp al,0 ;Int 21/63/00 is special
jne gec80
mov di,offset DXPMCODE:int2163
jmp short gec90
gec10:
ENDIF ; DBCS
gec20: cmp ah,5Eh ;Network Machine Name/Printer Setup Str?
jnz gec40
if DEBUG ;------------------------------------------------------------
cmp al,3
jna gec25
Debug_Out "Int 21h/5Eh Unsupported Function (#AX)"
jmp short gec80
gec25:
endif ;DEBUG --------------------------------------------------------
cmp al,3 ;Int 21-5E/00-03 are special
ja gec80
mov bl,al
mov di,offset DXPMCODE:int215E
jmp short gec85
gec40: cmp ah,5Fh ;Get/Make Assign-List Entry?
jnz gec80
if DEBUG ;------------------------------------------------------------
cmp al,5
ja @f
cmp al,2
jnb gec45
@@:
cmp al,30h ;Register based. Get Redirector version
;used by Lanman Enhanced.
je gec80
Debug_Out "Int 21h/5Fh Unsupported Function (#AX)"
jmp short gec80
gec45:
endif ;DEBUG --------------------------------------------------------
cmp al,2 ;Int 21/5F/02-05 are special
jb gec80
cmp al,5
ja gec80
mov bl,al
sub bl,2
mov di,offset DXPMCODE:int215F02
jmp short gec85
gec80: mov bl,ah
gec85: xor bh,bh
shl bx,2
add di,bx ;Address of entry code
gec90:
mov ax,word ptr cs:[di] ;The entry code itself
pop bx
return
GetEntryCd endp
; -------------------------------------------------------
; CheckStatus -- This routine determines if data should be copied
; back to protect mode by checking the DOS function
; return status.
;
; Input: none
; Output: NZ - if data should NOT be copied, Z otherwise
;
; Errors: none
; Uses: none
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public CheckStatus
CheckStatus proc near
; For now, only worry about the functions that return variable length
; results, like ASCIIZ strings.
cmp byte ptr pmrg.xax+1,32h
jz @f
cmp byte ptr pmrg.xax+1,47h ;Get Current Directory
jz @f
cmp byte ptr pmrg.xax+1,5Ah ;Create Temporary File
jz @f
cmp byte ptr pmrg.xax+1,5Eh ;Get Machine Name/Printer Str
jc cks90
cmp byte ptr pmrg.xax+1,5Fh ;Get Redirection Entry
ja cks90
@@:
test byte ptr rmflags,1 ;Carry set?
return
cks90: cmp al,al ;Assume status is okay (or doesn't
return ; matter) -- set Z and return
CheckStatus endp
; -------------------------------------------------------
; DOSXEC -- This function performs the transfer of the
; DOS exec parameter block on entry to DOS function 4Bh.
;
; transfer int-21 ah = 4b0x EXEC block and associated strings
; to Area 1. This area is laid out partly analogously to a PSP as follows:
;
; 0-1f EXEC block defined according to the execblk struc above
; 20-2f FCB1
; 30-3f FCB2
; 40-bf command line
;
; cx, si, di changed.
assume ds:DGROUP,es:DGROUP,ss:DGROUP
public dosxec
dosxec:
push ax ;Save entrcd code
push bx
push dx
mov cx,10h ;Setup parameter block. Xfer pm user block first
mov bx,npXfrBuf1 ;Point at larger buffer
mov di,bx
mov dx,segDXDataPM
mov rmrg.xbx,di ;int-21 4b0x expects es:bx -> exec block
mov si,pmrg.xbx ;npXfrBuf1:0 - 1f (xtra room for undocumented)
mov ds,pmrg.xes
rep movsw ;copy caller's exec param block to our buffer
; Copy FCB1 down if the user has specified one.
dsxc20: mov ax,word ptr es:[bx].fcb1ptr
cmp ax,0FFFFh
jz dsxc22
or ax,word ptr es:[bx].fcb1ptr+2
jz dsxc22
lds si,es:[bx].fcb1ptr ;Get pointer to FCB1
mov word ptr es:[bx].fcb1ptr,di ;store new pointer in the copy of the
mov word ptr es:[bx].fcb1ptr+2,dx ; exec block we are building
mov cl,8 ;copy FCB1 down to our buffer
rep movsw
jmp short dsxc24
dsxc22: add di,10h
; Copy FCB2 down if the user has specified one.
dsxc24: mov ax,word ptr es:[bx].fcb2ptr
cmp ax,0FFFFh
jz dsxc26
or ax,word ptr es:[bx].fcb2ptr+2
jz dsxc26
lds si,es:[bx].fcb2ptr ;Move FCB2
mov word ptr es:[bx].fcb2ptr,di
mov word ptr es:[bx].fcb2ptr+2,dx
mov cl,8
rep movsw
jmp short dsxc30
dsxc26: add di,10h
; Copy the command line down.
dsxc30: lds si,es:[bx].cmdptr ;Move command line
mov word ptr es:[bx].cmdptr,di
mov word ptr es:[bx].cmdptr+2,dx
mov cl,[si]
inc cx ;Include count
inc cx ;Include final CR not included in count
rep movsb
; Now, we need to set up the enviroment table to be passed to the
; child program.
mov di,bx ;di = npXfrBuf1
mov dx,es:[di] ;Setup desired environment
or dx,dx ;Use parent's environment?
jnz dosxegotenv
; pick up the environment segment from the current PDB. It's a selector,
; so it has to be translated.
push bx
push di
push es
mov ax,SEL_DXDATA OR STD_RING
mov ds,ax
SwitchToRealMode ;much of this is easier in real mode
mov ah,51h ;get PSP of current task
pushf
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov [bp + 6],word ptr (offset dosxeret)
mov ax,es:[21h*4]
mov [bp + 2],ax
mov ax,es:[21h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
dosxeret:
assume es:PSPSEG
mov es, bx ;current PSP
mov dx, es:[segEnviron] ;get environment (currently selector)
push dx ;save over call (bugbug is this needed?)
SwitchToProtectedMode
pop dx ;bugbug is this needed?
pop es
pop di
pop bx
dosxegotenv:
xor si,si ;No. Setup to copy desired environment down
mov ds,dx ;ds = dx has caller's selector. Use 0 offset
add di,100h
shr di,4 ;Convert offset to paragraph
mov dx,segDXDataPM
add dx,di ;dx = absolute paragraph within larger buffer
shl di,4 ;Convert back (with low nibble cleared)
mov cx,CB_XFRBUF1 ;Max room available for environment
sub cx,100h
dosxe2: lodsw ;Copy environment down
stosw
or ax,ax
jz dosxe4
dec si ;Check every byte offset in environment for double 0
dec di
loop dosxe2
xor dx,dx ;Environment too large for buffer: use parent's
;Issue error message? Program might run with parent's
; and not with desired monster environment
dosxe4: push es ;Fix up parameter block entry
pop ds ;ds:dgroup
mov [bx].evrnmt,dx
pop dx
pop bx
pop ax ;Restore entrcd code
return
; -------------------------------------------------------
; XFRFLG -- This function will transfer the relevant real-mode
; flags to the protected mode IRET return information on the
; stack for returning to the protected mode caller.
;
; Input:
; Output:
; Errors:
; Uses: AX, CX, DI modified
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public xfrflg
xfrflg: push es
les di,dword ptr pmusrsp ;es:[di] = ip cs fl (assume 80286)
mov ax,rmflags
mov cx,es:[di+2*2] ;Get pm user entry flags
and ch,not 19h ;Only allow real-mode program to
and ah,18h ; change OF and DF in high byte of flags
or ah,ch
mov es:[di+2*2],ax
pop es
return
; -------------------------------------------------------
subttl Handlers for Special Case Dos Functions
page
; -------------------------------------------------------
; HANDLERS FOR SPECIAL CASE DOS FUNCTIONS
; -------------------------------------------------------
; -------------------------------------------------------
; Terminate process -- This routine replaces the apps
; termination vector in the PSP with ours. This allows
; us to clean up the dos extender.
;
; Entry: nothing
; Exit: nothing
; Uses: none
;
assume ds:dgroup,es:nothing
public TerminateProcess
TerminateProcess proc near
pusha
push es
;
; Get the childs PSP (bugbug do we need to get the current psp?)
;
SwitchToRealMode
mov ah,51h
pushf
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov [bp + 6],offset tp_10
mov ax,es:[21h*4]
mov [bp + 2],ax
mov ax,es:[21h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
tp_10: FSTI
;
; Change the termination vector to point to the dos extender
;
mov es,bx
mov bx,es:[0ah]
mov ax,es:[0ch]
mov cx,offset ChildTerminationHandler
mov es:[0ah],cx
mov cx,segDXCode
mov es:[0ch],cx
;
; Save the old termination vector for restoration later
;
mov cx,segCurrentHostData
mov es,cx
mov word ptr es:[HdPspTerminate],bx
mov word ptr es:[HdPspTerminate+2],ax
SwitchToProtectedMode
pop es
popa
ret
TerminateProcess endp
DXPMCODE ends
;****************************************************************
end
| 35.664678 | 87 | 0.476101 |
b5bb86604ac1cf158a02f67112285d4d805b8b0e | 387 | asm | Assembly | programs/oeis/242/A242894.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/242/A242894.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/242/A242894.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A242894: Beginning with a central 'Star' configuration of a Penrose 'Kite' and 'Dart' tiling with rotational symmetry as the first step, number of tiles that can be added to the free edges of the current tiling.
; 5,10,10,20,20,25,35,40,40,45,45
mov $2,$0
mov $3,1
lpb $0
mov $0,$2
sub $0,1
add $1,1
add $3,1
div $0,$3
add $1,$0
mul $3,2
lpe
mov $0,$1
mul $0,5
add $0,5
| 21.5 | 213 | 0.658915 |
ef858049a666455dbc0833b6337a0d0a506f93ca | 3,760 | asm | Assembly | release/src/router/gmp/source/mpn/x86/k7/mode1o.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 12 | 2020-01-08T01:33:02.000Z | 2022-03-16T00:25:34.000Z | release/src/router/gmp/source/mpn/x86/k7/mode1o.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 8 | 2019-12-19T19:34:56.000Z | 2022-03-10T10:11:28.000Z | release/src/router/gmp/source/mpn/x86/k7/mode1o.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 2 | 2022-03-30T13:12:22.000Z | 2022-03-30T18:12:10.000Z | dnl AMD K7 mpn_modexact_1_odd -- exact division style remainder.
dnl Copyright 2000, 2001, 2002, 2004, 2007 Free Software Foundation, 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 Athlon: 11.0
C Hammer: 7.0
C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
C mp_limb_t divisor);
C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
C mp_limb_t divisor, mp_limb_t carry);
C
C With the loop running at just 11 cycles it doesn't seem worth bothering to
C check for high<divisor to save one step.
C
C Using a divl for size==1 measures slower than the modexact method, which
C is not too surprising since for the latter it's only about 24 cycles to
C calculate the modular inverse.
defframe(PARAM_CARRY, 16)
defframe(PARAM_DIVISOR,12)
defframe(PARAM_SIZE, 8)
defframe(PARAM_SRC, 4)
defframe(SAVE_EBX, -4)
defframe(SAVE_ESI, -8)
defframe(SAVE_EDI, -12)
defframe(SAVE_EBP, -16)
deflit(STACK_SPACE, 16)
TEXT
ALIGN(16)
PROLOGUE(mpn_modexact_1c_odd)
deflit(`FRAME',0)
movl PARAM_CARRY, %ecx
jmp L(start_1c)
EPILOGUE()
ALIGN(16)
PROLOGUE(mpn_modexact_1_odd)
deflit(`FRAME',0)
xorl %ecx, %ecx
L(start_1c):
movl PARAM_DIVISOR, %eax
subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
movl %esi, SAVE_ESI
movl PARAM_DIVISOR, %esi
movl %edi, SAVE_EDI
shrl %eax C d/2
andl $127, %eax
ifdef(`PIC',`
LEA( binvert_limb_table, %edi)
movzbl (%eax,%edi), %edi C inv 8 bits
',`
movzbl binvert_limb_table(%eax), %edi C inv 8 bits
')
xorl %edx, %edx C initial extra carry
leal (%edi,%edi), %eax C 2*inv
imull %edi, %edi C inv*inv
movl %ebp, SAVE_EBP
movl PARAM_SIZE, %ebp
movl %ebx, SAVE_EBX
movl PARAM_SRC, %ebx
imull %esi, %edi C inv*inv*d
subl %edi, %eax C inv = 2*inv - inv*inv*d
leal (%eax,%eax), %edi C 2*inv
imull %eax, %eax C inv*inv
imull %esi, %eax C inv*inv*d
leal (%ebx,%ebp,4), %ebx C src end
negl %ebp C -size
subl %eax, %edi C inv = 2*inv - inv*inv*d
ASSERT(e,` C d*inv == 1 mod 2^BITS_PER_MP_LIMB
movl %esi, %eax
imull %edi, %eax
cmpl $1, %eax')
C The dependent chain here is
C
C cycles
C subl %edx, %eax 1
C imull %edi, %eax 4
C mull %esi 6 (high limb)
C ----
C total 11
C
C Out of order execution hides the load latency for the source data, so no
C special scheduling is required.
L(top):
C eax src limb
C ebx src end ptr
C ecx next carry bit, 0 or 1 (or initial carry param)
C edx carry limb, high of last product
C esi divisor
C edi inverse
C ebp counter, limbs, negative
movl (%ebx,%ebp,4), %eax
subl %ecx, %eax C apply carry bit
movl $0, %ecx
setc %cl C new carry bit
subl %edx, %eax C apply carry limb
adcl $0, %ecx
imull %edi, %eax
mull %esi
incl %ebp
jnz L(top)
movl SAVE_ESI, %esi
movl SAVE_EDI, %edi
leal (%ecx,%edx), %eax
movl SAVE_EBX, %ebx
movl SAVE_EBP, %ebp
addl $STACK_SPACE, %esp
ret
EPILOGUE()
| 22.117647 | 78 | 0.686968 |
5e32d2834f19ab31011e93bca51aea94eba95ae4 | 401 | asm | Assembly | oeis/306/A306193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/306/A306193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/306/A306193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A306193: a(n) = Product_{k=0..n} (1 + n!/k!).
; Submitted by Jon Maiga
; 2,4,18,392,81250,225061452,9854913828914,7821195286733052688,128042318400630042200896962,48734103316428964151516768659332500,480771737247108575104717059364582638896056402,135700420467061659867201490569546772642393389614560348824
mov $1,2
mov $2,1
lpb $0
mul $2,$0
sub $0,1
add $2,1
mul $1,$2
sub $2,1
lpe
mov $0,$1
| 26.733333 | 230 | 0.763092 |
5e7b988dd0996f64b24558b5521ec94de791d0f0 | 510 | asm | Assembly | solutions/53 - 100 Cubes on the Floor/size-23_speed-63.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 45 | 2018-09-05T04:56:59.000Z | 2021-11-22T08:57:26.000Z | solutions/53 - 100 Cubes on the Floor/size-23_speed-63.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 36 | 2018-09-01T11:34:26.000Z | 2021-05-19T23:20:49.000Z | solutions/53 - 100 Cubes on the Floor/size-23_speed-63.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 36 | 2018-09-01T07:44:19.000Z | 2021-09-10T19:07:35.000Z | -- 7 Billion Humans (2212:2214M) --
-- 53: 100 Cubes on the Floor --
-- Author: DeepAQ
-- Size: 23
-- Speed: 63
if nw == datacube and
se == nothing:
mem1 = set 41
endif
a:
step w
if c != datacube:
jump a
endif
b:
if mem1 > 0:
c:
d:
pickup c
write mem1
drop
if w != wall:
step w
mem1 = calc mem1 + 1
jump b
endif
endif
if e != datacube:
e:
mem1 = set n
if mem1 > 0:
mem1 = calc mem1 + 10
jump c
endif
mem2 = set s
if mem2 > 0:
mem1 = calc mem2 - 10
jump d
endif
jump e
endif
| 11.086957 | 35 | 0.594118 |
1fd86ba818e2e6844a17c0ad2dd1d39c52d247ee | 428 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_fx/_bitfx_21.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_fx/_bitfx_21.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_fx/_bitfx_21.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
SECTION code_clib
SECTION code_sound_bit
PUBLIC _bitfx_21
INCLUDE "clib_target_cfg.asm"
_bitfx_21:
; ascending buzzer
ld hl,1023
hdesc1:
push hl
ld b,16
hdesc2:
rl l
rl h
jr nc, hdesc3
xor __sound_bit_toggle
INCLUDE "sound/bit/z80/output_bit_device_2.inc"
hdesc3:
djnz hdesc2
pop hl
dec hl
ld c,a
ld a,h
or l
ld a,c
jr nz, hdesc1
ret
| 9.304348 | 50 | 0.614486 |
395aaa72976d6c597551095624fdc2f422bb51b7 | 406 | asm | Assembly | programs/oeis/055/A055990.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/055/A055990.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/055/A055990.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A055990: a(n) is its own 4th difference.
; 1,4,14,50,181,657,2385,8657,31422,114051,413966,1502555,5453761,19795288,71850128,260791401,946583628,3435774958,12470688498,45264335853,164294064481,596331286321,2164478699633,7856317702310,28515747394555,103502414271126,375678379097907,1363584081738689,4949344043795952
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
add $1,$2
add $4,$1
add $3,$4
lpe
| 31.230769 | 273 | 0.775862 |
1a47ce7d5e58ebedc35c50341456b9d27ebb1e03 | 524 | asm | Assembly | oeis/061/A061717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/061/A061717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/061/A061717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A061717: Binary order of n^n.
; Submitted by Jon Maiga
; 0,2,5,8,12,16,20,24,29,34,39,44,49,54,59,64,70,76,81,87,93,99,105,111,117,123,129,135,141,148,154,160,167,173,180,187,193,200,207,213,220,227,234,241,248,255,262,269,276,283,290,297,304,311,318,326,333,340,348,355,362,370,377,384,392,399,407,414,422,430,437,445,452,460,468,475,483,491,498,506,514,522,530,537,545,553,561,569,577,585,593,601,609,617,625,633,641,649,657,665
add $0,1
pow $0,$0
sub $0,1
mov $1,-1
lpb $0
div $0,2
add $1,1
lpe
add $1,1
mov $0,$1
| 34.933333 | 375 | 0.69084 |
29b394414a1622d14a21a3330e9c5bb597103f3f | 3,878 | asm | Assembly | maps/GoldenrodDeptStoreB1F.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | maps/GoldenrodDeptStoreB1F.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | maps/GoldenrodDeptStoreB1F.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | object_const_def ; object_event constants
const GOLDENRODDEPTSTOREB1F_POKE_BALL1
const GOLDENRODDEPTSTOREB1F_POKE_BALL2
const GOLDENRODDEPTSTOREB1F_POKE_BALL3
const GOLDENRODDEPTSTOREB1F_POKE_BALL4
const GOLDENRODDEPTSTOREB1F_BLACK_BELT1
const GOLDENRODDEPTSTOREB1F_BLACK_BELT2
const GOLDENRODDEPTSTOREB1F_BLACK_BELT3
const GOLDENRODDEPTSTOREB1F_MACHOP
GoldenrodDeptStoreB1F_MapScripts:
db 0 ; scene scripts
db 2 ; callbacks
callback MAPCALLBACK_TILES, .ClearBoxes
callback MAPCALLBACK_NEWMAP, .Unblock
.ClearBoxes:
checkevent EVENT_RECEIVED_CARD_KEY
iftrue .GotCardKey
sjump .Continue
.GotCardKey:
changeblock 16, 4, $0d ; floor
sjump .Continue
.Continue:
checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_2
iftrue .Layout2
checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_3
iftrue .Layout3
changeblock 10, 8, $0d ; floor
return
.Layout2:
changeblock 4, 10, $0d ; floor
return
.Layout3:
changeblock 10, 12, $0d ; floor
return
.Unblock:
clearevent EVENT_GOLDENROD_UNDERGROUND_WAREHOUSE_BLOCKED_OFF
return
GoldenrodDeptStoreB1FBlackBelt1Script:
jumptextfaceplayer GoldenrodDeptStoreB1FBlackBelt1Text
GoldenrodDeptStoreB1FBlackBelt2Script:
jumptextfaceplayer GoldenrodDeptStoreB1FBlackBelt2Text
GoldenrodDeptStoreB1FBlackBelt3Script:
jumptextfaceplayer GoldenrodDeptStoreB1FBlackBelt3Text
GoldenrodDeptStoreB1FMachopScript:
opentext
writetext GoldenrodDeptStoreB1FMachokeText
cry MACHOKE
waitbutton
closetext
end
GoldenrodDeptStoreB1FEther:
itemball ETHER
GoldenrodDeptStoreB1FAmuletCoin:
itemball AMULET_COIN
GoldenrodDeptStoreB1FBurnHeal:
itemball BURN_HEAL
GoldenrodDeptStoreB1FUltraBall:
itemball ULTRA_BALL
GoldenrodDeptStoreB1FBlackBelt1Text:
text "Hey, kid! You're"
line "holding us up!"
para "Our policy is to"
line "work behind the"
para "scenes where no"
line "one can see us!"
done
GoldenrodDeptStoreB1FBlackBelt2Text:
text "I lose my passion"
line "for work if some-"
cont "one's watching."
para "Come on, kid,"
line "scoot!"
done
GoldenrodDeptStoreB1FBlackBelt3Text:
text "Oohah! Oohah!"
para "The stuff on the"
line "ground's junk."
para "Take it if you"
line "want it!"
done
GoldenrodDeptStoreB1FMachokeText:
text "MACHOKE: Maaacho!"
done
GoldenrodDeptStoreB1F_MapEvents:
db 0, 0 ; filler
db 3 ; warp events
warp_event 17, 2, GOLDENROD_UNDERGROUND_WAREHOUSE, 3
warp_event 9, 4, GOLDENROD_DEPT_STORE_ELEVATOR, 1
warp_event 10, 4, GOLDENROD_DEPT_STORE_ELEVATOR, 2
db 0 ; coord events
db 0 ; bg events
db 8 ; object events
object_event 10, 15, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, GoldenrodDeptStoreB1FEther, EVENT_GOLDENROD_DEPT_STORE_B1F_ETHER
object_event 14, 2, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, GoldenrodDeptStoreB1FAmuletCoin, EVENT_GOLDENROD_DEPT_STORE_B1F_AMULET_COIN
object_event 6, 3, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, GoldenrodDeptStoreB1FBurnHeal, EVENT_GOLDENROD_DEPT_STORE_B1F_BURN_HEAL
object_event 15, 15, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, GoldenrodDeptStoreB1FUltraBall, EVENT_GOLDENROD_DEPT_STORE_B1F_ULTRA_BALL
object_event 9, 10, SPRITE_BLACK_BELT, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 1, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, GoldenrodDeptStoreB1FBlackBelt1Script, -1
object_event 4, 8, SPRITE_BLACK_BELT, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, GoldenrodDeptStoreB1FBlackBelt2Script, -1
object_event 6, 13, SPRITE_BLACK_BELT, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, GoldenrodDeptStoreB1FBlackBelt3Script, -1
object_event 7, 7, SPRITE_MACHOP, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, GoldenrodDeptStoreB1FMachopScript, -1
| 29.603053 | 178 | 0.817947 |
29b565be928aa34906a37c165da911ae49ae6905 | 18,280 | asm | Assembly | writeups/flag3/src/main.asm | zer0x64/nsec2022-gband | 7f831b1af83c7f766f139dfce14776b654ee8d9a | [
"Apache-2.0",
"MIT"
] | null | null | null | writeups/flag3/src/main.asm | zer0x64/nsec2022-gband | 7f831b1af83c7f766f139dfce14776b654ee8d9a | [
"Apache-2.0",
"MIT"
] | null | null | null | writeups/flag3/src/main.asm | zer0x64/nsec2022-gband | 7f831b1af83c7f766f139dfce14776b654ee8d9a | [
"Apache-2.0",
"MIT"
] | null | null | null | include "constants.inc"
CHARACTER_SCREEN_POSITION_X = 80 + 8
CHARACTER_SCREEN_POSITION_Y = 72 + 16
; The position represents the middle of the tile
CHARACTER_DEFAULT_POSITION_X = 128
CHARACTER_DEFAULT_POSITION_Y = 112
; The direction the character faces
CHARACTER_DIRECTION_DOWN = $00
CHARACTER_DIRECTION_RIGHT = $10
CHARACTER_DIRECTION_LEFT = $20
CHARACTER_DIRECTION_UP = $30
MAX_SCROLL_X = 256 - 160
MAX_SCROLL_Y = 256 - 144
MAP_ENTITY_EMPTY = 0
MAP_ENTITY_SOLID = 1
MAP_ENTITY_NPC = 2
MAP_ENTITY_FLAG = 3
MAP_ENTITY_CHICKEN = 4
MAP_STATE_RUNNING = 0
MAP_STATE_TALKING = 1
MAP_STATE_NPC = 2
MAP_STATE_EXITING = 3
TEXTBOX_LINE_LENGTH = 18
DEFAULT_NPC_CURSOR_POSITION = $6B
; The character hitbox size is 4x4
HITBOX_SIZE = 6
INTERACTION_RANGE = 8
; How many frames pass between each frame of walk cycle animation
WALK_ANIMATION_SPEED = 8
SECTION FRAGMENT "Game Loop", ROMX
RunGame::
; Disable the PPU
xor a
ld [rLCDC], a
; We start without any scroll
ld [shadowScrollX], a
ld [shadowScrollY], a
; We start with the window off
ld [shadowWindow], a
; We set the textbox text to be empty
call ClearTextboxText
; We set the window position
ld a, 7
ld [rWX], a
ld a, 144 - 40
ld [rWY], a
; Sets the default position of the character
ld a, CHARACTER_DEFAULT_POSITION_X
ld [characterPositionX], a
ld a, CHARACTER_DEFAULT_POSITION_Y
ld [characterPositionY], a
; Character starts facing down
ld a, CHARACTER_DIRECTION_DOWN
ld [characterDirection], a
ld [animationCycleTimer], a
ld a, DEFAULT_NPC_CURSOR_POSITION
ld [npcCursorPosition], a
; Copy the tile map
ld de, mapTileMap
ld hl, _SCRN0
ld bc, mapTileMap.end - mapTileMap
call CopyToVRAM
; Copy the window tile map
ld de, mapWindowTileMap
ld hl, _SCRN1
ld bc, mapWindowTileMap.end - mapWindowTileMap
call CopyToVRAM
ld a, [isCgb]
cp 1
jr nz, .skipAttributeCopy
; GDMA the attribute map
; Change VRAM bank
ld a, 1
ld [rVBK], a
ld de, mapAttributes
ld hl, _SCRN0
ld bc, mapAttributes.end - mapAttributes
call CopyToVRAM
; GDMA the window attribute map
ld de, mapWindowAttributes
ld hl, _SCRN1
ld bc, mapWindowAttributes.end - mapWindowAttributes
call CopyToVRAM
; Reset VRAM bank
ld a, 0
ld [rVBK], a
.skipAttributeCopy
; Load game state
ld a, MAP_STATE_RUNNING
ld [mapState], a
; Character Y
ld a, CHARACTER_SCREEN_POSITION_Y
ld [shadowOAM], a
; Cursor X
ld a, CHARACTER_SCREEN_POSITION_X
ld [shadowOAM + 1], a
; Character default tile index
ld a, CHARACTER_DIRECTION_DOWN
ld [shadowOAM + 2], a
; character palette and attribute
ld a, 1
ld [shadowOAM + 3], a
; Enable PPU
ld a, LCDC_DEFAULT
ld [rLCDC], a
ei
.loop:
; We check the map state to decide what to do
ld a, [mapState]
cp MAP_STATE_RUNNING
jr z, .mainLoop
cp MAP_STATE_EXITING
jr z, .exit
cp MAP_STATE_TALKING
jr z, .talking
cp MAP_STATE_NPC
jr z, .talkingToNpc
.exit
; Turn PPU off and exit
xor a
ld [rLCDC], a
ret
.talking
; We update the joypad state
call ReadJoypad
; We check if a has newly been pressed
ld a, [joypadButtons]
ld b, a
ld a, [joypadButtonsOld]
call GetNewlyPushedButtons
and a, %11
cp 0
jr z, :+
; A or B has been pressed, exit the state
ld a, MAP_STATE_RUNNING
ld [mapState], a
; Disable the window
ld a, 0
ld [shadowWindow], a
:
jr .render
.talkingToNpc
; interaction with serial NPC
call NpcInteraction
jr .render
.mainLoop
; We update the joypad state
call ReadJoypad
; We move the character according to the inputs
call MoveCharacter
; We change the character direction to match the inputs
call ChangeCharacterDirection
; We update the character's animation cycle
call SetAnimationCycle
; We load the character sprite
ld a, [characterDirection]
ld [shadowOAM + 2], a
; This calculate the screen scroll
call CalculateScroll
; This calculate the sprite position on the screen
; Normally the sprite will be at the center of the screen,
; but if there's a scroll lock the sprite can move around freely
call CalculateSpriteScreenPosition
; Check if there is an interaction to process
call CheckInteraction
.render
; Lock so we wait for the frame to end
ld a, 1
ld [waitForFrame], a;
.waitForFrame
; Wait until waitForFrame = 0, which is set by the VBlank handler
ld a, [waitForFrame]
cp a, 0
jr nz, .waitForFrame
; Print window
call DrawWindow
jr .loop
MoveCharacter:
ld a, [joypadDpad]
; Check X movement
ld b, $00
bit 0, a
jr z, :+
bit 1, a
jr z, :++
jr :+++
:
; Right
ld b, $01
ld a, [characterDirection]
and %00001111
or CHARACTER_DIRECTION_RIGHT
ld [characterDirection], a
jr :++
:
; Left
ld b, $FF
ld a, [characterDirection]
and %00001111
or CHARACTER_DIRECTION_LEFT
ld [characterDirection], a
jr :+
:
; Apply X movement
ld a, [characterPositionX]
add a, b
; Store the value
ld [localVariables], a
; We check if the new position is valid
ld e, a
ld a, [characterPositionY]
ld d, a
call CheckCollision
; If the tile is not valid, we don't commit the new position
cp 0
jr nz, .y_movement
ld a, [localVariables]
ld [characterPositionX], a
.y_movement
; Check Y movement
ld a, [joypadDpad]
ld b, $00
bit 2, a
jr z, :+
bit 3, a
jr z, :++
jr :+++
:
; Up
ld b, $FF
ld a, [characterDirection]
and %00001111
or CHARACTER_DIRECTION_UP
ld [characterDirection], a
jr :++
:
; Down
ld b, $01
ld a, [characterDirection]
and %00001111
or CHARACTER_DIRECTION_DOWN
ld [characterDirection], a
jr :+
:
ld a, [characterPositionY]
add a, b
; Store the value
ld [localVariables], a
; We check if the new position is valid
ld d, a
ld a, [characterPositionX]
ld e, a
call CheckCollision
; If the tile is not valid, we don't commit the new position
cp 0
ret nz
ld a, [localVariables]
ld [characterPositionY], a
ret
ChangeCharacterDirection:
; Here we change the direction the character is facing
ld a, [characterDirection]
ld [shadowOAM + 2], a
; mask so I just get the direction and not the bits for the animation cycle
and %00110000
; check if pressing up
cp CHARACTER_DIRECTION_UP
jr z, :+
; check if pressing down
cp CHARACTER_DIRECTION_DOWN
jr z, :++
jr .resetFlip
: ; if pressing up
ld a, [joypadDpad]
; check if also pressing right
bit 0, a
jr z, .applyFlip
jr .resetFlip
: ; if pressing down
ld a, [joypadDpad]
; check if also pressing left
bit 1, a
jr z, .applyFlip
jr .resetFlip
.applyFlip
ld a, [shadowOAM + 3]
set 5, a
jr .applyNewDirection
.resetFlip
ld a, [shadowOAM + 3]
res 5, a
.applyNewDirection
ld [shadowOAM + 3], a
ret
SetAnimationCycle:
ld a, [joypadDpad]
ld b, %00001111
and b
; if no inputs, reset animation cycle
cp b
jr z, .resetCycle
; check if the timer is ellapsed
ld a, [animationCycleTimer]
cp WALK_ANIMATION_SPEED
jr c, :+
jr z, :++
; this means it incremented over the timer limit somehow... reset
jr .resetCycle
: ; timer not ellapsed, increment by 1
inc a
ld [animationCycleTimer], a
ret
: ; timer ellapsed, change to next frame of animation
; reset timer
ld a, 0
ld [animationCycleTimer], a
; we change bit 1 so it switches to the other frame of animation
ld a, [characterDirection]
xor $01
ld [characterDirection], a
and $01
cp $00
jr z, :+
ret
: ; back to frame 0 of animation. switch leg
ld a, [characterDirection]
xor %00001000
ld [characterDirection], a
ret
.resetCycle
ld a, $00
ld [animationCycleTimer], a
ld a, [characterDirection]
and %11110000
ld [characterDirection], a
ret
NpcInteraction:
; We update the joypad state
call ReadJoypad
; We check newly pressed buttons
ld a, [joypadButtons]
ld b, a
ld a, [joypadButtonsOld]
call GetNewlyPushedButtons
bit 1, a
jr nz, :++
bit 0, a
jr nz, :+
; now check newly pressed dpad inputs
ld a, [joypadDpad]
ld b, a
ld a, [joypadDpadOld]
call GetNewlyPushedButtons
; we check if left or right are pressed
and %00000011
cp 0
ret z
ld a, [npcCursorPosition]
xor %00001000
ld [npcCursorPosition], a
ret
: ; A pressed
ld a, [npcCursorPosition]
cp DEFAULT_NPC_CURSOR_POSITION ; here I kinda just assume the default is No...
jr nz, :++
: ; No selected (or B pressed), exiting dialog
ld a, MAP_STATE_RUNNING
ld [mapState], a
; Disable the window
ld a, 0
ld [shadowWindow], a
; reset cursor position for next time
ld a, DEFAULT_NPC_CURSOR_POSITION
ld [npcCursorPosition], a
ret
: ; Yes selected, confirmed dialog
call ClearTextboxText
ld a, MAP_STATE_EXITING
ld [mapState], a
ld a, GAMESTATE_SERIAL
ld [gameState], a
xor a
ld [shadowWindow], a
ret
CalculateScroll:
; Here we calculate X scroll
ld a, [characterPositionX]
sub a, 80 + 4
; Check if we're on the edge for X-
jr c, :+
; Check if we're on the edge for X+
ld b, a
ld a, MAX_SCROLL_X
sub b
jr c, :++
; We got scrollX in B, we can apply it
jr .applyScrollX
:
; Screen is locked on X-
ld b, 0
jr .applyScrollX
:
; Screen is locked on X+
ld b, MAX_SCROLL_X
jr .applyScrollX
.applyScrollX
ld a, b
ld [shadowScrollX], a
; Here we calculate Y scroll
ld a, [characterPositionY]
sub a, 72 + 4
; Check if we're on the edge for Y-
jr c, :+
; Check if we're on the edge for Y+
ld b, a
ld a, MAX_SCROLL_Y
sub b
jr c, :++
; We got scrollY in B, we can apply it
jr .applyScrollY
:
; Screen is locked on Y-
ld b, 0
jr .applyScrollY
:
; Screen is locked on Y+
ld b, MAX_SCROLL_Y
jr .applyScrollY
.applyScrollY
ld a, b
ld [shadowScrollY], a
ret
CalculateSpriteScreenPosition:
; We start by calculating the X position
ld a, [shadowScrollX]
cp 0
jr z, :+
cp MAX_SCROLL_X
jr z, :++
ld a, CHARACTER_SCREEN_POSITION_X
jr .loadX
:
; Screen is locked to the left, so the sprite can go move freely on X
ld a, [characterPositionX]
; Add 8 because of the offset in OAM, remove 4 to get the left side
add 8 - 4
jr .loadX
:
; Screen is locked to the right, so the sprite can go move freely on X with an offset
ld a, [characterPositionX]
; Add 8 because of the offset in OAM, remove 4 to get the left side
sub (MAX_SCROLL_X - (8 - 4))
jr .loadX
.loadX
ld [shadowOAM + 1], a
; We now calculate the Y position
ld a, [shadowScrollY]
cp 0
jr z, :+
cp MAX_SCROLL_Y
jr z, :++
ld a, CHARACTER_SCREEN_POSITION_Y
jr .loadY
:
; Screen is locked to the bottom, so the sprite can go move freely on Y
ld a, [characterPositionY]
; Add 16 because of the offset in OAM, remove 4 to get the top side
add (16 - 4)
jr .loadY
:
; Screen is locked to the top, so the sprite can go move freely on Y with an offset
ld a, [characterPositionY]
; Add 16 because of the offset in OAM, remove 4 to get the top side
sub (MAX_SCROLL_Y - (16 - 4))
jr .loadY
.loadY
ld [shadowOAM], a
ret
; Check if the point collides with a solid object
; @param d Y position of the point to check
; @param e X position oof the point to check
; returns a == 0 if the player can move there
CheckCollision:
; Check top left
ld h, d
ld l, e
ld a, d
sub HITBOX_SIZE / 2
ld d, a
ld a, e
sub HITBOX_SIZE / 2
ld e, a
push hl
call GetLogicTile
pop hl
; If a is not zero, break
cp MAP_ENTITY_EMPTY
jr nz, .break
; Check bottom left
ld d, h
ld e, l
ld a, d
add HITBOX_SIZE / 2
ld d, a
ld a, e
sub HITBOX_SIZE / 2
ld e, a
push hl
call GetLogicTile
pop hl
; If a is not zero, break
cp MAP_ENTITY_EMPTY
jr nz, .break
; Check top right
ld d, h
ld e, l
ld a, d
sub HITBOX_SIZE / 2
ld d, a
ld a, e
add HITBOX_SIZE / 2
ld e, a
push hl
call GetLogicTile
pop hl
; If a is not zero, break
cp MAP_ENTITY_EMPTY
jr nz, .break
; Check bottom right
ld d, h
ld e, l
ld a, d
add HITBOX_SIZE / 2
ld d, a
ld a, e
add HITBOX_SIZE / 2
ld e, a
push hl
call GetLogicTile
pop de
; If a is not zero, break
cp MAP_ENTITY_EMPTY
jr nz, .break
; Every checks has passed, return 1
xor a
ret
.break
ld a, 1
ret
; Checks if the player presses A on an interactable tile
CheckInteraction::
; We handle the buttons first
ld a, [joypadButtons]
ld b, a
ld a, [joypadButtonsOld]
call GetNewlyPushedButtons
; We only check for the a button
bit 0, a
; We immediately return if a is not newly pressed
ret z
ld a, [characterDirection]
and %00110000
cp a, CHARACTER_DIRECTION_LEFT
jr z, .facingLeft
cp a, CHARACTER_DIRECTION_RIGHT
jr z, .facingRight
cp a, CHARACTER_DIRECTION_UP
jr z, .facingUp
cp a, CHARACTER_DIRECTION_DOWN
jr z, .facingDown
; Load the Y offset in d and the X offset in e
.facingLeft
ld d, 0
ld e, -INTERACTION_RANGE
jr .checkInteraction
.facingRight
ld d, 0
ld e, INTERACTION_RANGE
jr .checkInteraction
.facingUp
ld d, -INTERACTION_RANGE
ld e, 0
jr .checkInteraction
.facingDown
ld d, INTERACTION_RANGE
ld e, 0
jr .checkInteraction
.checkInteraction
; Compute the Y position to check
ld a, [characterPositionY]
add d
ld d, a
; Compute the X position to check
ld a, [characterPositionX]
add e
ld e, a
; Get the tile value
call GetLogicTile
cp MAP_ENTITY_FLAG
jr z, .handleFlagInteraction
cp MAP_ENTITY_CHICKEN
jr z, .handleChickenInteraction
cp MAP_ENTITY_NPC
jr z, .handleNpcInteraction
; Other tiles don't do anything when interacted with
ret
.handleFlagInteraction
ld a, MAP_STATE_TALKING
ld [mapState], a
; We show the window
ld a, 1
ld [shadowWindow], a
; We clear the textbox string
call ClearTextboxText
; We put the chicken text in
ld de, flagRam
ld hl, textboxText
ld b, 0
ld a, [flagLengthRam]
ld c, a
call MemCpy
ret
.handleChickenInteraction
ld a, MAP_STATE_TALKING
ld [mapState], a
; We show the window
ld a, 1
ld [shadowWindow], a
; We clear the textbox string
call ClearTextboxText
; We put the chicken text in
ld de, chickenText
ld hl, textboxText
ld bc, chickenText.end - chickenText
call MemCpy
ret
.handleNpcInteraction
ld a, MAP_STATE_NPC
ld [mapState], a
; We show the window
ld a, 1
ld [shadowWindow], a
; We clear the textbox string
call ClearTextboxText
; We put the chicken text in
ld de, npcText
ld hl, textboxText
ld bc, npcText.end - npcText
call MemCpy
ret
; Check if the point collides with a solid object
; @param d Y position of the point to check
; @param e X position oof the point to check
; returns a The enum value of the object
GetLogicTile:
; Divides each componnents by 8 to remove subpixels
ld a, d
and a, %11111000
ld d, a
; Adresses are on 10 bits, 5 for X and 5 for Y
; The 5 X bits are the lower 5 bits of tthe lower register(e in the case of de)
srl e
srl e
srl e
; The 5 bits of Y are a bit more complicated:
; The 3 lower bits of y are the 3 higher bits of e...
sla a
sla a
or e
ld e, a
; ... while the 2 higher bits of y are the 2 lower bits of d
ld a, d
srl a
srl a
srl a
srl a
srl a
srl a
ld d, a
; We load the logic map address and add the calculated offset
ld hl, mapLogic
add hl, de
; We fetch the logic byte
ld a, [hl]
ret
DrawWindow:
ld a, [shadowWindow]
cp 0
jr z, .windowOff
; Turn window on
ld a, [rLCDC]
set 5, a
ld [rLCDC], a
; We draw the two lines of text on the window
ld de, textboxText
ld hl, _SCRN1 + $21
ld bc, TEXTBOX_LINE_LENGTH
call MemCpy
ld hl, _SCRN1 + $41
ld bc, TEXTBOX_LINE_LENGTH
call MemCpy
; Check if we're talking to the NPC for the 3rd line
ld a, [mapState]
cp MAP_STATE_NPC
jr z, :+
; Not talking to NPC
; Clear the yes/no text
xor a
ld hl, _SCRN1 + $61
ld bc, TEXTBOX_LINE_LENGTH
call MemSet
ret
: ; talking to NPC
ld de, yesNoText
ld hl, _SCRN1 + $61
ld bc, yesNoText.end - yesNoText
call MemCpy
; place cursor in NPS window
ld a, [npcCursorPosition]
ld hl, _SCRN1
ld l, a
; cursor tile index
ld a, $91
ld [hl], a
ret
.windowOff
; Turn window off
ld a, [rLCDC]
res 5, a
ld [rLCDC], a
ret
ClearTextboxText:
; We set the textbox text to be empty
xor a
ld hl, textboxText
ld bc, textboxText.end - textboxText
call MemSet
ret
chickenText:
DB "poc poc", $01
.end
npcText:
DB "Connect to the other side?"
.end
yesNoText:
DB " yes no"
.end
SECTION FRAGMENT "Game Loop", ROMX, ALIGN[8]
mapTileMap:
INCBIN "res/map_tilemap.bin"
.end
mapAttributes:
INCBIN "res/map_attributes.bin"
.end
mapLogic:
INCBIN "res/map_logic.bin"
.end
mapWindowTileMap:
INCBIN "res/map_window_tilemap.bin"
.end
mapWindowAttributes:
INCBIN "res/map_window_attributes.bin"
.end
| 18.577236 | 89 | 0.63058 |
0970204ace29a437bcd135a49caadfdfa8278184 | 109 | asm | Assembly | 10.12Q1A.asm | vkmanojk/Simulation-8051 | 935ca9fc642cd2f2c082a440e241a0b052de4546 | [
"MIT"
] | 1 | 2019-07-26T13:09:51.000Z | 2019-07-26T13:09:51.000Z | 10.12Q1A.asm | vkmanojk/Simulation-8051 | 935ca9fc642cd2f2c082a440e241a0b052de4546 | [
"MIT"
] | null | null | null | 10.12Q1A.asm | vkmanojk/Simulation-8051 | 935ca9fc642cd2f2c082a440e241a0b052de4546 | [
"MIT"
] | null | null | null | ORG 0000
MOV PSW, #00H
MOV R0,#05H
MOV A, R0
MOV PSW, #10H
MOV R0, A
MOV PSW, #00H
MOV PSW, #10H
| 9.909091 | 14 | 0.577982 |
d7dd8d7e12a8cac28c198a361bbeb461e6696815 | 204 | asm | Assembly | data/pokemon/dex_entries/rhyhorn.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/pokemon/dex_entries/rhyhorn.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/pokemon/dex_entries/rhyhorn.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | db "SPIKES@" ; species name
dw 303, 2540 ; height, weight
db "It can remember"
next "only one thing at"
next "a time. Once it"
page "starts rushing, it"
next "forgets why it"
next "started.@"
| 18.545455 | 30 | 0.656863 |
3f81b36b154f5e3b5770a15de64667a6f0c48462 | 332 | asm | Assembly | oeis/174/A174491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/174/A174491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/174/A174491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A174491: Denominator in the coefficient of x^n in exp( Sum_{m>=1} x^m/(m*2^(m^2)) ).
; 1,2,32,512,262144,33554432,137438953472,562949953421312,147573952589676412928,2417851639229258349412352,2535301200456458802993406410752,2658455991569831745807614120560689152
mov $1,$0
pow $0,2
mov $2,2
pow $2,$0
gcd $1,$2
mul $1,$2
mov $0,$1
| 30.181818 | 175 | 0.759036 |
0a3c566a4ad2b696e245141066357fec3e7a0a56 | 1,695 | asm | Assembly | day 1/Day1.asm | chris-pie/aoc2019 | e644733abdbc4fdaca34f4d9ded1f37a389e2dcf | [
"MIT"
] | null | null | null | day 1/Day1.asm | chris-pie/aoc2019 | e644733abdbc4fdaca34f4d9ded1f37a389e2dcf | [
"MIT"
] | null | null | null | day 1/Day1.asm | chris-pie/aoc2019 | e644733abdbc4fdaca34f4d9ded1f37a389e2dcf | [
"MIT"
] | null | null | null | extern CreateFileA : PROC
extern GetLastError : PROC
extern ReadFile : PROC
extern WriteFile : PROC
extern GetStdHandle : PROC
extern ExitProcess : PROC
.data
handle dq 0
file_name db "Day 1.txt"
bufin db 100 dup(0)
numread dq 0
.CODE
Day1 PROC
mov r14, 0
mov rcx, OFFSET file_name
mov rdx, 80000000h
mov r8, 1
mov r9, 0
push 0
push 128
push 3
sub rsp, 8*4
call CreateFileA
add rsp, 8*7
mov handle, rax
ReadFromFile:
mov rcx, handle
mov rdx, OFFSET bufin
mov r8, 100
mov r9, OFFSET numread
push 0
sub rsp, 8*4
call ReadFile
add rsp, 8*5
cmp numread, 0
je DoneReadingFile
sub r15, 100
cmp r12, 10
je ReadNumber
xor r15, r15
mov r12, 10
mov r13, OFFSET bufin
push 0
ReadNumber:
pop rax
ReadChar:
cmp r15, numread
jge ReadFromFileBis
mov cl, [r13+r15]
cmp cl, 0Dh
je DoneReadingNumber
add r15, 1
sub cl, '0'
mul r12
add rax, rcx
jmp ReadChar
ReadFromFileBis:
push rax
jmp ReadFromFile
DoneReadingFile:
pop rax
DoneReadingNumber:
add r15, 2
mov r8, 3
xor r10, r10
mov r11, 0
CountFuel:
idiv r8
sub rax, 2
mov rdx, rax
shr rdx, 63
xor rdx, 1
mul rdx
add r14, rax
cmp rax, 0
jg CountFuel
push 0
cmp numread, 0
jne ReadNumber
mov rax, r14
mov r14, OFFSET bufin
add r14, 99
mov r13, r14
MakeAsciiCharacter:
xor rdx, rdx
mov rcx, 10
idiv rcx
add rdx, '0'
mov [r14], dl
dec r14
cmp rax, 0
jne MakeAsciiCharacter
mov r12, OFFSET bufin
MoveToBeginning:
inc r14
mov al, [r14]
mov [r12], al
inc r12
cmp r14, r13
jne MoveToBeginning
xor rax, rax
mov [r12], rax
mov rcx, -11
sub rsp, 8*4
call GetStdHandle
mov rcx, rax
mov r13, OFFSET bufin
sub r12, r13
mov rdx, r13
mov r8, r12
add r12, r13
add r12, 1
mov r9, r14
push 0
call WriteFile
add rsp, 8*5
mov rcx, 0
call ExitProcess
Day1 ENDP
END | 12.107143 | 26 | 0.738053 |
f18b8fb0274421fa8822ca929219ea5a2a3cf982 | 235 | asm | Assembly | programs/oeis/017/A017611.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017611.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017611.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017611: (12n+7)^7.
; 823543,893871739,27512614111,271818611107,1522435234375,6060711605323,19203908986159,51676101935731,122987386542487,266001988046875,532875860165503,1002544368429379,1789940649848551
mul $0,12
add $0,7
pow $0,7
| 33.571429 | 183 | 0.838298 |
261ce16f44668310e083db21ae06c8c5ffef8872 | 4,902 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0.log_21829_68.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0.log_21829_68.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0.log_21829_68.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %rcx
lea addresses_WC_ht+0x1280, %r8
nop
nop
add %r12, %r12
movb $0x61, (%r8)
nop
inc %r12
pop %rcx
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rax
push %rbp
push %rcx
// Store
mov $0x480, %r10
nop
nop
nop
nop
nop
cmp %rcx, %rcx
movw $0x5152, (%r10)
nop
nop
nop
add $57652, %rax
// Load
mov $0x400, %rbp
clflush (%rbp)
nop
cmp $26781, %r14
mov (%rbp), %eax
nop
nop
nop
nop
nop
cmp $53105, %rcx
// Load
lea addresses_UC+0x4fd9, %rax
nop
nop
inc %r14
movb (%rax), %cl
nop
nop
sub $50643, %rax
// Load
lea addresses_PSE+0x6280, %r10
xor $22709, %rcx
mov (%r10), %ax
nop
and $60267, %rbp
// Faulty Load
lea addresses_PSE+0x5a80, %rbp
clflush (%rbp)
nop
nop
nop
dec %r13
mov (%rbp), %r15w
lea oracles, %rcx
and $0xff, %r15
shlq $12, %r15
mov (%rcx,%r15,1), %r15
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_P', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_P', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 45.388889 | 2,999 | 0.652183 |
f8296673cb3f5eecf4b93f861f58f863cca05b69 | 708 | asm | Assembly | oeis/160/A160682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/160/A160682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/160/A160682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A160682: The list of the A values in the common solutions to 13*k+1 = A^2 and 17*k+1 = B^2.
; Submitted by Jon Maiga
; 1,14,209,3121,46606,695969,10392929,155197966,2317576561,34608450449,516809180174,7717529252161,115246129602241,1720974414781454,25699370092119569,383769576967012081,5730844284413061646,85578894689228912609,1277952576054020627489,19083709746121080499726,284977693615762186868401,4255581694490311722526289,63548747723738913651025934,948975634161593393042862721,14171085764700161981991914881,211617310836340836336835860494,3160088576780412383070545992529,47189711340869844909721354027441
lpb $0
sub $0,1
add $3,1
mov $1,$3
mul $1,13
add $2,$1
add $3,$2
lpe
mov $0,$2
add $0,1
| 47.2 | 487 | 0.830508 |
b2d71278789606d13a588fea7571148f29e5b753 | 199 | asm | Assembly | libs/Libmy/ASM/src/asm_isneg.asm | DarkyZShadow/my_printf | 4d1b3519dc430e347dd57ed2d1b2460fc16bb3c4 | [
"MIT"
] | null | null | null | libs/Libmy/ASM/src/asm_isneg.asm | DarkyZShadow/my_printf | 4d1b3519dc430e347dd57ed2d1b2460fc16bb3c4 | [
"MIT"
] | null | null | null | libs/Libmy/ASM/src/asm_isneg.asm | DarkyZShadow/my_printf | 4d1b3519dc430e347dd57ed2d1b2460fc16bb3c4 | [
"MIT"
] | null | null | null | ;
; int asm_isneg(int n)
;
BITS 64
SECTION .text
GLOBAL asm_isneg
asm_isneg:
CMP EDI, 0
JS _less
_greater:
MOV RAX, 0
JMP _end
_less:
MOV RAX, 1
_end:
RET
| 8.652174 | 36 | 0.562814 |
f9b152a8b3e26f76ccda15b514046c580d3ccebe | 316 | asm | Assembly | libsrc/adt/linkedlist/adt_ListDelete.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/adt/linkedlist/adt_ListDelete.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/adt/linkedlist/adt_ListDelete.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void adt_ListDelete(struct adt_List *list, void *delete)
; CALLER linkage for function pointers
SECTION code_clib
PUBLIC adt_ListDelete
PUBLIC _adt_ListDelete
EXTERN asm_adt_ListDelete
.adt_ListDelete
._adt_ListDelete
pop bc
pop de
pop hl
push hl
push de
push bc
jp asm_adt_ListDelete
| 15.047619 | 58 | 0.762658 |
48ef8f0296c5a3e5a24f07dcc0d8a1dc886c2386 | 4,553 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_21829_1471.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_21829_1471.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_21829_1471.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %r9
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_WT+0x18d70, %rsi
lea addresses_WC+0x12658, %rdi
nop
nop
nop
nop
and %r9, %r9
mov $98, %rcx
rep movsq
cmp %r9, %r9
// REPMOV
lea addresses_US+0x9d58, %rsi
lea addresses_RW+0x19058, %rdi
nop
nop
nop
nop
nop
xor $55541, %r11
mov $16, %rcx
rep movsw
nop
and %r15, %r15
// Store
lea addresses_US+0x509c, %r12
and %rdi, %rdi
movl $0x51525354, (%r12)
nop
xor %r13, %r13
// Faulty Load
lea addresses_US+0x3258, %r12
nop
nop
cmp $15518, %rsi
movups (%r12), %xmm7
vpextrq $0, %xmm7, %r11
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_US', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_RW', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'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
*/
| 54.855422 | 2,999 | 0.658687 |
17ec1a051feea0dfc57f767fa333feaee746c0a0 | 6,423 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1555.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1555.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1555.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1bddb, %rsi
lea addresses_WC_ht+0xfceb, %rdi
nop
nop
nop
nop
nop
and $43784, %rdx
mov $120, %rcx
rep movsb
nop
nop
nop
add %rsi, %rsi
lea addresses_WT_ht+0x191db, %rsi
lea addresses_WC_ht+0x183db, %rdi
nop
nop
nop
xor %rax, %rax
mov $108, %rcx
rep movsw
xor $13372, %rsi
lea addresses_UC_ht+0x547b, %rdx
nop
nop
nop
add %r11, %r11
mov (%rdx), %rax
nop
nop
nop
nop
nop
and %r11, %r11
lea addresses_D_ht+0x132b3, %rdi
nop
nop
nop
nop
add %r12, %r12
mov (%rdi), %r11
add $44278, %rax
lea addresses_D_ht+0x7d27, %rax
nop
nop
add $34242, %r12
mov $0x6162636465666768, %rcx
movq %rcx, (%rax)
nop
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0xec81, %rsi
lea addresses_A_ht+0x19adb, %rdi
inc %r11
mov $117, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $6084, %r12
lea addresses_WT_ht+0x1e372, %rdx
dec %rsi
mov $0x6162636465666768, %rdi
movq %rdi, (%rdx)
nop
nop
nop
add %r12, %r12
lea addresses_D_ht+0xb9db, %rdi
nop
nop
nop
and $50113, %r11
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rdx
nop
nop
nop
nop
xor %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rax
push %rcx
push %rsi
// Store
lea addresses_D+0x1dfdb, %rax
nop
nop
nop
nop
nop
inc %r9
movb $0x51, (%rax)
nop
nop
nop
sub $31667, %rcx
// Store
lea addresses_WT+0x1505b, %rsi
nop
nop
nop
nop
cmp $2455, %r9
movb $0x51, (%rsi)
nop
and %r9, %r9
// Faulty Load
lea addresses_normal+0x73db, %r10
cmp %r14, %r14
mov (%r10), %ecx
lea oracles, %r9
and $0xff, %rcx
shlq $12, %rcx
mov (%r9,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'dst': {'same': True, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 36.702857 | 2,999 | 0.65717 |
a2d58dd78258b927fcbe2306b249731d98d3b31c | 2,574 | asm | Assembly | kernel/x86/pic.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | 1 | 2021-03-21T19:49:05.000Z | 2021-03-21T19:49:05.000Z | kernel/x86/pic.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | null | null | null | kernel/x86/pic.asm | leonardoruilova/xos | 1e72d2294a7373dbbd601e6796a8a95d0d7056a8 | [
"MIT"
] | null | null | null |
;; xOS32
;; Copyright (C) 2016-2017 by Omar Mohammad.
use32
IRQ_BASE = 0x30
; pic_init:
; Initializes the PIC
pic_init:
mov esi, .starting_msg
call kprint
mov al, IRQ_BASE
mov ah, IRQ_BASE+8
call pic_remap
; cascade
mov al, IRQ_BASE+2
mov ebp, pic_cascade
call install_isr
; master spurious
mov al, IRQ_BASE+7
mov ebp, pic1_spurious
call install_isr
; slave spurious
mov al, IRQ_BASE+15
mov ebp, pic2_spurious
call install_isr
; unmask the cascade IRQ so that IRQs from the slave PIC can happen
mov al, 2
call pic_unmask
sti
mov al, 0x20
out 0x20, al
out 0xA0, al
ret
.starting_msg db "Reprogamming IRQs...",10,0
; pic_cascade:
; IRQ 2 (Cascade) Handler
pic_cascade:
iret
; pic1_spurious:
; IRQ 7 (Master Spurious) Handler
pic1_spurious:
push eax
mov al, 0x0B ; read ISR register
out 0x20, al
call iowait
in al, 0x20
test al, 0x80
jz .quit
mov al, 0x20
out 0x20, al
.quit:
pop eax
iret
; pic2_spurious:
; IRQ 15 (Slave Spurious) Handler
pic2_spurious:
push eax
mov al, 0x0B
out 0xA0, al
call iowait
in al, 0xA0
test al, 0x80
jz .quit
mov al, 0x20
out 0xA0, al
.quit:
mov al, 0x20
out 0x20, al
pop eax
iret
; pic_remap:
; Remaps the PIC
; In\ AL = Master PIC Vector
; In\ AH = Slave PIC Vector
; Out\ Nothing
pic_remap:
mov [.master], al
mov [.slave], ah
; save masks
in al, 0x21
mov [.data1], al
call iowait
in al, 0xA1
mov [.data2], al
call iowait
mov al, 0x11 ; initialize command
out 0x20, al
call iowait
mov al, 0x11
out 0xA0, al
call iowait
mov al, [.master]
out 0x21, al
call iowait
mov al, [.slave]
out 0xA1, al
call iowait
mov al, 4
out 0x21, al
call iowait
mov al, 2
out 0xA1, al
call iowait
mov al, 1
out 0x21, al
call iowait
mov al, 1
out 0xA1, al
call iowait
; restore masks
mov al, [.data1]
out 0x21, al
call iowait
mov al, [.data2]
out 0xA1, al
call iowait
ret
.master db 0
.slave db 0
.data1 db 0
.data2 db 0
; pic_mask:
; Masks an IRQ
; In\ AL = IRQ number
; Out\ Nothing
pic_mask:
cmp al, 8
jge .slave
.master:
mov cl, al
mov dl, 1
shl dl, cl
in al, 0x21
or al, dl
out 0x21, al
ret
.slave:
sub al, 8
mov cl, al
mov dl, 1
shl dl, cl
in al, 0xA1
or al, dl
out 0xA1, al
ret
; pic_unmask:
; Unmasks a PIC IRQ
; In\ AL = IRQ
; Out\ Nothing
pic_unmask:
cmp al, 8
jge .slave
.master:
mov cl, al
mov dl, 1
shl dl, cl
in al, 0x21
not dl
and al, dl
out 0x21, al
ret
.slave:
sub al, 8
mov cl, al
mov dl, 1
shl dl, cl
in al, 0xA1
not dl
and al, dl
out 0xA1, al
ret
| 11.240175 | 68 | 0.656954 |
15d7eaab587b409069b1c12edd6a5812de3a4139 | 432 | asm | Assembly | examples/semihash.asm | kspalaiologos/asmbf | c98a51d61724a46855de291a27d68a49a034810b | [
"MIT"
] | 67 | 2020-08-03T06:26:35.000Z | 2022-03-24T19:50:51.000Z | test/semihash.asm | pyautogui/asmbf | 37c54a8a62df2fc4bab28bdeb43237b4905cbecd | [
"MIT"
] | 55 | 2019-10-02T19:37:08.000Z | 2020-06-12T19:40:53.000Z | test/semihash.asm | pyautogui/asmbf | 37c54a8a62df2fc4bab28bdeb43237b4905cbecd | [
"MIT"
] | 9 | 2019-05-18T11:59:41.000Z | 2020-06-21T20:40:25.000Z | ; Wrap everything in a loop.
@l
; Read a character from stdin.
in r1
; if r1 = ';', set the condition flag.
ceq r1,.;
; if condition flag is set, add 1 to r2
; r2 is used as an accumulator.
cad r2,1
; if r1 = '#', set the condition flag.
ceq r1,.#
; if condition flag is not set, jump to d
cjz %d
; display acc%127 and clear it.
mod r2,127
out r2
clr r2
@d
; loop if didn't hit an EOF
jnz r1, %l | 21.6 | 41 | 0.608796 |
b5a04a75e057cb12c4182bad67421964c843c79e | 603 | asm | Assembly | programs/oeis/194/A194082.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/194/A194082.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194082.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A194082: Sum{floor(sqrt(3)*k/2) : 1<=k<=n}
; 0,1,3,6,10,15,21,27,34,42,51,61,72,84,96,109,123,138,154,171,189,208,227,247,268,290,313,337,362,387,413,440,468,497,527,558,590,622,655,689,724,760,797,835,873,912,952,993,1035,1078,1122,1167,1212
mov $14,$0
mov $16,$0
lpb $16
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
lpb $13
clr $0,11
mov $0,$11
sub $13,1
sub $0,$13
mov $2,$0
mul $2,13
sub $2,1
mod $2,15
lpb $2
mov $2,1
mov $3,14
lpe
mov $1,$3
div $1,13
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
| 18.272727 | 199 | 0.543947 |
41e3c3348b6a7f35cda9ed2af622690dfa50eda1 | 593 | asm | Assembly | libsrc/stdio_new/file/general/stdio_findfilestruct.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/stdio_new/file/general/stdio_findfilestruct.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/stdio_new/file/general/stdio_findfilestruct.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ; stdio_findfilestruct
; 07.2009 aralbrec
PUBLIC stdio_findfilestruct
EXTERN stdio_findfdstruct
EXTERN _stdio_filetbl, LIBDISP_STDIO_FINDFDSTRUCT
; return address of table entry holding file struct address
;
; enter : ix = FILE *
; exit : hl = & stdio_filetbl[FILEentry] + 1, carry reset
; carry set if FILE* not in filetbl
; uses : af, b, hl
INCLUDE "../../stdio.def"
.stdio_findfilestruct
ld b,STDIO_NUMFILE + 3 ; include stdin / stdout / stderr in this search
ld hl,_stdio_filetbl - 6
jp stdio_findfdstruct + LIBDISP_STDIO_FINDFDSTRUCT ; save a few bytes
| 24.708333 | 79 | 0.725126 |
8f6f4cccbb1cc575becffed57eeeac77da1a8f36 | 373 | asm | Assembly | programs/oeis/290/A290651.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/290/A290651.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/290/A290651.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A290651: a(n) = 5 - 2^(n - 1) + 3^(n - 1) + n - 2.
; 4,6,11,26,73,220,675,2070,6317,19184,58039,175114,527361,1586148,4766603,14316158,42981205,129009112,387158367,1161737202,3485735849,10458256076,31376865331,94134790246,282412759293,847255055040,2541798719495,7625463267290
mov $2,1
mov $3,$0
lpb $0
sub $0,1
mul $1,3
add $1,$2
mul $2,2
lpe
add $1,4
add $1,$3
| 26.642857 | 224 | 0.697051 |
d08b954b569c4fb18d91ba367733d58b4498f290 | 22,155 | asm | Assembly | Appl/Icon/Preview/previewPreview.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Icon/Preview/previewPreview.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Icon/Preview/previewPreview.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Preview
FILE: previewPreview.asm
AUTHOR: Steve Yegge, Jul 30, 1992
ROUTINES:
Name Description
---- -----------
DBViewerUpdatePreviewArea - calls SetPreviewMonikers with current icon
DBViewerSetPreviewObject - sets-usable a single preview object
SetAllUnusable - sets all preview objects unusable
DBViewerApplyPreviewColorChanges- sets all preview objects to current colors
ChangePreviewObjectColors - sets colors for a specific object
PreviewGetColorSelectorColors - looks in dialog box for the colors
SetColorSelectorSelections - sets color-dialog toolbox colors
SetPreviewMonikers - sets the monikers
ResizeScrollingList - they don't resize automatically...
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 7/30/92 Initial revision
DESCRIPTION:
This file contains the routines to allow the 'colors' dialog
box to change its own colors and those of the preview objects.
The preview objects are generic objects that you can place
your icon into to see what it will look like, and for tools
and triggers you can also change the background color to a
mix of 2 VGA colors.
$Id: previewPreview.asm,v 1.1 97/04/04 16:06:12 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
idata segment
;-----------------------------------------------------------------------------
;
; Here are the declarations necessary for creating a moniker
; containing a reference to a bitmap on an lmem heap.
;
;-----------------------------------------------------------------------------
VMH2 label VisMoniker
VisMoniker < <0,1,DAR_NORMAL,>, , >
VMGS2 label VisMonikerGString
VisMonikerGString < >
GSBeginString ; takes no space
OPDB label OpDrawBitmapOptr
OpDrawBitmapOptr <,0,0,0>
GSEndString
VMH2_SIZE equ $ - VMH2
idata ends
PreviewCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DBViewerUpdatePreviewArea
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sets the monikers of the preview objects to the current bitmap
CALLED BY: MSG_DB_VIEWER_UPDATE_PREVIEW_AREA
PASS: *ds:si = DBViewer object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
One thing we have to do is make sure the scrolling item group
is the right height & width (since it refuses to resize itself
to fit its children's monikers.) We calculate how big it
should be and send it a MSG_GEN_SET_FIXED_SIZE.
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 10/ 1/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DBViewerUpdatePreviewArea proc far
uses ax,bx,cx,dx,si,di
.enter
push si
mov bx, ds:[LMBH_handle]
mov si, offset BMO
mov di, mask MF_CALL
mov ax, MSG_VIS_BITMAP_GET_MAIN_BITMAP
call ObjMessage ; returns ^vcx:dx
pop si
call SetPreviewMonikers
.leave
ret
DBViewerUpdatePreviewArea endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DBViewerSetPreviewObject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set-enabled the desired preview object and disable others.
CALLED BY: MSG_DB_VIEWER_SET_PREVIEW_OBJECT
PASS: es = dgroup
cx = object type (PreviewGroupInteractionObject)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Sets the currently displayed preview object to whatever menu
selection was returned in cx.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 7/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DBViewerSetPreviewObject proc far
uses ax,bx,cx,dx,si,di,bp
.enter
;
; First set all the other children unusable. Of course later
; when the database is implemented I'll just check to see
; which one we're currently viewing and disable that one.
;
call SetAllUnusable
;
; set up for a call to ObjMessage
;
mov ax, MSG_GEN_SET_USABLE
mov di, mask MF_CALL
mov dl, VUM_NOW
;
; Now set-usable the appropriate selection
;
mov bx, cx ; offset into table
mov bx, cs:[objectTable][bx]
jmp bx
objectTable nptr trigger,
tool,
scrollableList,
bulletedList
trigger:
GetResourceHandleNS TriggerGroup, bx
mov si, offset TriggerGroup
jmp short done
tool:
GetResourceHandleNS ToolGroup, bx
mov si, offset ToolGroup
jmp short done
scrollableList:
GetResourceHandleNS ScrollableListGroup, bx
mov si, offset ScrollableListGroup
jmp short done
bulletedList:
GetResourceHandleNS BulletedListGroup, bx
mov si, offset BulletedListGroup
jmp short done
done:
call ObjMessage ; set-usable the object
.leave
ret
DBViewerSetPreviewObject endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetAllUnusable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: sets all the children of the preview group unusable
CALLED BY: PreviewSetPreviewObject, FindIcon
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
- sets all 4 groups unusable
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 7/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetAllUnusable proc near
uses ax,bx,cx,dx,si,di
.enter
GetResourceHandleNS TriggerGroup, bx
mov si, offset TriggerGroup
mov di, mask MF_CALL
mov ax, MSG_GEN_SET_NOT_USABLE
mov dl, VUM_NOW
call ObjMessage
GetResourceHandleNS ToolGroup, bx
mov si, offset ToolGroup
mov di, mask MF_CALL
mov ax, MSG_GEN_SET_NOT_USABLE
mov dl, VUM_NOW
call ObjMessage
GetResourceHandleNS ScrollableListGroup, bx
mov si, offset ScrollableListGroup
mov di, mask MF_CALL
mov ax, MSG_GEN_SET_NOT_USABLE
mov dl, VUM_NOW
call ObjMessage
GetResourceHandleNS BulletedListGroup,bx
mov si, offset BulletedListGroup
mov di, mask MF_CALL
mov ax, MSG_GEN_SET_NOT_USABLE
mov dl, VUM_NOW
call ObjMessage
.leave
ret
SetAllUnusable endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DBViewerApplyPreviewColorChanges
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Applies the color changes to all preview objects.
CALLED BY: MSG_DB_VIEWER_APPLY_PREVIEW_COLOR_CHANGES
PASS: *ds:si = DBViewerObject
ds:di = DBViewerInstance
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
This message is called when the user selects a new color
from one of the color selectors in the preview dialog.
We want to save their changes into the database, so we
call the dirty-database routine, and then change the
colors in the preview objects.
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 8/ 3/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DBViewerApplyPreviewColorChanges proc far
uses ax, cx, dx, bp
.enter
mov ax, MSG_GEN_DOCUMENT_MARK_DIRTY
call ObjCallInstanceNoLock
mov ax, MSG_DB_VIEWER_MARK_ICON_DIRTY
call ObjCallInstanceNoLock
call ChangePreviewObjectColors
.leave
ret
DBViewerApplyPreviewColorChanges endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChangePreviewObjectColors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the colors for all the preview objects.
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
This routine changes the BackgroundColors struct information in
all of the preview objects, enabled or no.
First we call a helper routine that puts the current selections
from the Preview Colors dialog box into cx and dx:
ch = selected ("on") color 1
cl = selected ("on") color 2
dh = unselected ("off") color 1
dl = unselected ("off") color 2
Then we call the message defined for each of the color-generic
objects that changes all 4 colors
(MSG_DB_VIEWER_COLOR_<BLAH>_SET_ALL_COLORS)
for each of the preview objects.
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 12/10/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChangePreviewObjectColors proc far
uses ax,bx,cx,dx,si,di,bp
.enter
;
; First get all 4 colors into ch, cl, dh, dl.
;
call PreviewGetColorSelectorColors
push cx, dx ; save the colors
;
; Change off-trigger colors (from dh and dl)
;
GetResourceHandleNS Trigger1, bx
mov si, offset Trigger1
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov ax, MSG_ICON_COLOR_TRIGGER_SET_COLORS
mov di, mask MF_CALL
call ObjMessage
;
; change tool colors
;
pop cx, dx ; restore colors
push cx, dx ; save colors
GetResourceHandleNS Tool1, bx
mov si, offset Tool1
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
pop cx, dx ; restore colors
push cx, dx ; save colors
GetResourceHandleNS Tool2, bx
mov si, offset Tool2
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
;
; Change scrollable-list item colors
;
pop cx, dx ; restore colors
push cx, dx ; save colors
GetResourceHandleNS ScrollableListItem1, bx
mov si, offset ScrollableListItem1
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
pop cx, dx ; restore colors
push cx, dx ; save colors
GetResourceHandleNS ScrollableListItem2, bx
mov si, offset ScrollableListItem2
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
;
; Change bulleted list item colors
;
pop cx, dx ; restore colors
push cx, dx ; save colors
GetResourceHandleNS BulletedListItem1, bx
mov si, offset BulletedListItem1
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
pop cx, dx ; restore colors
GetResourceHandleNS BulletedListItem2, bx
mov si, offset BulletedListItem2
mov bp, mask COCTS_ON_ONE or \
mask COCTS_ON_TWO or \
mask COCTS_OFF_ONE or \
mask COCTS_OFF_TWO
mov di, mask MF_CALL
mov ax, MSG_ICON_COLOR_LIST_ITEM_SET_COLORS
call ObjMessage
.leave
ret
ChangePreviewObjectColors endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PreviewGetColorSelectorColors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gets the selections from the 4 color selectors into cx and dx
CALLED BY: ApplyPreviewColorChanges, SavePreviewStuff
PASS: nothing
RETURN: ch = on color 1
cl = on color 2
dh = off color 1
dl = off color 2
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Sends a MSG_GEN_ITEM_GROUP_GET_SELECTION to each of the color
selectors. That method nukes cx, dx and bp, and returns the
selection in ax.
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 8/ 3/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PreviewGetColorSelectorColors proc far
uses ax,bx,si,di,bp
.enter
GetResourceHandleNS OnColorSelector1, bx
mov si, offset OnColorSelector1
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
mov di, mask MF_CALL
call ObjMessage
push ax ; save on-color 1
GetResourceHandleNS OnColorSelector2, bx
mov si, offset OnColorSelector2
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
mov di, mask MF_CALL
call ObjMessage
push ax ; save on-color 2
GetResourceHandleNS OffColorSelector1, bx
mov si, offset OffColorSelector1
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
mov di, mask MF_CALL
call ObjMessage
push ax ; save off-color 1
GetResourceHandleNS OffColorSelector2, bx
mov si, offset OffColorSelector2
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
mov di, mask MF_CALL
call ObjMessage
mov dl, al ; off-color 2
pop ax ; off-color 1
mov dh, al
pop ax ; on-color 2
mov cl, al
pop ax ; on-color 1
mov ch, al
.leave
ret
PreviewGetColorSelectorColors endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetColorSelectorSelections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the color-selector selections to the new colors.
CALLED BY: SetUpPreviewStuff
PASS: ax = on colorPair
bx = off colorPair
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 9/11/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetColorSelectorSelections proc far
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Set the selections in the color-selectors (ax = on, bp = off)
;
push ax, bx ; save colors
GetResourceHandleNS OnColorSelector1, bx
mov si, offset OnColorSelector1
mov di, mask MF_CALL
clrdw cxdx
mov cl, al
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
call ObjMessage ; nukes ax, cx, dx, bp
pop ax, bx ; restore on & off colors
push bx ; save off colors
GetResourceHandleNS OnColorSelector2, bx
mov si, offset OnColorSelector2
mov di, mask MF_CALL
clrdw cxdx
mov cl, ah ; cl <- color
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
call ObjMessage
;
; Set OffColorSelectors
;
pop ax ; restore off colors
push ax ; ...and save them
mov di, mask MF_CALL
clrdw cxdx ; not indeterminate
mov cl, al
GetResourceHandleNS OffColorSelector1, bx
mov si, offset OffColorSelector1
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
call ObjMessage
pop ax ; restore off colors
GetResourceHandleNS OffColorSelector2, bx
mov si, offset OffColorSelector2
mov di, mask MF_CALL
clrdw cxdx ; not indeterminate
mov cl, ah ; cl <- color
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
call ObjMessage
.leave
ret
SetColorSelectorSelections endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetPreviewMonikers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Takes a bitmap and sets it as the moniker for all the
preview objects.
CALLED BY: GLOBAL
PASS: *ds:si = DBViewer object
cx = vm file handle for bitmap
dx = vm chain for bitmap (block handle)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
In order to avoid having multiple copies of a big moniker in
memory (potentially up to 64k per moniker), we have a special
moniker defined in idata which contains an optr to a bitmap
in an lmem heap somewhere. This allows all the places where
we're using the bitmap in a moniker to be pointing back to
the original bitmap.
Note that we before we can free the old bitmap block, we have
to change all the monikers to point to the new bitmap block,
or there could be synchronization problems.
We also have to resize the scrolling list correctly for the
new moniker.
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 8/13/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetPreviewMonikers proc far
class DBViewerClass
uses ax,bx,cx,dx,si,di,bp
.enter
call ResizeScrollingList
;
; Turn the huge-bitmap into a regular bitmap in its own chunk
; in an lmem heap. (optr = ^lcx:dx)
;
mov bx, es:[OPDB].ODBOP_optr.handle ; get old bitmap block
push cx, dx ; save huge bitmap
call HugeBitmapToSimpleBitmap
LONG jc errorPop2
mov es:[OPDB].ODBOP_optr.handle, cx ; optr to simple bitmap
mov es:[OPDB].ODBOP_optr.chunk, dx
pop cx, dx ; restore bitmap
push bx ; save ye olde block handle
call HugeBitmapGetFormatAndDimensions
;
; Use the grabbed width & height for the cached size of the
; moniker, as well as in the ReplaceVisMonikerFrame. Also
; set the DisplayClass for the moniker, based on the BMFormat.
;
mov es:[VMH2].VM_width, cx
mov es:[VMGS2].VMGS_height, dx
andnf es:[VMH2].VM_type, not mask VMT_GS_COLOR
cmp al, BMF_MONO
je monochrome
cmp al, BMF_4BIT
je fourBit
ornf es:[VMH2].VM_type, DC_COLOR_8
jmp short replaceTheDangThang
fourBit:
ornf es:[VMH2].VM_type, DC_COLOR_4
jmp short replaceTheDangThang
monochrome:
ornf es:[VMH2].VM_type, DC_GRAY_1
replaceTheDangThang:
;
; Set up the stack frame for all the following calls...
;
sub sp, size ReplaceVisMonikerFrame
mov bp, sp
mov ss:[bp].RVMF_sourceType, VMST_FPTR
mov ss:[bp].RVMF_source.segment, es
mov ss:[bp].RVMF_source.offset, offset VMH2
mov ss:[bp].RVMF_dataType, VMDT_VIS_MONIKER
mov ss:[bp].RVMF_width, cx
mov ss:[bp].RVMF_height, dx
mov ss:[bp].RVMF_length, VMH2_SIZE
mov ss:[bp].RVMF_updateMode, VUM_NOW
;
; replace the moniker of the TRIGGER preview object(s)
;
push bp ; save stack frame
GetResourceHandleNS Trigger1, bx
mov si, offset Trigger1
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp ; restore stack frame
;
; replace the moniker of the TOOL preview object(s)
;
push bp
GetResourceHandleNS Tool1, bx
mov si, offset Tool1
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp
push bp ; save locals
GetResourceHandleNS Tool2, bx
mov si, offset Tool2
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp ; restore locals
;
; replace the moniker of the SCROLLABLE LIST preview object(s)
;
push bp
GetResourceHandleNS ScrollableListItem1, bx
mov si, offset ScrollableListItem1
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp
push bp
GetResourceHandleNS ScrollableListItem2, bx
mov si, offset ScrollableListItem2
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp
;
; replace the moniker of the BULLETED LIST preview object(s)
;
push bp
GetResourceHandleNS BulletedListItem1, bx
mov si, offset BulletedListItem1
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
pop bp
GetResourceHandleNS BulletedListItem2, bx
mov si, offset BulletedListItem2
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_REPLACE_VIS_MONIKER
mov dx, size ReplaceVisMonikerFrame
call ObjMessage
add sp, size ReplaceVisMonikerFrame
;
; Now that ALL the monikers are pointing to the new bitmap,
; we can free the old one. If we had done it before, one
; of the objects might've tried to draw the old bitmap
; during this routine (before it had been pointed to the
; new bitmap), and that would have been a Bad Thing.
;
pop bx ; restore the old bitmap
tst bx
jz dontFreeHandle
call MemFree ; free the old lmem heap
dontFreeHandle:
done:
.leave
ret
errorPop2:
pop ax, ax
jmp done
SetPreviewMonikers endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ResizeScrollingList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sends a MSG_GEN_SET_FIXED_SIZE to the scrolling list.
CALLED BY: SetPreviewMonikers
PASS: ^vcx:dx = bitmap
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 10/28/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ResizeScrollingList proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Set the scrolling list's size.
;
call HugeBitmapGetFormatAndDimensions
shl cx ; cx = cx * 2 (2 children)
sub sp, size SetSizeArgs
mov bp, sp
mov ss:[bp].SSA_width, cx
mov ss:[bp].SSA_height, dx
mov ss:[bp].SSA_count, 2
mov ss:[bp].SSA_updateMode, VUM_NOW
GetResourceHandleNS ScrollableListGroup, bx
mov si, offset ScrollableListGroup
mov di, mask MF_CALL or mask MF_STACK
mov ax, MSG_GEN_SET_FIXED_SIZE
mov dx, size SetSizeArgs
call ObjMessage
add sp, size SetSizeArgs
.leave
ret
ResizeScrollingList endp
PreviewCode ends
| 26.854545 | 79 | 0.635477 |
696281c5efa38c6c935b1a1b3d3ab21f846db959 | 486 | asm | Assembly | programs/oeis/117/A117520.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/117/A117520.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/117/A117520.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A117520: Triangular numbers for which the digital root is also a triangular number.
; 0,1,3,6,10,15,21,28,55,66,78,91,105,120,136,190,210,231,253,276,300,325,406,435,465,496,528,561,595,703,741,780,820,861,903,946,1081,1128,1176,1225,1275,1326,1378,1540,1596,1653,1711,1770,1830,1891,2080,2145
mov $2,$0
lpb $2
add $5,$0
lpb $5
mov $1,1
mov $4,$0
mov $5,0
lpe
lpb $4
add $1,$2
mov $2,2
trn $4,7
lpe
add $3,$1
bin $1,$2
trn $2,$3
lpe
mov $0,$1
| 22.090909 | 209 | 0.62963 |
899f4e01bfb83f72be2055a33e9eacb67b14e223 | 36,442 | asm | Assembly | Appl/Startup/BStartup/bsCalibrate.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Startup/BStartup/bsCalibrate.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Startup/BStartup/bsCalibrate.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: bsCalibrate.asm
AUTHOR: Steve Yegge, Jul 15, 1993
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 7/15/93 Initial revision
DESCRIPTION:
$Id: bsCalibrate.asm,v 1.1 97/04/04 16:53:06 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrateCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenContentKbdChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This is the message sent out on any keyboard press or release.
Subclassed to make the a keypress restart the calibration
sequence.
CALLED BY: MSG_VIS_SCREEN_KBD_CHAR
PASS: cx = character value
dl = CharFlags
dh = ShiftState
bp low = ToggleState
bp high = scan code
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS: may restart the calibration process.
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
PW 4/13/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenContentKbdChar method dynamic VisScreenContentClass,
MSG_META_KBD_CHAR
;
; See if we want the event, else pass it on.
;
test dl, mask CF_RELEASE
jnz callSuperClass ; do nothing on release
;
; Restart the calibration sequence
;
restartCalibration::
mov ax, MSG_VIS_SCREEN_RESTART_CALIBRATION
GOTO VisCallFirstChild
callSuperClass:
mov di, offset VisScreenContentClass
GOTO ObjCallSuperNoLock
VisScreenContentKbdChar endm
;-----------------------------------------------------------------------------
; VisScreen methods & routines
;-----------------------------------------------------------------------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenFlashCalibrationPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Flash the current calibration point
CALLED BY: GLOBAL (MSG_VIS_SCREEN_FLASH_CALIBRATION_POINT)
PASS: *DS:SI = VisScreenClass object
DS:DI = VisScreenClassInstance
RETURN: Nothing
DESTROYED: AX, CX, DX, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenFlashCalibrationPoint method dynamic VisScreenClass,
MSG_VIS_SCREEN_FLASH_CALIBRATION_POINT
.enter
;
; Draw the next flash square.
;
test ds:[di].VSI_state, mask VSS_ADVANCE
jnz done
mov bp, ds:[di].VSI_pointCurrent
cmp bp, NUM_CALIBRATION_POINTS
je done
shl bp, 1
shl bp, 1
mov cx, ds:[di].VSI_pointBufferDoc[bp].P_x
mov dx, ds:[di].VSI_pointBufferDoc[bp].P_y
mov si, di
mov di, ds:[si].VSI_gstate
tst di
jz done
;
; See if we need to erase the old image.
;
mov bp, ds:[si].VSI_pointState
tst bp
jnz erase
mov bp, CALIBRATION_FLASH_START
jmp draw
;
; Erase the current flash square.
;
erase:
call CalibrationClearFlash
inc bp
cmp bp, CALIBRATION_FLASH_END
jle draw
mov bp, CALIBRATION_FLASH_START
draw:
call CalibrationDrawFlash
mov ds:[si].VSI_pointState, bp
if 1
;
; This is commented out because we get MSG_META_PTR
; events while the pen is down on the Bullet, even if
; it's not moving.
;
;
; Now check the calibration point
;
mov di, si ; VisScreenInstance => DS:DI
test ds:[di].VSI_state, mask VSS_SELECT
jz done
cmp ds:[di].VSI_calCount, -1
je done ; if no press, do nothing
mov cx, ds:[di].VSI_calPoint.P_x
mov dx, ds:[di].VSI_calPoint.P_y
clr bp ; no override
call CalibrationCheckPoint
endif
done:
.leave
ret
VisScreenFlashCalibrationPoint endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenVisOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a GState to be cached while we're visible
CALLED BY: GLOBAL (MSG_VIS_OPEN)
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClassInstance
bp = Window to open on
RETURN: Nothing
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenVisOpen method dynamic VisScreenClass, MSG_VIS_OPEN
.enter
;
; First call my superclass.
;
mov di, offset VisScreenClass
call ObjCallSuperNoLock
;
; Now create the GState.
;
mov ax, MSG_VIS_VUP_CREATE_GSTATE
call ObjCallSuperNoLock
LONG jnc done ;If no gstate available
mov di, ds:[si]
add di, ds:[di].VisScreen_offset
mov ds:[di].VSI_gstate, bp
;
; Make sure the only the correct state bits are set.
;
clr ds:[di].VSI_state
;
; Get the handle of the current mouse/pen driver, and
; grab the calibration points. We assume that the driver
; is already loaded, and hence we can unload it once
; we've found the handle of the geode.
;
push ds, si
mov ax, GDDT_MOUSE
call GeodeGetDefaultDriver
mov_tr bx, ax
call GeodeInfoDriver
movdw dxcx, ds:[si].DIS_strategy
pop ds, si
mov di, ds:[si]
add di, ds:[di].VisScreen_offset
movdw ds:[di].VSI_driverStrategy, dxcx
;
; Set up the initial calibration points.
;
call SetFakeCalibrationPoints
;
; Create a timer for calibration point flashing
;
mov al, TIMER_EVENT_CONTINUAL
mov bx, ds:[LMBH_handle] ; OD => BX:SI
mov cx, FLASH_INTERVAL ; time till 1st timeout
mov dx, MSG_VIS_SCREEN_FLASH_CALIBRATION_POINT
mov di, cx ; time interval
call TimerStart
mov di, ds:[si]
add di, ds:[di].VisScreen_offset
movdw ds:[di].VSI_timer, bxax
done:
.leave
ret
VisScreenVisOpen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenVisClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clean up any cached data
CALLED BY: MSG_VIS_CLOSE
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClassInstance
RETURN: Nothing
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenVisClose method dynamic VisScreenClass, MSG_VIS_CLOSE
uses ax
.enter
;
; Destroy the GState.
;
clr ax
xchg ax, ds:[di].VSI_gstate
tst ax
jz timer
xchg di, ax
call GrDestroyState
mov_tr di, ax ; ds:di = VisScreenInstance
timer:
;
; Create a timer for calibration point flashing.
;
clr cx
movdw bxax, ds:[di].VSI_timer
movdw ds:[di].VSI_timer, cxcx
tst bx
jz done
call TimerStop
done:
;
; We're done, so call our superclass
;
clr ds:[di].VSI_pointCurrent
.leave
mov di, offset VisScreenClass
GOTO ObjCallSuperNoLock
VisScreenVisClose endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenVisDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the screen
CALLED BY: GLOBAL (MSG_VIS_DRAW)
PASS: *DS:SI = VisScreenClass object
DS:DI = VisScreenClassInstance
BP = GState handle
CL = DrawFlags
RETURN: Nothing
DESTROYED: AX, CX, DX, BP
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenVisDraw method dynamic VisScreenClass, MSG_VIS_DRAW
.enter
;
; First draw the screen
;
mov si, di ; VisScreenInstance => DS:SI
mov di, bp ; GState => DI
call StringDraw
call CalibrationDraw
.leave
ret
VisScreenVisDraw endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenRestartCalibration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Start the whole thing over from the first point.
CALLED BY: MSG_VIS_SCREEN_RESTART_CALIBRATION
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClass instance data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 7/21/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenRestartCalibration method dynamic VisScreenClass,
MSG_VIS_SCREEN_RESTART_CALIBRATION
.enter
ornf ds:[di].VSI_state, mask VSS_IGNORE_NEXT_END_SELECT
call RestartCalibrationCommon
.leave
ret
VisScreenRestartCalibration endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RestartCalibrationCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Common code for restarting calibration
CALLED BY: VisScreenRestartCalibration, VisScreenRedoCalibration
PASS: *ds:si = VisScreen object
ds:di = VisScreenInstance
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 8/24/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RestartCalibrationCommon proc near
class VisScreenClass
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Get out of calibrating mode.
;
mov si, di ; VisScreenInstance => DS:SI
andnf ds:[di].VSI_state, not (mask VSS_SELECT or mask VSS_QUIT or mask VSS_ADVANCE or mask VSS_CALIBRATE)
;
; Clear the current flash point.
;
mov di, ds:[si].VSI_gstate
clr bp
xchg bp, ds:[si].VSI_pointCurrent
shl bp, 1
shl bp, 1 ; since a Point is size 4
mov cx, ds:[si].VSI_pointBufferDoc[bp].P_x
mov dx, ds:[si].VSI_pointBufferDoc[bp].P_y
clr bp
xchg bp, ds:[si].VSI_pointState
call CalibrationClearFlash
mov ds:[si].VSI_calCount, -1
;
; Reset the initial default calibration points.
;
push di ; gstate
mov di, si ; di = instance
call SetFakeCalibrationPoints
pop di
if 0
;
; Invalidate the rectangle that bounds the strings
;
clr ax
mov bx, SCREEN_STRING1_TOP
mov cx, SCREEN_WIDTH
mov dx, SCREEN_STRING4_BOTTOM
call GrInvalRect ; request re-draw
endif
call GrGetWinBounds
call GrInvalRect
.leave
ret
RestartCalibrationCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetFakeCalibrationPoints
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Put in some reasonable default values.
CALLED BY: RestartCalibrationCommon, VisScreenVisOpen
PASS: ds:di = VisScreenInstance
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 9/ 8/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetFakeCalibrationPoints proc near
class VisScreenClass
uses ax
.enter
;
; Write some fake calibration points to prevent the
; calibration from being REALLY screwed up, which can
; cause the penpresses to be over in the hard-icon bar,
; so we don't get any pointer events at all...
;
mov ds:[di+0].VSI_pointBufferRaw.P_x, 64*4096/640
mov ds:[di+0].VSI_pointBufferRaw.P_y, 40*4096/400
mov ds:[di+4].VSI_pointBufferRaw.P_x, 576*4096/640
mov ds:[di+4].VSI_pointBufferRaw.P_y, 40*4096/400
mov ds:[di+8].VSI_pointBufferRaw.P_x, 64*4096/640
mov ds:[di+8].VSI_pointBufferRaw.P_y, 360*4096/400
mov ds:[di+12].VSI_pointBufferRaw.P_x, 576*4096/640
mov ds:[di+12].VSI_pointBufferRaw.P_y, 360*4096/400
call CalibrationSetPoints
;
; Now clear the point buffer...
;
clr ax
czr ax, ds:[di+0].VSI_pointBufferRaw.P_x
czr ax, ds:[di+0].VSI_pointBufferRaw.P_y
czr ax, ds:[di+4].VSI_pointBufferRaw.P_x
czr ax, ds:[di+4].VSI_pointBufferRaw.P_y
czr ax, ds:[di+8].VSI_pointBufferRaw.P_x
czr ax, ds:[di+8].VSI_pointBufferRaw.P_y
czr ax, ds:[di+12].VSI_pointBufferRaw.P_x
czr ax, ds:[di+12].VSI_pointBufferRaw.P_y
;
; Get the points we need into VSI_pointBufferDoc.
;
call CalibrationGetPoints
.leave
ret
SetFakeCalibrationPoints endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenStartSelect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Start a pen selection
CALLED BY: MSG_META_START_SELECT
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClassInstance
(cx,dx) = Mouse position
RETURN: ax = MouseReturnFlags
DESTROYED: cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenStartSelect method dynamic VisScreenClass,
MSG_META_START_SELECT
.enter
ornf ds:[di].VSI_state, mask VSS_SELECT
;
; Set a timer for restarting calibration.
;
push cx, dx ; mouse position
mov bx, ds:[LMBH_handle] ; ^lbx:si = destination
mov al, TIMER_EVENT_ONE_SHOT
mov cx, RESTART_CALIBRATION_TIMEOUT ; 5 seconds or so
mov dx, MSG_VIS_SCREEN_RESTART_CALIBRATION
call TimerStart
pop cx, dx ; mouse position
mov ds:[di].VSI_timerHandle, bx
mov ds:[di].VSI_timerID, ax
;
; Grab the mouse.
;
push cx, dx
mov ax, MSG_VIS_TAKE_GADGET_EXCL
mov cx, ds:[LMBH_handle]
mov dx, si ; our OD => CX:DX
call VisCallParent ; tell parent we want excl
call VisGrabMouse ; grab the mouse
pop cx, dx ; mouse coordinates
clr bp ; no override
call CalibrationCheckPoint
mov ax, mask MRF_PROCESSED
.leave
ret
VisScreenStartSelect endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Follow the mouse around the screen
CALLED BY: MSG_META_PTR
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClassInstance
(cx,dx) = Mouse position
RETURN: ax = MouseReturnFlags
DESTROYED: cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenPtr method dynamic VisScreenClass, MSG_META_PTR
.enter
test bp, (mask UIFA_SELECT shl 8)
jz done
clr bp ; no override
call CalibrationCheckPoint
done:
mov ax, mask MRF_PROCESSED
.leave
ret
VisScreenPtr endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenEndSelect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Track the mouse pointer around the screen
CALLED BY: MSG_META_END_SELECT
PASS: *ds:si = VisScreenClass object
ds:di = VisScreenClassInstance
(cx,dx) = Mouse position
RETURN: ax = MouseReturnFlags
DESTROYED: cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenEndSelect method dynamic VisScreenClass,
MSG_META_END_SELECT
uses cx, dx, bp
.enter
test ds:[di].VSI_state, mask VSS_SELECT
jz exit
andnf ds:[di].VSI_state, not (mask VSS_SELECT)
;
; Kill the restart-calibration timer, if any.
;
clr bx
xchg bx, ds:[di].VSI_timerHandle
mov ax, ds:[di].VSI_timerID
call TimerStop
;
; If we're supposed to be ignoring this end-select, then
; do so, but only once.
;
test ds:[di].VSI_state, mask VSS_IGNORE_NEXT_END_SELECT
lahf
andnf ds:[di].VSI_state, not (mask VSS_IGNORE_NEXT_END_SELECT)
sahf
jnz done
;
; If we're on the final screen (we've got all the points),
; then we either quit or restart calibration.
;
test ds:[di].VSI_state, mask VSS_QUIT
jz notDone
call CheckIfTheyQuit
jnc restart
call BringDownTheDialog
jmp done
restart:
andnf ds:[di].VSI_state, mask VSS_QUIT
call RestartCalibrationCommon
jmp done
notDone:
;
; Check this point. If CalibrationCheckPoint returns
; VSS_ADVANCE set, go to the next point.
;
mov bp, TRUE ; override point count rule
call CalibrationCheckPoint
test ds:[di].VSI_state, mask VSS_ADVANCE
jnz advance
;
; If VSS_CALIBRATE is not set at this point, then we have
; finished the calibration and are probably bringing down
; the dialog.
;
test ds:[di].VSI_state, mask VSS_CALIBRATE
jz done
doCalibration:
call CalibrationSetPoints
andnf ds:[di].VSI_state, not (mask VSS_CALIBRATE)
jmp invalRegion
advance:
;
; Advance to the next point.
;
andnf ds:[di].VSI_state, not (mask VSS_ADVANCE)
clr ds:[di].VSI_pointState
mov ds:[di].VSI_calCount, -1
inc ds:[di].VSI_pointCurrent
cmp ds:[di].VSI_pointCurrent, NUM_CALIBRATION_POINTS
jne invalRegion
;
; We've got all the points, so do the calibration.
;
jmp doCalibration
invalRegion:
;
; Invalidate the entire screen (not just the rectangle
; that bounds the strings) to get rid of spurious garbage
; that appears on the screen (such as leftover messages).
;
mov di, ds:[di].VSI_gstate
call GrGetWinBounds
call GrInvalRect ; request re-draw
done:
call VisReleaseMouse ; release the mouse
exit:
mov ax, mask MRF_PROCESSED
.leave
ret
VisScreenEndSelect endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StringDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the appropriate strings
CALLED BY: ScreenDraw
PASS: ds:si = VisScreenInstance
di = GState handle
RETURN: Nothing
DESTROYED: ax, bx, cx, dx, bp
PSEUDO CODE/STRATEGY:
Regretfully I am reduced to pushing in one place
and popping in two places, because Don used all the
index registers.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StringDraw proc near
class VisScreenClass
uses si
.enter
push si
mov si, ds:[si].VSI_pointCurrent
mov bp, TRUE ; draw the sucker
cmp si, NUM_CALIBRATION_POINTS
je calibrationThanks ; if done, say thank you.
;
; Draw the two calibration strings.
;
mov bx, SCREEN_STRING1_TOP
shl si, 1
add si, offset calibrate1String
call DrawCenteredString
mov bx, SCREEN_STRING2_TOP
mov si, offset flashingString
call DrawCenteredString
jmp short calibrationRestart
calibrationThanks:
;
; Draw the quit button.
;
pop si
or ds:[si].VSI_state, mask VSS_QUIT
mov di, ds:[si].VSI_gstate
mov ax, C_BLACK or (CF_INDEX shl 8)
call GrSetAreaColor
mov ax, QUIT_BUTTON_LEFT
mov bx, QUIT_BUTTON_TOP
mov cx, QUIT_BUTTON_RIGHT
mov dx, QUIT_BUTTON_BOTTOM
call GrDrawRect
;
; Draw the calibration thanks strings.
;
mov bx, SCREEN_STRING1_TOP
mov si, offset calibrateThanks1String
call DrawCenteredString
mov bx, SCREEN_STRING2_TOP
mov si, offset calibrateThanks2String
call DrawCenteredString
jmp done
calibrationRestart:
mov bx, SCREEN_STRING3_TOP
mov si, offset restart1String;
call DrawCenteredString
mov bx, SCREEN_STRING4_TOP
mov si, offset restart2String;
call DrawCenteredString
pop si ; restore stack pointer
done:
.leave
ret
StringDraw endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawCenteredString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a string centered horizontally
CALLED BY: UTILITY
PASS: SI = Chunk handle of string
DI = GState handle
BP = TRUE (draw) or FALSE (don't draw)
BX = Top of string
RETURN: AX = Left
CX = Right
DX = Top
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawCenteredString proc far
uses si, ds
.enter
;
; Lock the done string
;
push bx
mov bx, handle Strings
call MemLock
mov ds, ax
mov si, ds:[si] ; string => DS:SI
pop bx
;
; Set the GState state properly
;
mov cx, FID_BERKELEY
mov dx, SCREEN_FONT_SIZE
clr ah
call GrSetFont
;
; Calculate the text width
;
clr cx ; NULL-terminated
call GrTextWidth
mov ax, SCREEN_WIDTH
mov cx, ax
sub ax, dx
shr ax, 1 ; left => AX
sub cx, ax ; right => CX
mov dx, bx
add dx, SCREEN_FONT_SIZE ; bottom => DX
;
; Now draw the sucker
;
cmp bp, TRUE
jne done ; don't draw if not TRUE
push cx, dx
clr cx ; NULL-terminated
call GrDrawText ; draw the text
pop cx, dx
done:
;
; Clean up
;
push bx
mov bx, handle Strings
call MemUnlock
pop bx
.leave
ret
DrawCenteredString endp
;-----------------------------------------------------------------------------
; *** Calibration Stuff
;-----------------------------------------------------------------------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationGetPoints
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the points used for calibration
CALLED BY: VisScreenVisOpen
PASS: DS:DI = VisScreenInstance
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationGetPoints proc near
class VisScreenClass
uses di, si
.enter
;
; Call the pen digitizer driver
;
mov bx, di ; ds:bx = instance
mov dx, ds
mov si, di
add si, offset VSI_pointBufferDoc
mov di, DR_MOUSE_GET_CALIBRATION_POINTS
call ds:[bx].VSI_driverStrategy
mov di, bx ; ds:di = VisScreenInstance
jcxz emulateZoomer ; if no calibration, emulate
;
; Now un-translate all of the points
;
untranslate:
mov cx, NUM_CALIBRATION_POINTS
mov si, ds:[di].VSI_gstate
xchg si, di
clr bp
nextPoint:
mov ax, ds:[si].VSI_pointBufferDoc[bp].P_x
mov bx, ds:[si].VSI_pointBufferDoc[bp].P_y
call GrUntransform
mov ds:[si].VSI_pointBufferDoc[bp].P_x, ax
mov ds:[si].VSI_pointBufferDoc[bp].P_y, bx
add bp, (size Point) ; go to the next Point
loop nextPoint
mov ds:[si].VSI_calCount, -1
.leave
ret
;
; Emulate the Zoomer on the PC
;
emulateZoomer:
or ds:[di].VSI_state, mask VSS_EMULATE
mov ds:[di+0].VSI_pointBufferDoc.P_x, 64
mov ds:[di+0].VSI_pointBufferDoc.P_y, 40
mov ds:[di+4].VSI_pointBufferDoc.P_x, 576
mov ds:[di+4].VSI_pointBufferDoc.P_y, 40
mov ds:[di+8].VSI_pointBufferDoc.P_x, 64
mov ds:[di+8].VSI_pointBufferDoc.P_y, 360
mov ds:[di+12].VSI_pointBufferDoc.P_x, 576
mov ds:[di+12].VSI_pointBufferDoc.P_y, 360
jmp untranslate
CalibrationGetPoints endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationCheckPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check to see if the mouse is over the correct point
CALLED BY: UTILITY
PASS: DS:DI = VisScreenInstance
(CX,DX) = Dcoument coordinate
BP = Override point-count requirement (TRUE or FALSE)
RETURN: Nothing
DESTROYED: AX, BX, CX, DX
PSEUDO CODE/STRATEGY:
* Grab the un-calibrated mouse position
* Compare it against the desired point
* If equal
save point
turn off hilite
switch to next point
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationCheckPoint proc near
class VisScreenClass
uses di, si, bp
.enter
;
; Get the current raw pen position.
;
call CalibrationGetPoint ; returns ds:si = instance
jc startCount ; invalid point
cmp bp, TRUE ; override point-count rqmt?
je acceptPoint ; accept the point (pen release)
;
; The user must hold the pen in the same location for
; CALIBRATION_POINT_COUNT number of points, unless the
; pen was released (then we assume the user knows what
; s/he wants).
;
mov bp, ds:[si].VSI_pointCurrent
shl bp, 1
shl bp, 1 ; multiply by size of a Point
cmp ds:[si].VSI_calCount, -1
je restartCount
cmp cx, ds:[si].VSI_calPoint.P_x
jne restartCount
cmp dx, ds:[si].VSI_calPoint.P_y
jne restartCount
inc ds:[si].VSI_calCount
cmp ds:[si].VSI_calCount, CALIBRATION_POINT_COUNT
jne done ; if not done, continue
;
; Store the raw point away (AX, BX)
;
acceptPoint:
mov bp, ds:[si].VSI_pointCurrent
shl bp, 1
shl bp, 1 ; multiply by (size Point)
mov ds:[si].VSI_pointBufferRaw[bp].P_x, ax
mov ds:[si].VSI_pointBufferRaw[bp].P_y, bx
or ds:[si].VSI_state, mask VSS_ADVANCE
;
; Clear the current flash mark, for user feedback
;
mov cx, ds:[si].VSI_pointBufferDoc[bp].P_x
mov dx, ds:[si].VSI_pointBufferDoc[bp].P_y
mov bp, ds:[si].VSI_pointState
mov di, ds:[si].VSI_gstate
call CalibrationClearFlash
done:
.leave
ret
;
; Re-start the calibration point count, only if the
; adjusted point in within reasonable proximity to
; the actual point
;
restartCount:
clc
startCount:
mov ds:[si].VSI_calCount, -1
jc done ; if invalid, wait some more
mov ds:[si].VSI_calPoint.P_x, cx
mov ds:[si].VSI_calPoint.P_y, dx
clr ds:[si].VSI_calCount
jmp done
CalibrationCheckPoint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationGetPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get & store the current calibration point
CALLED BY: UTILITY
PASS: DS:DI = VisScreenInstance
(CX,DX) = Document coordinate
RETURN: DS:SI = VisScreenInstance
(AX,BX) = Raw coordinate
Carry = Clear (valid point)
- or -
= Set (invalid point)
DESTROYED: DI
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 4/24/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;PROXIMITY_HORIZONTAL equ 40
;PROXIMITY_VERTICAL equ 40
CalibrationGetPoint proc near
class VisScreenClass
uses bp
.enter
;
; Grab the un-calibrated mouse position.
;
mov si, di ; ds:si = instance
mov bx, di
mov di, DR_MOUSE_GET_RAW_COORDINATE
call ds:[bx].VSI_driverStrategy
jc emulateZoomer
;
; Ensure the point is valid.
; adj = (CX, DX)
; raw = (AX, BX)
;
checkProximity:
push cx, dx
mov bp, ds:[si].VSI_pointCurrent
shl bp, 1
shl bp, 1
sub cx, ds:[si].VSI_pointBufferDoc[bp].P_x
sub dx, ds:[si].VSI_pointBufferDoc[bp].P_y
if 0
;
; We've commented this part out because Todd (in his
; nearly infinite pen-driver wisdom) has noted that
; if the calibration starts out Really Screwed Up,
; it's unlikely that the adjusted point will be
; within 40 pixels of the document coordinate.
;
cmp cx, PROXIMITY_HORIZONTAL
jg invalid
cmp cx, -PROXIMITY_HORIZONTAL
jl invalid
cmp dx, PROXIMITY_VERTICAL
jg invalid
cmp dx, -PROXIMITY_VERTICAL
jl invalid
endif
clc
jmp short done
invalid::
; stc
done:
pop cx, dx
.leave
ret
;
; Emulate the Zoomer hardware
;
emulateZoomer:
mov ax, cx
mov bx, dx
dec ax
dec bx
jmp short checkProximity
CalibrationGetPoint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationSetPoints
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the calibration points
CALLED BY: CalibrationCheckPoint
PASS: DS:DI = VisScreenInstance
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationSetPoints proc near
class VisScreenClass
uses bx, cx, di, si, bp
.enter
;
; Set the calibration points
;
mov cx, NUM_CALIBRATION_POINTS
mov bx, di
mov si, di
add si, offset VSI_pointBufferRaw
mov dx, ds ; point array => DX:SI
mov di, DR_MOUSE_SET_CALIBRATION_POINTS
call ds:[bx].VSI_driverStrategy
.leave
ret
CalibrationSetPoints endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the calibration points
CALLED BY: ScreenDraw
PASS: DS:SI = VisScreenInstance
DI = GState handle
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationDraw proc near
class VisScreenClass
uses si
.enter
;
; Draw the calibration points
;
mov cx, NUM_CALIBRATION_POINTS
add si, offset VSI_pointBufferDoc
pointLoop:
mov ax, ds:[si].P_x
mov bx, ds:[si].P_y
call CalibrationDrawPoint
add si, (size Point)
loop pointLoop
.leave
ret
CalibrationDraw endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationDrawPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a single calibration point
CALLED BY: CalibrationDraw
PASS: DI = GState handle
(AX,BX) = Calibration point
RETURN: AX, BX, DX
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationDrawPoint proc near
uses cx
.enter
;
; Draw a cross-hair at the point
;
mov cx, ax
mov dx, bx
sub ax, CROSSHAIR_LENGTH
add cx, CROSSHAIR_LENGTH + 1
call GrDrawLine
mov al, MM_INVERT
call GrSetMixMode
sub cx, CROSSHAIR_LENGTH + 1
mov ax, cx
sub bx, CROSSHAIR_LENGTH
add dx, CROSSHAIR_LENGTH + 1
call GrDrawLine
mov al, MM_COPY
call GrSetMixMode
.leave
ret
CalibrationDrawPoint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalibrationDrawFlash
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the flash for a single calibration point
CALLED BY: UTILITY
PASS: DS:SI = VisScreenInstance
DI = GState
BP = Flash radius
(CX,DX) = Calibration point
RETURN: Nothing
DESTROYED: AX, BX
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalibrationClearFlash proc near
mov ax, C_WHITE or (CF_INDEX shl 8)
call GrSetLineColor
call CalibrationDrawFlash
mov ax, C_BLACK or (CF_INDEX shl 8)
call GrSetLineColor
ret
CalibrationClearFlash endp
CalibrationDrawFlash proc near
uses cx, dx
.enter
mov ax, cx
mov bx, dx
sub ax, bp
sub bx, bp
add cx, bp
add dx, bp
call GrDrawRect
.leave
ret
CalibrationDrawFlash endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BringDownTheDialog
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Dismiss the calibration dialog.
CALLED BY: VisScreenStartSelect
PASS: *ds:si = VisScreen object
ds:di = VisScreenInstance
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/29/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BringDownTheDialog proc near
class VisScreenClass
uses ax, cx, dx, bp
.enter
;
; Kill the restart-calibration timer, if any.
;
clr bx
xchg bx, ds:[di].VSI_timerHandle
mov ax, ds:[di].VSI_timerID
call TimerStop
;
; Tell the system the pen is calibrated
;
mov ax, TRUE
call BSSetCalibration
;
; Call our parent (the content) telling it to deal with this.
;
mov ax, MSG_VIS_SCREEN_CONTENT_DISMISS_DIALOG
call VisCallParent
.leave
ret
BringDownTheDialog endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisScreenContentDismissDialog
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Nuke the dialog we're in.
CALLED BY: MSG_VIS_SCREEN_CONTENT_DISMISS_DIALOG
PASS: *ds:si = VisScreenContentClass object
ds:di = VisScreenContentClass instance data
RETURN: nothing
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/29/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisScreenContentDismissDialog method dynamic VisScreenContentClass,
MSG_VIS_SCREEN_CONTENT_DISMISS_DIALOG
;
; Get the block our view is in (this is the same block
; as the main dialog).
;
mov ax, MSG_GEN_GUP_INTERACTION_COMMAND
mov bx, ds:[di].VCNI_view.handle
mov si, offset CalibrationDialog
mov cx, IC_DISMISS
mov di, mask MF_FORCE_QUEUE
call ObjMessage
;
; Tell the primary to go on to the next screen.
;
mov bx, handle MyBSPrimary
mov si, offset MyBSPrimary
mov di, mask MF_FORCE_QUEUE
mov ax, MSG_BS_PRIMARY_DO_THE_TIME_DATE_THING
GOTO ObjMessage
VisScreenContentDismissDialog endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckIfTheyQuit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See if the user clicked in the quit-button area.
CALLED BY: VisScreenStartSelect
PASS: ds:di = VisScreenInstance
(cx,dx) = mouse position
RETURN: carry set if they quit, clear to restart calibration
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 8/ 6/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckIfTheyQuit proc near
.enter
cmp cx, QUIT_BUTTON_LEFT
jb nope
cmp cx, QUIT_BUTTON_RIGHT
ja nope
cmp dx, QUIT_BUTTON_TOP
jb nope
cmp dx, QUIT_BUTTON_BOTTOM
ja nope
stc
jmp done
nope:
clc
done:
.leave
ret
CheckIfTheyQuit endp
CalibrateCode ends
| 23.495809 | 108 | 0.573075 |
7a2f4af9b1d7be5a2298f6393e0b166c3d3ffa13 | 20,776 | asm | Assembly | src/kernel/x64/irq-vectors-x64.asm | alkhe/runtime | acb6330185c1be88449198c28059d24bc4fb62c2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-02T04:57:42.000Z | 2020-05-02T04:57:42.000Z | src/kernel/x64/irq-vectors-x64.asm | alkhe/runtime | acb6330185c1be88449198c28059d24bc4fb62c2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/kernel/x64/irq-vectors-x64.asm | alkhe/runtime | acb6330185c1be88449198c28059d24bc4fb62c2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | ; Copyright 2014 Runtime.JS project authors
;
; 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.
format ELF64
section ".text" align 16
use64
public _preemptStart as 'preemptStart'
public _threadStructInit as 'threadStructInit'
public _enterFirstThread as 'enterFirstThread'
public _int_gate_exception_DE as 'int_gate_exception_DE'
public _int_gate_exception_DB as 'int_gate_exception_DB'
public _int_gate_exception_NMI as 'int_gate_exception_NMI'
public _int_gate_exception_BP as 'int_gate_exception_BP'
public _int_gate_exception_OF as 'int_gate_exception_OF'
public _int_gate_exception_BR as 'int_gate_exception_BR'
public _int_gate_exception_UD as 'int_gate_exception_UD'
public _int_gate_exception_NM as 'int_gate_exception_NM'
public _int_gate_exception_DF as 'int_gate_exception_DF'
public _int_gate_exception_TS as 'int_gate_exception_TS'
public _int_gate_exception_NP as 'int_gate_exception_NP'
public _int_gate_exception_SS as 'int_gate_exception_SS'
public _int_gate_exception_GP as 'int_gate_exception_GP'
public _int_gate_exception_PF as 'int_gate_exception_PF'
public _int_gate_exception_MF as 'int_gate_exception_MF'
public _int_gate_exception_AC as 'int_gate_exception_AC'
public _int_gate_exception_MC as 'int_gate_exception_MC'
public _int_gate_exception_XF as 'int_gate_exception_XF'
public _int_gate_exception_SX as 'int_gate_exception_SX'
public _int_gate_exception_other as 'int_gate_exception_other'
public _int_gate_irq_timer as 'int_gate_irq_timer'
public _int_gate_irq_keyboard as 'int_gate_irq_keyboard'
public _int_gate_irq_spurious as 'int_gate_irq_spurious'
public _switch_to_stack as 'switch_to_stack'
public _irq_gate_20
public _irq_gate_21
public _irq_gate_22
public _irq_gate_23
public _irq_gate_24
public _irq_gate_25
public _irq_gate_26
public _irq_gate_27
public _irq_gate_28
public _irq_gate_29
public _irq_gate_2a
public _irq_gate_2b
public _irq_gate_2c
public _irq_gate_2d
public _irq_gate_2e
public _irq_gate_2f
public _irq_gate_30
public _irq_gate_31
public _irq_gate_32
public _irq_gate_33
public _irq_gate_34
public _irq_gate_35
public _irq_gate_36
public _irq_gate_37
public _irq_gate_38
public _irq_gate_39
public _irq_gate_3a
public _irq_gate_3b
public _irq_gate_3c
public _irq_gate_3d
public _irq_gate_3e
public _irq_gate_3f
public _irq_gate_40
public _irq_gate_41
public _irq_gate_42
public _irq_gate_43
public _irq_gate_44
public _irq_gate_45
public _irq_gate_46
public _irq_gate_47
public _irq_gate_48
public _irq_gate_49
public _irq_gate_4a
public _irq_gate_4b
public _irq_gate_4c
public _irq_gate_4d
public _irq_gate_4e
public _irq_gate_4f
public _irq_gate_50
public _irq_gate_51
public _irq_gate_52
public _irq_gate_53
public _irq_gate_54
public _irq_gate_55
public _irq_gate_56
public _irq_gate_57
public _irq_gate_58
public _irq_gate_59
public _irq_gate_5a
public _irq_gate_5b
public _irq_gate_5c
public _irq_gate_5d
public _irq_gate_5e
public _irq_gate_5f
public _irq_gate_60
public _irq_gate_61
public _irq_gate_62
public _irq_gate_63
public _irq_gate_64
public _irq_gate_65
public _irq_gate_66
public _irq_gate_67
public _irq_gate_68
public _irq_gate_69
public _irq_gate_6a
public _irq_gate_6b
public _irq_gate_6c
public _irq_gate_6d
public _irq_gate_6e
public _irq_gate_6f
public _irq_gate_70
public _irq_gate_71
public _irq_gate_72
public _irq_gate_73
public _irq_gate_74
public _irq_gate_75
public _irq_gate_76
public _irq_gate_77
public _irq_gate_78
public _irq_gate_79
public _irq_gate_7a
public _irq_gate_7b
public _irq_gate_7c
public _irq_gate_7d
public _irq_gate_7e
public _irq_gate_7f
public _irq_gate_80
public _irq_gate_81
public _irq_gate_82
public _irq_gate_83
public _irq_gate_84
public _irq_gate_85
public _irq_gate_86
public _irq_gate_87
public _irq_gate_88
public _irq_gate_89
public _irq_gate_8a
public _irq_gate_8b
public _irq_gate_8c
public _irq_gate_8d
public _irq_gate_8e
public _irq_gate_8f
public _irq_gate_90
public _irq_gate_91
public _irq_gate_92
public _irq_gate_93
public _irq_gate_94
public _irq_gate_95
public _irq_gate_96
public _irq_gate_97
public _irq_gate_98
public _irq_gate_99
public _irq_gate_9a
public _irq_gate_9b
public _irq_gate_9c
public _irq_gate_9d
public _irq_gate_9e
public _irq_gate_9f
public _irq_gate_a0
public _irq_gate_a1
public _irq_gate_a2
public _irq_gate_a3
public _irq_gate_a4
public _irq_gate_a5
public _irq_gate_a6
public _irq_gate_a7
public _irq_gate_a8
public _irq_gate_a9
public _irq_gate_aa
public _irq_gate_ab
public _irq_gate_ac
public _irq_gate_ad
public _irq_gate_ae
public _irq_gate_af
public _irq_gate_b0
public _irq_gate_b1
public _irq_gate_b2
public _irq_gate_b3
public _irq_gate_b4
public _irq_gate_b5
public _irq_gate_b6
public _irq_gate_b7
public _irq_gate_b8
public _irq_gate_b9
public _irq_gate_ba
public _irq_gate_bb
public _irq_gate_bc
public _irq_gate_bd
public _irq_gate_be
public _irq_gate_bf
public _irq_gate_c0
public _irq_gate_c1
public _irq_gate_c2
public _irq_gate_c3
public _irq_gate_c4
public _irq_gate_c5
public _irq_gate_c6
public _irq_gate_c7
public _irq_gate_c8
public _irq_gate_c9
public _irq_gate_ca
public _irq_gate_cb
public _irq_gate_cc
public _irq_gate_cd
public _irq_gate_ce
public _irq_gate_cf
public _irq_gate_d0
public _irq_gate_d1
public _irq_gate_d2
public _irq_gate_d3
public _irq_gate_d4
public _irq_gate_d5
public _irq_gate_d6
public _irq_gate_d7
public _irq_gate_d8
public _irq_gate_d9
public _irq_gate_da
public _irq_gate_db
public _irq_gate_dc
public _irq_gate_dd
public _irq_gate_de
public _irq_gate_df
public _irq_gate_e0
public _irq_gate_e1
public _irq_gate_e2
public _irq_gate_e3
public _irq_gate_e4
public _irq_gate_e5
public _irq_gate_e6
public _irq_gate_e7
public _irq_gate_e8
public _irq_gate_e9
public _irq_gate_ea
public _irq_gate_eb
public _irq_gate_ec
public _irq_gate_ed
public _irq_gate_ee
public _irq_gate_ef
public _irq_gate_f0
public _irq_gate_f1
public _irq_gate_f2
public _irq_gate_f3
public _irq_gate_f4
public _irq_gate_f5
public _irq_gate_f6
public _irq_gate_f7
public _irq_gate_f8
public _irq_gate_f9
public _irq_gate_fa
public _irq_gate_fb
public _irq_gate_fc
public _irq_gate_fd
public _irq_gate_fe
extrn exception_DE_event
extrn exception_DB_event
extrn exception_NMI_event
extrn exception_BP_event
extrn exception_OF_event
extrn exception_BR_event
extrn exception_UD_event
extrn exception_NM_event
extrn exception_DF_event
extrn exception_TS_event
extrn exception_NP_event
extrn exception_SS_event
extrn exception_GP_event
extrn exception_PF_event
extrn exception_MF_event
extrn exception_AC_event
extrn exception_MC_event
extrn exception_XF_event
extrn exception_SX_event
extrn exception_other_event
extrn irq_timer_event
extrn irq_keyboard_event
extrn irq_other_event
extrn irq_handler_any
macro SaveState
{
sub rsp, 256
mov qword [rsp+0], r15
mov qword [rsp+8], r14
mov qword [rsp+16], r13
mov qword [rsp+24], r12
mov qword [rsp+32], r11
mov qword [rsp+40], r10
mov qword [rsp+48], r9
mov qword [rsp+56], r8
mov qword [rsp+64], rdi
mov qword [rsp+72], rsi
mov qword [rsp+80], rdx
mov qword [rsp+88], rcx
mov qword [rsp+96], rbx
mov qword [rsp+104], rax
mov qword [rsp+112], rbp
mov qword [rsp+120], rsp
}
macro RestoreState
{
mov r15, qword [rsp+0]
mov r14, qword [rsp+8]
mov r13, qword [rsp+16]
mov r12, qword [rsp+24]
mov r11, qword [rsp+32]
mov r10, qword [rsp+40]
mov r9, qword [rsp+48]
mov r8, qword [rsp+56]
mov rdi, qword [rsp+64]
mov rsi, qword [rsp+72]
mov rdx, qword [rsp+80]
mov rcx, qword [rsp+88]
mov rbx, qword [rsp+96]
mov rax, qword [rsp+104]
mov rbp, qword [rsp+112]
mov rsp, qword [rsp+120]
add rsp, 256
}
macro IrqHandler num
{
SaveState
mov rdi, num
call irq_handler_any
RestoreState
iretq
}
macro Hang
{
jmp $
}
; rdi containts first argument - stack pointer
; rsi containts second argument - address to jump
_switch_to_stack:
xor rax,rax
push rax ; target ss
push rdi ; target rsp
pushfq ; target flags
push rax ; target cs
push rsi ; target rip
iretq
; ---------------------------------------------------
; begin preempt logic
; Param: RDI - load thread structure location, 16 bytes aligned
; structure size - 1024 bytes
; 0 - 512 fx state
; 512 - 1024 general registers etc
_enterFirstThread:
xor rax, rax
push rax ; target ss
push qword [rdi+560] ; target rsp
pushfq ; target flags
push 0x08 ; target cs
push qword [rdi+568] ; target rip
mov rdi, qword [rdi+576] ; pass thread pointer as 1st parameter
iretq
;
; Param: RDI - save thread structure location, 16 bytes aligned
; structure size - 1024 bytes
; 0 - 512 fx state
; 512 - 1024 general registers etc
; Param: RSI - load thread structure location, 16 bytes aligned
; structure size - 1024 bytes
; 0 - 512 fx state
; 512 - 1024 general registers etc
;
_preemptStart:
cli
push rdi
fxsave [rdi]
mov qword [rdi+512], r15
mov qword [rdi+520], r14
mov qword [rdi+528], r13
mov qword [rdi+536], r12
mov qword [rdi+544], rbp
mov qword [rdi+552], rbx
mov qword [rdi+560], rsp
mov qword [rdi+568], _preemptCallback
xor rax, rax
push rax ; target ss
push qword [rsi+560] ; target rsp
pushfq ; target flags
push 0x08 ; target cs
push qword [rsi+568] ; target rip
mov rdi, qword [rsi+576] ; pass thread pointer as 1st parameter
iretq
_preemptCallback:
pop rdi
fxrstor [rdi]
mov r15, qword [rdi+512]
mov r14, qword [rdi+520]
mov r13, qword [rdi+528]
mov r12, qword [rdi+536]
mov rbp, qword [rdi+544]
mov rbx, qword [rdi+552]
mov rax, qword [rdi+576] ; return thread pointer
sti
ret
; Param: RDI - clean 1024 byte space for thread structure location
; Param: RSI - function pointer to thread entry point
; Param: RDX - thread stack location
; Param: RCX - thread object pointer
_threadStructInit:
fxsave [rdi] ; save current state, it could be any valid fxstate
xor rax, rax
mov qword [rdi+512], rax
mov qword [rdi+520], rax
mov qword [rdi+528], rax
mov qword [rdi+536], rax
mov qword [rdi+544], rax
mov qword [rdi+552], rax
mov qword [rdi+560], rdx
mov qword [rdi+568], rsi
mov qword [rdi+576], rcx
ret
; end preempt logic
; ---------------------------------------------------
_int_gate_exception_DE:
SaveState
call exception_DE_event
RestoreState
Hang
_int_gate_exception_DB:
SaveState
call exception_DB_event
RestoreState
Hang
_int_gate_exception_NMI:
SaveState
call exception_NMI_event
RestoreState
Hang
_int_gate_exception_BP:
SaveState
call exception_BP_event
RestoreState
Hang
_int_gate_exception_OF:
SaveState
call exception_OF_event
RestoreState
Hang
_int_gate_exception_BR:
SaveState
call exception_BR_event
RestoreState
Hang
_int_gate_exception_UD:
pop rdi ; rip, 1 arg
pop rsi ; cs, 2 arg
SaveState
call exception_UD_event
RestoreState
Hang
_int_gate_exception_NM:
SaveState
call exception_NM_event
RestoreState
Hang
_int_gate_exception_DF:
SaveState
call exception_DF_event
RestoreState
Hang
_int_gate_exception_TS:
SaveState
call exception_TS_event
RestoreState
Hang
_int_gate_exception_NP:
SaveState
call exception_NP_event
RestoreState
Hang
_int_gate_exception_SS:
SaveState
call exception_SS_event
RestoreState
Hang
_int_gate_exception_GP:
pop rdx ; error code, 3arg
pop rdi ; rip, 1 arg
pop rsi ; cs, 2 arg
pop rbx ; remove flags
pop rbx ; remore rsp
pop rbx ; remove ss
mov rcx, rax ; save rax, 4 arg
SaveState
call exception_GP_event
RestoreState
cli
hlt
iretq
_int_gate_exception_PF:
SaveState
mov rsi, 0
mov rdi, cr2 ; CR2 contians the address that the program tried to access
call exception_PF_event
RestoreState
add rsp, 8 ; fix rsp after state restore
iretq
_int_gate_exception_MF:
SaveState
call exception_MF_event
RestoreState
Hang
_int_gate_exception_AC:
SaveState
call exception_AC_event
RestoreState
Hang
_int_gate_exception_MC:
SaveState
call exception_MC_event
RestoreState
Hang
_int_gate_exception_XF:
SaveState
call exception_XF_event
RestoreState
Hang
_int_gate_exception_SX:
SaveState
call exception_SX_event
RestoreState
Hang
_int_gate_exception_other:
SaveState
call exception_other_event
RestoreState
Hang
align 16
_int_gate_irq_timer:
SaveState
mov rdi, rsp ; arg 0
add rdi, 256
mov rdx, [rdi] ; arg 2, rip from stack
add rdi, 40 ; compute sp, exclude cpu saved state (5*qword)
mov rsi, rbp ; arg 1
call irq_timer_event
RestoreState
iretq
align 16
_int_gate_irq_keyboard:
; debugging
; pop rdi ; place RIP into first argument
; push rdi ; put it back
SaveState
call irq_keyboard_event
RestoreState
iretq
align 16
_irq_gate_20: IrqHandler 0x0
_irq_gate_21: IrqHandler 0x1
_irq_gate_22: IrqHandler 0x2
_irq_gate_23: IrqHandler 0x3
_irq_gate_24: IrqHandler 0x4
_irq_gate_25: IrqHandler 0x5
_irq_gate_26: IrqHandler 0x6
_irq_gate_27: IrqHandler 0x7
_irq_gate_28: IrqHandler 0x8
_irq_gate_29: IrqHandler 0x9
_irq_gate_2a: IrqHandler 0xa
_irq_gate_2b: IrqHandler 0xb
_irq_gate_2c: IrqHandler 0xc
_irq_gate_2d: IrqHandler 0xd
_irq_gate_2e: IrqHandler 0xe
_irq_gate_2f: IrqHandler 0xf
_irq_gate_30: IrqHandler 0x10
_irq_gate_31: IrqHandler 0x11
_irq_gate_32: IrqHandler 0x12
_irq_gate_33: IrqHandler 0x13
_irq_gate_34: IrqHandler 0x14
_irq_gate_35: IrqHandler 0x15
_irq_gate_36: IrqHandler 0x16
_irq_gate_37: IrqHandler 0x17
_irq_gate_38: IrqHandler 0x18
_irq_gate_39: IrqHandler 0x19
_irq_gate_3a: IrqHandler 0x1a
_irq_gate_3b: IrqHandler 0x1b
_irq_gate_3c: IrqHandler 0x1c
_irq_gate_3d: IrqHandler 0x1d
_irq_gate_3e: IrqHandler 0x1e
_irq_gate_3f: IrqHandler 0x1f
_irq_gate_40: IrqHandler 0x20
_irq_gate_41: IrqHandler 0x21
_irq_gate_42: IrqHandler 0x22
_irq_gate_43: IrqHandler 0x23
_irq_gate_44: IrqHandler 0x24
_irq_gate_45: IrqHandler 0x25
_irq_gate_46: IrqHandler 0x26
_irq_gate_47: IrqHandler 0x27
_irq_gate_48: IrqHandler 0x28
_irq_gate_49: IrqHandler 0x29
_irq_gate_4a: IrqHandler 0x2a
_irq_gate_4b: IrqHandler 0x2b
_irq_gate_4c: IrqHandler 0x2c
_irq_gate_4d: IrqHandler 0x2d
_irq_gate_4e: IrqHandler 0x2e
_irq_gate_4f: IrqHandler 0x2f
_irq_gate_50: IrqHandler 0x30
_irq_gate_51: IrqHandler 0x31
_irq_gate_52: IrqHandler 0x32
_irq_gate_53: IrqHandler 0x33
_irq_gate_54: IrqHandler 0x34
_irq_gate_55: IrqHandler 0x35
_irq_gate_56: IrqHandler 0x36
_irq_gate_57: IrqHandler 0x37
_irq_gate_58: IrqHandler 0x38
_irq_gate_59: IrqHandler 0x39
_irq_gate_5a: IrqHandler 0x3a
_irq_gate_5b: IrqHandler 0x3b
_irq_gate_5c: IrqHandler 0x3c
_irq_gate_5d: IrqHandler 0x3d
_irq_gate_5e: IrqHandler 0x3e
_irq_gate_5f: IrqHandler 0x3f
_irq_gate_60: IrqHandler 0x40
_irq_gate_61: IrqHandler 0x41
_irq_gate_62: IrqHandler 0x42
_irq_gate_63: IrqHandler 0x43
_irq_gate_64: IrqHandler 0x44
_irq_gate_65: IrqHandler 0x45
_irq_gate_66: IrqHandler 0x46
_irq_gate_67: IrqHandler 0x47
_irq_gate_68: IrqHandler 0x48
_irq_gate_69: IrqHandler 0x49
_irq_gate_6a: IrqHandler 0x4a
_irq_gate_6b: IrqHandler 0x4b
_irq_gate_6c: IrqHandler 0x4c
_irq_gate_6d: IrqHandler 0x4d
_irq_gate_6e: IrqHandler 0x4e
_irq_gate_6f: IrqHandler 0x4f
_irq_gate_70: IrqHandler 0x50
_irq_gate_71: IrqHandler 0x51
_irq_gate_72: IrqHandler 0x52
_irq_gate_73: IrqHandler 0x53
_irq_gate_74: IrqHandler 0x54
_irq_gate_75: IrqHandler 0x55
_irq_gate_76: IrqHandler 0x56
_irq_gate_77: IrqHandler 0x57
_irq_gate_78: IrqHandler 0x58
_irq_gate_79: IrqHandler 0x59
_irq_gate_7a: IrqHandler 0x5a
_irq_gate_7b: IrqHandler 0x5b
_irq_gate_7c: IrqHandler 0x5c
_irq_gate_7d: IrqHandler 0x5d
_irq_gate_7e: IrqHandler 0x5e
_irq_gate_7f: IrqHandler 0x5f
_irq_gate_80: IrqHandler 0x60
_irq_gate_81: IrqHandler 0x61
_irq_gate_82: IrqHandler 0x62
_irq_gate_83: IrqHandler 0x63
_irq_gate_84: IrqHandler 0x64
_irq_gate_85: IrqHandler 0x65
_irq_gate_86: IrqHandler 0x66
_irq_gate_87: IrqHandler 0x67
_irq_gate_88: IrqHandler 0x68
_irq_gate_89: IrqHandler 0x69
_irq_gate_8a: IrqHandler 0x6a
_irq_gate_8b: IrqHandler 0x6b
_irq_gate_8c: IrqHandler 0x6c
_irq_gate_8d: IrqHandler 0x6d
_irq_gate_8e: IrqHandler 0x6e
_irq_gate_8f: IrqHandler 0x6f
_irq_gate_90: IrqHandler 0x70
_irq_gate_91: IrqHandler 0x71
_irq_gate_92: IrqHandler 0x72
_irq_gate_93: IrqHandler 0x73
_irq_gate_94: IrqHandler 0x74
_irq_gate_95: IrqHandler 0x75
_irq_gate_96: IrqHandler 0x76
_irq_gate_97: IrqHandler 0x77
_irq_gate_98: IrqHandler 0x78
_irq_gate_99: IrqHandler 0x79
_irq_gate_9a: IrqHandler 0x7a
_irq_gate_9b: IrqHandler 0x7b
_irq_gate_9c: IrqHandler 0x7c
_irq_gate_9d: IrqHandler 0x7d
_irq_gate_9e: IrqHandler 0x7e
_irq_gate_9f: IrqHandler 0x7f
_irq_gate_a0: IrqHandler 0x80
_irq_gate_a1: IrqHandler 0x81
_irq_gate_a2: IrqHandler 0x82
_irq_gate_a3: IrqHandler 0x83
_irq_gate_a4: IrqHandler 0x84
_irq_gate_a5: IrqHandler 0x85
_irq_gate_a6: IrqHandler 0x86
_irq_gate_a7: IrqHandler 0x87
_irq_gate_a8: IrqHandler 0x88
_irq_gate_a9: IrqHandler 0x89
_irq_gate_aa: IrqHandler 0x8a
_irq_gate_ab: IrqHandler 0x8b
_irq_gate_ac: IrqHandler 0x8c
_irq_gate_ad: IrqHandler 0x8d
_irq_gate_ae: IrqHandler 0x8e
_irq_gate_af: IrqHandler 0x8f
_irq_gate_b0: IrqHandler 0x90
_irq_gate_b1: IrqHandler 0x91
_irq_gate_b2: IrqHandler 0x92
_irq_gate_b3: IrqHandler 0x93
_irq_gate_b4: IrqHandler 0x94
_irq_gate_b5: IrqHandler 0x95
_irq_gate_b6: IrqHandler 0x96
_irq_gate_b7: IrqHandler 0x97
_irq_gate_b8: IrqHandler 0x98
_irq_gate_b9: IrqHandler 0x99
_irq_gate_ba: IrqHandler 0x9a
_irq_gate_bb: IrqHandler 0x9b
_irq_gate_bc: IrqHandler 0x9c
_irq_gate_bd: IrqHandler 0x9d
_irq_gate_be: IrqHandler 0x9e
_irq_gate_bf: IrqHandler 0x9f
_irq_gate_c0: IrqHandler 0xa0
_irq_gate_c1: IrqHandler 0xa1
_irq_gate_c2: IrqHandler 0xa2
_irq_gate_c3: IrqHandler 0xa3
_irq_gate_c4: IrqHandler 0xa4
_irq_gate_c5: IrqHandler 0xa5
_irq_gate_c6: IrqHandler 0xa6
_irq_gate_c7: IrqHandler 0xa7
_irq_gate_c8: IrqHandler 0xa8
_irq_gate_c9: IrqHandler 0xa9
_irq_gate_ca: IrqHandler 0xaa
_irq_gate_cb: IrqHandler 0xab
_irq_gate_cc: IrqHandler 0xac
_irq_gate_cd: IrqHandler 0xad
_irq_gate_ce: IrqHandler 0xae
_irq_gate_cf: IrqHandler 0xaf
_irq_gate_d0: IrqHandler 0xb0
_irq_gate_d1: IrqHandler 0xb1
_irq_gate_d2: IrqHandler 0xb2
_irq_gate_d3: IrqHandler 0xb3
_irq_gate_d4: IrqHandler 0xb4
_irq_gate_d5: IrqHandler 0xb5
_irq_gate_d6: IrqHandler 0xb6
_irq_gate_d7: IrqHandler 0xb7
_irq_gate_d8: IrqHandler 0xb8
_irq_gate_d9: IrqHandler 0xb9
_irq_gate_da: IrqHandler 0xba
_irq_gate_db: IrqHandler 0xbb
_irq_gate_dc: IrqHandler 0xbc
_irq_gate_dd: IrqHandler 0xbd
_irq_gate_de: IrqHandler 0xbe
_irq_gate_df: IrqHandler 0xbf
_irq_gate_e0: IrqHandler 0xc0
_irq_gate_e1: IrqHandler 0xc1
_irq_gate_e2: IrqHandler 0xc2
_irq_gate_e3: IrqHandler 0xc3
_irq_gate_e4: IrqHandler 0xc4
_irq_gate_e5: IrqHandler 0xc5
_irq_gate_e6: IrqHandler 0xc6
_irq_gate_e7: IrqHandler 0xc7
_irq_gate_e8: IrqHandler 0xc8
_irq_gate_e9: IrqHandler 0xc9
_irq_gate_ea: IrqHandler 0xca
_irq_gate_eb: IrqHandler 0xcb
_irq_gate_ec: IrqHandler 0xcc
_irq_gate_ed: IrqHandler 0xcd
_irq_gate_ee: IrqHandler 0xce
_irq_gate_ef: IrqHandler 0xcf
_irq_gate_f0: IrqHandler 0xd0
_irq_gate_f1: IrqHandler 0xd1
_irq_gate_f2: IrqHandler 0xd2
_irq_gate_f3: IrqHandler 0xd3
_irq_gate_f4: IrqHandler 0xd4
_irq_gate_f5: IrqHandler 0xd5
_irq_gate_f6: IrqHandler 0xd6
_irq_gate_f7: IrqHandler 0xd7
_irq_gate_f8: IrqHandler 0xd8
_irq_gate_f9: IrqHandler 0xd9
_irq_gate_fa: IrqHandler 0xda
_irq_gate_fb: IrqHandler 0xdb
_irq_gate_fc: IrqHandler 0xdc
_irq_gate_fd: IrqHandler 0xdd
_irq_gate_fe: IrqHandler 0xde
_int_gate_irq_spurious:
iretq
;------------------------------
;EOF
| 23.90794 | 83 | 0.788362 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.