Create a gist now

Instantly share code, notes, and snippets.

../inc/equates.dasm (line 7): [0x0000] .equ kernel_exec 0x0000
../inc/equates.dasm (line 8): [0x0000] .equ kernel_data 0x5000
../inc/equates.dasm (line 10): [0x0000] .equ thread_table 0x5000
../inc/equates.dasm (line 11): [0x0000] .equ library_table 0x5100
../inc/equates.dasm (line 12): [0x0000] .equ signal_table 0x5200
../inc/equates.dasm (line 13): [0x0000] .equ file_table 0x5300
../inc/equates.dasm (line 14): [0x0000] .equ interrupt_table 0x5400
../inc/equates.dasm (line 16): [0x0000] .equ current_thread_index 0x5500
../inc/equates.dasm (line 17): [0x0000] .equ active_threads 0x5501
../inc/equates.dasm (line 18): [0x0000] .equ active_libraries 0x5502
../inc/equates.dasm (line 19): [0x0000] .equ pending_signals 0x5503
../inc/equates.dasm (line 20): [0x0000] .equ open_file_handles 0x5504
../inc/equates.dasm (line 21): [0x0000] .equ active_interrupts 0x5505
../inc/equates.dasm (line 23): [0x0000] .equ next_thread_id 0x5510
../inc/equates.dasm (line 25): [0x0000] .equ context_switch_enabled 0x5520
../inc/equates.dasm (line 26): [0x0000] .equ kernel_disk_buffer 0x5E00
../inc/equates.dasm (line 27): [0x0000] .equ kernel_temp 0x6000
../inc/equates.dasm (line 28): [0x0000] .equ kernel_jump_table 0x7000
../inc/equates.dasm (line 30): [0x0000] .equ userspace_memory 0x8000
../inc/equates.dasm (line 31): [0x0000] .equ userspace_memory_end 0x0000
../inc/equates.dasm (line 33): [0x0000] .equ null_thread -1
../inc/equates.dasm (line 34): [0x0000] .equ permenant_memory -2
../inc/equates.dasm (line 35): [0x0000] .equ max_threads 32
../inc/equates.dasm (line 37): [0x0000] .equ context_switch_frequency 60
../inc/macros.dasm (line 11): [0x0000] .macro pushAll()
../inc/macros.dasm (line 11): [0x0000] SET PUSH, A
../inc/macros.dasm (line 11): [0x0000] SET PUSH, B
../inc/macros.dasm (line 11): [0x0000] SET PUSH, C
../inc/macros.dasm (line 11): [0x0000] SET PUSH, X
../inc/macros.dasm (line 11): [0x0000] SET PUSH, Y
../inc/macros.dasm (line 11): [0x0000] SET PUSH, Z
../inc/macros.dasm (line 11): [0x0000] SET PUSH, I
../inc/macros.dasm (line 11): [0x0000] SET PUSH, J
../inc/macros.dasm (line 11): [0x0000] SET PUSH, EX
../inc/macros.dasm (line 11): [0x0000] .endmacro
../inc/macros.dasm (line 23): [0x0000] .macro popAll()
../inc/macros.dasm (line 23): [0x0000] SET EX, POP
../inc/macros.dasm (line 23): [0x0000] SET J, POP
../inc/macros.dasm (line 23): [0x0000] SET I, POP
../inc/macros.dasm (line 23): [0x0000] SET Z, POP
../inc/macros.dasm (line 23): [0x0000] SET Y, POP
../inc/macros.dasm (line 23): [0x0000] SET X, POP
../inc/macros.dasm (line 23): [0x0000] SET C, POP
../inc/macros.dasm (line 23): [0x0000] SET B, POP
../inc/macros.dasm (line 23): [0x0000] SET A, POP
../inc/macros.dasm (line 23): [0x0000] .endmacro
boot.dasm (line 4): [0x0000] kernel_start:
boot.dasm (line 5): [0x0000] 7F61 7000 SET SP, kernel_jump_table
boot.dasm (line 6): [0x0002] 87C1 5520 SET [context_switch_enabled], 0
boot.dasm (line 9): [0x0004] 7C20 002E JSR kernel_format_userspace
boot.dasm (line 11): [0x0006] 7FC1 FFFE 5500 SET [current_thread_index], permenant_memory
boot.dasm (line 13): [0x0009] 7C20 00A3 JSR initialize_interrupts
boot.dasm (line 17): [0x000B] 7C20 00C5 JSR init_devices
boot.dasm (line 25): [0x000D] 7C01 0028 SET A, test_thread
boot.dasm (line 26): [0x000F] 7C21 0032 SET B, 50
boot.dasm (line 27): [0x0011] 8441 SET C, 0
boot.dasm (line 28): [0x0012] 7C20 011E JSR start_thread
boot.dasm (line 30): [0x0014] 7C01 002B SET A, test_thread2
boot.dasm (line 31): [0x0016] 7C21 0032 SET B, 50
boot.dasm (line 32): [0x0018] 8441 SET C, 0
boot.dasm (line 33): [0x0019] 7C20 011E JSR start_thread
boot.dasm (line 36): [0x001B] 83C1 5500 SET [current_thread_index], -1
boot.dasm (line 37): [0x001D] 0120 IAG A
boot.dasm (line 39): [0x001E] 8412 IFE A, 0
boot.dasm (line 40): [0x001F] 7F81 0028 SET PC, boot_no_clock
boot.dasm (line 42): [0x0021] 8980 IAQ 1
boot.dasm (line 43): [0x0022] 8BC1 5520 SET [context_switch_enabled], 1
boot.dasm (line 44): [0x0024] 7F01 00BC SET PUSH, system_interrupt_return
boot.dasm (line 45): [0x0026] 7F81 016E SET PC, context_switch_next_thread
boot.dasm (line 47): [0x0028] boot_no_clock:
boot.dasm (line 50): [0x0028] test_thread:
boot.dasm (line 51): [0x0028] 8802 ADD A, 1
boot.dasm (line 52): [0x0029] 7F81 0028 SET PC, test_thread
boot.dasm (line 54): [0x002B] test_thread2:
boot.dasm (line 55): [0x002B] 8822 ADD B, 1
boot.dasm (line 56): [0x002C] 7F81 002B SET PC, test_thread2
memory.dasm (line 5): [0x002E] kernel_format_userspace:
memory.dasm (line 6): [0x002E] 83C1 8000 SET [userspace_memory], -1
memory.dasm (line 7): [0x0030] 7FC1 7FFD 8001 SET [userspace_memory + 1], (userspace_memory_end - userspace_memory) - 3
memory.dasm (line 8): [0x0033] 7FC1 8000 FFFF SET [userspace_memory_end - 1], userspace_memory
memory.dasm (line 9): [0x0036] 6381 SET PC, POP
memory.dasm (line 12): [0x0037] alloc_mem:
memory.dasm (line 13): [0x0037] 7C21 8000 SET B, userspace_memory
memory.dasm (line 15): [0x0039] .loop:
memory.dasm (line 16): [0x0039] 8132 IFE [B], -1
memory.dasm (line 17): [0x003A] 7F81 0046 SET PC, .check_free
memory.dasm (line 18): [0x003C] 4422 0001 ADD B, [B + 1]
memory.dasm (line 19): [0x003E] 8C22 ADD B, 2
memory.dasm (line 20): [0x003F] 8432 IFE B, 0
memory.dasm (line 21): [0x0040] 7F81 0044 SET PC, .none_found
memory.dasm (line 22): [0x0042] 7F81 0039 SET PC, .loop
memory.dasm (line 23): [0x0044] .none_found:
memory.dasm (line 24): [0x0044] 8001 SET A, -1
memory.dasm (line 25): [0x0045] 6381 SET PC, POP
memory.dasm (line 26): [0x0046] .check_free:
memory.dasm (line 27): [0x0046] 8822 ADD B, 1
memory.dasm (line 28): [0x0047] 2416 IFL A, [B]
memory.dasm (line 29): [0x0048] 7F81 0051 SET PC, .do_allocate
memory.dasm (line 30): [0x004A] 2422 ADD B, [B]
memory.dasm (line 31): [0x004B] 8822 ADD B, 1
memory.dasm (line 32): [0x004C] 8432 IFE B, 0
memory.dasm (line 33): [0x004D] 7F81 0044 SET PC, .none_found
memory.dasm (line 34): [0x004F] 7F81 0039 SET PC, .loop
memory.dasm (line 35): [0x0051] .do_allocate:
memory.dasm (line 39): [0x0051] 2441 SET C, [B]
memory.dasm (line 40): [0x0052] 0043 SUB C, A
memory.dasm (line 41): [0x0053] 9043 SUB C, 3
memory.dasm (line 42): [0x0054] 0121 SET [B], A
memory.dasm (line 43): [0x0055] 0301 SET PUSH, A
memory.dasm (line 44): [0x0056] 7C20 010E JSR get_current_thread_id
memory.dasm (line 45): [0x0058] 0221 FFFF SET [B + 0xFFFF], A
memory.dasm (line 46): [0x005A] 6001 SET A, POP
memory.dasm (line 47): [0x005B] 8822 ADD B, 1
memory.dasm (line 48): [0x005C] 0701 SET PUSH, B
memory.dasm (line 49): [0x005D] 4422 FFFF ADD B, [B + 0xFFFF]
memory.dasm (line 50): [0x005F] 6521 SET [B], PEEK
memory.dasm (line 51): [0x0060] 8D23 SUB [B], 2
memory.dasm (line 52): [0x0061] 9056 IFL C, 3
memory.dasm (line 53): [0x0062] 7F81 006F SET PC, .finish_gapless
memory.dasm (line 54): [0x0064] 8822 ADD B, 1
memory.dasm (line 55): [0x0065] 8121 SET [B], -1
memory.dasm (line 56): [0x0066] 0A21 0001 SET [B + 1], C
memory.dasm (line 57): [0x0068] 0701 SET PUSH, B
memory.dasm (line 58): [0x0069] 4422 0001 ADD B, [B + 1]
memory.dasm (line 59): [0x006B] 8C22 ADD B, 2
memory.dasm (line 60): [0x006C] 6121 SET [B], POP
memory.dasm (line 61): [0x006D] .finish:
memory.dasm (line 62): [0x006D] 6001 SET A, POP
memory.dasm (line 63): [0x006E] 6381 SET PC, POP
memory.dasm (line 64): [0x006F] .finish_gapless:
memory.dasm (line 65): [0x006F] 0822 ADD B, C
memory.dasm (line 66): [0x0070] 6521 SET [B], PEEK
memory.dasm (line 67): [0x0071] 6421 SET B, PEEK
memory.dasm (line 68): [0x0072] 0A22 0001 ADD [B + 1], C
memory.dasm (line 69): [0x0074] 6001 SET A, POP
memory.dasm (line 70): [0x0075] 6381 SET PC, POP
memory.dasm (line 73): [0x0076] free_mem:
memory.dasm (line 74): [0x0076] 8201 FFFE SET [A + 0xFFFE], -1
memory.dasm (line 75): [0x0078] 4021 FFFF SET B, [A + 0xFFFF]
memory.dasm (line 77): [0x007A] 0301 SET PUSH, A
memory.dasm (line 78): [0x007B] 0402 ADD A, B
memory.dasm (line 79): [0x007C] 8212 0001 IFE [A + 1], -1
memory.dasm (line 80): [0x007E] 7F81 008C SET PC, .merge_foward
memory.dasm (line 81): [0x0080] 6001 SET A, POP
memory.dasm (line 82): [0x0081] .check_backward:
memory.dasm (line 84): [0x0081] 9003 SUB A, 3
memory.dasm (line 85): [0x0082] 03F4 8000 IFG userspace_memory, A
memory.dasm (line 86): [0x0084] 6381 SET PC, POP
memory.dasm (line 88): [0x0085] 4021 0002 SET B, [A + 2]
memory.dasm (line 89): [0x0087] 2001 SET A, [A]
memory.dasm (line 90): [0x0088] 8112 IFE [A], -1
memory.dasm (line 91): [0x0089] 7F81 0099 SET PC, .merge_backward
memory.dasm (line 92): [0x008B] 6381 SET PC, POP
memory.dasm (line 93): [0x008C] .merge_foward:
memory.dasm (line 94): [0x008C] 8C02 ADD A, 2
memory.dasm (line 95): [0x008D] 2022 ADD B, [A]
memory.dasm (line 96): [0x008E] 9022 ADD B, 3
memory.dasm (line 97): [0x008F] 6001 SET A, POP
memory.dasm (line 98): [0x0090] 0601 FFFF SET [A + 0xFFFF], B
memory.dasm (line 99): [0x0092] 0301 SET PUSH, A
memory.dasm (line 100): [0x0093] 0402 ADD A, B
memory.dasm (line 101): [0x0094] 6501 SET [A], PEEK
memory.dasm (line 102): [0x0095] 8D03 SUB [A], 2
memory.dasm (line 103): [0x0096] 6001 SET A, POP
memory.dasm (line 104): [0x0097] 7F81 0081 SET PC, .check_backward
memory.dasm (line 105): [0x0099] .merge_backward:
memory.dasm (line 106): [0x0099] 9202 0001 ADD [A + 1], 3
memory.dasm (line 107): [0x009B] 0602 0001 ADD [A + 1], B
memory.dasm (line 108): [0x009D] 0301 SET PUSH, A
memory.dasm (line 109): [0x009E] 4002 0001 ADD A, [A + 1]
memory.dasm (line 110): [0x00A0] 8C02 ADD A, 2
memory.dasm (line 111): [0x00A1] 6101 SET [A], POP
memory.dasm (line 112): [0x00A2] 6381 SET PC, POP
interrupts.dasm (line 4): [0x00A3] initialize_interrupts:
interrupts.dasm (line 5): [0x00A3] 87C1 5505 SET [active_interrupts], 0
interrupts.dasm (line 6): [0x00A5] 6381 SET PC, POP
interrupts.dasm (line 12): [0x00A6] register_interrupt:
interrupts.dasm (line 13): [0x00A6] 7821 5505 SET B, [active_interrupts]
interrupts.dasm (line 14): [0x00A8] 0701 SET PUSH, B
interrupts.dasm (line 15): [0x00A9] 7C22 5400 ADD B, interrupt_table
interrupts.dasm (line 16): [0x00AB] 0121 SET [B], A
interrupts.dasm (line 17): [0x00AC] 8BC2 5505 ADD [active_interrupts], 1
interrupts.dasm (line 18): [0x00AE] 6001 SET A, POP
interrupts.dasm (line 19): [0x00AF] 8802 ADD A, 1
interrupts.dasm (line 20): [0x00B0] 6381 SET PC, POP
interrupts.dasm (line 23): [0x00B1] system_interrupt:
interrupts.dasm (line 24): [0x00B1] 0701 SET PUSH, B
interrupts.dasm (line 24): [0x00B2] 0B01 SET PUSH, C
interrupts.dasm (line 25): [0x00B3] 0F01 SET PUSH, X
interrupts.dasm (line 25): [0x00B4] 1301 SET PUSH, Y
interrupts.dasm (line 25): [0x00B5] 1701 SET PUSH, Z
interrupts.dasm (line 26): [0x00B6] 1B01 SET PUSH, I
interrupts.dasm (line 26): [0x00B7] 1F01 SET PUSH, J
interrupts.dasm (line 27): [0x00B8] 7701 SET PUSH, EX
interrupts.dasm (line 29): [0x00B9] 7C02 53FF ADD A, interrupt_table - 1
interrupts.dasm (line 30): [0x00BB] 2020 JSR [A]
interrupts.dasm (line 31): [0x00BC] system_interrupt_return:
interrupts.dasm (line 32): [0x00BC] 63A1 SET EX, POP
interrupts.dasm (line 33): [0x00BD] 60E1 SET J, POP
interrupts.dasm (line 33): [0x00BE] 60C1 SET I, POP
interrupts.dasm (line 34): [0x00BF] 60A1 SET Z, POP
interrupts.dasm (line 34): [0x00C0] 6081 SET Y, POP
interrupts.dasm (line 34): [0x00C1] 6061 SET X, POP
interrupts.dasm (line 35): [0x00C2] 6041 SET C, POP
interrupts.dasm (line 35): [0x00C3] 6021 SET B, POP
interrupts.dasm (line 36): [0x00C4] 8560 RFI 0
hardware.dasm (line 4): [0x00C5] init_devices:
hardware.dasm (line 6): [0x00C5] 1A00 HWN I
hardware.dasm (line 7): [0x00C6] 88C3 SUB I, 1
hardware.dasm (line 8): [0x00C7] .loop:
hardware.dasm (line 10): [0x00C7] 1A20 HWQ I
hardware.dasm (line 12): [0x00C8] 7CE1 0109 SET J, driver_table
hardware.dasm (line 13): [0x00CA] .driverLoop:
hardware.dasm (line 14): [0x00CA] 1F01 SET PUSH, J
hardware.dasm (line 15): [0x00CB] 3CE1 SET J, [J]
hardware.dasm (line 17): [0x00CC] 01F2 IFE [J], A
hardware.dasm (line 18): [0x00CD] 06F2 0001 IFE [J + 1], B
hardware.dasm (line 19): [0x00CF] 7F81 00DB SET PC, .loadDriver
hardware.dasm (line 20): [0x00D1] 60E1 SET J, POP
hardware.dasm (line 21): [0x00D2] .continue:
hardware.dasm (line 22): [0x00D2] 8CE2 ADD J, 2
hardware.dasm (line 23): [0x00D3] 81F3 IFN [J], -1
hardware.dasm (line 24): [0x00D4] 7F81 00CA SET PC, .driverLoop
hardware.dasm (line 25): [0x00D6] 88C3 SUB I, 1
hardware.dasm (line 26): [0x00D7] 80D2 IFE I, -1
hardware.dasm (line 27): [0x00D8] 6381 SET PC, POP
hardware.dasm (line 28): [0x00D9] 7F81 00C7 SET PC, .loop
hardware.dasm (line 29): [0x00DB] .loadDriver:
hardware.dasm (line 30): [0x00DB] 60E1 SET J, POP
hardware.dasm (line 31): [0x00DC] pushAll()
hardware.dasm (line 31): [0x00DC] 0301 SET PUSH, A
hardware.dasm (line 31): [0x00DD] 0701 SET PUSH, B
hardware.dasm (line 31): [0x00DE] 0B01 SET PUSH, C
hardware.dasm (line 31): [0x00DF] 0F01 SET PUSH, X
hardware.dasm (line 31): [0x00E0] 1301 SET PUSH, Y
hardware.dasm (line 31): [0x00E1] 1701 SET PUSH, Z
hardware.dasm (line 31): [0x00E2] 1B01 SET PUSH, I
hardware.dasm (line 31): [0x00E3] 1F01 SET PUSH, J
hardware.dasm (line 31): [0x00E4] 7701 SET PUSH, EX
hardware.dasm (line 32): [0x00E5] 5CE1 0001 SET J, [J + 1]
hardware.dasm (line 33): [0x00E7] 3C20 JSR [J]
hardware.dasm (line 34): [0x00E8] popAll()
hardware.dasm (line 34): [0x00E8] 63A1 SET EX, POP
hardware.dasm (line 34): [0x00E9] 60E1 SET J, POP
hardware.dasm (line 34): [0x00EA] 60C1 SET I, POP
hardware.dasm (line 34): [0x00EB] 60A1 SET Z, POP
hardware.dasm (line 34): [0x00EC] 6081 SET Y, POP
hardware.dasm (line 34): [0x00ED] 6061 SET X, POP
hardware.dasm (line 34): [0x00EE] 6041 SET C, POP
hardware.dasm (line 34): [0x00EF] 6021 SET B, POP
hardware.dasm (line 34): [0x00F0] 6001 SET A, POP
hardware.dasm (line 35): [0x00F1] 7F81 00D2 SET PC, .continue
lem1802.dasm (line 4): [0x00F3] lem1802info:
lem1802.dasm (line 5): [0x00F3] .dw 0xf615, 0x7349
lem1802.dasm (line 5): [0x00F3] F615 7349
lem1802.dasm (line 6): [0x00F5] .dw 0x1802
lem1802.dasm (line 6): [0x00F5] 1802
lem1802.dasm (line 8): [0x00F6] lem1802driver:
lem1802.dasm (line 9): [0x00F6] .dw .init
lem1802.dasm (line 9): [0x00F6] 00F7
lem1802.dasm (line 10): [0x00F7] .init:
lem1802.dasm (line 11): [0x00F7] 6381 SET PC, POP
genericclock.dasm (line 4): [0x00F8] genericclock_info:
genericclock.dasm (line 5): [0x00F8] .dw 0xB402, 0x12D0
genericclock.dasm (line 5): [0x00F8] B402 12D0
genericclock.dasm (line 6): [0x00FA] .dw 1
genericclock.dasm (line 6): [0x00FA] 0001
genericclock.dasm (line 8): [0x00FB] genericclock_driver:
genericclock.dasm (line 9): [0x00FB] .dw .init
genericclock.dasm (line 9): [0x00FB] 00FC
genericclock.dasm (line 10): [0x00FC] .init:
genericclock.dasm (line 12): [0x00FC] 7C01 0165 SET A, context_switch
genericclock.dasm (line 13): [0x00FE] 7C20 00A6 JSR register_interrupt
genericclock.dasm (line 15): [0x0100] 0021 SET B, A
genericclock.dasm (line 16): [0x0101] 8C01 SET A, 2
genericclock.dasm (line 17): [0x0102] 1A40 HWI I
genericclock.dasm (line 19): [0x0103] 8821 SET B, 60 / context_switch_frequency
genericclock.dasm (line 20): [0x0104] 8401 SET A, 0
genericclock.dasm (line 21): [0x0105] 1A40 HWI I
genericclock.dasm (line 23): [0x0106] 7D40 00B1 IAS system_interrupt
genericclock.dasm (line 24): [0x0108] 6381 SET PC, POP
drivers/base.dasm (line 10): [0x0109] driver_table:
drivers/base.dasm (line 11): [0x010A] .dw lem1802info, lem1802driver
drivers/base.dasm (line 11): [0x010A] 00F3 00F6
drivers/base.dasm (line 12): [0x010C] .dw genericclock_info, genericclock_driver
drivers/base.dasm (line 12): [0x010C] 00F8 00FB
drivers/base.dasm (line 13): [0x010E] .dw 0xFFFF
drivers/base.dasm (line 13): [0x010E] FFFF
threads.dasm (line 5): [0x010E] get_current_thread_id:
threads.dasm (line 6): [0x010E] 7FD2 FFFE 5500 IFE [current_thread_index], 0xFFFE
threads.dasm (line 7): [0x0111] 7F81 011A SET PC, .new_thread
threads.dasm (line 8): [0x0113] 7801 5500 SET A, [current_thread_index]
threads.dasm (line 9): [0x0115] A404 MUL A, 8
threads.dasm (line 10): [0x0116] 7C02 5000 ADD A, thread_table
threads.dasm (line 11): [0x0118] 2001 SET A, [A]
threads.dasm (line 12): [0x0119] 6381 SET PC, POP
threads.dasm (line 13): [0x011A] .new_thread:
threads.dasm (line 14): [0x011A] 7801 5510 SET A, [next_thread_id]
threads.dasm (line 15): [0x011C] 6381 SET PC, POP
threads.dasm (line 17): [0x011D] kill_current_thread:
threads.dasm (line 18): [0x011D] 8B83 SUB PC, 1
threads.dasm (line 23): [0x011F] .equ required_system_stack 16
threads.dasm (line 24): [0x011E] start_thread:
threads.dasm (line 25): [0x011E] 7B01 5520 SET PUSH, [context_switch_enabled]
threads.dasm (line 26): [0x0120] 87C1 5520 SET [context_switch_enabled], 0
threads.dasm (line 27): [0x0122] 0B01 SET PUSH, C
threads.dasm (line 28): [0x0123] 0301 SET PUSH, A
threads.dasm (line 30): [0x0124] 7841 5501 SET C, [active_threads]
threads.dasm (line 31): [0x0126] 7C52 0020 IFE C, max_threads
threads.dasm (line 32): [0x0128] 7F81 015D SET PC, .max_threads_reached
threads.dasm (line 33): [0x012A] A444 MUL C, 8
threads.dasm (line 34): [0x012B] 7C42 5000 ADD C, thread_table
threads.dasm (line 37): [0x012D] 0401 SET A, B
threads.dasm (line 38): [0x012E] 7C16 FFEF IFL A, 0xFFFF - required_system_stack
threads.dasm (line 39): [0x0130] C402 ADD A, required_system_stack
threads.dasm (line 40): [0x0131] 0301 SET PUSH, A
threads.dasm (line 42): [0x0132] 0B01 SET PUSH, C
threads.dasm (line 43): [0x0133] 7B01 5500 SET PUSH, [current_thread_index]
threads.dasm (line 44): [0x0135] 7FC1 FFFE 5500 SET [current_thread_index], 0xFFFE
threads.dasm (line 45): [0x0138] 7C20 0037 JSR alloc_mem
threads.dasm (line 46): [0x013A] 63C1 5500 SET [current_thread_index], POP
threads.dasm (line 47): [0x013C] 6041 SET C, POP
threads.dasm (line 49): [0x013D] 6002 ADD A, POP
threads.dasm (line 50): [0x013E] 8C03 SUB A, 2
threads.dasm (line 51): [0x013F] 6501 SET [A], PEEK
threads.dasm (line 52): [0x0140] 7E01 011D 0001 SET [A + 1], kill_current_thread
threads.dasm (line 53): [0x0143] AC03 SUB A, 10
threads.dasm (line 54): [0x0144] 7D01 00BC SET [A], system_interrupt_return
threads.dasm (line 55): [0x0146] 0301 SET PUSH, A
threads.dasm (line 57): [0x0147] 7A41 5510 0000 SET [C + 0x0000], [next_thread_id]
threads.dasm (line 58): [0x014A] 6241 0002 SET [C + 0x0002], POP
threads.dasm (line 59): [0x014C] 6241 0001 SET [C + 0x0001], POP
threads.dasm (line 60): [0x014E] 6241 0003 SET [C + 0x0003], POP
threads.dasm (line 61): [0x0150] 8241 0004 SET [C + 0x0004], 0xffff
threads.dasm (line 62): [0x0152] 8641 0005 SET [C + 0x0005], 0
threads.dasm (line 66): [0x0154] 7801 5510 SET A, [next_thread_id]
threads.dasm (line 67): [0x0156] 8BC2 5501 ADD [active_threads], 1
threads.dasm (line 68): [0x0158] 7C20 0162 JSR find_next_thread_id
threads.dasm (line 69): [0x015A] 63C1 5520 SET [context_switch_enabled], POP
threads.dasm (line 70): [0x015C] 6381 SET PC, POP
threads.dasm (line 71): [0x015D] .max_threads_reached:
threads.dasm (line 72): [0x015D] 8F62 ADD SP, 2
threads.dasm (line 73): [0x015E] 63C1 5520 SET [context_switch_enabled], POP
threads.dasm (line 74): [0x0160] 8001 SET A, -1
threads.dasm (line 75): [0x0161] 6381 SET PC, POP
threads.dasm (line 77): [0x0162] find_next_thread_id:
threads.dasm (line 78): [0x0162] 8BC2 5510 ADD [next_thread_id], 1
threads.dasm (line 79): [0x0164] 6381 SET PC, POP
threads.dasm (line 83): [0x0165] context_switch:
threads.dasm (line 84): [0x0165] 87D2 5520 IFE [context_switch_enabled], 0
threads.dasm (line 85): [0x0167] 6381 SET PC, POP
threads.dasm (line 87): [0x0168] 7801 5500 SET A, [current_thread_index]
threads.dasm (line 88): [0x016A] A404 MUL A, 8
threads.dasm (line 89): [0x016B] 7C02 5002 ADD A, thread_table + 2
threads.dasm (line 91): [0x016D] 6D01 SET [A], SP
threads.dasm (line 93): [0x016E] context_switch_next_thread:
threads.dasm (line 95): [0x016E] 7801 5500 SET A, [current_thread_index]
threads.dasm (line 96): [0x0170] 8802 ADD A, 1
threads.dasm (line 97): [0x0171] 7812 5501 IFE A, [active_threads]
threads.dasm (line 98): [0x0173] 8401 SET A, 0
threads.dasm (line 99): [0x0174] 03C1 5500 SET [current_thread_index], A
threads.dasm (line 102): [0x0176] A404 MUL A, 8
threads.dasm (line 103): [0x0177] 7C02 5002 ADD A, thread_table + 2
threads.dasm (line 104): [0x0179] 2361 SET SP, [A]
threads.dasm (line 105): [0x017A] 6381 SET PC, POP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment