Changeset 220 for branches/CpuSingleSize/Sample.asm
- Timestamp:
- Oct 20, 2020, 1:10:09 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CpuSingleSize/Sample.asm
r219 r220 3 3 NOP 4 4 NOP 5 6 VAR DeviceConsole 1 7 VAR ConsoleReadChar 0 8 VAR ConsoleWriteChar 0 9 10 VAR DeviceKeyboard 2 11 12 VAR DeviceScreen 3 13 VAR ScreenGetWidth 0 14 VAR ScreenGetHeight 1 15 VAR ScreenSetAddr 0 16 VAR ScreenWrite 1 5 17 6 18 ORG 16 … … 63 75 PUSH R2 64 76 PUSH R3 65 SET R3, 0 77 PUSH R4 78 SET R3, ConsoleWriteChar 79 SET R4, DeviceConsole 66 80 WriteStrLoop: 67 81 LD R2, (R0) 68 OUT (R 3), R282 OUT (R4: R3), R2 69 83 INC R0 70 84 DEC R1 71 85 JNZ R1, WriteStrLoop 86 POP R4 72 87 POP R3 73 88 POP R2 74 89 RET 75 90 76 91 ClearScreen: 77 92 PUSH R0 78 93 PUSH R1 79 94 PUSH R2 80 SET R0, 1 95 PUSH R3 96 SET R0, ScreenSetAddr 81 97 SET R1, 0 82 OUT (R0), R1 83 SET R0, 3 84 IN R1, (R0) 85 SET R0, 4 86 IN R2, (R0) 98 SET R3, DeviceScreen 99 OUT (R3: R0), R1 100 SET R0, ScreenGetWidth 101 IN R1, (R3: R0) 102 SET R0, ScreenGetHeight 103 IN R2, (R3: R0) 87 104 MUL R2, R1 88 SET R0, 2105 SET R0, ScreenWrite 89 106 SET R1, 120 90 107 ClearScreenLoop: 91 OUT (R 0), R1108 OUT (R3: R0), R1 92 109 DEC R2 93 110 JNZ R2, ClearScreenLoop 111 POP R3 94 112 POP R2 95 113 POP R1 … … 104 122 PUSH R3 105 123 PUSH R2 106 SET R3, 0 107 IN R2, (R3) 108 OUT (R3), R2 124 PUSH R4 125 SET R4, DeviceConsole 126 SET R3, ConsoleReadChar 127 IN R2, (R4: R3) 128 SET R3, ConsoleWriteChar 129 OUT (R4: R3), R2 130 POP R4 109 131 POP R2 110 132 POP R3
Note:
See TracChangeset
for help on using the changeset viewer.