68000 Assembler - version 2.71.F3w (Jul 27, 2006) Copyright 1985 by Brian R. Anderson. AmigaDOS conversion copyright 1991 by Charlie Gibbs. 1 ; 68000 MONITOR Version 2.11, modified April 2014. 2 ; 3 ; Based on Antonakos's monitor with substantial changes 4 ; since the original version lacked many features. 5 ; Register display, register modify, tracing and 6 ; break-pointing were added by Sol Rosenstark (SR). 7 ; Disassembly was added by Dave Harrison (DH). 8 ; 9 ; Version 2.10 contains the following modifications; 10 ; 11 ; (DH) 1. Modified exception ADDERR, ILEGAL, DIVZERO 12 ; routines to include address of exception. 13 ; 2. Added option to change register values 14 ; while tracing. 15 ; 3. Fixed unassembly of register lists for 16 ; MOVEM instruction. 17 ; (SR) 1. The trap #0, trap #1 and the trap #3 18 ; routines no longer trash the D0 register. 19 ; 2. The LEA disassebly now distinguishes the 20 ; following: 21 ; 00008000 4BF8 8000 LEA.W $8000,A5 22 ; 00008004 4BF9 0000 D000 LEA.L $0000D000,A5 23 ; (SR) 3. Made the trace display correspond more closely 24 ; to that of EMU68K, with some improvements. 25 ; Serial port assignments 26 ; 700001 27 duart equ $700001 28 ; 000000 29 mr1a equ 0 000000 30 mr2a equ 0 000002 31 sra equ 2 000002 32 csra equ 2 000004 33 cra equ 4 000006 34 tba equ 6 000008 35 acr equ 8 36 ; 000010 37 mr1b equ 16 000010 38 mr2b equ 16 000012 39 srb equ 18 000012 40 csrb equ 18 000014 41 crb equ 20 000016 42 tbb equ 22 43 ; 44 ; Ram storage assignments. 0F0000 45 RAM EQU $F0000 ;Change for other decoding 00FFF0 46 RAMLEN EQU $FFF0 ;$8000 for 62256 0FFFF0 47 ENDRAM EQU RAM+RAMLEN 0FFEA0 48 USTCK EQU ENDRAM-$150 ;user stack pointer 0FFF26 49 STACK EQU ENDRAM-$CA ;system stack pointer 0FFF26 50 OLD_PC EQU ENDRAM-$CA ;preceding PC 0FFF2A 51 UNADR EQU ENDRAM-$C6 ;unasm start address 0FFF2E 52 UASMCMD EQU ENDRAM-$C2 ;unasm cmd buf. 32 char 0FFF36 53 UASMOPR EQU ENDRAM-$BA ;****** 0FFF37 54 SPARE EQU ENDRAM-$B9 ;spare byte for future 55 ;use 0FFF38 56 REGTYP EQU ENDRAM-$B8 ;information for return 57 ;from regmod cmd 0FFF50 58 PRTBUF EQU ENDRAM-$A0 ;16 char print buffer 0FFF60 59 INPBUF EQU ENDRAM-$90 ;32 char input buffer 0FFF80 60 SAVREGS EQU ENDRAM-$70 ;D0-D7/A0-A6 storage 0FFFBC 61 SAV_A7 EQU ENDRAM-$34 ;A7 storage 0FFFC0 62 SAV_PC EQU ENDRAM-$30 ;PC storage 0FFFC4 63 SAV_SR EQU ENDRAM-$2C ;SR storage 0FFFC6 64 DUMPADR EQU ENDRAM-$2A ;dump start address 65 ; The 2 permanent breakpoint addresses go below 0FFFCA 66 BP_AD3 EQU ENDRAM-$26 0FFFCE 67 BP_AD4 EQU ENDRAM-$22 68 ; Temporary breakpoint addresses go below 0FFFD2 69 BP_ADS1 EQU ENDRAM-$1E 0FFFD6 70 BP_ADS2 EQU ENDRAM-$1A 0FFFDA 71 BP_ADS3 EQU ENDRAM-$16 0FFFDE 72 BP_ADS4 EQU ENDRAM-$12 73 ; Saved breakpoint opcodes go below 0FFFE2 74 OPCOD1 EQU ENDRAM-$E 0FFFE4 75 OPCOD2 EQU ENDRAM-$C 0FFFE6 76 OPCOD3 EQU ENDRAM-$A 0FFFE8 77 OPCOD4 EQU ENDRAM-$8 78 ; 0FFFEA 79 FP_FLG EQU ENDRAM-$6 ;TRACE 1st pass flag 0FFFEB 80 SKIPFLG EQU ENDRAM-$5 ;Go skip 1 instruction flag 0FFFEC 81 S2_FLG EQU ENDRAM-$4 ;LOAD S2 line flag 82 ; miscellaneous equates 004E4A 83 TRPTEN EQU $4E4A 004E4B 84 TRPELF EQU $4E4B 00000E 85 NUMCMD EQU 14 ;# commands checked 00008F 86 DUMPBYT EQU $8F ;# of chars in dump 00000D 87 CR EQU $D 00000A 88 LF EQU $A 89 ; equates for RAM testing of exceptions 0F0000 90 TRP_11 EQU RAM ;TRAP #11 0F0004 91 TRP_12 EQU RAM+4 ;TRAP #12 0F0008 92 TRP_13 EQU RAM+8 ;TRAP #13 0F000C 93 TRP_14 EQU RAM+12 ;TRAP #14 0F0010 94 TRP_15 EQU RAM+16 ;TRAP #15 0F0014 95 FUTURE EQU RAM+20 96 ; 100000 97 ORG $100000 98 ; The code below goes into the ROM vector table 100000 000FFF26 99 DC.L STACK ;RESET: initial SSP 100004 00100400 100 DC.L START ;RESET: initial PC 100008 00101D34 101 DC.L BUSERR 10000C 00101D42 102 DC.L ADDERR 100010 00101D82 103 DC.L ILEGAL 100014 00101DB2 104 DC.L DIVZERO 100018 00100418 105 DC.L RESTART ;CHK not implemented 10001C 00101E34 106 DC.L TRAP_V 100020 00101E40 107 DC.L PRIVIOL ;Privilege violation 100024 00100E54 108 DC.L TRACE 100028 00101DD4 109 DC.L LINE_A 10002C 00101E04 110 DC.L LINE_F 111 ;As a precaution, skip reserved vectors 10007C 112 ORG $10007C 10007C 00101E4C 113 DC.L LEVEL_7 100080 00101E66 114 DC.L TO_CHARIN ;TRAP #0 100084 00101E6C 115 DC.L TO_CHAROUT ;TRAP #1 100088 00101E72 116 DC.L TO_CRLF ;TRAP #2 10008C 00101E78 117 DC.L TO_PRTMSG ;TRAP #3 100090 00101E7E 118 DC.L TO_PRT_BYT ;TRAP #4 100094 00101E84 119 DC.L TO_PRT_WRD ;TRAP #5 100098 00101E8A 120 DC.L TO_PRT_LON ;TRAP #6 10009C 00101E90 121 DC.L TO_GET_BYT ;TRAP #7 1000A0 00101E96 122 DC.L TO_GETADR ;TRAP #8 1000A4 00100638 123 DC.L TRP_9 ;TRAP #9 1000A8 0010065A 124 DC.L TRP_10 ;TRAP #10 1000AC 000F0000 125 DC.L TRP_11 ;TRAP #11 1000B0 000F0004 126 DC.L TRP_12 ;TRAP #12 1000B4 000F0008 127 DC.L TRP_13 ;TRAP #13 1000B8 000F000C 128 DC.L TRP_14 ;TRAP #14 1000BC 000F0010 129 DC.L TRP_15 ;TRAP #15 1000C0 130 nd_excp equ * 131 ; 132 ; The address below can be much lower if 133 ; few interrupts are used. 100400 134 ORG $100400 ;start of monitor 135 ; 100400 227C 00100000 136 START MOVEA.L #$100000,A1 ;start of copy 100406 247C 00000000 137 MOVEA.L #0,A2 ;copy destination 10040C 267C 001000C0 138 MOVEA.L #nd_excp,A3 ;end of copy 100412 14D9 139 CPLP MOVE.B (A1)+,(A2)+ ;do copy 100414 B7C9 140 CMP.L A1,A3 ;done? 100416 66FA 141 BNE CPLP ;no 142 100418 6100 0654 143 RESTART BSR NULLREG ;init user regs 10041C 6100 0422 144 BSR SERINI ;init ser. chip 100420 6100 04D8 145 BSR SIGN_ON ;greet user 146 ; 147 ; This point is reentered after each command 148 ; is executed, so various things are reset. It 149 ; then sends the prompt and calls GETLIN to 150 ; obtain a line of KBD input terminated by 151 ; a CR. The typed line is in the INPBUF. 100424 027C 7FFF 152 GET_CMD ANDI.W #$7FFF,SR ;disable tracing 100428 0279 7FFF 000FFFC4 153 ANDI.W #$7FFF,SAV_SR;fix the USR 100430 2E7C 000FFF26 154 MOVEA.L #STACK,A7 ;init stack 100436 6100 04A6 155 BSR CRLF 10043A 123C 0025 156 MOVE.B #'%',D1 ;output prompt 10043E 6100 0476 157 BSR CHAROUT 100442 6100 05C8 158 BSR GETLIN ;fill INPBUF from KBD 100446 2C7C 000FFF60 159 MOVEA.L #INPBUF,A6 ;repoint to buffer 10044C 6100 0614 160 BSR SKIPSP ;skip leading SPs 161 ; 162 ; A6 now points to the first non SP char. 163 ; This is put in D1, changed to UC. It will 164 ; put the last character preceding a CR or 165 ; SP into D2 and go on to SEARCH. Thus 166 ; typing command ABCD is the same as D. 167 ; This routine leaves A6 pointing one beyond 168 ; the CR or SP which follows the principal 169 ; command character where it stays until the 170 ; command service routine is executed. 100450 121E 171 INCOM MOVE.B (A6)+,D1 100452 6100 05A6 172 BSR UP_CASE 100456 0C01 000D 173 CMPI.B #CR,D1 ;test for CR 10045A 670A 174 BEQ.S SEARCH 10045C 0C01 0020 175 CMPI.B #' ',D1 ;test for SP 100460 6704 176 BEQ.S SEARCH 100462 1401 177 MOVE.B D1,D2 ;insert it into D2 100464 60EA 178 BRA.S INCOM ;get next char 179 ; 180 ; Put the # of commands in D5, the command 181 ; addresses in A1 and the command character 182 ; addresses in A2. If the command letter is 183 ; legit then jump to the command routine, 184 ; else signal by typing "Bad Command." 100466 1A3C 000E 185 SEARCH MOVE.B #NUMCMD,D5 ;# of cmds 10046A 227C 001023B6 186 MOVEA.L #CMD_ADR,A1 ;A1 -> cmd addrs 100470 247C 001023EE 187 MOVEA.L #COMANDS,A2 ;A2 -> cmd chars 100476 B41A 188 TSTNEXT CMP.B (A2)+,D2 ;test again 100478 670A 189 BEQ.S DO_JUMP 10047A 5889 190 ADDQ.L #4,A1 ;point to next cmd 10047C 5305 191 SUBQ.B #1,D5 ;all cmds checked? 10047E 66F6 192 BNE.S TSTNEXT 100480 6000 04CA 193 BRA CMDERR ;illegal command 100484 2251 194 DO_JUMP MOVEA.L (A1),A1 ;get command addr 100486 4ED1 195 JMP (A1) ;and go execute it 196 ; 197 ; Fill memory between 2 addresses with a 198 ; HEX value. 100488 6100 0544 199 FILL BSR GETADR ;get start addr 10048C 2242 200 MOVEA.L D2,A1 10048E 6100 053E 201 BSR GETADR ;get end addr 100492 5282 202 ADDQ.L #1,D2 ;Needed because using (A1)+ 100494 2442 203 MOVEA.L D2,A2 100496 6100 0536 204 BSR GETADR ;get HEX byte 10049A B5C9 205 FILLEM CMPA.L A1,A2 ;at end yet? 10049C 6786 206 BEQ GET_CMD 10049E 12C2 207 MOVE.B D2,(A1)+ ;move'em 1004A0 60F8 208 BRA.S FILLEM 209 ; 210 ; Jump to a memory location 211 ; 1004A2 6100 052A 212 JUMP BSR GETADR ;get addr 1004A6 2242 213 MOVEA.L D2,A1 1004A8 4ED1 214 JMP (A1) ;go there 215 ; 216 ; Dumps memory. The starting address is 217 ; fixed to end in 00. Displays in rows of 218 ; 16 bytes. Displays ASCII equivalents too. 1004AA 0C2E 000D FFFF 219 DUMP CMPI.B #CR,-1(A6);is previous CR? 1004B0 6610 220 BNE.S DUMP0 ;no, so proceed 1004B2 243A FB12 221 MOVE.L DUMPADR,D2 ;get old starting address 1004B6 2842 222 MOVEA.L D2,A4 1004B8 0682 0000008F 223 ADDI.L #DUMPBYT,D2 ;get standard # of lines 1004BE 2A42 224 MOVEA.L D2,A5 1004C0 6038 225 BRA.S ADR_OUT ;all done, so dump 1004C2 0C16 002C 226 DUMP0 CMPI.B #',',(A6);is char a comma? 1004C6 660A 227 BNE.S DUMP0A ;no, then get new start addr 1004C8 243A FAFC 228 MOVE.L DUMPADR,D2 ;get old dump addr 1004CC 2A42 229 MOVEA.L D2,A5 ;into A5 1004CE 528E 230 ADDQ.L #1,A6 ;point past comma 1004D0 601C 231 BRA.S DUMP1 ;get count 1004D2 6100 04FA 232 DUMP0A BSR GETADR ;get start address 1004D6 0202 00F0 233 ANDI.B #$F0,D2 ;zero lower nibble 1004DA 2842 234 MOVEA.L D2,A4 1004DC 0C2E 000D FFFF 235 CMPI.B #CR,-1(A6);is previous CR? 1004E2 660A 236 BNE.S DUMP1 ;no, so proceed 1004E4 0682 0000008F 237 ADDI.L #DUMPBYT,D2 1004EA 2A42 238 MOVEA.L D2,A5 1004EC 600C 239 BRA.S ADR_OUT 1004EE 6100 04DE 240 DUMP1 BSR GETADR ;get # of lines to display 1004F2 5382 241 SUBQ.L #1,D2 ;reduce by 1 1004F4 E98A 242 LSL.L #4,D2 ;x16 bytes per line 1004F6 2A42 243 MOVEA.L D2,A5 1004F8 DBCC 244 ADDA.L A4,A5 ;add the start address 1004FA 6100 03E2 245 ADR_OUT BSR CRLF ;new line please 1004FE 240C 246 MOVE.L A4,D2 ;print address 100500 6100 0426 247 BSR PRT_SIX 100504 6100 03EE 248 BSR TWO_SP ;and some spaces 100508 141C 249 BYTEOUT MOVE.B (A4)+,D2;get a byte 10050A 6100 03F8 250 BSR PRT_BYT ;print the byte 10050E 6100 03DC 251 BSR SPACE 100512 220C 252 MOVE.L A4,D1 ;done 16 yet? 100514 0281 0000000F 253 ANDI.L #$F,D1 10051A 66EC 254 BNE.S BYTEOUT 10051C 99FC 00000010 255 SUBA.L #16,A4 ;back up 16 bytes 100522 6100 03C8 256 BSR SPACE 100526 121C 257 ASC_OUT MOVE.B (A4)+,D1;get a byte 100528 0C01 0020 258 CMPI.B #' ',D1 ;is it printable? 10052C 6B06 259 BMI.S UN_PRT 10052E 0C01 007D 260 CMPI.B #$7D,D1 100532 6B04 261 BMI.S SEND_IT 100534 123C 002E 262 UN_PRT MOVE.B #'.',D1 ;unprintables -> . 100538 6100 037C 263 SEND_IT BSR CHAROUT ;print ASCII equiv 10053C 240C 264 MOVE.L A4,D2 ;done 16 yet? 10053E 0282 0000000F 265 ANDI.L #$F,D2 100544 66E0 266 BNE.S ASC_OUT 100546 23CC 000FFFC6 267 MOVE.L A4,DUMPADR 10054C 6100 0338 268 BSR INSTAT ;key pressed? 100550 670C 269 BEQ.S SEND1 ;no, go on 100552 6100 034A 270 BSR CHARIN ;yes, get the char 100556 0C01 0003 271 CMPI.B #3,D1 ;Is it ^C? 10055A 6700 FEC8 272 BEQ GET_CMD ;If yes then quit 10055E BBCC 273 SEND1 CMPA.L A4,A5 ;Is A4 > A5? 100560 6B00 FEC2 274 BMI GET_CMD ;Yes, then quit 100564 6094 275 BRA.S ADR_OUT 276 ; 277 ; Set breakpoints and transfer execution 278 ; to the user program. 279 ; G starts execution at current address 280 ; G is obvious 281 ; G , continues from current 282 ; program counter. 100566 0C2E 000D FFFF 283 GO CMPI.B #CR,-1(A6);is previous CR? 10056C 6738 284 BEQ.S GO3 ;yes, so start 10056E 0C16 002C 285 CMPI.B #',',(A6);is char a comma? 100572 6604 286 BNE.S GO1 ;no, then go on 100574 528E 287 ADDQ.L #1,A6 ;point past comma 100576 6012 288 BRA.S GO2 ;get breakpoints 289 ; get execution address 100578 6100 0454 290 GO1 BSR GETADR 10057C 23C2 000FFFC0 291 MOVE.L D2,SAV_PC ;save it 100582 0C2E 000D FFFF 292 CMPI.B #CR,-1(A6);is previous CR? 100588 671C 293 BEQ.S GO3 ;yes, so start 294 ; get first breakpoint address 10058A 6100 0442 295 GO2 BSR GETADR 10058E 23C2 000FFFD2 296 MOVE.L D2,BP_ADS1 ;save it 100594 0C2E 000D FFFF 297 CMPI.B #CR,-1(A6);is previous CR? 10059A 670A 298 BEQ.S GO3 ;yes, so start 299 ; get second breakpoint address 10059C 6100 0430 300 BSR GETADR 1005A0 23C2 000FFFD6 301 MOVE.L D2,BP_ADS2 ;save it 302 ; Now move-in the 2 permanent addresses 1005A6 23FA FA22 000FFFDA 303 GO3 MOVE.L BP_AD3,BP_ADS3 1005AE 23FA FA1E 000FFFDE 304 MOVE.L BP_AD4,BP_ADS4 305 ; Duplicate breakpoints wreak havoc when set. To avoid 306 ; these problems RID_EQ nulls duplicate entries. 1005B6 615A 307 BSR RID_EQ 308 ; Now all breakpoints are in place. If a breakpoint 309 ; address is 0 then it's not set. If not 0 then 310 ; proceed to see if the address is the same as that 311 ; at SAV_PC. If yes then execute 1 instruction and 312 ; now proceed to set the breakpoint by saving its 313 ; opcode and replacing it with TRAP #10. This is to 314 ; be done but once. 1005B8 207C 000FFFD2 315 MOVEA.L #BP_ADS1,A0 ;A0 -> BP_ADS1 1005BE 227C 000FFFE2 316 MOVEA.L #OPCOD1,A1 ;A1 -> OPCOD1 1005C4 51C1 317 SF D1 ;succcesive instructions flag 1005C6 303C 0003 318 MOVE.W #3,D0 ;loop counter in D0.W 1005CA 4A90 319 GO4 TST.L (A0) 1005CC 6720 320 BEQ.S GO6 ;if bkpt addr is 0 then ignore 1005CE 243A F9F0 321 MOVE.L SAV_PC,D2 ;Not 0, so compare bkpt 1005D2 B490 322 CMP.L (A0),D2 ;addr. with user PC 1005D4 6610 323 BNE.S GO5 ;Go and set if not same 1005D6 4A01 324 TST.B D1 ;Is this the 1st occurrence? 1005D8 660C 325 BNE.S GO5 ;No, the go set it. 1005DA 48E780C0 326 MOVEM.L D0/A0-A1,-(A7) ;If bkpt = (SAV_PC) 1005DE 611C 327 BSR GOSKIP ;then skip one instruction 1005E0 4CDF0301 328 MOVEM.L (A7)+,D0/A0-A1 1005E4 50C1 329 ST D1 ;Make sure this happens but once 330 ; Okay, now finally set the breakpoints. 1005E6 2450 331 GO5 MOVEA.L (A0),A2 ;get bkpt addr 1005E8 3292 332 MOVE.W (A2),(A1) ;save and replace 1005EA 34BC 4E4A 333 MOVE.W #TRPTEN,(A2) ;its opcode 334 ; Bump pointers to the next breakpoint 1005EE 5848 335 GO6 LEA 4(A0),A0 ;bump A0 1005F0 5449 336 LEA 2(A1),A1 ;bump A1 1005F2 51C8 FFD6 337 DBRA D0,GO4 1005F6 6100 04C4 338 BSR REGREST ;restore user regs 1005FA 4E73 339 RTE ;and go to user program 340 ; 341 ; This is the routine for doing a hidden 342 ; trace tracing of a single line of code. 1005FC 50F9 000FFFEB 343 GOSKIP ST SKIPFLG ;set the flag 100602 51F9 000FFFEA 344 SF FP_FLG ;clear flag 100608 6100 04B2 345 BSR REGREST ;restore user regs 10060C 007C 8000 346 ORI.W #$8000,SR ;enable tracing 100610 4E73 347 RTE 348 ; 349 ; This routine nulls duplicate entries. 100612 323C 0003 350 RID_EQ MOVE.W #3,D1 100616 207C 000FFFD2 351 MOVEA.L #BP_ADS1,A0 ;point to 1st num 10061C 3801 352 RID1 MOVE.W D1,D4 10061E 43E8 0004 353 LEA 4(A0),A1 ;point to 2nd num 100622 2410 354 RID2 MOVE.L (A0),D2 ;put it in D2 100624 B491 355 CMP.L (A1),D2 100626 6602 356 BNE.S RID3 ;skip if not equal 100628 4291 357 CLR.L (A1) 10062A 5889 358 RID3 ADDQ.L #4,A1 ;point to next enty 10062C 5344 359 SUBQ.W #1,D4 ;decrement inner loop counter 10062E 66F2 360 BNE.S RID2 100630 5888 361 ADDQ.L #4,A0 ;point to next enty 100632 5341 362 SUBQ.W #1,D1 100634 66E6 363 BNE.S RID1 100636 4E75 364 RTS 365 ; 366 ; This routine saves the user registers 367 ; after a TRAP #9 program termination, 368 ; prints the address at which the TRAP #9 369 ; instruction was found and puts back the 370 ; original opcodes at all breakpoints. 100638 6100 0458 371 TRP_9 BSR REG_SAV 10063C 267C 00102BF4 372 MOVEA.L #MSG_NIN,A3;point to message 100642 6100 028A 373 BSR PRTMSG 100646 243A F978 374 MOVE.L SAV_PC,D2 ;get user PC value 10064A 5582 375 SUBQ.L #2,D2 ;adjust address 10064C 6100 02DA 376 BSR PRT_SIX 100650 6100 028C 377 BSR CRLF 100654 612C 378 BSR CLR_BK ;clear the bkpts 100656 6000 FDCC 379 BRA GET_CMD ;all done 380 ; 381 ; This TRAP #10 routine is executed when a 382 ; breakpoint is encountered. It saves the 383 ; registers and prints MSG_TEN. It then 384 ; puts back the original opcodes at all 385 ; breakpoints. 10065A 6100 0436 386 TRP_10 BSR REG_SAV 10065E 267C 00102C16 387 MOVEA.L #MSG_TEN,A3;point to message 100664 6100 0268 388 BSR PRTMSG 100668 243A F956 389 MOVE.L SAV_PC,D2 ;get user PC value 10066C 5582 390 SUBQ.L #2,D2 ;adjust address 10066E 23C2 000FFFC0 391 MOVE.L D2,SAV_PC ;store adjusted PC 100674 6100 02B2 392 BSR PRT_SIX 100678 6100 0264 393 BSR CRLF 10067C 6104 394 BSR CLR_BK ;clear the bkpts 10067E 6000 FDA4 395 BRA GET_CMD ;all done 396 ; 397 ; Removes any breakpoints that existed and 398 ; puts back the appropriate opcodes. 399 ; First remove bkpts set by GO command. 100682 207C 000FFFD2 400 CLR_BK MOVEA.L #BP_ADS1,A0 ;A0 -> BP_AD1 100688 227C 000FFFE2 401 MOVEA.L #OPCOD1,A1 ;A1 -> OPCOD1 10068E 7003 402 MOVEQ #3,D0 ;loop 4 times 100690 4A90 403 CLR_BK1 TST.L (A0) 100692 6706 404 BEQ.S CLR_BK2 ;if 0 then ignore 100694 2450 405 MOVEA.L (A0),A2 ;get breakpoint addr 100696 3491 406 MOVE.W (A1),(A2) ;restore opcode 100698 4290 407 CLR.L (A0) 10069A 5848 408 CLR_BK2 LEA 4(A0),A0 ;bump A0 10069C 5449 409 LEA 2(A1),A1 ;bump A1 10069E 51C8 FFF0 410 DBRA D0,CLR_BK1 1006A2 4E75 411 RTS 412 ; 1006A4 6100 0328 413 VERIFY BSR GETADR ;get start addr 1006A8 2242 414 MOVEA.L D2,A1 ;start addr in A1 1006AA 6100 0322 415 BSR GETADR ;get end addr 1006AE 2442 416 MOVEA.L D2,A2 ;end addr in A2 1006B0 528A 417 ADDQ.L #1,A2 ;Needed because using (A1)+ 1006B2 6100 031A 418 BSR GETADR ;get dest addr 1006B6 2642 419 MOVEA.L D2,A3 ;dest addr in A3 1006B8 B709 420 VERIF1 CMPM.B (A1)+,(A3)+ ;compare bytes 1006BA 660C 421 BNE FAIL 1006BC B5C9 422 CMPA.L A1,A2 ;at end addr yet? 1006BE 66F8 423 BNE.S VERIF1 1006C0 47F9 00102C67 424 LEA PASSMSG,A3 ;POINT TO MESSAGE 1006C6 6006 425 BRA.S QUIT 1006C8 47F9 00102C82 426 FAIL LEA FAILMSG,A3 ;POINT TO MESSAGE 1006CE 6100 01FE 427 QUIT BSR PRTMSG 1006D2 6000 FD50 428 BRA GET_CMD 429 ; 1006D6 6100 02F6 430 MOOV BSR GETADR ;get start addr 1006DA 2242 431 MOVEA.L D2,A1 1006DC 6100 02F0 432 BSR GETADR ;get end addr 1006E0 2442 433 MOVEA.L D2,A2 1006E2 528A 434 ADDQ.L #1,A2 ;Needed because using (A1)+ 1006E4 6100 02E8 435 BSR GETADR ;get dest addr 1006E8 2642 436 MOVEA.L D2,A3 1006EA 16D9 437 MOOV1 MOVE.B (A1)+,(A3)+ ;move bytes 1006EC B5C9 438 CMPA.L A1,A2 ;at end addr yet? 1006EE 66FA 439 BNE.S MOOV1 1006F0 6000 FD32 440 BRA GET_CMD 441 ; 442 ; Edit data on the screen 1006F4 6100 02D8 443 EDIT BSR GETADR ;get start address 1006F8 2442 444 MOVEA.L D2,A2 ;point A2 to memory 1006FA 6100 01E2 445 BSR CRLF ;new line please 1006FE 240A 446 NEW_DAT MOVE.L A2,D2 ;print data address 100700 6100 0226 447 BSR PRT_SIX 100704 6100 01E6 448 BSR SPACE 100708 1412 449 MOVE.B (A2),D2 ;get the data stored 10070A 6100 01F8 450 BSR PRT_BYT ;and show it 10070E 123C 003F 451 MOVE.B #'?',D1 ;Print change prompt 100712 6100 01A2 452 BSR CHAROUT 100716 6100 0268 453 BSR GET_BYT ;get new data 10071A 4A02 454 TST.B D2 ;no change desired? 10071C 6702 455 BEQ.S ENTR_IT ;jump if new data 10071E 1212 456 MOVE.B (A2),D1 ;reget old data 100720 14C1 457 ENTR_IT MOVE.B D1,(A2)+;save data and bump 100722 61DA 458 BSR.S NEW_DAT ;pointer 459 ; 460 ; Display or modify register data as 461 ; required. SEARCH left A6 pointing one 462 ; beyond the CR or SP which follows the 463 ; principal command character. 464 ; Next line added in mon209 to set where to return 100724 13FC 0000 000FFF38 465 REGMOD MOVE.B #$00,REGTYP 10072C 0C2E 000D FFFF 466 CMPI.B #CR,-1(A6);is previous CR? 100732 6608 467 BNE.S REGMOD0 ;no, so skip 100734 6100 03A2 468 BSR REGPRT1 100738 6000 FCEA 469 BRA GET_CMD 10073C 6100 0324 470 REGMOD0 BSR SKIPSP ;skip leading SPs 100740 121E 471 MOVE.B (A6)+,D1;get the next char 100742 6100 02B6 472 BSR UP_CASE 100746 267C 000FFFA0 473 MOVEA.L #SAVREGS+32,A3 ;temporary 10074C 0C01 0041 474 CMPI.B #'A',D1 100750 6774 475 BEQ.S REGMOD1 ;A reg so jump 100752 267C 000FFF80 476 MOVEA.L #SAVREGS,A3 ;temporary 100758 0C01 0044 477 CMPI.B #'D',D1 10075C 6768 478 BEQ.S REGMOD1 ;D reg so jump 10075E 267C 000FFFC0 479 MOVEA.L #SAV_PC,A3 ;temporary 100764 0C01 0050 480 CMPI.B #'P',D1 100768 6600 00C8 481 BNE REGME 482 ; No command errors, so we modify the PC. 10076C 1801 483 MOVE.B D1,D4 ;will need 'P' later 10076E 121E 484 MOVE.B (A6)+,D1;get next char 100770 6100 0288 485 BSR UP_CASE 100774 0C01 0043 486 CMPI.B #'C',D1 ;is it 'C'? 100778 6600 00B8 487 BNE REGME ;no,so quit 10077C 1601 488 MOVE.B D1,D3 ;will need 'C' later 10077E 121E 489 MOVE.B (A6)+,D1;get last char 100780 0C01 000D 490 CMPI.B #CR,D1 ;is it CR? 100784 6600 00AC 491 BNE REGME ;no,so quit 100788 6100 0154 492 BSR CRLF ;passed all tests 10078C 1204 493 MOVE.B D4,D1 ;display the 'P' 10078E 6100 0126 494 BSR CHAROUT 100792 1203 495 MOVE.B D3,D1 ;display the 'C' 100794 6100 0120 496 BSR CHAROUT 100798 123C 003A 497 MOVE.B #':',D1 ;also a ':' 10079C 6100 0118 498 BSR CHAROUT 1007A0 6100 014A 499 BSR SPACE ;a ' ' looks good 1007A4 241B 500 MOVE.L (A3)+,D2;get the data in D2 1007A6 6100 0176 501 BSR PRT_LON ;display it 1007AA 6100 0140 502 BSR SPACE ;another ' ' 1007AE 123C 003F 503 MOVE.B #'?',D1 ;now a '?' 1007B2 6100 0102 504 BSR CHAROUT 1007B6 6100 0134 505 BSR SPACE ;one more ' ' 1007BA 6100 0200 506 BSR GETADRT ;get new data in D2 1007BE 4A06 507 TST.B D6 ;check flag for CR 1007C0 6662 508 BNE REGMQ ;was FF so quit it 1007C2 2702 509 MOVE.L D2,-(A3);save it 1007C4 605E 510 BRA REGMQ ;done 511 ;This portion modifies the A and D registers 1007C6 1801 512 REGMOD1 MOVE.B D1,D4 ;save the A or D 1007C8 121E 513 MOVE.B (A6)+,D1;get register # 1007CA 0C01 0030 514 CMPI.B #'0',D1 ;within bounds? 1007CE 6B62 515 BMI REGME ;< than, no good 1007D0 0C01 0037 516 CMPI.B #'7',D1 1007D4 6E5C 517 BGT REGME ;> than, no good 1007D6 1601 518 MOVE.B D1,D3 ;will need # later 1007D8 121E 519 MOVE.B (A6)+,D1;get last char 1007DA 0C01 000D 520 CMPI.B #CR,D1 ;is it CR? 1007DE 6652 521 BNE REGME ;no, so quit 1007E0 1203 522 MOVE.B D3,D1 ;find displacement 1007E2 0281 0000000F 523 ANDI.L #$F,D1 ;remove ASCII bias 1007E8 E581 524 ASL.L #2,D1 ;multiply by 4 1007EA D7C1 525 ADDA.L D1,A3 ;A3 points correctly 1007EC 1204 526 MOVE.B D4,D1 ;display 'A' or 'D' 1007EE 6100 00C6 527 BSR CHAROUT 1007F2 1203 528 MOVE.B D3,D1 ;display the # 1007F4 6100 00C0 529 BSR CHAROUT 1007F8 123C 003A 530 MOVE.B #':',D1 ;also a ':' 1007FC 6100 00B8 531 BSR CHAROUT 100800 6100 00EA 532 BSR SPACE ;a ' ' looks good 100804 241B 533 MOVE.L (A3)+,D2;get the data in D2 100806 6100 0116 534 BSR PRT_LON ;display it 10080A 6100 00E0 535 BSR SPACE ;another ' ' 10080E 123C 003F 536 MOVE.B #'?',D1 ;now a '?' 100812 6100 00A2 537 BSR CHAROUT 100816 6100 00D4 538 BSR SPACE ;one more ' ' 10081A 6100 01A0 539 BSR GETADRT ;get new data in D2 10081E 4A06 540 TST.B D6 ;check flag for CR 100820 6602 541 BNE REGMQ ;was FF so quit it 100822 2702 542 MOVE.L D2,-(A3);save it 543 ; 544 ; Added in mon209 to exit from different regmod types 100824 0C39 00FF 000FFF38 545 REGMQ CMPI.B #$FF,REGTYP 10082C 6600 FBF6 546 BNE GET_CMD 100830 4E75 547 RTS 548 ; 100832 0C39 00FF 000FFF38 549 REGME CMPI.B #$FF,REGTYP 10083A 6600 0110 550 BNE CMDERR 10083E 4E75 551 RTS 552 ; 553 ; initialize DUART 554 ; 100840 41F9 00700001 555 SERINI LEA.L duart,A0 100846 117C 0000 0008 556 MOVE.B #0,acr(A0) 10084C 117C 00CC 0002 557 MOVE.B #$CC,csra(A0) ;chan. A = 38.4k 100852 117C 0010 0004 558 MOVE.B #$10,cra(A0) ;point to mr1a 100858 10BC 0013 559 MOVE.B #$13,mr1a(A0) 10085C 10BC 0007 560 MOVE.B #$07,mr2a(A0) 100860 117C 00CC 0012 561 MOVE.B #$CC,csrb(A0) ;chan. B = 38.4k 100866 117C 0010 0014 562 MOVE.B #$10,crb(A0) ;point to mr1b 10086C 117C 0013 0010 563 MOVE.B #$13,mr1b(A0) 100872 117C 0007 0010 564 MOVE.B #$07,mr2b(A0) 100878 117C 0005 0004 565 MOVE.B #5,cra(A0) ;enable TxDA, RxDA 10087E 117C 0005 0014 566 MOVE.B #5,crb(A0) ;enable TxDB, RxDB 100884 4E75 567 RTS 568 ; 569 ; Returns Z-flag = 0 if no char. 100886 48E78080 570 INSTAT MOVEM.L D0/A0,-(A7) 10088A 41F9 00700001 571 LEA.L duart,A0 ;point to DUART 100890 1028 0002 572 MOVE.B sra(A0),D0 ;get port A status 100894 0200 0001 573 ANDI.B #1,D0 ;test RxRDY bit 100898 4CDF0101 574 MOVEM.L (A7)+,D0/A0 ;movem affects no flags 10089C 4E75 575 RTS 576 ; 577 ; Returns 7-bit char in D1.B 10089E 2F08 578 CHARIN MOVEM.L A0,-(A7) 1008A0 61E4 579 CHARIN1 BSR.S INSTAT ;check receiver status 1008A2 67FC 580 BEQ.S CHARIN1 ;loop if no character waiting 1008A4 41F9 00700001 581 LEA.L duart,A0 ;point to DUART 1008AA 1228 0006 582 MOVE.B tba(A0),D1 ;get the ASCII character 1008AE 0201 007F 583 ANDI.B #$7F,D1 ;strip off MSB 1008B2 205F 584 MOVEM.L (A7)+,A0 1008B4 4E75 585 RTS 586 ; 587 ; Sends out char in D1.B 1008B6 2F08 588 CHAROUT MOVEM.L A0,-(A7) 1008B8 41F9 00700001 589 LEA.L duart,A0 ;point to DUART 1008BE 0828 0002 0002 590 CHOT2 BTST.B #2,sra(A0) ;check status 1008C4 67F8 591 BEQ CHOT2 ;loop if not ready 1008C6 1141 0006 592 MOVE.B D1,tba(A0) ;send it out 1008CA 205F 593 MOVEM.L (A7)+,A0 1008CC 4E75 594 RTS 595 ; 596 ; This routine prints a message pointed to 597 ; by A3. The message must end in a NULL. 1008CE 121B 598 PRTMSG MOVE.B (A3)+,D1;get a char 1008D0 6704 599 BEQ.S PRTMEX ;quit on 0 1008D2 61E2 600 BSR.S CHAROUT ;display the char 1008D4 60F8 601 BRA.S PRTMSG ;do it again 1008D6 4E75 602 PRTMEX RTS 603 ; 604 ; Inputs and echoes a character 1008D8 61C4 605 CHARIO BSR.S CHARIN 1008DA 61DA 606 BSR.S CHAROUT 1008DC 4E75 607 RTS 608 ; 609 ; Send out CR and LF 1008DE 123C 000D 610 CRLF MOVE.B #CR,D1 ;send ASCII CR 1008E2 61D2 611 BSR.S CHAROUT 1008E4 123C 000A 612 MOVE.B #LF,D1 ;send ASCII LF 1008E8 61CC 613 BSR.S CHAROUT 1008EA 4E75 614 RTS 615 ; 616 ; Send out a SP 1008EC 123C 0020 617 SPACE MOVE.B #' ',D1 ;send ASCII SP 1008F0 61C4 618 BSR.S CHAROUT 1008F2 4E75 619 RTS 620 ; 621 ; Send two spaces to the screen 1008F4 61F6 622 TWO_SP BSR.S SPACE 1008F6 61F4 623 BSR.S SPACE 1008F8 4E75 624 RTS 625 ; 626 ; Prints sign-on message 1008FA 267C 00102B20 627 SIGN_ON MOVEA.L #HELLO,A3 ;point to 'HELLO' 100900 61CC 628 BSR.S PRTMSG ;send it out 100902 4E75 629 RTS 630 ; 631 ; Takes a byte in D2.B, converts to 2 632 ; ASCII characters and puts them on screen. 100904 2202 633 PRT_BYT MOVE.L D2,D1 ;init conversion reg 100906 E919 634 ROL.B #4,D1 ;do upper nibble first 100908 6164 635 BSR NUM_ASC ;convert to ASCII 10090A 61AA 636 BSR.S CHAROUT 10090C 2202 637 MOVE.L D2,D1 ;now do lower nibble 10090E 615E 638 BSR NUM_ASC 100910 61A4 639 BSR.S CHAROUT ;send character 100912 4E75 640 RTS 641 ; 642 ; Takes a word in D2.W, converts to 4 643 ; ASCII characters and puts them on screen. 100914 E15A 644 PRT_WRD ROL.W #8,D2 ;swap bytes in word 100916 61EC 645 BSR.S PRT_BYT ;output MSB 100918 E15A 646 ROL.W #8,D2 ;reswap bytes 10091A 61E8 647 BSR.S PRT_BYT ;output LSB 10091C 4E75 648 RTS 649 ; 650 ; Takes a long word in D2.L, converts to 8 651 ; ASCII characters and puts them on screen. 10091E 4842 652 PRT_LON SWAP D2 ;get upper 16 bits 100920 61F2 653 BSR.S PRT_WRD ;convert 4 chars 100922 4842 654 SWAP D2 ;get lower 16 bits 100924 61EE 655 BSR.S PRT_WRD 100926 4E75 656 RTS 657 ; 658 ; Takes a long word in D2.L, and prints the 659 ; least significand 6 ASCII on the screen. 100928 4842 660 PRT_SIX SWAP D2 ;get upper 16 bits 10092A 61D8 661 BSR.S PRT_BYT ;convert 4 chars 10092C 4842 662 SWAP D2 ;get lower 16 bits 10092E 61E4 663 BSR.S PRT_WRD 100930 4E75 664 RTS 665 ; 666 ; Checks to see if D1.B contains a valid HEX 667 ; digit. 100932 0C01 0046 668 VALDIG CMPI.B #'F',D1 ;char > 'F' ? 100936 6E1E 669 BGT DATAERR ;yes, so alert 100938 0C01 0030 670 CMPI.B #'0',D1 ;char < '0' ? 10093C 6D18 671 BLT DATAERR ;yes, so alert 10093E 0C01 0039 672 CMPI.B #'9',D1 ;char < = '9'? 100942 6F06 673 BLE.S VALDIGE ;'0' < char < '9' 100944 0C01 0041 674 CMPI.B #'A',D1 ;char < 'A'? 100948 6D0C 675 BLT DATAERR ;yes, so alert 10094A 4E75 676 VALDIGE RTS ;'A' < char < 'F' 677 ; 678 ; Prints out the message "Bad Command" 679 ; then looks for another command. 10094C 267C 00102AF6 680 CMDERR MOVEA.L #BADCMD,A3 ;point to message 100952 6000 1502 681 BRA REPORT ;restart monitor 682 ; 683 ; Prints out the message "Invalid address 684 ; or hex data." Then it restarts monitor. 100956 267C 00102B03 685 DATAERR MOVEA.L #INVDATA,A3;point to message 10095C 6000 14F8 686 BRA REPORT ;restart monitor 687 ; 688 ; Converts legit ASCII #s to BCD. 100960 0401 0030 689 ASC_BCD SUBI.B #$30,D1 ;remove ASCII bias 100964 0C01 000A 690 CMPI.B #10,D1 ;0-9? 100968 6B02 691 BMI.S ASC_BX ;Yes, so job's done 10096A 5F01 692 SUBQ.B #7,D1 ;remove alpha bias 10096C 4E75 693 ASC_BX RTS 694 ; 695 ; Convert HEX digit in D1.B to ASCII 10096E 0201 000F 696 NUM_ASC ANDI.B #$F,D1 ;reset upper nibble 100972 0601 0030 697 ADDI.B #$30,D1 ;add ASCII bias 100976 0C01 003A 698 CMPI.B #$3A,D1 ;test if > '9' 10097A 6B02 699 BMI.S NUM_EX ;< '9' so done 10097C 5E01 700 ADDQ.B #7,D1 ;> '9', so add 7 10097E 4E75 701 NUM_EX RTS 702 ; 703 ; It first fills INPBUF with chars until a 704 ; CR occurs. The chars are then examined. 705 ; If 1st char is CR then it sets D2.B and 706 ; quits. Else it resets D2.B and proceeds to 707 ; change valid hex digits to ASCII numbers. 708 ; This routine is only used by EDIT. 100980 6100 008A 709 GET_BYT BSR GETLIN ;get chars from kbd 100984 2C7C 000FFF60 710 MOVEA.L #INPBUF,A6 ;reset A6 10098A 6100 00D6 711 GETB1 BSR SKIPSP ;get rid if spaces 10098E 121E 712 MOVE.B (A6)+,D1;get first char 100990 50C2 713 ST D2 ;set D2.B for now 100992 6166 714 BSR UP_CASE ;convert to UC 100994 0C01 000D 715 CMPI.B #CR,D1 ;test for CR 100998 6720 716 BEQ.S GETBX ;if CR, no change 10099A 6196 717 BSR.S VALDIG ;valid digit? 10099C 61C2 718 BSR.S ASC_BCD ;convert into hex 10099E 1401 719 MOVE.B D1,D2 ;save 1st digit 1009A0 121E 720 MOVE.B (A6)+,D1;get second digit 1009A2 6156 721 BSR UP_CASE 1009A4 0C01 000D 722 CMPI.B #CR,D1 ;test for CR 1009A8 6604 723 BNE.S GETB2 ;not CR, so process 1009AA 1202 724 MOVE.B D2,D1 ;reget 1st digit 1009AC 600A 725 BRA.S GETB3 ;and get out 1009AE 6100 FF82 726 GETB2 BSR VALDIG ;valid digit? 1009B2 61AC 727 BSR.S ASC_BCD ;convert into hex 1009B4 E91A 728 ROL.B #4,D2 ;move first digit 1009B6 D202 729 ADD.B D2,D1 ;form final result 1009B8 51C2 730 GETB3 SF D2 ;signal change 1009BA 4E75 731 GETBX RTS 732 ; 733 ; Gets keyboard input and transforms it into 734 ; a longword into D2. If only a CR was typed 735 ; then D6.B contains $FF, else it's 0. 1009BC 614E 736 GETADRT BSR GETLIN ;fill buffer 1009BE 2C7C 000FFF60 737 MOVEA.L #INPBUF,A6 ;repoint A6 1009C4 50C6 738 ST D6 ;set flag in D6.B 1009C6 0C16 000D 739 CMPI.B #CR,(A6) ;check 1st char 1009CA 672C 740 BEQ.S EX_ADR ;if it's CR then exit 1009CC 51C6 741 SF D6 ;not CR, so reset D6.B 1009CE 6100 0092 742 GETADR BSR SKIPSP ;skip over SPs 1009D2 4281 743 CLR.L D1 ;init temp register 1009D4 4282 744 CLR.L D2 ;init result register 1009D6 121E 745 NEXTCHR MOVE.B (A6)+,D1;get a char 1009D8 6120 746 BSR UP_CASE 1009DA 0C01 000D 747 CMPI.B #CR,D1 ;exit if CR 1009DE 6718 748 BEQ.S EX_ADR 1009E0 0C01 0020 749 CMPI.B #' ',D1 ;exit if SP 1009E4 6712 750 BEQ.S EX_ADR 1009E6 6100 FF4A 751 BSR VALDIG ;valid digit? 1009EA 6100 FF74 752 BSR ASC_BCD ;convert it to hex 1009EE E99A 753 ROL.L #4,D2 ;next digit in D2 1009F0 0202 00F0 754 ANDI.B #$F0,D2 1009F4 D401 755 ADD.B D1,D2 ;insert new digit 1009F6 60DE 756 BRA.S NEXTCHR ;and continue 1009F8 4E75 757 EX_ADR RTS 758 ; 759 ; Changes chars in the range 'a'=buffer 100A50 5206 795 ADDQ.B #1,D6 ;update char count 100A52 6100 FE62 796 BSR CHAROUT ;echo the char 100A56 60C0 797 BRA.S GETCHAR ;get another char 100A58 1C81 798 GETCHX MOVE.B D1,(A6) ;Place CR in buffer 100A5A 5206 799 ADDQ.B #1,D6 ;and count it 100A5C 6100 FE80 800 BSR CRLF ;send a CR & LF 100A60 4E75 801 RTS 802 ; 803 ; If not SP do nothing. If SP increment 804 ; pointer A6 by one. 100A62 0C16 0020 805 SKIPSP CMPI.B #' ',(A6) 100A66 6604 806 BNE.S SKIPSPE 100A68 528E 807 ADDQ.L #1,A6 100A6A 60F6 808 BRA.S SKIPSP 100A6C 4E75 809 SKIPSPE RTS 810 ; 811 ; Initializes the user registers to zeros. 100A6E 227C 000FFF80 812 NULLREG MOVEA.L #SAVREGS,A1 100A74 247C 000FFFF0 813 MOVEA.L #ENDRAM,A2 100A7A 4219 814 NULLR1 CLR.B (A1)+ ;clear them 100A7C B5C9 815 CMPA.L A1,A2 ;done yet? 100A7E 66FA 816 BNE.S NULLR1 100A80 23FC 000FFEA0 000FFFBC 817 MOVE.L #USTCK,SAV_A7 100A8A 42B9 000FFF2A 818 CLR.L UNADR 100A90 4E75 819 RTS 820 ; 821 ; This routine saves the registers of the 822 ; executed program for future display and 823 ; future restoration. 100A92 48F97FFF 000FFF80 824 REG_SAV MOVEM.L D0-D7/A0-A6,SAVREGS ;d0-a6 100A9A 201F 825 MOVE.L (A7)+,D0 ;pop ret address 100A9C 33DF 000FFFC4 826 MOVE.W (A7)+,SAV_SR ;pop SR 100AA2 23FA F51C 000FFF26 827 MOVE.L SAV_PC,OLD_PC 100AAA 23DF 000FFFC0 828 MOVE.L (A7)+,SAV_PC ;pop PC 100AB0 2F00 829 MOVE.L D0,-(A7) ;repush ret addr 100AB2 4E6D 830 MOVE.L USP,A5 ;get user's A7 100AB4 23CD 000FFFBC 831 MOVE.L A5,SAV_A7 ;save it 100ABA 4E75 832 RTS 833 ; 834 ; This routine restores the registers of a 835 ; program whose execution terminates with 836 ; either a trap #9 or some other trap put 837 ; in place to breakpoint a program. Transfer 838 ; to the user program is then accomplished 839 ; with an RTE instruction. 100ABC 201F 840 REGREST MOVE.L (A7)+,D0 ;pop ret address 100ABE 2A7A F4FC 841 MOVEA.L SAV_A7,A5 ;get user's A7 100AC2 4E65 842 MOVE.L A5,USP ;restore it 100AC4 2F3A F4FA 843 MOVE.L SAV_PC,-(A7) ;push PC 100AC8 3F3A F4FA 844 MOVE.W SAV_SR,-(A7) ;push SR 100ACC 2F00 845 MOVE.L D0,-(A7) ;repush ret addr 100ACE 4CFA7FFF F4AE 846 MOVEM.L SAVREGS,D0-D7/A0-A6 ;d0-a6 100AD4 4E75 847 RTS 848 ; 849 ; This routine will diplay the register 850 ; information saved by REG_SAV. 100AD6 611E 851 REG_PRT BSR PRTOLD ;Old PC with disassembly 100AD8 207C 000FFF80 852 REGPRT1 MOVEA.L #SAVREGS,A0 ;A0 -> reg. data 100ADE 1E3C 0044 853 MOVE.B #'D',D7 ;print the D regs 100AE2 6100 0094 854 BSR REGDISP 100AE6 1E3C 0041 855 MOVE.B #'A',D7 ;print the A regs 100AEA 6100 008C 856 BSR REGDISP 100AEE 6154 857 BSR PRTNEW 100AF0 6100 00C2 858 BSR PRTSR 100AF4 4E75 859 RTS 860 ; 861 ; Disassebly and display of the OPCODE at OLD_PC. 100AF6 2A7A F42E 862 PRTOLD MOVEA.L OLD_PC,A5 ;Disassem address in A5 100AFA 6100 0562 863 BSR UNASMB ;call unasm core routine 100AFE 240D 864 MOVE.L A5,D2 ;move instruction address 100B00 6100 FE26 865 BSR PRT_SIX 100B04 6100 FDEE 866 BSR TWO_SP 100B08 4283 867 CLR.L D3 ;blank spaces counter (BSC) 100B0A 341D 868 PRTOLD1 MOVE.W (A5)+,D2 ;get word 100B0C 6100 FE06 869 BSR PRT_WRD ;print word of hex code 100B10 6100 FDDA 870 BSR SPACE ;space 100B14 5403 871 ADDQ.B #2,D3 ;add 2 bytes to BSC 100B16 5506 872 SUBQ.B #2,D6 ;reduce length counter by 2 100B18 66F0 873 BNE.S PRTOLD1 ;if more bytes print again 100B1A 0C03 000A 874 PRTOLD2 CMPI.B #10,D3 ;is the string 10 bytes 100B1E 6C10 875 BGE.S PRTOLD3 100B20 6100 FDD2 876 BSR TWO_SP 100B24 6100 FDCE 877 BSR TWO_SP 100B28 6100 FDC2 878 BSR SPACE 100B2C 5403 879 ADDQ.B #2,D3 100B2E 60EA 880 BRA.S PRTOLD2 100B30 6100 FDBA 881 PRTOLD3 BSR SPACE 100B34 267C 000FFF2E 882 MOVEA.L #UASMCMD,A3 ;point A3 to unasm cmd buff 100B3A 6100 FD92 883 BSR PRTMSG ;display commant text 100B3E 6100 FD9E 884 BSR CRLF 100B42 4E75 885 RTS 886 ; 887 ; Next PC is printed and disassembled. 100B44 267C 00102CB0 888 PRTNEW MOVEA.L #PC_MSG,A3 100B4A 6100 FD82 889 BSR PRTMSG 100B4E 243A F470 890 MOVE.L SAV_PC,D2 ;get the register 100B52 6100 FDD4 891 BSR PRT_SIX 100B56 267C 00102C99 892 MOVEA.L #SP24MSG,A3 100B5C 6100 FD70 893 BSR PRTMSG 100B60 2A7A F45E 894 MOVEA.L SAV_PC,A5 100B64 6100 04F8 895 BSR UNASMB 100B68 267C 000FFF2E 896 MOVEA.L #UASMCMD,A3 ;A3 -> to unasm cmd buffer 100B6E 6100 FD5E 897 BSR PRTMSG ;display command text 100B72 6100 FD6A 898 BSR CRLF 100B76 4E75 899 RTS 900 ; 100B78 1A3C 0030 901 REGDISP MOVE.B #'0',D5 ;register # in here 100B7C 1207 902 REGD1 MOVE.B D7,D1 ;print reg letter 100B7E 6100 FD36 903 BSR CHAROUT 100B82 1205 904 MOVE.B D5,D1 ;print reg number 100B84 6100 FD30 905 BSR CHAROUT 100B88 6100 00D4 906 BSR COL_SP ;print :, space 100B8C 2418 907 MOVE.L (A0)+,D2;print the register 100B8E 6100 FD8E 908 BSR PRT_LON 100B92 6100 FD60 909 BSR TWO_SP ;print 2 spaces 100B96 6100 FD54 910 BSR SPACE 100B9A 5205 911 ADDQ.B #1,D5 100B9C 0C05 0038 912 CMPI.B #'8',D5 ; D5 = '8' yet? 100BA0 670C 913 BEQ.S REGDFIN ; if yes then exit 100BA2 0C05 0034 914 CMPI.B #'4',D5 ; D5 = '4' yet? 100BA6 66D4 915 BNE.S REGD1 ; no, then next reg 100BA8 6100 FD34 916 BSR CRLF ; D5 = '4' send CRLF 100BAC 60CE 917 BRA.S REGD1 ; and do next reg 100BAE 6100 FD2E 918 REGDFIN BSR CRLF 100BB2 4E75 919 RTS 920 ; 921 ; Print the USR 100BB4 267C 00102CB7 922 PRTSR MOVEA.L #SR_MSG,A3 100BBA 6100 FD12 923 BSR PRTMSG 100BBE 343A F404 924 MOVE.W SAV_SR,D2 100BC2 3802 925 MOVE.W D2,D4 ;copy SR to D4 100BC4 6100 FD4E 926 BSR PRT_WRD ;print the register 100BC8 6100 FD2A 927 BSR TWO_SP ;print 2 spaces 928 ; Print "Flags: X = " and X flag 100BCC 267C 001023FC 929 MOVEA.L #MESGFLG,A3 100BD2 6100 FCFA 930 BSR PRTMSG 100BD6 123C 0031 931 MOVE.B #'1',D1 100BDA 0804 0004 932 BTST.B #4,D4 100BDE 6604 933 BNE.S REGETC1 100BE0 123C 0030 934 MOVE.B #'0',D1 100BE4 6100 FCD0 935 REGETC1 BSR CHAROUT 936 ;Print ", N = " and N flag 100BE8 267C 00102409 937 MOVEA.L #MESGN,A3 100BEE 6100 FCDE 938 BSR PRTMSG 100BF2 123C 0031 939 MOVE.B #'1',D1 100BF6 0804 0003 940 BTST.B #3,D4 100BFA 6604 941 BNE.S REGETC2 100BFC 123C 0030 942 MOVE.B #'0',D1 100C00 6100 FCB4 943 REGETC2 BSR CHAROUT 944 ;Print ", Z = " and Z flag 100C04 267C 00102410 945 MOVEA.L #MESGZ,A3 100C0A 6100 FCC2 946 BSR PRTMSG 100C0E 123C 0031 947 MOVE.B #'1',D1 100C12 0804 0002 948 BTST.B #2,D4 100C16 6604 949 BNE.S REGETC3 100C18 123C 0030 950 MOVE.B #'0',D1 100C1C 6100 FC98 951 REGETC3 BSR CHAROUT 952 ;Print ", V = " and V flag 100C20 267C 00102417 953 MOVEA.L #MESGV,A3 100C26 6100 FCA6 954 BSR PRTMSG 100C2A 123C 0031 955 MOVE.B #'1',D1 100C2E 0804 0001 956 BTST.B #1,D4 100C32 6604 957 BNE.S REGETC4 100C34 123C 0030 958 MOVE.B #'0',D1 100C38 6100 FC7C 959 REGETC4 BSR CHAROUT 960 ;Print " C = " and C flag 100C3C 267C 0010241E 961 MOVEA.L #MESGC,A3 100C42 6100 FC8A 962 BSR PRTMSG 100C46 123C 0031 963 MOVE.B #'1',D1 100C4A 0804 0000 964 BTST.B #0,D4 100C4E 6604 965 BNE.S REGETC5 100C50 123C 0030 966 MOVE.B #'0',D1 100C54 6100 FC60 967 REGETC5 BSR CHAROUT 100C58 6100 FC84 968 BSR CRLF 100C5C 4E75 969 RTS 970 ; 971 ; Send : and space to the screen 100C5E 123C 003A 972 COL_SP MOVE.B #':',D1 100C62 6100 FC52 973 BSR CHAROUT 100C66 123C 0020 974 MOVE.B #' ',D1 100C6A 6100 FC4A 975 BSR CHAROUT 100C6E 4E75 976 RTS 977 ; 978 ; Download a .HEX file in ASCII S-format. 979 ; A .HEX file consists of pure ASCII chars. 980 ; (See MacKenzie p.50.) The explanation 981 ; below with typical file lines is perfectly 982 ; general and applies to all files. 983 ; 984 ; The 1st line S00700007465737438 signifies: 985 ; S0 = header line 986 ; 07 = $7 bytes to load 987 ; 0000 = address, in this case meaningless 988 ; 74 65 73 74 = ASCII filename "TEST." 989 ; 38 = hex check byte used as follows: 16 990 ; bit check sum = 07+00+00+74+65+73+74+38=FF 991 ; 992 ; The following lines contain code and data. 993 ; A typical line S10780003200428183 means: 994 ; S1 = code line with 16 bit load address 995 ; 07 = $7 bytes to load 996 ; 8000 = start loading at this HEX address 997 ; 32 00 42 81 = code or data to load 998 ; 83 = hex check sum as above 999 ; 1000 ; Another typical line S208AF800032004281D3 1001 ; signifies: 1002 ; S2 = code line with 24 bit load address 1003 ; 08 = $8 bytes to load 1004 ; AF8000 = start loading at this HEX address 1005 ; 32 00 42 81 = execution code to load 1006 ; D3 = hex check sum as always 1007 ; 1008 ; There are two kinds of footer line: 1009 ; The line S90380007C signifies: 1010 ; S9 = This line contains a 16-bit entry 1011 ; address, in this case 8000. The byte 1012 ; count is 03 and 7C is the check sum. 1013 ; 1014 ; The second kind of footer line is, e.g. 1015 ; S804AF8000CC signifies: 1016 ; S8 = This line contains a 24-bit entry 1017 ; address, in this case AF8000. The byte 1018 ; count is 04 and CC is the check sum. 1019 ; 1020 ; S5 lines exist too. They inform you of 1021 ; the number of lines of code in the file. 1022 ; Nothing will happen if we simply ignore 1023 ; these lines. 1024 ; 1025 ; The code directly below steers the 1026 ; loading. 100C70 2A7C 00000000 1027 LD_FILE MOVEA.L #0,A5 ;A5 holds offset address 100C76 0C2E 000D FFFF 1028 CMPI.B #CR,-1(A6);Is previous CHAR a CR? 100C7C 6706 1029 BEQ.S LD_FIL0 ;Yes so skip 100C7E 6100 FD4E 1030 BSR GETADR ;get offset address 100C82 2A42 1031 MOVEA.L D2,A5 ;save for later 100C84 267C 00102B99 1032 LD_FIL0 MOVEA.L #LS_MSG,A3;Tell'em to start 100C8A 6100 FC42 1033 BSR PRTMSG ;sending the file 100C8E 6100 FC0E 1034 LD_FIL1 BSR CHARIN ;Get first char 100C92 0C01 0003 1035 CMPI.B #3,D1 ;Is it ^C? 100C96 6700 F78C 1036 BEQ GET_CMD ;Yes, so abandon 100C9A 0C01 0053 1037 CMPI.B #'S',D1 ;Is it 'S'? 100C9E 670C 1038 BEQ.S IS_S ;Yes, get next char 1039 ; The end of line CR and LF are handled here. If 1040 ; it's a CR then send a CRLF else get another char 100CA0 0C01 000D 1041 CMPI.B #CR,D1 ;Is it CR? 100CA4 66E8 1042 BNE.S LD_FIL1 ;No, so dump LFs 100CA6 6100 FC36 1043 BSR CRLF ;If CR, then do CRLF 100CAA 66E2 1044 BNE.S LD_FIL1 ;get another char 100CAC 6100 FC08 1045 IS_S BSR CHAROUT ;Print the 'S' 100CB0 6100 FBEC 1046 BSR CHARIN ;get next char 100CB4 0C01 0030 1047 CMPI.B #'0',D1 ;Is it '0'? 100CB8 673A 1048 BEQ.S S0 ;if so branch 100CBA 51F9 000FFFEC 1049 SF S2_FLG ;Reset flag 100CC0 0C01 0031 1050 CMPI.B #'1',D1 ;Is it '1'? 100CC4 6766 1051 BEQ.S S12 ;It's '1' so process 100CC6 50F9 000FFFEC 1052 ST S2_FLG ;Set flag 100CCC 0C01 0032 1053 CMPI.B #'2',D1 ;Is it '2'? 100CD0 675A 1054 BEQ.S S12 ;It's '2' so process 100CD2 0C01 0035 1055 CMPI.B #'5',D1 ;Is it '5'? 100CD6 6766 1056 BEQ.S S5 ;Yes, go dump line 100CD8 50F9 000FFFEC 1057 ST S2_FLG ;Set flag 100CDE 0C01 0038 1058 CMPI.B #'8',D1 ;Is it '8'? 100CE2 676C 1059 BEQ.S S89 ;if so branch 100CE4 51F9 000FFFEC 1060 SF S2_FLG ;Reset flag 100CEA 0C01 0039 1061 CMPI.B #'9',D1 ;Is it '9'? 100CEE 6760 1062 BEQ.S S89 ;if so branch 100CF0 6000 013C 1063 BRA LD_ERR ;None of above, err 1064 ; 1065 ; A line that begins with S0 is the header 1066 ; containing the name 100CF4 4204 1067 S0 CLR.B D4 ;Null hex check sum 100CF6 6100 00A0 1068 BSR LD_NUM ;line length in D2.B 100CFA 6100 00B6 1069 BSR LD_ADR ;discard 0000 100CFE 207C 000FFF50 1070 MOVEA.L #PRTBUF,A0 100D04 0C02 0001 1071 CMPI.B #1,D2 ;hex check byte yet? 100D08 6718 1072 BEQ.S S0B ;jump if there's no name 100D0A 2F02 1073 S0A MOVE.L D2,-(A7) ;push line length 100D0C 6100 008A 1074 BSR LD_NUM ;get a name char 100D10 1202 1075 MOVE.B D2,D1 100D12 241F 1076 MOVE.L (A7)+,D2;pop line length 100D14 6100 FCE4 1077 BSR UP_CASE ;change to UC 100D18 10C1 1078 MOVE.B D1,(A0)+;store it 100D1A 5302 1079 SUBQ.B #1,D2 ;length counter = 1? 100D1C 0C02 0001 1080 CMPI.B #1,D2 ;hex check byte yet? 100D20 66E8 1081 BNE.S S0A ;if not then loop 100D22 4210 1082 S0B CLR.B (A0) ;end name with NULL 100D24 6100 00EA 1083 BSR LD_CHK ;branch chk 100D28 6000 FF64 1084 BRA LD_FIL1 ;Go to next line 1085 ; 1086 ; Loads an S1 or S2 line 100D2C 4204 1087 S12 CLR.B D4 ;Null hex check sum 100D2E 6168 1088 BSR LD_NUM ;line length in D2.B 100D30 6100 0080 1089 BSR LD_ADR ;line address in A4 100D34 D9CD 1090 ADDA.L A5,A4 ;Add offset to address 100D36 6100 00B4 1091 BSR LD_DATA ;load data 100D3A 6000 FF52 1092 BRA LD_FIL1 ;Go to next line 1093 ; 1094 ; Discard all chars in the S5 line 100D3E 6158 1095 S5 BSR LD_NUM ;line length in D2.B 100D40 D402 1096 ADD.B D2,D2 ;double it and add 2 100D42 5402 1097 ADDQ.B #2,D2 ;to discard the CRLF 100D44 6100 FB58 1098 S5A BSR CHARIN ;Input and echo char 100D48 5302 1099 SUBQ.B #1,d2 100D4A 66F8 1100 BNE.S S5A 100D4C 6000 FF40 1101 BRA LD_FIL1 ;Go to next line 1102 ; 1103 ; End of file line. Its data is used to 1104 ; change the value of the user PC. Works 1105 ; with S8 and S9 lines. 100D50 4204 1106 S89 CLR.B D4 ;Null hex check sum 100D52 6144 1107 BSR LD_NUM ;line length in D2.B 100D54 615C 1108 BSR LD_ADR ;load address in A4 100D56 23CC 000FFFC0 1109 MOVE.L A4,SAV_PC ;save it 100D5C B9FC 00000000 1110 CMPA.L #0,A4 100D62 670C 1111 BEQ.S S89A 100D64 23CC 000FFF2A 1112 MOVE.L A4,UNADR 100D6A 23CC 000FFFC6 1113 MOVE.L A4,DUMPADR 100D70 6100 009E 1114 S89A BSR LD_CHK 100D74 6100 FB28 1115 BSR CHARIN ;read the final CR 100D78 6100 FB24 1116 BSR CHARIN ;and LF 100D7C 6100 FB60 1117 BSR CRLF 100D80 267C 000FFF50 1118 MOVEA.L #PRTBUF,A3;print file name 100D86 6100 FB46 1119 BSR PRTMSG 100D8A 267C 00102B7D 1120 MOVEA.L #LG_MSG,A3 ;print 100D90 6100 FB3C 1121 BSR PRTMSG ;successful load 100D94 6000 F68E 1122 BRA GET_CMD ;go to prompt 1123 ; 1124 ; Reads and echos the two ASCII bytes repre- 1125 ; senting a number and converts them to a HEX 1126 ; number in D2.B. Thus a '2' & 'E' is conver- 1127 ; ted to $2E. Also updates checksum in D4.B 100D98 6100 FB04 1128 LD_NUM BSR CHARIN ;get first char 100D9C 6100 FBC2 1129 BSR ASC_BCD ;convert it to BCD 100DA0 E919 1130 ROL.B #4,D1 ;move it to MSB 100DA2 1401 1131 MOVE.B D1,D2 ;copy to reg D2 100DA4 6100 FAF8 1132 BSR CHARIN ;get second char 100DA8 6100 FBB6 1133 BSR ASC_BCD ;convert it to hex 100DAC D401 1134 ADD.B D1,D2 ;add them 100DAE D802 1135 ADD.B D2,D4 ;update check sum 100DB0 4E75 1136 RTS 1137 ; 1138 ; Routine to extract 16 or 24 bit address 1139 ; from S-file into A4. The line count in D2.B 1140 ; represents the # of words in the S-line. 1141 ; The address info takes 2 or 3 words so the 1142 ; line count is reduced by 2 or 3 at routine's 1143 ; end. Also updates checksum in D4.B 100DB2 4283 1144 LD_ADR CLR.L D3 ;D3.L = 0 100DB4 3A3C 0003 1145 MOVE.W #3,D5 ;Get set for 4 times 100DB8 4A39 000FFFEC 1146 TST.B S2_FLG ;See if set 100DBE 6702 1147 BEQ.S LD_AD1 ;Not set, so skip 100DC0 5445 1148 ADDQ.W #2,D5 ;Change to 6 times 100DC2 E99B 1149 LD_AD1 ROL.L #4,D3 ;move it up a nibble 100DC4 6100 FAD8 1150 BSR CHARIN ;Get char & convert 100DC8 6100 FB96 1151 BSR ASC_BCD ;to hex in D1.B 100DCC D601 1152 ADD.B D1,D3 ;Add it to D3.B and 100DCE 51CD FFF2 1153 DBRA D5,LD_AD1 ;Loop 4 or 6 times 100DD2 2843 1154 MOVEA.L D3,A4 ;Put address in A4 100DD4 D803 1155 ADD.B D3,D4 ;Update check sum 100DD6 E15B 1156 ROL.W #8,D3 ;for both bytes in 100DD8 D803 1157 ADD.B D3,D4 ;D3.W 100DDA 4843 1158 SWAP D3 ;Update 3rd byte too 100DDC D803 1159 ADD.B D3,D4 ;Checksum now in D4.B 100DDE 5502 1160 SUBQ.B #2,D2 ;line counter-2 100DE0 4A39 000FFFEC 1161 TST.B S2_FLG ;If not set, skip 100DE6 6702 1162 BEQ.S LD_AD2 ;Set, so do one more 100DE8 5302 1163 SUBQ.B #1,D2 ;subtraction 100DEA 4E75 1164 LD_AD2 RTS 1165 ; 1166 ; Loads, into RAM, data in a HEX file whose 1167 ; line begins with S1 or S2. D2 holds the 1168 ; byte count and A4 the loading address. Also 1169 ; updates checksum which is finally checked 1170 ; by the routine that follows. 100DEC 0C02 0001 1171 LD_DATA CMPI.B #1,D2 ;At check byte? 100DF0 671E 1172 BEQ.S LD_CHK ;Yes, jump 100DF2 6100 FAAA 1173 BSR CHARIN ;get char 100DF6 6100 FB68 1174 BSR ASC_BCD ;convert to hex 100DFA E919 1175 ROL.B #4,D1 ;move it to MSB 100DFC 1601 1176 MOVE.B D1,D3 ;copy to reg D3 100DFE 6100 FA9E 1177 BSR CHARIN ;get second char 100E02 6100 FB5C 1178 BSR ASC_BCD ;convert it to hex 100E06 D601 1179 ADD.B D1,D3 ;add them 100E08 18C3 1180 MOVE.B D3,(A4)+;move to load addr 100E0A D803 1181 ADD.B D3,D4 ;update check sum 100E0C 5302 1182 SUBQ.B #1,D2 ;decr. line counter 100E0E 60DC 1183 BRA.S LD_DATA ;Go for more 1184 ; Gets the last byte in an S line. If check 1185 ; sum is not 0FFH it flags an error. 100E10 6100 FA8C 1186 LD_CHK BSR CHARIN ;get char 100E14 6100 FB4A 1187 BSR ASC_BCD ;convert it to hex 100E18 E919 1188 ROL.B #4,D1 ;move it to MSB 100E1A 1601 1189 MOVE.B D1,D3 ;copy to reg D3 100E1C 6100 FA80 1190 BSR CHARIN ;get second char 100E20 6100 FB3E 1191 BSR ASC_BCD ;convert it to hex 100E24 D601 1192 ADD.B D1,D3 ;add them 100E26 D803 1193 ADD.B D3,D4 ;should = 0FFH 100E28 5204 1194 ADDQ.B #1,D4 ;Should be 0 100E2A 6602 1195 BNE.S LD_ERR ;Not 0, so flag it 100E2C 4E75 1196 RTS 1197 ; 1198 ; Flags loading error and goes to GET_CMD 100E2E 267C 00102B58 1199 LD_ERR MOVEA.L #LE_MSG,A3 ;get message ptr 100E34 6000 1020 1200 BRA REPORT ;restart monitor 1201 ; 1202 ; Routine that initializes the tracing 100E38 0C2E 000D FFFF 1203 BEG_TRC CMPI.B #CR,-1(A6);is previous CR? 100E3E 670A 1204 BEQ.S BEG1 ;yes, so start 100E40 6100 FB8C 1205 BSR GETADR ;get execution addr 100E44 23C2 000FFFC0 1206 MOVE.L D2,SAV_PC ;save it 100E4A 6100 FC70 1207 BEG1 BSR REGREST ;restore user regs 100E4E 007C 8000 1208 ORI.W #$8000,SR ;enable tracing 100E52 4E73 1209 RTE 1210 ; 1211 ; If the SKIPFLG is set then jump to TRACE5, else 1212 ; proceed normally. In the regular trace no tracing 1213 ; is done on the 1st pass. If a TRAP instruction is 1214 ; next then tracing is terminated. Tracing continues 1215 ; when a CR is typed. Any other chararacter causes 1216 ; termination of tracing. The FP_FLG is 0 in entry. 100E54 6100 FC3C 1217 TRACE BSR REG_SAV ;save USER registers 100E58 4A39 000FFFEA 1218 TST.B FP_FLG ;is flag = 0? 100E5E 6608 1219 BNE.S TRACE0 ;no, so continue 100E60 50F9 000FFFEA 1220 ST FP_FLG ;it was 0, so set it 100E66 6066 1221 BRA.S TRACE4 ;do nothing this time 100E68 4A39 000FFFEB 1222 TRACE0 TST.B SKIPFLG ;If not 0 100E6E 6674 1223 BNE.S TRACE5 ;then jump 100E70 6100 FC64 1224 BSR REG_PRT ;display them 1225 ; Check if TRAP is the next instruction. 100E74 207A F14A 1226 MOVEA.L SAV_PC,A0 100E78 0C50 4E4F 1227 CMPI.W #$4E4F,(A0) ;> TRAP #15? 100E7C 6E12 1228 BGT.S TRACE1 ;you're okay 100E7E 0C50 4E40 1229 CMPI.W #$4E40,(A0) ;< TRAP #0? 100E82 6D0C 1230 BLT.S TRACE1 ;okay again 100E84 267C 00102C3B 1231 MOVEA.L #TRC_MSG,A3 100E8A 6100 FA42 1232 BSR PRTMSG 100E8E 6020 1233 BRA.S TRACE2 1234 ; Check for CHARIN. If CR then keep tracing. 100E90 123C 003E 1235 TRACE1 MOVE.B #'>',D1 100E94 6100 FA20 1236 BSR CHAROUT 100E98 6100 FA04 1237 BSR CHARIN 100E9C 0C01 000D 1238 CMPI.B #CR,D1 100EA0 6728 1239 BEQ.S TRACE3 100EA2 6100 FA12 1240 BSR CHAROUT ; If R modify register 100EA6 6100 FB52 1241 BSR UP_CASE ; <<<< Added in mon209 >>>> 100EAA 0C01 0052 1242 CMPI.B #'R',D1 ; <<<< Added in mon209 >>>> 100EAE 6752 1243 BEQ.S TRACE6 ; <<<< Added in mon209 >>>> 1244 ; Turn off all tracing and put out prompt. 100EB0 027C 7FFF 1245 TRACE2 ANDI.W #$7FFF,SR ;disable tracing 100EB4 007C 2000 1246 ORI.W #$2000,SR ;enable supervisor 100EB8 0279 7FFF 000FFFC4 1247 ANDI.W #$7FFF,SAV_SR;fix the USR 100EC0 51F9 000FFFEA 1248 SF FP_FLG ;clear flag 100EC6 6000 F55C 1249 BRA GET_CMD 1250 ; Continue tracing 100ECA 6100 FA12 1251 TRACE3 BSR CRLF 100ECE 0279 2FFF 000FFFC4 1252 TRACE4 ANDI.W #$2FFF,SAV_SR;enable user 100ED6 0079 8000 000FFFC4 1253 ORI.W #$8000,SAV_SR;enable tracing 100EDE 6100 FBDC 1254 BSR REGREST 100EE2 4E73 1255 RTE 1256 ; 1257 ; TRACE saved the USER registers. This means 1258 ; that the return address of the routine 1259 ; that called GOSKIP is next on the stack. 100EE4 027C 7FFF 1260 TRACE5 ANDI.W #$7FFF,SR ;disable tracing 100EE8 007C 2000 1261 ORI.W #$2000,SR ;enable supervisor 100EEC 0279 7FFF 000FFFC4 1262 ANDI.W #$7FFF,SAV_SR;fix the USR 100EF4 51F9 000FFFEB 1263 SF SKIPFLG ;clear flag 100EFA 51F9 000FFFEA 1264 SF FP_FLG ;clear flag 100F00 4E75 1265 RTS ;pick up where you left off 1266 ; 1267 ; <<<< Added in mon209 >>>> 1268 ; Get register to be modified then 1269 ; set register value 100F02 6100 FB08 1270 TRACE6 BSR GETLIN 100F06 2C7C 000FFF60 1271 MOVEA.L #INPBUF,A6 ;point to buffer 100F0C 13FC 00FF 000FFF38 1272 MOVE.B #$0FF,REGTYP 100F14 6100 F826 1273 BSR REGMOD0 100F18 6000 FF76 1274 BRA TRACE1 1275 ; 1276 ; Set (at most two) permanent breakpoints. 1277 ; B displays the current breakpoints. 1278 ; B 1
sets breakpoint 1. 1279 ; B 1 clears breakpoint 1. 100F1C 0C2E 000D FFFF 1280 BREAK CMPI.B #CR,-1(A6);is previous CR? 100F22 6728 1281 BEQ.S DSPBRK 1282 ; get breakpoint number in D2.L 100F24 207C 000FFFCA 1283 MOVEA.L #BP_AD3,A0 100F2A 0C16 0031 1284 CMPI.B #'1',(A6);is char a '1'? 100F2E 6706 1285 BEQ.S BREAK1 ;no, then go on 100F30 207C 000FFFCE 1286 MOVEA.L #BP_AD4,A0 100F36 528E 1287 BREAK1 ADDQ.L #1,A6 ;point past # 100F38 0C16 000D 1288 CMPI.B #CR,(A6);is it a CR? 100F3C 6604 1289 BNE.S BREAK2 100F3E 4290 1290 CLR.L (A0) 100F40 6006 1291 BRA.S BREAK3 100F42 6100 FA8A 1292 BREAK2 BSR GETADR 100F46 2082 1293 MOVE.L D2,(A0) ;save it 100F48 6000 F4DA 1294 BREAK3 BRA GET_CMD 1295 ; 1296 ;Deal with 1st breakpoint first. 100F4C 267C 001024B5 1297 DSPBRK MOVEA.L #MSG_8,A3 ;breakpoint 1: 100F52 6100 F97A 1298 BSR PRTMSG 100F56 207C 000FFFCA 1299 MOVEA.L #BP_AD3,A0 ;A0 -> #BP_AD3 100F5C 4A90 1300 TST.L (A0) 100F5E 660C 1301 BNE.S DSPBRK1 100F60 267C 001024D7 1302 MOVEA.L #MSG_10,A3 100F66 6100 F966 1303 BSR PRTMSG 100F6A 6006 1304 BRA.S DSPBRK2 100F6C 2410 1305 DSPBRK1 MOVE.L (A0),D2 100F6E 6100 F9B8 1306 BSR PRT_SIX 1307 ;Deal with 2nd breakpoint next. 100F72 267C 001024C6 1308 DSPBRK2 MOVEA.L #MSG_9,A3 ;breakpoint 1: 100F78 6100 F954 1309 BSR PRTMSG 100F7C 207C 000FFFCE 1310 MOVEA.L #BP_AD4,A0 ;A0 -> #BP_AD3 100F82 4A90 1311 TST.L (A0) 100F84 660C 1312 BNE.S DSPBRK3 100F86 267C 001024D7 1313 MOVEA.L #MSG_10,A3 100F8C 6100 F940 1314 BSR PRTMSG 100F90 6006 1315 BRA.S DSPBRK4 100F92 2410 1316 DSPBRK3 MOVE.L (A0),D2 100F94 6100 F992 1317 BSR PRT_SIX 100F98 6000 F48A 1318 DSPBRK4 BRA GET_CMD 1319 ; 1320 ; Finds and prints the sum and difference 1321 ; of 2 HEX numbers 100F9C 6100 FA30 1322 HEXCALC BSR GETADR ;get first number 100FA0 2602 1323 MOVE.L D2,D3 ;move it to D3 100FA2 6100 FA2A 1324 BSR GETADR ;get second number 100FA6 2802 1325 MOVE.L D2,D4 ;make a spare in D4 100FA8 D483 1326 ADD.L D3,D2 ;add them 100FAA 267C 00102BD8 1327 MOVEA.L #HS_MSG,A3 100FB0 6100 F91C 1328 BSR PRTMSG ;print sum msg 100FB4 6100 F968 1329 BSR PRT_LON ;print sum 100FB8 2404 1330 MOVE.L D4,D2 ;reload original D2 100FBA 9682 1331 SUB.L D2,D3 ;subtract them 100FBC 2403 1332 MOVE.L D3,D2 ;move to D2 to print 100FBE 267C 00102BE2 1333 MOVEA.L #HD_MSG,A3 100FC4 6100 F908 1334 BSR PRTMSG ;print diff msg 100FC8 6100 F954 1335 BSR PRT_LON ;print difference 100FCC 6000 F456 1336 BRA GET_CMD ;put out prompt 1337 ; 1338 ;**************************************************** 1339 ;Begin Unassemble Routines 1340 ;**************************************************** 1341 ; 1342 ;First get the disassembly start address and # of lines 100FD0 1E3C 000A 1343 UNASM MOVE.B #10,D7 ;Prepare to do 10 lines 100FD4 0C2E 000D FFFF 1344 CMPI.B #CR,-1(A6);is previous CR? 100FDA 6608 1345 BNE.S UNASMS1 ;no, so proceed 100FDC 243A EF4C 1346 MOVE.L UNADR,D2 ;get old disassebly addr 100FE0 2A42 1347 MOVEA.L D2,A5 ;into A5 100FE2 6026 1348 BRA.S UNASMS3 ;stick with 10 lines & go on 100FE4 0C16 002C 1349 UNASMS1 CMPI.B #',',(A6);is char a comma? 100FE8 660A 1350 BNE.S USM1 ;no, then get start address 100FEA 243A EF3E 1351 MOVE.L UNADR,D2 ;get old disassebly addr 100FEE 2A42 1352 MOVEA.L D2,A5 ;into A5 100FF0 528E 1353 ADDQ.L #1,A6 ;point past comma 100FF2 6010 1354 BRA.S UNASMS2 ;get count 100FF4 6100 F9D8 1355 USM1 BSR GETADR ;get start address into D2 100FF8 2A42 1356 MOVEA.L D2,A5 ;and put into A5 100FFA 0C2E 000D FFFF 1357 CMPI.B #CR,-1(A6) ;is previous CR? 101000 6602 1358 BNE.S UNASMS2 ;no, so proceed 101002 6006 1359 BRA.S UNASMS3 101004 6100 F9C8 1360 UNASMS2 BSR GETADR ;get # of lines to display 101008 1E02 1361 MOVE.B D2,D7 1362 ;Command line is totally parsed, so do the disassembly 10100A 6152 1363 UNASMS3 BSR UNASMB ;call unasm core routine 10100C 240D 1364 MOVE.L A5,D2 ;move instruction address 10100E 6100 F918 1365 BSR PRT_SIX ;into D2 and print it 101012 6100 F8E0 1366 BSR TWO_SP ;two space 101016 4283 1367 CLR.L D3 ;blank spaces counter (BSC) 101018 341D 1368 UNASMS4 MOVE.W (A5)+,D2 ;get word 10101A 6100 F8F8 1369 BSR PRT_WRD ;print word of hex code 10101E 6100 F8CC 1370 BSR SPACE ;space 101022 5403 1371 ADDQ.B #2,D3 ;add 2 bytes to BSC 101024 5506 1372 SUBQ.B #2,D6 ;reduce length counter by 2 101026 66F0 1373 BNE.S UNASMS4 ;if more bytes print again 101028 0C03 000A 1374 UNASMS5 CMPI.B #10,D3 ;is the string 10 bytes 10102C 6C10 1375 BGE.S UNASMS6 10102E 6100 F8C4 1376 BSR TWO_SP 101032 6100 F8C0 1377 BSR TWO_SP 101036 6100 F8B4 1378 BSR SPACE 10103A 5403 1379 ADDQ.B #2,D3 10103C 60EA 1380 BRA.S UNASMS5 10103E 6100 F8AC 1381 UNASMS6 BSR SPACE ;space 101042 267C 000FFF2E 1382 MOVEA.L #UASMCMD,A3 ;point A3 to unasm cmd buff 101048 6100 F884 1383 BSR PRTMSG ;display commant text 10104C 6100 F890 1384 BSR CRLF 101050 5307 1385 SUBQ.B #1,D7 101052 66B6 1386 BNE.S UNASMS3 101054 23CD 000FFF2A 1387 MOVE.L A5,UNADR 10105A 6000 F3C8 1388 BRA GET_CMD 1389 ; 1390 ; 32 bytes of ram are reserved above the stacks 1391 ; for the text of the disassembled command. 1392 ; UNASMCMD points to the beginning and 1393 ; UNASMOPR points 9 characters in, so the operands 1394 ; are always evenly spaced. The text is ternminated 1395 ; with a zero and can be displayed with a call to 1396 ; PRTMSG. 1397 ; 1398 ;example 1399 ;12345678901234567890123456789012 1400 ;MOVE.B #$01,D0 1401 ;^ ^ 1402 ;| |---UNASMOPR 1403 ;| 1404 ;|------UNASMCMD 1405 ; 1406 ; Disasemble routine. When called, A5 points to code. 1407 ; Use of Registers 1408 ; D0-Varies A0-Varies 1409 ; D1-Varies A1-Varies 1410 ; D2-Varies A2-Varies 1411 ; D3-Varies A3-Varies 1412 ; D4-cmd size (B,W,L) A4-Instruction text buffer 1413 ; D5-instruction hex (W) A5-Ptr. to 1st byte of code 1414 ; D6-instr lngth (bytes) A6-Varies 1415 ; D7-loop count A7-stack 1416 ; 10105E 3A15 1417 UNASMB MOVE.W (A5),D5 ;D5 gets 1st byte of code 101060 7C02 1418 MOVE.L #2,D6 ;D6 will have # of bytes in code 101062 287C 000FFF2E 1419 MOVEA.L #UASMCMD,A4 ;A4 -> to unasm cmd buff 1420 ; 101068 123C 0020 1421 MOVE.B #32,D1 ;Prefill UASMCMD with 32 ' 's 10106C 18FC 0020 1422 UNASML MOVE.B #' ',(A4)+ 101070 5301 1423 SUBQ.B #1,D1 101072 66F8 1424 BNE.S UNASML 1425 ; 101074 287C 000FFF2E 1426 MOVEA.L #UASMCMD,A4 ;Repoint A4 10107A 6114 1427 BSR UNSEAR ;Returns with A3 -> matching cmd 10107C 226B 000A 1428 MOVEA.L 10(A3),A1 ;put sub-routine addr in A1 101080 588B 1429 ADDQ.L #4,A3 ;point A3 to inst txt 101082 121B 1430 UNASM1 MOVE.B (A3)+,D1 ;get a char 101084 6704 1431 BEQ.S UNASM2 ;stop on 0 101086 18C1 1432 MOVE.B D1,(A4)+ ;move to cmd buff 101088 60F8 1433 BRA.S UNASM1 ;do it again 10108A 4E91 1434 UNASM2 JSR (A1) ;run sub-routine 10108C 421C 1435 CLR.B (A4)+ ;end cmd text with zero 10108E 4E75 1436 RTS 1437 ; 1438 ; This routine searches through the list of commands 1439 ; UNINSTR, comparing to the code. When a match is 1440 ; found, the routine returns with A3 pointing to it. 101090 267C 00101E9C 1441 UNSEAR MOVEA.L #UNINSTR,A3 ;point A3 to first cmd 101096 3005 1442 UNSEAR0 MOVE.W D5,D0 ;Get opcode into D0 101098 C06B 0002 1443 AND.W 2(A3),D0;AND opcode word with mask 10109C B053 1444 CMP.W (A3),D0 ;CMP result with stored word 10109E 6708 1445 BEQ.S UNSEARE ;Same, so done 1010A0 D7FC 0000000E 1446 ADDA.L #14,A3 ;Test failed, so try next one 1010A6 60EE 1447 BRA.S UNSEAR0 1010A8 4E75 1448 UNSEARE RTS 1449 ; 1450 ; The following subroutines are for the specific 1451 ; commands. They all follow a similar format. 1452 ; First, if need be, move the length info to the end 1453 ; of the instruction, i.e. (.B, .L, .W). Next shift A4 1454 ; to UNASMOPR, then find the operands. 1455 ; 1456 ;for commands with no operands 1010AA 4E75 1457 U00 RTS 1458 ; 1459 ; ILLEGAL adds AL to end of instruction 1010AC 18FC 0041 1460 U01 MOVE.B #'A',(A4)+ 1010B0 18FC 004C 1461 MOVE.B #'L',(A4)+ 1010B4 4E75 1462 RTS 1463 ; 1464 ; ADD, SUB, AND, EOR, OR, CMP 1010B6 4280 1465 U02 CLR.L D0 1010B8 103C 0007 1466 MOVE.B #7,D0 1010BC 6100 0B60 1467 BSR USZ 1010C0 287C 000FFF36 1468 MOVEA.L #UASMOPR,A4 1010C6 103C 0008 1469 MOVE.B #8,D0 1010CA 0105 1470 BTST D0,D5 1010CC 6716 1471 BEQ.S U02_01 1010CE 18FC 0044 1472 MOVE.B #'D',(A4)+ 1010D2 103C 000B 1473 MOVE.B #11,D0 1010D6 6100 0B14 1474 BSR UREG 1010DA 18FC 002C 1475 MOVE.B #',',(A4)+ 1010DE 6100 08A2 1476 BSR UEA 1010E2 6014 1477 BRA.S U02_02 1010E4 6100 089C 1478 U02_01 BSR UEA 1010E8 18FC 002C 1479 MOVE.B #',',(A4)+ 1010EC 18FC 0044 1480 MOVE.B #'D',(A4)+ 1010F0 103C 000B 1481 MOVE.B #11,D0 1010F4 6100 0AF6 1482 BSR UREG 1010F8 4E75 1483 U02_02 RTS 1484 ; 1485 ; ADDA, SUBA, CMPA 1010FA 4280 1486 U03 CLR.L D0 1010FC 103C 0008 1487 MOVE.B #8,D0 101100 0105 1488 BTST D0,D5 101102 6712 1489 BEQ.S U03_01 101104 18FC 002E 1490 MOVE.B #'.',(A4)+ 101108 18FC 004C 1491 MOVE.B #'L',(A4)+ 10110C 18FC 0020 1492 MOVE.B #' ',(A4)+ 101110 183C 004C 1493 MOVE.B #'L',D4 101114 6010 1494 BRA.S U03_02 101116 18FC 002E 1495 U03_01 MOVE.B #'.',(A4)+ 10111A 18FC 0057 1496 MOVE.B #'W',(A4)+ 10111E 18FC 0020 1497 MOVE.B #' ',(A4)+ 101122 183C 0057 1498 MOVE.B #'W',D4 101126 287C 000FFF36 1499 U03_02 MOVEA.L #UASMOPR,A4 10112C 6100 0854 1500 BSR UEA 101130 18FC 002C 1501 MOVE.B #',',(A4)+ 101134 18FC 0041 1502 MOVE.B #'A',(A4)+ 101138 103C 000B 1503 MOVE.B #11,D0 10113C 6100 0AAE 1504 BSR UREG 101140 4E75 1505 RTS 1506 ; 1507 ; ADDX, SUBX 101142 4280 1508 U04 CLR.L D0 101144 103C 0007 1509 MOVE.B #7,D0 101148 6100 0AD4 1510 BSR USZ 10114C 287C 000FFF36 1511 MOVEA.L #UASMOPR,A4 101152 103C 0003 1512 MOVE.B #3,D0 101156 0105 1513 BTST D0,D5 101158 6736 1514 BEQ.S U04_01 10115A 18FC 002D 1515 MOVE.B #'-',(A4)+ 10115E 18FC 0028 1516 MOVE.B #'(',(A4)+ 101162 18FC 0041 1517 MOVE.B #'A',(A4)+ 101166 103C 0002 1518 MOVE.B #2,D0 10116A 6100 0A80 1519 BSR UREG 10116E 18FC 0029 1520 MOVE.B #')',(A4)+ 101172 18FC 002C 1521 MOVE.B #',',(A4)+ 101176 18FC 002D 1522 MOVE.B #'-',(A4)+ 10117A 18FC 0028 1523 MOVE.B #'(',(A4)+ 10117E 18FC 0041 1524 MOVE.B #'A',(A4)+ 101182 103C 000B 1525 MOVE.B #11,D0 101186 6100 0A64 1526 BSR UREG 10118A 18FC 0029 1527 MOVE.B #')',(A4)+ 10118E 601C 1528 BRA.S U04_02 101190 18FC 0044 1529 U04_01 MOVE.B #'D',(A4)+ 101194 103C 0002 1530 MOVE.B #2,D0 101198 6100 0A52 1531 BSR UREG 10119C 18FC 002C 1532 MOVE.B #',',(A4)+ 1011A0 18FC 0044 1533 MOVE.B #'D',(A4)+ 1011A4 103C 000B 1534 MOVE.B #11,D0 1011A8 6100 0A42 1535 BSR UREG 1011AC 4E75 1536 U04_02 RTS 1537 ; 1538 ; CMPM 1011AE 4280 1539 U05 CLR.L D0 1011B0 103C 0007 1540 MOVE.B #7,D0 1011B4 6100 0A68 1541 BSR USZ 1011B8 287C 000FFF36 1542 MOVEA.L #UASMOPR,A4 1011BE 18FC 0028 1543 MOVE.B #'(',(A4)+ 1011C2 18FC 0041 1544 MOVE.B #'A',(A4)+ 1011C6 103C 0002 1545 MOVE.B #02,D0 1011CA 6100 0A20 1546 BSR UREG 1011CE 18FC 0029 1547 MOVE.B #')',(A4)+ 1011D2 18FC 002B 1548 MOVE.B #'+',(A4)+ 1011D6 18FC 002C 1549 MOVE.B #',',(A4)+ 1011DA 18FC 0028 1550 MOVE.B #'(',(A4)+ 1011DE 18FC 0041 1551 MOVE.B #'A',(A4)+ 1011E2 103C 000B 1552 MOVE.B #11,D0 1011E6 6100 0A04 1553 BSR UREG 1011EA 18FC 0029 1554 MOVE.B #')',(A4)+ 1011EE 18FC 002B 1555 MOVE.B #'+',(A4)+ 1011F2 4E75 1556 RTS 1557 ; 1558 ; DIVU, DIVS, MULU, MULS 1011F4 4280 1559 U06 CLR.L D0 1011F6 183C 0057 1560 MOVE.B #'W',D4 1011FA 287C 000FFF36 1561 MOVEA.L #UASMOPR,A4 101200 6100 0780 1562 BSR UEA 101204 18FC 002C 1563 MOVE.B #',',(A4)+ 101208 18FC 0044 1564 MOVE.B #'D',(A4)+ 10120C 103C 000B 1565 MOVE.B #11,D0 101210 6100 09DA 1566 BSR UREG 101214 4E75 1567 RTS 1568 ; 1569 ; ASL, ASR, LSL, LSR, ROXL, ROXR, ROL, ROR 1570 ; memory shifts 101216 4280 1571 U07 CLR.L D0 101218 103C 0008 1572 MOVE.B #8,D0 ;check direction 10121C 0105 1573 BTST D0,D5 10121E 6706 1574 BEQ.S U07_01 101220 18FC 004C 1575 MOVE.B #'L',(A4)+ 101224 6004 1576 BRA.S U07_02 101226 18FC 0052 1577 U07_01 MOVE.B #'R',(A4)+ 10122A 18FC 002E 1578 U07_02 MOVE.B #'.',(A4)+ 10122E 18FC 0057 1579 MOVE.B #'W',(A4)+ 101232 183C 0057 1580 MOVE.B #'W',D4 101236 287C 000FFF36 1581 MOVEA.L #UASMOPR,A4 10123C 6100 0744 1582 BSR UEA 101240 4E75 1583 RTS 1584 ; 1585 ; ASL, ASR, LSL, LSR, ROXL, ROXR, ROL, ROR 1586 ; register shifts 101242 4280 1587 U08 CLR.L D0 101244 103C 0008 1588 MOVE.B #8,D0 ;check direction 101248 0105 1589 BTST D0,D5 10124A 6706 1590 BEQ.S U08_01 10124C 18FC 004C 1591 MOVE.B #'L',(A4)+ 101250 6004 1592 BRA.S U08_02 101252 18FC 0052 1593 U08_01 MOVE.B #'R',(A4)+ 101256 103C 0007 1594 U08_02 MOVE.B #7,D0 10125A 6100 09C2 1595 BSR USZ 10125E 287C 000FFF36 1596 MOVEA.L #UASMOPR,A4 101264 103C 0005 1597 MOVE.B #5,D0 101268 0105 1598 BTST D0,D5 ;i/r = 0 then count is within 10126A 670E 1599 BEQ.S U08_03 ;bits 9,10,11 so jump 10126C 18FC 0044 1600 MOVE.B #'D',(A4)+ ;i/r = 1 so count is in Dn 101270 103C 000B 1601 MOVE.B #11,D0 101274 6100 0976 1602 BSR UREG 101278 601A 1603 BRA.S U08_08 10127A 18FC 0023 1604 U08_03 MOVE.B #'#',(A4)+ ;Store a # symbol 10127E 3205 1605 MOVE.W D5,D1 ;Don't trash D5 101280 7009 1606 MOVE.L #9,D0 ;Put shift size in D0 101282 E069 1607 LSR.W D0,D1 ;Move shift-count bits down 9 101284 0201 0007 1608 ANDI.B #7,D1 ;Mask out unwanted stuff 101288 6604 1609 BNE.S U08_06 ;If not 0 then it's ready 10128A 123C 0008 1610 MOVE.B #8,D1 ;If 0 replace with 8 10128E 0601 0030 1611 U08_06 ADDI.B #'0',D1 ;Add the 30H to D1 101292 18C1 1612 MOVE.B D1,(A4)+ ;Store it 101294 18FC 002C 1613 U08_08 MOVE.B #',',(A4)+ ;Add a ',' 101298 18FC 0044 1614 MOVE.B #'D',(A4)+ ;Now add a 'D' 10129C 7002 1615 MOVE.L #2,D0 ;Point to register bits 10129E 6100 094C 1616 BSR UREG 1012A2 4E75 1617 RTS 1618 ; 1619 ; ANDI, ORI, EORI to CCR 1012A4 4280 1620 U09 CLR.L D0 1012A6 18FC 002E 1621 MOVE.B #'.',(A4)+ 1012AA 18FC 0042 1622 MOVE.B #'B',(A4)+ 1012AE 287C 000FFF36 1623 MOVEA.L #UASMOPR,A4 1012B4 18FC 0023 1624 MOVE.B #'#',(A4)+ 1012B8 18FC 0024 1625 MOVE.B #'$',(A4)+ 1012BC 3235 6800 1626 MOVE.W 0(A5,D6.L),D1 1012C0 6100 0946 1627 BSR UGBYT 1012C4 5406 1628 ADDQ.B #2,D6 1012C6 18FC 002C 1629 MOVE.B #',',(A4)+ 1012CA 18FC 0043 1630 MOVE.B #'C',(A4)+ 1012CE 18FC 0043 1631 MOVE.B #'C',(A4)+ 1012D2 18FC 0052 1632 MOVE.B #'R',(A4)+ 1012D6 4E75 1633 RTS 1634 ; 1635 ; ANDI, ORI, EORI to SR 1012D8 4280 1636 U10 CLR.L D0 1012DA 18FC 002E 1637 MOVE.B #'.',(A4)+ 1012DE 18FC 0057 1638 MOVE.B #'W',(A4)+ 1012E2 183C 004C 1639 MOVE.B #'L',D4 1012E6 287C 000FFF36 1640 MOVEA.L #UASMOPR,A4 1012EC 18FC 0023 1641 MOVE.B #'#',(A4)+ 1012F0 18FC 0024 1642 MOVE.B #'$',(A4)+ 1012F4 3235 6800 1643 MOVE.W 0(A5,D6.L),D1 1012F8 E159 1644 ROL.W #8,D1 1012FA 6100 090C 1645 BSR UGBYT 1012FE 3235 6800 1646 MOVE.W 0(A5,D6.L),D1 101302 6100 0904 1647 BSR UGBYT 101306 5406 1648 ADDQ.B #2,D6 101308 18FC 002C 1649 MOVE.B #',',(A4)+ 10130C 18FC 0053 1650 MOVE.B #'S',(A4)+ 101310 18FC 0052 1651 MOVE.B #'R',(A4)+ 101314 4E75 1652 RTS 1653 ; 1654 ; ADDI, ANDI, ORI, EORI, SUBI, CMPI 101316 4280 1655 U11 CLR.L D0 101318 103C 0007 1656 MOVE.B #7,D0 10131C 6100 0900 1657 BSR USZ 101320 287C 000FFF36 1658 MOVEA.L #UASMOPR,A4 101326 18FC 0023 1659 MOVE.B #'#',(A4)+ 10132A 18FC 0024 1660 MOVE.B #'$',(A4)+ 10132E 0C04 0042 1661 CMPI.B #'B',D4 101332 660C 1662 BNE.S U11_01 101334 3235 6800 1663 MOVE.W 0(A5,D6.L),D1 101338 6100 08CE 1664 BSR UGBYT 10133C 5406 1665 ADDQ.B #2,D6 10133E 6042 1666 BRA.S U11_03 101340 0C04 0057 1667 U11_01 CMPI.B #'W',D4 101344 6616 1668 BNE.S U11_02 101346 3235 6800 1669 MOVE.W 0(A5,D6.L),D1 10134A E159 1670 ROL.W #8,D1 10134C 6100 08BA 1671 BSR UGBYT 101350 3235 6800 1672 MOVE.W 0(A5,D6.L),D1 101354 6100 08B2 1673 BSR UGBYT 101358 5406 1674 ADDQ.B #2,D6 10135A 6026 1675 BRA.S U11_03 10135C 3235 6800 1676 U11_02 MOVE.W 0(A5,D6.L),D1 101360 E159 1677 ROL.W #8,D1 101362 6100 08A4 1678 BSR UGBYT 101366 3235 6800 1679 MOVE.W 0(A5,D6.L),D1 10136A 6100 089C 1680 BSR UGBYT 10136E 3235 6802 1681 MOVE.W 2(A5,D6.L),D1 101372 E159 1682 ROL.W #8,D1 101374 6100 0892 1683 BSR UGBYT 101378 3235 6802 1684 MOVE.W 2(A5,D6.L),D1 10137C 6100 088A 1685 BSR UGBYT 101380 5806 1686 ADDQ.B #4,D6 101382 18FC 002C 1687 U11_03 MOVE.B #',',(A4)+ 101386 6100 05FA 1688 BSR UEA 10138A 4E75 1689 RTS 1690 ; 1691 ; BRA, BSR 10138C 4280 1692 U12 CLR.L D0 10138E 0C05 0000 1693 CMPI.B #0,D5 101392 6708 1694 BEQ.S U12_00 101394 18FC 002E 1695 MOVE.B #'.',(A4)+ 101398 18FC 0053 1696 MOVE.B #'S',(A4)+ 10139C 287C 000FFF36 1697 U12_00 MOVEA.L #UASMOPR,A4 1013A2 18FC 0024 1698 MOVE.B #'$',(A4)+ 1013A6 220D 1699 MOVE.L A5,D1 1013A8 5481 1700 ADDQ.L #2,D1 1013AA 0C05 0000 1701 CMPI.B #0,D5 1013AE 670C 1702 BEQ.S U12_01 1013B0 0C05 00FF 1703 CMPI.B #$FF,D5 1013B4 6710 1704 BEQ.S U12_02 1013B6 1005 1705 MOVE.B D5,D0 1013B8 D200 1706 ADD.B D0,D1 1013BA 6012 1707 BRA.S U12_03 1013BC 3035 6800 1708 U12_01 MOVE.W 0(A5,D6.L),D0 1013C0 D240 1709 ADD.W D0,D1 1013C2 5406 1710 ADDQ.B #2,D6 1013C4 6008 1711 BRA.S U12_03 1013C6 2035 6800 1712 U12_02 MOVE.L 0(A5,D6.L),D0 1013CA D280 1713 ADD.L D0,D1 1013CC 5806 1714 ADDQ.B #4,D6 1013CE 103C 0004 1715 U12_03 MOVE.B #4,D0 1013D2 E199 1716 U12_04 ROL.L #8,D1 1013D4 6100 0832 1717 BSR UGBYT 1013D8 5300 1718 SUBQ.B #1,D0 1013DA 66F6 1719 BNE.S U12_04 1013DC 4E75 1720 RTS 1721 ; 1722 ; JMP, JSR 1013DE 287C 000FFF36 1723 U13 MOVEA.L #UASMOPR,A4 1013E4 6100 059C 1724 BSR UEA 1013E8 4E75 1725 RTS 1726 ; 1727 ; BTST, BCHG, BCLR, BSET immediate data. These don't 1728 ; need .B or .L. If the destination is a data register 1729 ; then it's automatically .L, otherwise it's always .B 1013EA 183C 0042 1730 U14 MOVE.B #'B',D4 1013EE 287C 000FFF36 1731 MOVEA.L #UASMOPR,A4 1013F4 18FC 0023 1732 MOVE.B #'#',(A4)+ 1013F8 18FC 0024 1733 MOVE.B #'$',(A4)+ 1013FC 3235 6800 1734 MOVE.W 0(A5,D6.L),D1 101400 6100 0806 1735 BSR UGBYT ;Change imm data to ASCII & store 101404 5406 1736 ADDQ.B #2,D6 101406 18FC 002C 1737 MOVE.B #',',(A4)+ 10140A 6100 0576 1738 BSR UEA 10140E 4E75 1739 RTS 1740 ; 1741 ; BTST, BCHG, BCLR, BSET 1742 ; register data 101410 4280 1743 U15 CLR.L D0 101412 183C 004C 1744 MOVE.B #'L',D4 101416 287C 000FFF36 1745 MOVEA.L #UASMOPR,A4 10141C 18FC 0044 1746 MOVE.B #'D',(A4)+ 101420 103C 000B 1747 MOVE.B #11,D0 101424 6100 07C6 1748 BSR UREG 101428 18FC 002C 1749 MOVE.B #',',(A4)+ 10142C 6100 0554 1750 BSR UEA 101430 4E75 1751 RTS 1752 ; 1753 ; MOVE 101432 4280 1754 U16 CLR.L D0 101434 103C 000D 1755 MOVE.B #13,D0 101438 6100 0818 1756 BSR USZM 10143C 287C 000FFF36 1757 MOVEA.L #UASMOPR,A4 101442 6100 053E 1758 BSR UEA 101446 18FC 002C 1759 MOVE.B #',',(A4)+ 10144A 2F05 1760 MOVE.L D5,-(A7) ;<<< these lines 10144C 3005 1761 MOVE.W D5,D0 ;flip destination addr. 10144E EF5D 1762 ROL.W #7,D5 ;RRRMMM to MMMRRR format 101450 0245 0007 1763 AND.W #7,D5 ;in EA location 101454 E658 1764 ROR.W #3,D0 101456 0240 0038 1765 ANDI.W #$38,D0 10145A DA40 1766 ADD.W D0,D5 10145C 6100 0524 1767 BSR UEA ;<<<< end flip 101460 2A1F 1768 MOVE.L (A7)+,D5 ;get back D5 101462 4E75 1769 RTS 1770 ; 1771 ; MOVEA 101464 4280 1772 U17 CLR.L D0 101466 103C 000D 1773 MOVE.B #13,D0 10146A 6100 07E6 1774 BSR USZM 10146E 287C 000FFF36 1775 MOVEA.L #UASMOPR,A4 101474 6100 050C 1776 BSR UEA 101478 18FC 002C 1777 MOVE.B #',',(A4)+ 10147C 18FC 0041 1778 MOVE.B #'A',(A4)+ 101480 103C 000B 1779 MOVE.B #11,D0 101484 6100 0766 1780 BSR UREG 101488 4E75 1781 RTS 1782 ; 1783 ; Bcc 10148A 7008 1784 U18 MOVE.L #8,D0 10148C 6100 07F8 1785 BSR UCC 101490 6100 FEFA 1786 BSR U12 ;bsr routine 101494 4E75 1787 RTS 1788 ; 1789 ; DBcc 101496 7008 1790 U19 MOVE.L #8,D0 101498 6100 07EC 1791 BSR UCC 10149C 287C 000FFF36 1792 MOVEA.L #UASMOPR,A4 1014A2 18FC 0044 1793 MOVE.B #'D',(A4)+ 1014A6 103C 0002 1794 MOVE.B #2,D0 1014AA 6100 0740 1795 BSR UREG 1014AE 18FC 002C 1796 MOVE.B #',',(A4)+ 1014B2 18FC 0024 1797 MOVE.B #'$',(A4)+ 1014B6 220D 1798 MOVE.L A5,D1 1014B8 5481 1799 ADDQ.L #2,D1 1014BA 3035 6800 1800 MOVE.W 0(A5,D6.L),D0 1014BE D240 1801 ADD.W D0,D1 1014C0 5406 1802 ADDQ.B #2,D6 1014C2 103C 0004 1803 MOVE.B #4,D0 1014C6 E199 1804 U19_01 ROL.L #8,D1 1014C8 6100 073E 1805 BSR UGBYT 1014CC 5300 1806 SUBQ.B #1,D0 1014CE 66F6 1807 BNE.S U19_01 1014D0 4E75 1808 RTS 1809 ; 1810 ; Scc 1014D2 7008 1811 U20 MOVE.L #8,D0 1014D4 6100 07B0 1812 BSR UCC 1014D8 183C 0042 1813 MOVE.B #'B',D4 1014DC 287C 000FFF36 1814 MOVEA.L #UASMOPR,A4 1014E2 183C 0042 1815 MOVE.B #'B',D4 1014E6 6100 049A 1816 BSR UEA 1014EA 4E75 1817 RTS 1818 ; 1819 ; NEGX, CLR, NEG, NOT, TST 1014EC 4280 1820 U21 CLR.L D0 1014EE 103C 0007 1821 MOVE.B #7,D0 1014F2 6100 072A 1822 BSR USZ 1014F6 287C 000FFF36 1823 MOVEA.L #UASMOPR,A4 1014FC 6100 0484 1824 BSR UEA 101500 4E75 1825 RTS 1826 ; 1827 ; TAS 101502 4280 1828 U22 CLR.L D0 101504 183C 0042 1829 MOVE.B #'B',D4 101508 287C 000FFF36 1830 MOVEA.L #UASMOPR,A4 10150E 6100 0472 1831 BSR UEA 101512 4E75 1832 RTS 1833 ; 1834 ; SWAP 101514 4280 1835 U23 CLR.L D0 101516 287C 000FFF36 1836 MOVEA.L #UASMOPR,A4 10151C 18FC 0044 1837 MOVE.B #'D',(A4)+ 101520 103C 0002 1838 MOVE.B #2,D0 101524 6100 06C6 1839 BSR UREG 101528 4E75 1840 RTS 1841 ; 1842 ; UNLK 10152A 4280 1843 U24 CLR.L D0 10152C 287C 000FFF36 1844 MOVEA.L #UASMOPR,A4 101532 18FC 0041 1845 MOVE.B #'A',(A4)+ 101536 103C 0002 1846 MOVE.B #2,D0 10153A 6100 06B0 1847 BSR UREG 10153E 4E75 1848 RTS 1849 ; 1850 ; LINK 101540 287C 000FFF36 1851 U25 MOVEA.L #UASMOPR,A4 101546 18FC 0041 1852 MOVE.B #'A',(A4)+ 10154A 103C 000B 1853 MOVE.B #11,D0 10154E 6100 069C 1854 BSR UREG 101552 18FC 002C 1855 MOVE.B #',',(A4)+ 101556 18FC 0023 1856 MOVE.B #'#',(A4)+ 10155A 18FC 0024 1857 MOVE.B #'$',(A4)+ 10155E 3235 6800 1858 MOVE.W 0(A5,D6.L),D1 101562 5406 1859 ADDQ.B #2,D6 101564 103C 0002 1860 MOVE.B #2,D0 101568 E159 1861 U25_01 ROL.W #8,D1 10156A 6100 069C 1862 BSR UGBYT 10156E 5300 1863 SUBQ.B #1,D0 101570 66F6 1864 BNE.S U25_01 101572 4E75 1865 RTS 1866 ; 1867 ; ABCD, SBCD 101574 4280 1868 U26 CLR.L D0 ;Mnemonic is already in buffer 101576 287C 000FFF36 1869 MOVEA.L #UASMOPR,A4 ;A4 -> to argument storage 10157C 0805 0003 1870 BTST #3,D5 ;D5 contains the hex opcode 101580 6624 1871 BNE.S U26_01 101582 287C 000FFF36 1872 MOVEA.L #UASMOPR,A4 101588 18FC 0044 1873 MOVE.B #'D',(A4)+ 10158C 103C 0002 1874 MOVE.B #2,D0 101590 6100 065A 1875 BSR UREG 101594 18FC 002C 1876 MOVE.B #',',(A4)+ 101598 18FC 0044 1877 MOVE.B #'D',(A4)+ 10159C 103C 000B 1878 MOVE.B #11,D0 1015A0 6100 064A 1879 BSR UREG 1015A4 6034 1880 BRA.S U26_02 1015A6 18FC 002D 1881 U26_01 MOVE.B #'-',(A4)+ 1015AA 18FC 0028 1882 MOVE.B #'(',(A4)+ 1015AE 18FC 0041 1883 MOVE.B #'A',(A4)+ 1015B2 103C 0002 1884 MOVE.B #02,D0 1015B6 6100 0634 1885 BSR UREG 1015BA 18FC 0029 1886 MOVE.B #')',(A4)+ 1015BE 18FC 002C 1887 MOVE.B #',',(A4)+ 1015C2 18FC 002D 1888 MOVE.B #'-',(A4)+ 1015C6 18FC 0028 1889 MOVE.B #'(',(A4)+ 1015CA 18FC 0041 1890 MOVE.B #'A',(A4)+ 1015CE 103C 000B 1891 MOVE.B #11,D0 1015D2 6100 0618 1892 BSR UREG 1015D6 18FC 0029 1893 MOVE.B #')',(A4)+ 1015DA 4E75 1894 U26_02 RTS 1895 ; 1896 ; ADDQ, SUBQ 1015DC 4280 1897 U27 CLR.L D0 1015DE 103C 0007 1898 MOVE.B #7,D0 1015E2 6100 063A 1899 BSR USZ 1015E6 287C 000FFF36 1900 MOVEA.L #UASMOPR,A4 1015EC 18FC 0023 1901 MOVE.B #'#',(A4)+ 1015F0 18FC 0024 1902 MOVE.B #'$',(A4)+ 1015F4 2F05 1903 MOVE.L D5,-(A7) ;get back D5 1015F6 EF5D 1904 ROL.W #7,D5 1015F8 0245 0007 1905 AND.W #7,D5 1015FC 0605 0030 1906 ADDI.B #$30,D5 101600 18C5 1907 MOVE.B D5,(A4)+ 101602 2A1F 1908 MOVE.L (A7)+,D5 ;get back D5 101604 18FC 002C 1909 MOVE.B #',',(A4)+ 101608 6100 0378 1910 BSR UEA 10160C 4E75 1911 RTS 1912 ; 1913 ; CHK 10160E 4280 1914 U28 CLR.L D0 101610 183C 0057 1915 MOVE.B #'W',D4 101614 287C 000FFF36 1916 MOVEA.L #UASMOPR,A4 10161A 6100 0366 1917 BSR UEA 10161E 18FC 002C 1918 MOVE.B #',',(A4)+ 101622 18FC 0044 1919 MOVE.B #'D',(A4)+ 101626 103C 000B 1920 MOVE.B #11,D0 10162A 6100 05C0 1921 BSR UREG 10162E 4E75 1922 RTS 1923 ; 1924 ; EXG Dn,Dm. It's always long. 101630 4280 1925 U29DD CLR.L D0 101632 287C 000FFF36 1926 MOVEA.L #UASMOPR,A4 101638 18FC 0044 1927 MOVE.B #'D',(A4)+ 10163C 103C 000B 1928 MOVE.B #11,D0 101640 6100 05AA 1929 BSR UREG 101644 18FC 002C 1930 MOVE.B #',',(A4)+ 101648 18FC 0044 1931 MOVE.B #'D',(A4)+ 10164C 103C 0002 1932 MOVE.B #2,D0 101650 6100 059A 1933 BSR UREG 101654 4E75 1934 RTS 1935 ; 1936 ; EXG An,Am. It's always long. 101656 4280 1937 U29AA CLR.L D0 101658 287C 000FFF36 1938 MOVEA.L #UASMOPR,A4 10165E 18FC 0041 1939 MOVE.B #'A',(A4)+ 101662 103C 000B 1940 MOVE.B #11,D0 101666 6100 0584 1941 BSR UREG 10166A 18FC 002C 1942 MOVE.B #',',(A4)+ 10166E 18FC 0041 1943 MOVE.B #'A',(A4)+ 101672 103C 0002 1944 MOVE.B #2,D0 101676 6100 0574 1945 BSR UREG 10167A 4E75 1946 RTS 1947 ; 1948 ; EXG. It's always long. 10167C 4280 1949 U29DA CLR.L D0 10167E 287C 000FFF36 1950 MOVEA.L #UASMOPR,A4 101684 18FC 0044 1951 MOVE.B #'D',(A4)+ 101688 103C 000B 1952 MOVE.B #11,D0 10168C 6100 055E 1953 BSR UREG 101690 18FC 002C 1954 MOVE.B #',',(A4)+ 101694 18FC 0041 1955 MOVE.B #'A',(A4)+ 101698 103C 0002 1956 MOVE.B #2,D0 10169C 6100 054E 1957 BSR UREG 1016A0 4E75 1958 RTS 1959 ; 1960 ; EXT 1016A2 4280 1961 U30 CLR.L D0 1016A4 18FC 002E 1962 MOVE.B #'.',(A4)+ 1016A8 0805 0006 1963 BTST #6,D5 1016AC 6706 1964 BEQ.S U30_01 1016AE 18FC 004C 1965 MOVE.B #'L',(A4)+ 1016B2 6004 1966 BRA.S U30_02 1016B4 18FC 0057 1967 U30_01 MOVE.B #'W',(A4)+ 1016B8 287C 000FFF36 1968 U30_02 MOVEA.L #UASMOPR,A4 1016BE 18FC 0044 1969 MOVE.B #'D',(A4)+ 1016C2 103C 0002 1970 MOVE.B #2,D0 1016C6 6100 0524 1971 BSR UREG 1016CA 4E75 1972 RTS 1973 ; 1974 ; LEA 1016CC 4280 1975 U31 CLR.L D0 1016CE 18FC 002E 1976 MOVE.B #'.',(A4)+ 1977 ; D5 contains the instruction word 1016D2 0805 0000 1978 BTST #0,D5 1016D6 660A 1979 BNE.S U31A 1016D8 18FC 0057 1980 MOVE.B #'W',(A4)+ 1016DC 183C 0057 1981 MOVE.B #'W',D4 1016E0 6008 1982 BRA.S U31B 1016E2 18FC 004C 1983 U31A MOVE.B #'L',(A4)+ 1016E6 183C 004C 1984 MOVE.B #'L',D4 1016EA 287C 000FFF36 1985 U31B MOVEA.L #UASMOPR,A4 1016F0 6100 0290 1986 BSR UEA 1016F4 18FC 002C 1987 MOVE.B #',',(A4)+ 1016F8 18FC 0041 1988 MOVE.B #'A',(A4)+ 1016FC 103C 000B 1989 MOVE.B #11,D0 101700 6100 04EA 1990 BSR UREG 101704 4E75 1991 RTS 1992 ; 1993 ; NBCD 101706 183C 0042 1994 U32 MOVE.B #'B',D4 10170A 287C 000FFF36 1995 MOVEA.L #UASMOPR,A4 101710 6100 0270 1996 BSR UEA 101714 4E75 1997 RTS 1998 ; 1999 ; PEA 101716 183C 004C 2000 U33 MOVE.B #'L',D4 10171A 287C 000FFF36 2001 MOVEA.L #UASMOPR,A4 101720 6100 0260 2002 BSR UEA 101724 4E75 2003 RTS 2004 ; 2005 ; STOP 101726 287C 000FFF36 2006 U34 MOVEA.L #UASMOPR,A4 10172C 18FC 0023 2007 MOVE.B #'#',(A4)+ 101730 18FC 0024 2008 MOVE.B #'$',(A4)+ 101734 3235 6800 2009 MOVE.W $00(A5,D6.L),D1 101738 E159 2010 ROL.W #8,D1 10173A 6100 04CC 2011 BSR UGBYT 10173E 3235 6800 2012 MOVE.W 0(A5,D6.L),D1 101742 6100 04C4 2013 BSR UGBYT 101746 5406 2014 ADDQ.B #2,D6 101748 4E75 2015 RTS 2016 ; 2017 ; TRAP 10174A 287C 000FFF36 2018 U35 MOVEA.L #UASMOPR,A4 101750 18FC 0023 2019 MOVE.B #'#',(A4)+ 101754 18FC 0024 2020 MOVE.B #'$',(A4)+ 101758 1205 2021 MOVE.B D5,D1 10175A 6100 F212 2022 BSR NUM_ASC 10175E 18C1 2023 MOVE.B D1,(A4)+ 101760 4E75 2024 RTS 2025 ; 2026 ; MOVE TO CCR 101762 18FC 002E 2027 U36 MOVE.B #'.',(A4)+ 101766 18FC 0057 2028 MOVE.B #'W',(A4)+ 10176A 183C 0057 2029 MOVE.B #'W',D4 10176E 287C 000FFF36 2030 MOVEA.L #UASMOPR,A4 101774 6100 020C 2031 BSR UEA 101778 18FC 002C 2032 MOVE.B #',',(A4)+ 10177C 18FC 0043 2033 MOVE.B #'C',(A4)+ 101780 18FC 0043 2034 MOVE.B #'C',(A4)+ 101784 18FC 0052 2035 MOVE.B #'R',(A4)+ 101788 4E75 2036 RTS 2037 ; 2038 ; MOVE from SR 10178A 18FC 002E 2039 U37 MOVE.B #'.',(A4)+ 10178E 18FC 0057 2040 MOVE.B #'W',(A4)+ 101792 183C 0057 2041 MOVE.B #'W',D4 101796 287C 000FFF36 2042 MOVEA.L #UASMOPR,A4 10179C 18FC 0053 2043 MOVE.B #'S',(A4)+ 1017A0 18FC 0052 2044 MOVE.B #'R',(A4)+ 1017A4 18FC 002C 2045 MOVE.B #',',(A4)+ 1017A8 6100 01D8 2046 BSR UEA 1017AC 4E75 2047 RTS 2048 ; 2049 ; MOVE to SR 1017AE 18FC 002E 2050 U38 MOVE.B #'.',(A4)+ 1017B2 18FC 0057 2051 MOVE.B #'W',(A4)+ 1017B6 183C 0057 2052 MOVE.B #'W',D4 1017BA 287C 000FFF36 2053 MOVEA.L #UASMOPR,A4 1017C0 6100 01C0 2054 BSR UEA 1017C4 18FC 002C 2055 MOVE.B #',',(A4)+ 1017C8 18FC 0053 2056 MOVE.B #'S',(A4)+ 1017CC 18FC 0052 2057 MOVE.B #'R',(A4)+ 1017D0 4E75 2058 RTS 2059 ; 2060 ; MOVE An <-> USP 1017D2 18FC 002E 2061 U39 MOVE.B #'.',(A4)+ 1017D6 18FC 004C 2062 MOVE.B #'L',(A4)+ 1017DA 287C 000FFF36 2063 MOVEA.L #UASMOPR,A4 1017E0 0805 0003 2064 BTST #3,D5 1017E4 671E 2065 BEQ.S U39_01 1017E6 18FC 0055 2066 MOVE.B #'U',(A4)+ 1017EA 18FC 0053 2067 MOVE.B #'S',(A4)+ 1017EE 18FC 0050 2068 MOVE.B #'P',(A4)+ 1017F2 18FC 002C 2069 MOVE.B #',',(A4)+ 1017F6 18FC 0041 2070 MOVE.B #'A',(A4)+ 1017FA 103C 0002 2071 MOVE.B #2,D0 1017FE 6100 03EC 2072 BSR UREG 101802 601C 2073 BRA.S U39_02 101804 18FC 0041 2074 U39_01 MOVE.B #'A',(A4)+ 101808 103C 0002 2075 MOVE.B #2,D0 10180C 6100 03DE 2076 BSR UREG 101810 18FC 002C 2077 MOVE.B #',',(A4)+ 101814 18FC 0055 2078 MOVE.B #'U',(A4)+ 101818 18FC 0053 2079 MOVE.B #'S',(A4)+ 10181C 18FC 0050 2080 MOVE.B #'P',(A4)+ 101820 4E75 2081 U39_02 RTS 2082 ; 2083 ; MOVEQ 101822 18FC 002E 2084 U40 MOVE.B #'.',(A4)+ 101826 18FC 004C 2085 MOVE.B #'L',(A4)+ 10182A 287C 000FFF36 2086 MOVEA.L #UASMOPR,A4 101830 18FC 0023 2087 MOVE.B #'#',(A4)+ 101834 18FC 0024 2088 MOVE.B #'$',(A4)+ 101838 1205 2089 MOVE.B D5,D1 10183A 6100 03CC 2090 BSR UGBYT 10183E 18FC 002C 2091 MOVE.B #',',(A4)+ 101842 18FC 0044 2092 MOVE.B #'D',(A4)+ 101846 103C 000B 2093 MOVE.B #11,D0 10184A 6100 03A0 2094 BSR UREG 10184E 4E75 2095 RTS 2096 ; 2097 ; MOVEP 101850 0805 0006 2098 U41 BTST #6,D5 101854 670A 2099 BEQ.S U41_01 101856 18FC 002E 2100 MOVE.B #'.',(A4)+ 10185A 18FC 004C 2101 MOVE.B #'L',(A4)+ 10185E 6008 2102 BRA.S U41_02 101860 18FC 002E 2103 U41_01 MOVE.B #'.',(A4)+ 101864 18FC 0057 2104 MOVE.B #'W',(A4)+ 101868 287C 000FFF36 2105 U41_02 MOVEA.L #UASMOPR,A4 10186E 0805 0007 2106 BTST #7,D5 101872 6714 2107 BEQ.S U41_03 ;If 0 then it's d(Ay),Dx 101874 18FC 0044 2108 MOVE.B #'D',(A4)+ ;It's 1 so do Dx,d(Ay) 101878 103C 000B 2109 MOVE.B #11,D0 ;point to bit 11 and put in 10187C 6100 036E 2110 BSR UREG ;place the data register # 101880 18FC 002C 2111 MOVE.B #',',(A4)+ 101884 6116 2112 BSR DOIT 101886 6012 2113 BRA.S U41_04 101888 6112 2114 U41_03 BSR DOIT 10188A 18FC 002C 2115 MOVE.B #',',(A4)+ 10188E 18FC 0044 2116 MOVE.B #'D',(A4)+ 101892 103C 000B 2117 MOVE.B #11,D0 101896 6100 0354 2118 BSR UREG 10189A 4E75 2119 U41_04 RTS 2120 ; 10189C 18FC 0024 2121 DOIT MOVE.B #'$',(A4)+ 1018A0 3235 6800 2122 MOVE.W $00(A5,D6.L),D1 1018A4 E159 2123 ROL.W #8,D1 1018A6 6100 0360 2124 BSR UGBYT 1018AA 3235 6800 2125 MOVE.W 0(A5,D6.L),D1 1018AE 6100 0358 2126 BSR UGBYT 1018B2 5406 2127 ADDQ.B #2,D6 1018B4 18FC 0028 2128 MOVE.B #'(',(A4)+ 1018B8 18FC 0041 2129 MOVE.B #'A',(A4)+ 1018BC 7002 2130 MOVEQ #2,D0 1018BE 6100 032C 2131 BSR UREG 1018C2 18FC 0029 2132 MOVE.B #')',(A4)+ 1018C6 4E75 2133 RTS 2134 ; 2135 ; MOVEM 1018C8 0805 0006 2136 U42 BTST #6,D5 1018CC 670A 2137 BEQ.S U42_01 1018CE 18FC 002E 2138 MOVE.B #'.',(A4)+ 1018D2 18FC 004C 2139 MOVE.B #'L',(A4)+ 1018D6 6008 2140 BRA.S U42_02 1018D8 18FC 002E 2141 U42_01 MOVE.B #'.',(A4)+ 1018DC 18FC 0057 2142 MOVE.B #'W',(A4)+ 1018E0 287C 000FFF36 2143 U42_02 MOVEA.L #UASMOPR,A4 1018E6 362D 0002 2144 MOVE.W 2(A5),D3 1018EA 0805 0005 2145 U42_03 BTST #5,D5 1018EE 6726 2146 BEQ.S U42_04 1018F0 0805 0004 2147 BTST #4,D5 1018F4 6620 2148 BNE.S U42_04 1018F6 0805 0003 2149 BTST #3,D5 1018FA 661A 2150 BNE.S U42_04 1018FC 4280 2151 CLR.L D0 1018FE 4282 2152 CLR.L D2 101900 323C 000F 2153 MOVE.W #$F,D1 101904 0303 2154 U42_06 BTST D1,D3 101906 6702 2155 BEQ.S U42_05 101908 01C2 2156 BSET D0,D2 10190A 5200 2157 U42_05 ADDQ.B #1,D0 10190C 5301 2158 SUBQ.B #1,D1 10190E 0C00 000F 2159 CMPI.B #$F,D0 101912 6FF0 2160 BLE.S U42_06 101914 3602 2161 MOVE.W D2,D3 101916 103C 000A 2162 U42_04 MOVE.B #10,D0 10191A 0105 2163 BTST D0,D5 10191C 6732 2164 BEQ.S U42_07 10191E 6162 2165 BSR UEA 101920 18FC 002C 2166 MOVE.B #',',(A4)+ 101924 143C 0044 2167 MOVE.B #'D',D2 101928 5406 2168 ADDQ.B #2,D6 10192A 6100 0378 2169 BSR UM 10192E 3203 2170 MOVE.W D3,D1 101930 E15B 2171 ROL.W #8,D3 101932 0C41 0100 2172 CMPI.W #$100,D1 101936 6D0E 2173 BLT.S U42_10 101938 0241 00FF 2174 AND.W #$FF,D1 10193C 0C41 0001 2175 CMPI.W #1,D1 101940 6D04 2176 BLT.S U42_10 101942 18FC 002F 2177 MOVE.B #'/',(A4)+ 101946 143C 0041 2178 U42_10 MOVE.B #'A',D2 10194A 6100 0358 2179 BSR UM 10194E 6030 2180 BRA.S U42_08 101950 143C 0044 2181 U42_07 MOVE.B #'D',D2 101954 5406 2182 ADDQ.B #2,D6 101956 6100 034C 2183 BSR UM 10195A 3203 2184 MOVE.W D3,D1 10195C E15B 2185 ROL.W #8,D3 10195E 0C41 0100 2186 CMPI.W #$100,D1 101962 6D0E 2187 BLT.S U42_09 101964 0241 00FF 2188 AND.W #$FF,D1 101968 0C41 0001 2189 CMPI.W #1,D1 10196C 6D04 2190 BLT.S U42_09 10196E 18FC 002F 2191 MOVE.B #'/',(A4)+ 101972 143C 0041 2192 U42_09 MOVE.B #'A',D2 101976 6100 032C 2193 BSR UM 10197A 18FC 002C 2194 MOVE.B #',',(A4)+ 10197E 6102 2195 BSR UEA 101980 4E75 2196 U42_08 RTS 2197 ; 2198 ; Tests effective address field 2199 ; D0 points to first bit of 2200 ; D4.B is length of cmd 'B','W','L' 2201 ; moves result to cmd line (A4) 2202 ; format MMMRRR 101982 4280 2203 UEA CLR.L D0 101984 103C 0005 2204 MOVE.B #05,D0 101988 0105 2205 BTST D0,D5 ;check first bit XMM 10198A 6700 020E 2206 BEQ UEA0 ;is 0MM, jmp 10198E 5300 2207 SUBQ.B #1,D0 101990 0105 2208 BTST D0,D5 ;check second bit 1XM 101992 6700 01C0 2209 BEQ UEA1 ;is 10M, jmp 101996 5300 2210 SUBQ.B #1,D0 101998 0105 2211 BTST D0,D5 ;check third bit 11X 10199A 6700 0156 2212 BEQ UEA2 ;is 110, jmp 10199E 5300 2213 SUBQ.B #1,D0 ;<<<<<<<< 111-RRR 1019A0 0105 2214 BTST D0,D5 ;test register bits 1019A2 6764 2215 BEQ.S UEA7 ;is 0RR, jmp 1019A4 18FC 0023 2216 MOVE.B #'#',(A4)+ ;<<<<<<<< 111-100 # 1019A8 18FC 0024 2217 MOVE.B #'$',(A4)+ 1019AC 0C04 0042 2218 CMPI.B #'B',D4 1019B0 660E 2219 BNE.S UEA11 1019B2 322D 0002 2220 MOVE.W 2(A5),D1 1019B6 6100 0250 2221 BSR UGBYT 1019BA 5406 2222 ADDQ.B #2,D6 1019BC 6000 022C 2223 BRA UEAD ;go to RTS 2224 ; 1019C0 0C04 0057 2225 UEA11 CMPI.B #'W',D4 1019C4 6618 2226 BNE.S UEA12 1019C6 3235 6800 2227 MOVE.W 0(A5,D6.L),D1 1019CA E159 2228 ROL.W #8,D1 1019CC 6100 023A 2229 BSR UGBYT 1019D0 3235 6800 2230 MOVE.W 0(A5,D6.L),D1 1019D4 6100 0232 2231 BSR UGBYT 1019D8 5406 2232 ADDQ.B #2,D6 1019DA 6000 020E 2233 BRA UEAD 1019DE 3235 6800 2234 UEA12 MOVE.W $00(A5,D6.L),D1 1019E2 E159 2235 ROL.W #8,D1 1019E4 6100 0222 2236 BSR UGBYT 1019E8 3235 6800 2237 MOVE.W 0(A5,D6.L),D1 1019EC 6100 021A 2238 BSR UGBYT 1019F0 3235 6802 2239 MOVE.W 2(A5,D6.L),D1 1019F4 E159 2240 ROL.W #8,D1 1019F6 6100 0210 2241 BSR UGBYT 1019FA 3235 6802 2242 MOVE.W 2(A5,D6.L),D1 1019FE 6100 0208 2243 BSR UGBYT 101A02 5806 2244 ADDQ.B #4,D6 101A04 6000 01E4 2245 BRA UEAD 2246 ; 101A08 5300 2247 UEA7 SUBQ.B #1,D0 101A0A 0105 2248 BTST D0,D5 ;test register bits 101A0C 6700 0094 2249 BEQ UEA8 ;is 00R, jmp 101A10 5300 2250 SUBQ.B #1,D0 101A12 0105 2251 BTST D0,D5 101A14 6760 2252 BEQ.S UEA9 ;is 010, jmp 101A16 18FC 0024 2253 MOVE.B #'$',(A4)+ ;<<<<<<<< 111-011 (d8,PC,Xn) 101A1A 322D 0002 2254 MOVE.W 2(A5),D1 101A1E 6100 01E8 2255 BSR UGBYT 101A22 5406 2256 ADDQ.B #2,D6 101A24 18FC 0028 2257 MOVE.B #'(',(A4)+ 101A28 18FC 0050 2258 MOVE.B #'P',(A4)+ 101A2C 18FC 0043 2259 MOVE.B #'C',(A4)+ 101A30 18FC 002C 2260 MOVE.B #',',(A4)+ 101A34 322D 0002 2261 MOVE.W 2(A5),D1 101A38 103C 000F 2262 MOVE.B #15,D0 101A3C 0101 2263 BTST D0,D1 101A3E 6706 2264 BEQ.S UEA17 101A40 18FC 0041 2265 MOVE.B #'A',(A4)+ 101A44 6004 2266 BRA.S UEA18 101A46 18FC 0044 2267 UEA17 MOVE.B #'D',(A4)+ 101A4A 5300 2268 UEA18 SUBQ.B #1,D0 101A4C 2605 2269 MOVE.L D5,D3 101A4E 3A2D 0002 2270 MOVE.W 2(A5),D5 101A52 6100 0198 2271 BSR UREG 101A56 2A03 2272 MOVE.L D3,D5 101A58 18FC 002E 2273 MOVE.B #'.',(A4)+ 101A5C 103C 000B 2274 MOVE.B #11,D0 101A60 0101 2275 BTST D0,D1 101A62 6706 2276 BEQ.S UEA19 101A64 18FC 004C 2277 MOVE.B #'L',(A4)+ 101A68 6004 2278 BRA.S UEA20 101A6A 18FC 0057 2279 UEA19 MOVE.B #'W',(A4)+ 101A6E 18FC 0029 2280 UEA20 MOVE.B #')',(A4)+ 101A72 6000 0176 2281 BRA UEAD ;go to RTS 2282 ; 101A76 18FC 0024 2283 UEA9 MOVE.B #'$',(A4)+ ;<<<<<<<< 111-010 (d16,PC) 101A7A 3235 6800 2284 MOVE.W 0(A5,D6.L),D1 101A7E E159 2285 ROL.W #8,D1 101A80 6100 0186 2286 BSR UGBYT 101A84 3235 6800 2287 MOVE.W 0(A5,D6.L),D1 101A88 6100 017E 2288 BSR UGBYT 101A8C 5406 2289 ADDQ.B #2,D6 101A8E 18FC 0028 2290 MOVE.B #'(',(A4)+ 101A92 18FC 0050 2291 MOVE.B #'P',(A4)+ 101A96 18FC 0043 2292 MOVE.B #'C',(A4)+ 101A9A 18FC 0029 2293 MOVE.B #')',(A4)+ 101A9E 6000 014A 2294 BRA UEAD ;go to RTS 2295 ; 101AA2 5300 2296 UEA8 SUBQ.B #1,D0 101AA4 0105 2297 BTST D0,D5 101AA6 672E 2298 BEQ.S UEA10 ;is 000, jmp 101AA8 18FC 0024 2299 MOVE.B #'$',(A4)+ ;<<<<<<<< 111-001 (xxx).L 101AAC 3235 6800 2300 MOVE.W $00(A5,D6.L),D1 101AB0 E159 2301 ROL.W #8,D1 101AB2 6100 0154 2302 BSR UGBYT 101AB6 3235 6800 2303 MOVE.W 0(A5,D6.L),D1 101ABA 6100 014C 2304 BSR UGBYT 101ABE 3235 6802 2305 MOVE.W 2(A5,D6.L),D1 101AC2 E159 2306 ROL.W #8,D1 101AC4 6100 0142 2307 BSR UGBYT 101AC8 3235 6802 2308 MOVE.W 2(A5,D6.L),D1 101ACC 6100 013A 2309 BSR UGBYT 101AD0 5806 2310 ADDQ.B #4,D6 101AD2 6000 0116 2311 BRA UEAD 2312 ; 101AD6 18FC 0024 2313 UEA10 MOVE.B #'$',(A4)+ ;<<<<<<<< 111-000 (xxx).W 101ADA 3235 6800 2314 MOVE.W 0(A5,D6.L),D1 101ADE E159 2315 ROL.W #8,D1 101AE0 6100 0126 2316 BSR UGBYT 101AE4 3235 6800 2317 MOVE.W 0(A5,D6.L),D1 101AE8 6100 011E 2318 BSR UGBYT 101AEC 5406 2319 ADDQ.B #2,D6 101AEE 6000 00FA 2320 BRA UEAD 101AF2 18FC 0024 2321 UEA2 MOVE.B #'$',(A4)+ ;<<<<<<<< 110 (d8,An,Xn) 101AF6 322D 0002 2322 MOVE.W 2(A5),D1 101AFA 6100 010C 2323 BSR UGBYT 101AFE 5406 2324 ADDQ.B #2,D6 101B00 18FC 0028 2325 MOVE.B #'(',(A4)+ 101B04 18FC 0041 2326 MOVE.B #'A',(A4)+ 101B08 5300 2327 SUBQ.B #1,D0 101B0A 6100 00E0 2328 BSR UREG 101B0E 18FC 002C 2329 MOVE.B #',',(A4)+ 101B12 322D 0002 2330 MOVE.W 2(A5),D1 101B16 103C 000F 2331 MOVE.B #15,D0 101B1A 0101 2332 BTST D0,D1 101B1C 6706 2333 BEQ.S UEA13 101B1E 18FC 0041 2334 MOVE.B #'A',(A4)+ 101B22 6004 2335 BRA.S UEA14 101B24 18FC 0044 2336 UEA13 MOVE.B #'D',(A4)+ 101B28 5300 2337 UEA14 SUBQ.B #1,D0 101B2A 2605 2338 MOVE.L D5,D3 101B2C 3A2D 0002 2339 MOVE.W 2(A5),D5 101B30 6100 00BA 2340 BSR UREG 101B34 2A03 2341 MOVE.L D3,D5 101B36 18FC 002E 2342 MOVE.B #'.',(A4)+ 101B3A 103C 000B 2343 MOVE.B #11,D0 101B3E 0101 2344 BTST D0,D1 101B40 6706 2345 BEQ.S UEA15 101B42 18FC 004C 2346 MOVE.B #'L',(A4)+ 101B46 6004 2347 BRA.S UEA16 101B48 18FC 0057 2348 UEA15 MOVE.B #'W',(A4)+ 101B4C 18FC 0029 2349 UEA16 MOVE.B #')',(A4)+ 101B50 6000 0098 2350 BRA UEAD 2351 ; 101B54 5300 2352 UEA1 SUBQ.B #1,D0 101B56 0105 2353 BTST D0,D5 ;check third bit 10X 101B58 672A 2354 BEQ.S UEA3 ;is 100, jmp 101B5A 18FC 0024 2355 UEA1A MOVE.B #'$',(A4)+ ;<<<<<<<< 101 (d16,An) 101B5E 3235 6800 2356 MOVE.W $00(A5,D6.L),D1 101B62 E159 2357 ROL.W #8,D1 101B64 6100 00A2 2358 BSR UGBYT 101B68 3235 6800 2359 MOVE.W 0(A5,D6.L),D1 101B6C 6100 009A 2360 BSR UGBYT 101B70 5406 2361 ADDQ.B #2,D6 101B72 18FC 0028 2362 MOVE.B #'(',(A4)+ 101B76 18FC 0041 2363 MOVE.B #'A',(A4)+ 101B7A 5300 2364 SUBQ.B #1,D0 101B7C 616E 2365 BSR UREG 101B7E 18FC 0029 2366 MOVE.B #')',(A4)+ 101B82 6066 2367 BRA.S UEAD 2368 ; 101B84 18FC 002D 2369 UEA3 MOVE.B #'-',(A4)+ ;<<<<<<<< 100 -(An) 101B88 18FC 0028 2370 MOVE.B #'(',(A4)+ 101B8C 18FC 0041 2371 MOVE.B #'A',(A4)+ 101B90 5300 2372 SUBQ.B #1,D0 101B92 6158 2373 BSR UREG 101B94 18FC 0029 2374 MOVE.B #')',(A4)+ 101B98 6050 2375 BRA.S UEAD 2376 ; 101B9A 5300 2377 UEA0 SUBQ.B #1,D0 101B9C 0105 2378 BTST D0,D5 ;check second bit 0XM 101B9E 672E 2379 BEQ.S UEA4 ;is 00M, jmp 101BA0 5300 2380 SUBQ.B #1,D0 101BA2 0105 2381 BTST D0,D5 ;check third bit 01X 101BA4 6716 2382 BEQ.S UEA5 ;is 010, jmp 101BA6 18FC 0028 2383 MOVE.B #'(',(A4)+ ;<<<<<<<< 011 (An)+ 101BAA 18FC 0041 2384 MOVE.B #'A',(A4)+ 101BAE 5300 2385 SUBQ.B #1,D0 101BB0 613A 2386 BSR UREG 101BB2 18FC 0029 2387 MOVE.B #')',(A4)+ 101BB6 18FC 002B 2388 MOVE.B #'+',(A4)+ 101BBA 602E 2389 BRA.S UEAD 2390 ; 101BBC 18FC 0028 2391 UEA5 MOVE.B #'(',(A4)+ ;<<<<<<<< 010 (An) 101BC0 18FC 0041 2392 MOVE.B #'A',(A4)+ 101BC4 5300 2393 SUBQ.B #1,D0 101BC6 6124 2394 BSR UREG 101BC8 18FC 0029 2395 MOVE.B #')',(A4)+ 101BCC 601C 2396 BRA.S UEAD 2397 ; 101BCE 5300 2398 UEA4 SUBQ.B #1,D0 101BD0 0105 2399 BTST D0,D5 ;check third bit 00X 101BD2 670A 2400 BEQ.S UEA6 ;is 000, jmp 101BD4 18FC 0041 2401 MOVE.B #'A',(A4)+ ;<<<<<<<< 001 An 101BD8 5300 2402 SUBQ.B #1,D0 101BDA 6110 2403 BSR UREG 101BDC 600C 2404 BRA.S UEAD 2405 ; 101BDE 18FC 0044 2406 UEA6 MOVE.B #'D',(A4)+ ;<<<<<<<< 000 Dn 101BE2 5300 2407 SUBQ.B #1,D0 101BE4 6106 2408 BSR UREG 101BE6 6000 0002 2409 BRA UEAD 101BEA 4E75 2410 UEAD RTS 2411 ; 2412 ; Gets the register number and adds it to printout 2413 ; buffer. D0.B points to MSB of register in OPCODE. 2414 ; A4 points to next place in printout buffer. 101BEC 3205 2415 UREG MOVE.W D5,D1 ;Don't trash D5 101BEE 0400 0002 2416 SUBI.B #2,D0 ;Point D0 to lowest bit 101BF2 0280 000000FF 2417 ANDI.L #$FF,D0 ;Reset the upper 3 bytes in D0 101BF8 6702 2418 BEQ.S UREG1 ;If shift size is 0 then skip 101BFA E069 2419 LSR.W D0,D1 ;Shift down the register num 101BFC 0201 0007 2420 UREG1 ANDI.B #7,D1 ;Mask out irrelevant bits 101C00 0601 0030 2421 ADDI.B #'0',D1 ;Add 30H to convert to ASCII 101C04 18C1 2422 MOVE.B D1,(A4)+ ;Store it 101C06 4E75 2423 RTS 2424 ; 2425 ; Converts byte in D1.B to ASCII and moves it to 2426 ; cmd line 101C08 2401 2427 UGBYT MOVE.L D1,D2 ;init conversion reg 101C0A E919 2428 ROL.B #4,D1 ;do upper nibble first 101C0C 6100 ED60 2429 BSR NUM_ASC ;convert to ASCII 101C10 18C1 2430 MOVE.B D1,(A4)+ 101C12 2202 2431 MOVE.L D2,D1 ;now do lower nibble 101C14 6100 ED58 2432 BSR NUM_ASC 101C18 18C1 2433 MOVE.B D1,(A4)+ 101C1A 2202 2434 MOVE.L D2,D1 101C1C 4E75 2435 RTS 2436 ; 2437 ; cmd size. 00=byte 01=word 10=long 2438 ; moves .B, .W or .L to cmd line 2439 ; D0 points to first size bit 2440 ; also moves L or W or B to D4 101C1E 0105 2441 USZ BTST D0,D5 101C20 670E 2442 BEQ.S USZ1 101C22 18FC 002E 2443 MOVE.B #'.',(A4)+ 101C26 18FC 004C 2444 MOVE.B #'L',(A4)+ 101C2A 183C 004C 2445 MOVE.B #'L',D4 101C2E 6020 2446 BRA.S USZE 101C30 5300 2447 USZ1 SUBQ.B #1,D0 101C32 0105 2448 BTST D0,D5 101C34 670E 2449 BEQ.S USZ2 101C36 18FC 002E 2450 MOVE.B #'.',(A4)+ 101C3A 18FC 0057 2451 MOVE.B #'W',(A4)+ 101C3E 183C 0057 2452 MOVE.B #'W',D4 101C42 600C 2453 BRA.S USZE 101C44 18FC 002E 2454 USZ2 MOVE.B #'.',(A4)+ 101C48 18FC 0042 2455 MOVE.B #'B',(A4)+ 101C4C 183C 0042 2456 MOVE.B #'B',D4 101C50 4E75 2457 USZE RTS 2458 ; 2459 ; cmd size for move 01=byte 11=word 10=long 2460 ; moves .B, .W or .L to cmd line 2461 ; D0 points to first size bit 2462 ; also moves L or W or B to D4 101C52 0105 2463 USZM BTST D0,D5 101C54 660E 2464 BNE.S USZM1 101C56 18FC 002E 2465 MOVE.B #'.',(A4)+ 101C5A 18FC 0042 2466 MOVE.B #'B',(A4)+ 101C5E 183C 0042 2467 MOVE.B #'B',D4 101C62 6020 2468 BRA.S USZME 101C64 5300 2469 USZM1 SUBQ.B #1,D0 101C66 0105 2470 BTST D0,D5 101C68 670E 2471 BEQ.S USZM2 101C6A 18FC 002E 2472 MOVE.B #'.',(A4)+ 101C6E 18FC 0057 2473 MOVE.B #'W',(A4)+ 101C72 183C 0057 2474 MOVE.B #'W',D4 101C76 600C 2475 BRA.S USZME 101C78 18FC 002E 2476 USZM2 MOVE.B #'.',(A4)+ 101C7C 18FC 004C 2477 MOVE.B #'L',(A4)+ 101C80 183C 004C 2478 MOVE.B #'L',D4 101C84 4E75 2479 USZME RTS 2480 ; 2481 ; Condition codes routine 2482 ; D0 contains nubmber of bits to roll 101C86 3205 2483 UCC MOVE.W D5,D1 101C88 E079 2484 ROR.W D0,D1 101C8A 0281 0000000F 2485 AND.L #$F,D1 101C90 C2FC 0002 2486 MULU.W #2,D1 101C94 207C 00102396 2487 MOVEA.L #UCCLST,A0 101C9A 18F0 1800 2488 MOVE.B 0(A0,D1.L),(A4)+ 101C9E 18F0 1801 2489 MOVE.B 1(A0,D1.L),(A4)+ 101CA2 4E75 2490 RTS 2491 ; 2492 ; <<<<<< Fixed in mon209 >>>>>> 2493 ; Routine for move multiple. 2494 ; D3 contains byte in X7-X0 format 2495 ; D2 contains letter (ie A,D) 101CA4 4280 2496 UM CLR.L D0 101CA6 123C 00FF 2497 MOVE.B #$FF,D1 101CAA 0103 2498 UM00 BTST.L D0,D3 101CAC 660C 2499 BNE UM01 101CAE 0600 0001 2500 ADDI.B #$01,D0 101CB2 0C00 0008 2501 CMPI.B #$08,D0 101CB6 6756 2502 BEQ UME 101CB8 60F0 2503 BRA UM00 101CBA 1200 2504 UM01 MOVE.B D0,D1 101CBC 615A 2505 BSR UMP 101CBE 0600 0001 2506 ADDI.B #$01,D0 101CC2 0C00 0008 2507 CMPI.B #$08,D0 101CC6 6746 2508 BEQ UME 101CC8 0103 2509 BTST.L D0,D3 101CCA 660C 2510 BNE UM02 101CCC 0600 0001 2511 ADDI.B #$01,D0 101CD0 0C00 0008 2512 CMPI.B #$08,D0 101CD4 6738 2513 BEQ UME 101CD6 6020 2514 BRA UM03 101CD8 1200 2515 UM02 MOVE.B D0,D1 101CDA 0600 0001 2516 ADDI.B #$01,D0 101CDE 0C00 0008 2517 CMPI.B #$08,D0 101CE2 672A 2518 BEQ UME 101CE4 0103 2519 BTST.L D0,D3 101CE6 66F0 2520 BNE UM02 101CE8 18FC 002D 2521 MOVE.B #'-',(A4)+ 101CEC 612A 2522 BSR UMP 101CEE 0600 0001 2523 ADDI.B #$01,D0 101CF2 0C00 0008 2524 CMPI.B #$08,D0 101CF6 6716 2525 BEQ UME 101CF8 0103 2526 UM03 BTST.L D0,D3 101CFA 660C 2527 BNE UM04 101CFC 0600 0001 2528 ADDI.B #$01,D0 101D00 0C00 0008 2529 CMPI.B #$08,D0 101D04 6708 2530 BEQ UME 101D06 60F0 2531 BRA UM03 101D08 18FC 002F 2532 UM04 MOVE.B #'/',(A4)+ 101D0C 60AC 2533 BRA UM01 101D0E 0C01 00FF 2534 UME CMPI.B #$FF,D1 101D12 6702 2535 BEQ UME0 101D14 6102 2536 BSR UMP 101D16 4E75 2537 UME0 RTS 101D18 18C2 2538 UMP MOVE.B D2,(A4)+ 101D1A 0601 0030 2539 ADDI.B #$30,D1 101D1E 18C1 2540 MOVE.B D1,(A4)+ 101D20 123C 00FF 2541 MOVE.B #$FF,D1 101D24 4E75 2542 RTS 2543 ; 2544 ;**************************************************** 2545 ;End Unassemble Routines 2546 ;**************************************************** 2547 ; 101D26 267C 0010253E 2548 HELP MOVEA.L #H_MSG1,A3 ;help menu 101D2C 6100 EBA0 2549 BSR PRTMSG ;now the help menu 101D30 6000 E6F2 2550 BRA GET_CMD 2551 ; 101D34 6100 E94C 2552 BUSERR BSR CLR_BK ;clear the bkpts 101D38 267C 00102425 2553 MOVEA.L #MSG_1,A3 101D3E 6000 0116 2554 BRA REPORT 2555 ; 2556 ; The address error exception stores more infomation 2557 ; than other exceptions. 8 additonal bytes are pushed 2558 ; to the stack before the SR and PC so a modified 2559 ; version of REG_SAV is used. 101D42 48F97FFF 000FFF80 2560 ADDERR MOVEM.L D0-D7/A0-A6,SAVREGS ;d0-a6 101D4A DFFC 00000008 2561 ADDA.L #$08,A7 101D50 33DF 000FFFC4 2562 MOVE.W (A7)+,SAV_SR ;pop SR 101D56 23DF 000FFFC0 2563 MOVE.L (A7)+,SAV_PC ;pop PC (It points to 2564 ;next instruction) 101D5C 4E6D 2565 MOVE.L USP,A5 ;get user's A7 101D5E 23CD 000FFFBC 2566 MOVE.L A5,SAV_A7 ;save it 101D64 267C 0010242F 2567 MOVEA.L #MSG_2,A3;point to message 101D6A 6100 EB62 2568 BSR PRTMSG 101D6E 243A E250 2569 MOVE.L SAV_PC,D2 ;get user PC value 101D72 6100 EBB4 2570 BSR PRT_SIX 101D76 6100 EB66 2571 BSR CRLF 101D7A 6100 E906 2572 BSR CLR_BK ;clear the bkpts 101D7E 6000 E6A4 2573 BRA GET_CMD ;all done 2574 ; 101D82 6100 ED0E 2575 ILEGAL BSR REG_SAV 101D86 267C 00102445 2576 MOVEA.L #MSG_3,A3;point to message 101D8C 6100 EB40 2577 BSR PRTMSG 101D90 243A E22E 2578 MOVE.L SAV_PC,D2 ;get user PC value (illegal instruction) 101D94 6100 EB92 2579 BSR PRT_SIX 101D98 5482 2580 ADDQ.L #2,D2 ;skip a longword in SAV_PC 101D9A 23C2 000FFFC0 2581 MOVE.L D2,SAV_PC 101DA0 51F9 000FFFEA 2582 SF FP_FLG ;clear flag 101DA6 6100 EB36 2583 BSR CRLF 101DAA 6100 E8D6 2584 BSR CLR_BK ;clear the bkpts 101DAE 6000 E674 2585 BRA GET_CMD ;all done 2586 ; 101DB2 6100 ECDE 2587 DIVZERO BSR REG_SAV 101DB6 267C 00102463 2588 MOVEA.L #MSG_4,A3;point to message 101DBC 6100 EB10 2589 BSR PRTMSG 101DC0 243A E1FE 2590 MOVE.L SAV_PC,D2 ;get user PC value (next instruction) 101DC4 6100 EB62 2591 BSR PRT_SIX 101DC8 6100 EB14 2592 BSR CRLF 101DCC 6100 E8B4 2593 BSR CLR_BK ;clear the bkpts 101DD0 6000 E652 2594 BRA GET_CMD ;all done 2595 ; 101DD4 6100 ECBC 2596 LINE_A BSR REG_SAV 101DD8 267C 001024E0 2597 MOVEA.L #MSG_A,A3;point to message 101DDE 6100 EAEE 2598 BSR PRTMSG 101DE2 243A E1DC 2599 MOVE.L SAV_PC,D2 ;get user PC value (illegal instruction) 101DE6 6100 EB40 2600 BSR PRT_SIX 101DEA 5482 2601 ADDQ.L #2,D2 ;skip a longword in SAV_PC 101DEC 23C2 000FFFC0 2602 MOVE.L D2,SAV_PC 101DF2 51F9 000FFFEA 2603 SF FP_FLG ;clear flag 101DF8 6100 EAE4 2604 BSR CRLF 101DFC 6100 E884 2605 BSR CLR_BK ;clear the bkpts 101E00 6000 E622 2606 BRA GET_CMD ;all done 2607 ; 101E04 6100 EC8C 2608 LINE_F BSR REG_SAV 101E08 267C 0010250F 2609 MOVEA.L #MSG_F,A3;point to message 101E0E 6100 EABE 2610 BSR PRTMSG 101E12 243A E1AC 2611 MOVE.L SAV_PC,D2 ;get user PC value (illegal instruction) 101E16 6100 EB10 2612 BSR PRT_SIX 101E1A 5482 2613 ADDQ.L #2,D2 ;skip a longword in SAV_PC 101E1C 23C2 000FFFC0 2614 MOVE.L D2,SAV_PC 101E22 6100 EABA 2615 BSR CRLF 101E26 51F9 000FFFEA 2616 SF FP_FLG ;clear flag 101E2C 6100 E854 2617 BSR CLR_BK ;clear the bkpts 101E30 6000 E5F2 2618 BRA GET_CMD ;all done 2619 ; 101E34 6100 E84C 2620 TRAP_V BSR CLR_BK ;clear the bkpts 101E38 267C 00102480 2621 MOVEA.L #MSG_5,A3 101E3E 6016 2622 BRA.S REPORT 2623 ; 101E40 6100 E840 2624 PRIVIOL BSR CLR_BK ;clear the bkpts 101E44 267C 0010248F 2625 MOVEA.L #MSG_6,A3 101E4A 600A 2626 BRA.S REPORT 2627 ; 101E4C 6100 E834 2628 LEVEL_7 BSR CLR_BK ;clear the bkpts 101E50 267C 001024A3 2629 MOVEA.L #MSG_7,A3 101E56 6100 EA86 2630 REPORT BSR CRLF 101E5A 6100 EA72 2631 BSR PRTMSG ;now the help menu 101E5E 6100 EA7E 2632 BSR CRLF 101E62 6000 E5C0 2633 BRA GET_CMD 2634 ; 101E66 6100 EA36 2635 TO_CHARIN BSR CHARIN 101E6A 4E73 2636 RTE 2637 ; 101E6C 6100 EA48 2638 TO_CHAROUT BSR CHAROUT 101E70 4E73 2639 RTE 2640 ; 101E72 6100 EA6A 2641 TO_CRLF BSR CRLF 101E76 4E73 2642 RTE 2643 ; 101E78 6100 EA54 2644 TO_PRTMSG BSR PRTMSG 101E7C 4E73 2645 RTE 2646 ; 101E7E 6100 EA84 2647 TO_PRT_BYT BSR PRT_BYT 101E82 4E73 2648 RTE 2649 ; 101E84 6100 EA8E 2650 TO_PRT_WRD BSR PRT_WRD 101E88 4E73 2651 RTE 2652 ; 101E8A 6100 EA92 2653 TO_PRT_LON BSR PRT_LON 101E8E 4E73 2654 RTE 2655 ; 101E90 6100 EAEE 2656 TO_GET_BYT BSR GET_BYT 101E94 4E73 2657 RTE 2658 ; 101E96 6100 EB24 2659 TO_GETADR BSR GETADRT 101E9A 4E73 2660 RTE 2661 ; 2662 ;****************************************************** 2663 ; Begin Unassemble of Instructions. Each entry is in 2664 ; the following format: The 1st word is the opcode 2665 ; with all variable bits made 0. The 2nd word is 2666 ; the mask consisting of all 1's in the bit positions 2667 ; in which the instruction is fully defined and 0's 2668 ; in the positions in which the bits can change. Next 2669 ; are 6 ASCII bytes of null-padded instruction text. 2670 ; Next is one long word pointing to the subroutine 2671 ; that handles the disassembly of the opcode. 2672 ; The order of the commands is extremely important. 2673 ; The most specific commands, those that have more 2674 ; ones bits in their mask, must come first. With each 2675 ; instruction you'll find the bit count of its mask. 2676 ; 2677 ; HEX opcode examples 2678 ;----------------------------------------------------- 2679 ; NOP This instruction is fully defined 2680 ; BITS (X's for variable bits) 0100111001110001 2681 ; 1st word (X bits converted to 0) 0100111001110001 2682 ; 2nd word (The mask, see CMPA below) 1111111111111111 2683 ; Mask bit count of ones = 16 2684 ; 2685 ; CMPA 2686 ; BITS (X's for variable bits) 1011XXXX11XXXXXX 2687 ; 1st word (X bits converted to 0) 1011000011000000 2688 ; 2nd word (Defined bits = 1, X = 0) 1111000011000000 2689 ; Mask bit count of ones = 6 2690 ; 2691 ;****************************************************** 101E9C 2692 UNINSTR 2693 ; Instructions with 1st nibble = 0000. 2694 ; ORI to CCR. Number of bits in mask = (16) 101E9C 003CFFFF 2695 DC.W $3C,$FFFF 101EA0 4F5249000000 2696 DC.B 'ORI',0,0,0 101EA6 001012A4 2697 DC.L U09 2698 ; ORI to SR (16) 101EAA 007CFFFF 2699 DC.W $7C,$FFFF 101EAE 4F5249000000 2700 DC.B 'ORI',0,0,0 101EB4 001012D8 2701 DC.L U10 2702 ; ANDI to CCR (16) 101EB8 023CFFFF 2703 DC.W $23C,$FFFF 101EBC 414E44490000 2704 DC.B 'ANDI',0,0 101EC2 001012A4 2705 DC.L U09 2706 ; ANDI to SR (16) 101EC6 027CFFFF 2707 DC.W $27C,$FFFF 101ECA 414E44490000 2708 DC.B 'ANDI',0,0 101ED0 001012D8 2709 DC.L U10 2710 ; EORI to CCR (16) 101ED4 0A3CFFFF 2711 DC.W $A3C,$FFFF 101ED8 454F52490000 2712 DC.B 'EORI',0,0 101EDE 001012A4 2713 DC.L U09 2714 ; EORI to SR (16) 101EE2 0A7CFFFF 2715 DC.W $A7C,$FFFF 101EE6 454F52490000 2716 DC.B 'EORI',0,0 101EEC 001012D8 2717 DC.L U10 2718 ; BTST (10) 101EF0 0800FFC0 2719 DC.W $800,$FFC0 101EF4 425453540000 2720 DC.B 'BTST',0,0 101EFA 001013EA 2721 DC.L U14 2722 ; BCHG (10) 101EFE 0840FFC0 2723 DC.W $840,$FFC0 101F02 424348470000 2724 DC.B 'BCHG',0,0 101F08 001013EA 2725 DC.L U14 2726 ; BCLR (10) 101F0C 0880FFC0 2727 DC.W $880,$FFC0 101F10 42434C520000 2728 DC.B 'BCLR',0,0 101F16 001013EA 2729 DC.L U14 2730 ; BSET (10) 101F1A 08C0FFC0 2731 DC.W $8C0,$FFC0 101F1E 425345540000 2732 DC.B 'BSET',0,0 101F24 001013EA 2733 DC.L U14 2734 ; Ordinary ORI (8) 101F28 0000FF00 2735 DC.W $0,$FF00 101F2C 4F5249000000 2736 DC.B 'ORI',0,0,0 101F32 00101316 2737 DC.L U11 2738 ; Ordinary ANDI (8) 101F36 0200FF00 2739 DC.W $200,$FF00 101F3A 414E44490000 2740 DC.B 'ANDI',0,0 101F40 00101316 2741 DC.L U11 2742 ; SUBI (8) 101F44 0400FF00 2743 DC.W $400,$FF00 101F48 535542490000 2744 DC.B 'SUBI',0,0 101F4E 00101316 2745 DC.L U11 2746 ; ADDI (8) 101F52 0600FF00 2747 DC.W $600,$FF00 101F56 414444490000 2748 DC.B 'ADDI',0,0 101F5C 00101316 2749 DC.L U11 2750 ; Ordinary EORI (8) 101F60 0A00FF00 2751 DC.W $A00,$FF00 101F64 454F52490000 2752 DC.B 'EORI',0,0 101F6A 00101316 2753 DC.L U11 2754 ; CMPI (8) 101F6E 0C00FF00 2755 DC.W $C00,$FF00 101F72 434D50490000 2756 DC.B 'CMPI',0,0 101F78 00101316 2757 DC.L U11 2758 ; MOVEP (8) 101F7C 0108F138 2759 DC.W $108,$F138 101F80 4D4F56455000 2760 DC.B 'MOVEP',0 101F86 00101850 2761 DC.L U41 2762 ; BTST (7) 101F8A 0100F1C0 2763 DC.W $100,$F1C0 101F8E 425453540000 2764 DC.B 'BTST',0,0 101F94 00101410 2765 DC.L U15 2766 ; BCHG (7) 101F98 0140F1C0 2767 DC.W $140,$F1C0 101F9C 424348470000 2768 DC.B 'BCHG',0,0 101FA2 00101410 2769 DC.L U15 2770 ; BCLR (7) 101FA6 0180F1C0 2771 DC.W $180,$F1C0 101FAA 42434C520000 2772 DC.B 'BCLR',0,0 101FB0 00101410 2773 DC.L U15 2774 ; BSET (7) 101FB4 01C0F1C0 2775 DC.W $1C0,$F1C0 101FB8 425345540000 2776 DC.B 'BSET',0,0 101FBE 00101410 2777 DC.L U15 2778 ; MOVEA (5) 101FC2 0040C1C0 2779 DC.W $40,$C1C0 101FC6 4D4F56454100 2780 DC.B 'MOVEA',0 101FCC 00101464 2781 DC.L U17 2782 ; MOVE (2) 101FD0 0000C000 2783 DC.W $0,$C000 101FD4 4D4F56450000 2784 DC.B 'MOVE',0,0 101FDA 00101432 2785 DC.L U16 2786 ; Instructions with 1st nibble = 0100 2787 ; ILLEGAL (16) 101FDE 4AFCFFFF 2788 DC.W $4AFC,$FFFF 101FE2 494C4C454700 2789 DC.B 'ILLEG',0 101FE8 001010AC 2790 DC.L U01 2791 ; RESET (16) 101FEC 4E70FFFF 2792 DC.W $4E70,$FFFF 101FF0 524553455400 2793 DC.B 'RESET',0 101FF6 001010AA 2794 DC.L U00 2795 ; NOP (16) 101FFA 4E71FFFF 2796 DC.W $4E71,$FFFF 101FFE 4E4F50000000 2797 DC.B 'NOP',0,0,0 102004 001010AA 2798 DC.L U00 2799 ; STOP (16) 102008 4E72FFFF 2800 DC.W $4E72,$FFFF 10200C 53544F500000 2801 DC.B 'STOP',0,0 102012 00101726 2802 DC.L U34 2803 ; RTE (16) 102016 4E73FFFF 2804 DC.W $4E73,$FFFF 10201A 525445000000 2805 DC.B 'RTE',0,0,0 102020 001010AA 2806 DC.L U00 2807 ; RTS (16) 102024 4E75FFFF 2808 DC.W $4E75,$FFFF 102028 525453000000 2809 DC.B 'RTS',0,0,0 10202E 001010AA 2810 DC.L U00 2811 ; TRAPV (16) 102032 4E76FFFF 2812 DC.W $4E76,$FFFF 102036 545241505600 2813 DC.B 'TRAPV',0 10203C 001010AA 2814 DC.L U00 2815 ; RTR (16) 102040 4E77FFFF 2816 DC.W $4E77,$FFFF 102044 525452000000 2817 DC.B 'RTR',0,0,0 10204A 001010AA 2818 DC.L U00 2819 ; SWAP (13) 10204E 4840FFF8 2820 DC.W $4840,$FFF8 102052 535741500000 2821 DC.B 'SWAP',0,0 102058 00101514 2822 DC.L U23 2823 ; LINK (13) 10205C 4E50FFF8 2824 DC.W $4E50,$FFF8 102060 4C494E4B0000 2825 DC.B 'LINK',0,0 102066 00101540 2826 DC.L U25 2827 ; UNLK (13) 10206A 4E58FFF8 2828 DC.W $4E58,$FFF8 10206E 554E4C4B0000 2829 DC.B 'UNLK',0,0 102074 0010152A 2830 DC.L U24 2831 ; MOVE An <-> USP (12) 102078 4E60FFF0 2832 DC.W $4E60,$FFF0 10207C 4D4F56450000 2833 DC.B 'MOVE',0,0 102082 001017D2 2834 DC.L U39 2835 ; TRAP (12) 102086 4E40FFF0 2836 DC.W $4E40,$FFF0 10208A 545241500000 2837 DC.B 'TRAP',0,0 102090 0010174A 2838 DC.L U35 2839 ; JSR (12) 102094 4E80FFC0 2840 DC.W $4E80,$FFC0 102098 4A5352000000 2841 DC.B 'JSR',0,0,0 10209E 001013DE 2842 DC.L U13 2843 ; JMP (12) 1020A2 4EC0FFC0 2844 DC.W $4EC0,$FFC0 1020A6 4A4D50000000 2845 DC.B 'JMP',0,0,0 1020AC 001013DE 2846 DC.L U13 2847 ; EXT (11) 1020B0 4880FEB8 2848 DC.W $4880,$FEB8 1020B4 455854000000 2849 DC.B 'EXT',0,0,0 1020BA 001016A2 2850 DC.L U30 2851 ; MOVE from SR (10) 1020BE 40C0FFC0 2852 DC.W $40C0,$FFC0 1020C2 4D4F56450000 2853 DC.B 'MOVE',0,0 1020C8 0010178A 2854 DC.L U37 2855 ; MOVE to CCR (10) 1020CC 44C0FFC0 2856 DC.W $44C0,$FFC0 1020D0 4D4F56450000 2857 DC.B 'MOVE',0,0 1020D6 00101762 2858 DC.L U36 2859 ; MOVE to SR (10) 1020DA 46C0FFC0 2860 DC.W $46C0,$FFC0 1020DE 4D4F56450000 2861 DC.B 'MOVE',0,0 1020E4 001017AE 2862 DC.L U38 2863 ; NBCD (10) 1020E8 4800FFC0 2864 DC.W $4800,$FFC0 1020EC 4E4243440000 2865 DC.B 'NBCD',0,0 1020F2 00101706 2866 DC.L U32 2867 ; PEA (10) 1020F6 4840FFC0 2868 DC.W $4840,$FFC0 1020FA 504541000000 2869 DC.B 'PEA',0,0,0 102100 00101716 2870 DC.L U33 2871 ; TAS (10) 102104 4AC0FFC0 2872 DC.W $4AC0,$FFC0 102108 544153000000 2873 DC.B 'TAS',0,0,0 10210E 00101502 2874 DC.L U22 2875 ; NEGX (8) 102112 4000FF00 2876 DC.W $4000,$FF00 102116 4E4547580000 2877 DC.B 'NEGX',0,0 10211C 001014EC 2878 DC.L U21 2879 ; CLR (8) 102120 4200FF00 2880 DC.W $4200,$FF00 102124 434C52000000 2881 DC.B 'CLR',0,0,0 10212A 001014EC 2882 DC.L U21 2883 ; NEG (8) 10212E 4400FF00 2884 DC.W $4400,$FF00 102132 4E4547000000 2885 DC.B 'NEG',0,0,0 102138 001014EC 2886 DC.L U21 2887 ; NOT (8) 10213C 4600FF00 2888 DC.W $4600,$FF00 102140 4E4F54000000 2889 DC.B 'NOT',0,0,0 102146 001014EC 2890 DC.L U21 2891 ; TST (8) 10214A 4A00FF00 2892 DC.W $4A00,$FF00 10214E 545354000000 2893 DC.B 'TST',0,0,0 102154 001014EC 2894 DC.L U21 2895 ; MOVEM (8) 102158 4880FB80 2896 DC.W $4880,$FB80 10215C 4D4F56454D00 2897 DC.B 'MOVEM',0 102162 001018C8 2898 DC.L U42 2899 ; LEA (7) 102166 41C0F1C0 2900 DC.W $41C0,$F1C0 10216A 4C4541000000 2901 DC.B 'LEA',0,0,0 102170 001016CC 2902 DC.L U31 2903 ; CHK (5) 102174 4000F040 2904 DC.W $4000,$F040 102178 43484B000000 2905 DC.B 'CHK',0,0,0 10217E 0010160E 2906 DC.L U28 2907 ; Instructions with 1st nibble = 0101 2908 ; DBcc (9) 102182 50C8F0F8 2909 DC.W $50C8,$F0F8 102186 444200000000 2910 DC.B 'DB',0,0,0,0 10218C 00101496 2911 DC.L U19 2912 ; Scc (6) 102190 50C0F0C0 2913 DC.W $50C0,$F0C0 102194 530000000000 2914 DC.B 'S',0,0,0,0,0 10219A 001014D2 2915 DC.L U20 2916 ; ADDQ (5) 10219E 5000F100 2917 DC.W $5000,$F100 1021A2 414444510000 2918 DC.B 'ADDQ',0,0 1021A8 001015DC 2919 DC.L U27 2920 ; SUBQ (5) 1021AC 5100F100 2921 DC.W $5100,$F100 1021B0 535542510000 2922 DC.B 'SUBQ',0,0 1021B6 001015DC 2923 DC.L U27 2924 ; Instructions with 1st nibble = 0110 2925 ; BRA (8) 1021BA 6000FF00 2926 DC.W $6000,$FF00 1021BE 425241000000 2927 DC.B 'BRA',0,0,0 1021C4 0010138C 2928 DC.L U12 2929 ; BSR (8) 1021C8 6100FF00 2930 DC.W $6100,$FF00 1021CC 425352000000 2931 DC.B 'BSR',0,0,0 1021D2 0010138C 2932 DC.L U12 2933 ; Bcc (4) 1021D6 6000F000 2934 DC.W $6000,$F000 1021DA 420000000000 2935 DC.B 'B',0,0,0,0,0 1021E0 0010148A 2936 DC.L U18 2937 ; Instructions with 1st nibble = 0111 2938 ; MOVEQ (5) 1021E4 7000F100 2939 DC.W $7000,$F100 1021E8 4D4F56455100 2940 DC.B 'MOVEQ',0 1021EE 00101822 2941 DC.L U40 2942 ; Instructions with 1st nibble = 1000 2943 ; SBCD (9) 1021F2 8100F1F0 2944 DC.W $8100,$F1F0 1021F6 534243440000 2945 DC.B 'SBCD',0,0 1021FC 00101574 2946 DC.L U26 2947 ; DIVU (7) 102200 80C0F1C0 2948 DC.W $80C0,$F1C0 102204 444956550000 2949 DC.B 'DIVU',0,0 10220A 001011F4 2950 DC.L U06 2951 ; DIVS (7) 10220E 81C0F1C0 2952 DC.W $81C0,$F1C0 102212 444956530000 2953 DC.B 'DIVS',0,0 102218 001011F4 2954 DC.L U06 2955 ; OR (4) 10221C 8000F000 2956 DC.W $8000,$F000 102220 4F5200000000 2957 DC.B 'OR',0,0,0,0 102226 001010B6 2958 DC.L U02 2959 ; Instructions with 1st nibble = 1001 2960 ; SUBX (7) 10222A 9100F130 2961 DC.W $9100,$F130 10222E 535542580000 2962 DC.B 'SUBX',0,0 102234 00101142 2963 DC.L U04 2964 ; SUBA (6) 102238 90C0F0C0 2965 DC.W $90C0,$F0C0 10223C 535542410000 2966 DC.B 'SUBA',0,0 102242 001010FA 2967 DC.L U03 2968 ; SUB (4) 102246 9000F000 2969 DC.W $9000,$F000 10224A 535542000000 2970 DC.B 'SUB',0,0,0 102250 001010B6 2971 DC.L U02 2972 ; Instructions with 1st nibble = 1011 2973 ; CMPM (8) 102254 B108F138 2974 DC.W $B108,$F138 102258 434D504D0000 2975 DC.B 'CMPM',0,0 10225E 001011AE 2976 DC.L U05 2977 ; CMPA (6) 102262 B0C0F0C0 2978 DC.W $B0C0,$F0C0 102266 434D50410000 2979 DC.B 'CMPA',0,0 10226C 001010FA 2980 DC.L U03 2981 ; EOR (5) 102270 B100F100 2982 DC.W $B100,$F100 102274 454F52000000 2983 DC.B 'EOR',0,0,0 10227A 001010B6 2984 DC.L U02 2985 ; CMP (4) 10227E B000F000 2986 DC.W $B000,$F000 102282 434D50000000 2987 DC.B 'CMP',0,0,0 102288 001010B6 2988 DC.L U02 2989 ; Instructions with 1st nibble = 1100 2990 ; EXG Dn,Dm. (10) 10228C C140F1F8 2991 DC.W $C140,$F1F8 102290 455847000000 2992 DC.B 'EXG',0,0,0 102296 00101630 2993 DC.L U29DD 2994 ; EXG An,Am. (10) 10229A C148F1F8 2995 DC.W $C148,$F1F8 10229E 455847000000 2996 DC.B 'EXG',0,0,0 1022A4 00101656 2997 DC.L U29AA 2998 ; EXG Dn,An. (10) 1022A8 C188F1F8 2999 DC.W $C188,$F1F8 1022AC 455847000000 3000 DC.B 'EXG',0,0,0 1022B2 0010167C 3001 DC.L U29DA 3002 ; ABCD (9) 1022B6 C100F1F0 3003 DC.W $C100,$F1F0 1022BA 414243440000 3004 DC.B 'ABCD',0,0 1022C0 00101574 3005 DC.L U26 3006 ; MULS (7) 1022C4 C1C0F1C0 3007 DC.W $C1C0,$F1C0 1022C8 4D554C530000 3008 DC.B 'MULS',0,0 1022CE 001011F4 3009 DC.L U06 3010 ; MULU (7) 1022D2 C0C0F1C0 3011 DC.W $C0C0,$F1C0 1022D6 4D554C550000 3012 DC.B 'MULU',0,0 1022DC 001011F4 3013 DC.L U06 3014 ; AND (4) 1022E0 C000F000 3015 DC.W $C000,$F000 1022E4 414E44000000 3016 DC.B 'AND',0,0,0 1022EA 001010B6 3017 DC.L U02 3018 ; Instructions with 1st nibble = 1101 3019 ; ADDX (7) 1022EE D100F130 3020 DC.W $D100,$F130 1022F2 414444580000 3021 DC.B 'ADDX',0,0 1022F8 00101142 3022 DC.L U04 3023 ; ADDA (6) 1022FC D0C0F0C0 3024 DC.W $D0C0,$F0C0 102300 414444410000 3025 DC.B 'ADDA',0,0 102306 001010FA 3026 DC.L U03 3027 ; ADD (4) 10230A D000F000 3028 DC.W $D000,$F000 10230E 414444000000 3029 DC.B 'ADD',0,0,0 102314 001010B6 3030 DC.L U02 3031 ; Instructions with 1st nibble = 1110 3032 ; ASL and ASR mem shifts (9) 102318 E0C0FEC0 3033 DC.W $E0C0,$FEC0 10231C 415300000000 3034 DC.B 'AS',0,0,0,0 102322 00101216 3035 DC.L U07 3036 ; LSL and LSR mem shifts (9) 102326 E2C0FEC0 3037 DC.W $E2C0,$FEC0 10232A 4C5300000000 3038 DC.B 'LS',0,0,0,0 102330 00101216 3039 DC.L U07 3040 ; ROXL and ROXR mem shifts (9) 102334 E4C0FEC0 3041 DC.W $E4C0,$FEC0 102338 524F58000000 3042 DC.B 'ROX',0,0,0 10233E 00101216 3043 DC.L U07 3044 ; ROL and ROR mem shifts (9) 102342 E6C0FEC0 3045 DC.W $E6C0,$FEC0 102346 524F00000000 3046 DC.B 'RO',0,0,0,0 10234C 00101216 3047 DC.L U07 3048 ; ASL and ASR reg shifts (6) 102350 E000F018 3049 DC.W $E000,$F018 102354 415300000000 3050 DC.B 'AS',0,0,0,0 10235A 00101242 3051 DC.L U08 3052 ; LSL and LSR reg shifts (6) 10235E E008F018 3053 DC.W $E008,$F018 102362 4C5300000000 3054 DC.B 'LS',0,0,0,0 102368 00101242 3055 DC.L U08 3056 ; ROXL and ROXR reg shifts (6) 10236C E010F018 3057 DC.W $E010,$F018 102370 524F58000000 3058 DC.B 'ROX',0,0,0 102376 00101242 3059 DC.L U08 3060 ; ROL and ROR reg shifts (6) 10237A E018F018 3061 DC.W $E018,$F018 10237E 524F00000000 3062 DC.B 'RO',0,0,0,0 102384 00101242 3063 DC.L U08 3064 ; This is the 'I have no idea' entry. 102388 00000000 3065 DC.W 0,0 10238C 3F3F3F3F3F00 3066 DC.B '?????',0 102392 001010AA 3067 DC.L U00 3068 ; 102396 5420 3069 UCCLST DC.B 'T ' 102398 4620 3070 DC.B 'F ' 10239A 4849 3071 DC.B 'HI' 10239C 4C53 3072 DC.B 'LS' 10239E 4343 3073 DC.B 'CC' 1023A0 4353 3074 DC.B 'CS' 1023A2 4E45 3075 DC.B 'NE' 1023A4 4551 3076 DC.B 'EQ' 1023A6 5643 3077 DC.B 'VC' 1023A8 5653 3078 DC.B 'VS' 1023AA 504C 3079 DC.B 'PL' 1023AC 4D49 3080 DC.B 'MI' 1023AE 4745 3081 DC.B 'GE' 1023B0 4C54 3082 DC.B 'LT' 1023B2 4754 3083 DC.B 'GT' 1023B4 4C45 3084 DC.B 'LE' 3085 ; 3086 ;*************************************************** 3087 ;End Unassemble Instructions 3088 ;*************************************************** 3089 ; 3090 ; Vectors to the command line routines 1023B6 001004AA 3091 CMD_ADR DC.L DUMP ;DUMP execution address 1023BA 00100566 3092 DC.L GO 1023BE 001006F4 3093 DC.L EDIT 1023C2 001006D6 3094 DC.L MOOV 1023C6 00101D26 3095 DC.L HELP 1023CA 00100C70 3096 DC.L LD_FILE 1023CE 00100488 3097 DC.L FILL 1023D2 00100F9C 3098 DC.L HEXCALC 1023D6 00100724 3099 DC.L REGMOD 1023DA 00100E38 3100 DC.L BEG_TRC ;tracing 1023DE 00100F1C 3101 DC.L BREAK 1023E2 00100FD0 3102 DC.L UNASM 1023E6 001006A4 3103 DC.L VERIFY 1023EA 001004A2 3104 DC.L JUMP 3105 ; The next command is for future command 3106 ; development in the RAM of the SBC 3107 ; DC.L FUTURE 3108 ; 1023EE 44 3109 COMANDS DC.B 'D' 1023EF 47 3110 DC.B 'G' 1023F0 45 3111 DC.B 'E' 1023F1 4D 3112 DC.B 'M' 1023F2 3F 3113 DC.B '?' 1023F3 4C 3114 DC.B 'L' 1023F4 46 3115 DC.B 'F' 1023F5 48 3116 DC.B 'H' 1023F6 52 3117 DC.B 'R' 1023F7 54 3118 DC.B 'T' 1023F8 42 3119 DC.B 'B' 1023F9 55 3120 DC.B 'U' 1023FA 43 3121 DC.B 'C' 1023FB 4A 3122 DC.B 'J' 3123 ; The next command is for future command 3124 ; development in the RAM of the SBC 3125 ; DC.B 'X' 3126 ; 3127 ; Messages go at end so that code word 3128 ; alignment won't get derailed 1023FC 20466C6167733A2058203D20 3129 MESGFLG dc.b ' Flags: X = ',0 102409 2C204E203D2000 3130 MESGN dc.b ', N = ',0 102410 2C205A203D2000 3131 MESGZ dc.b ', Z = ',0 102417 2C2056203D2000 3132 MESGV dc.b ', V = ',0 10241E 2C2043203D2000 3133 MESGC dc.b ', C = ',0 3134 ; 102425 427573204572726F7200 3135 MSG_1 DC.B 'Bus Error',0 10242F 41646472657373204572726F 3136 MSG_2 DC.B 'Address Error before ',0 102445 496C6C6567616C20496E7374 3137 MSG_3 DC.B 'Illegal Instruction Error at ' 102462 00 3138 DC.B 0 102463 446976696465206279205A65 3139 MSG_4 DC.B 'Divide by Zero Error before ',0 102480 5452415056204F766572666C 3140 MSG_5 DC.B 'TRAPV Overflow',0 10248F 50726976696C656765205669 3141 MSG_6 DC.B 'Privilege Violation',0 1024A3 4C6576656C2D3720496E7465 3142 MSG_7 DC.B 'Level-7 Interrupt',0 1024B5 0D0A427265616B706F696E74 3143 MSG_8 DC.B CR,LF,'Breakpoint 1: ',0 1024C6 0D0A427265616B706F696E74 3144 MSG_9 DC.B CR,LF,'Breakpoint 2: ',0 1024D7 496E61637469766500 3145 MSG_10 DC.B 'Inactive',0 1024E0 4C696E65203130313020656D 3146 MSG_A DC.B 'Line 1010 emulator instruction encountered at ',0 10250F 4C696E65203131313120656D 3147 MSG_F DC.B 'Line 1111 emulator instruction encountered at ',0 3148 ; 3149 ; Help menu in response to typing a ? 10253E 0D0A 3150 H_MSG1 DC.B CR,LF 102540 2A2A2A203638303030204350 3151 DC.B '*** 68000 CPU-based ' 102554 53696E676C6520426F617264 3152 DC.B 'Single Board Computer ' 10256A 2A2A2A204D6F6E69746F7220 3153 DC.B '*** Monitor Version 2.11',CR,LF 102584 3D3D3D3D3D3D3D3D3D3D3D3D 3154 DC.B '====================================' 1025A8 3D3D3D3D3D3D3D3D3D3D3D3D 3155 DC.B '================================' 1025C8 0D0A 3156 DC.B CR,LF 1025CA 42203C31206F7220323E203C 3157 DC.B 'B <1 or 2> ' 1025E7 536574207065726D616E656E 3158 DC.B 'Set permanent breakpoint ' 102600 31206F7220322E0D0A 3159 DC.B '1 or 2.',CR,LF 102609 42203C31206F7220323E3C45 3160 DC.B 'B <1 or 2> ' 102626 436C65617220627265616B70 3161 DC.B 'Clear breakpoint 1 or 2.',CR,LF 102640 423C454E543E202020202020 3162 DC.B 'B ' 10265D 446973706C6179207065726D 3163 DC.B 'Display permanent breakpoints.',CR,LF 10267D 43203C73746172743E203C65 3164 DC.B 'C ' 10269A 436F6D70617265204D656D6F 3165 DC.B 'Compare Memory',CR,LF 1026AA 44203C73746172743E203C23 3166 DC.B 'D <#$ of lines> ' 1026C7 44756D70204D656D6F727920 3167 DC.B 'Dump Memory with optional ' 1026E1 706172616D65746572732E20 3168 DC.B 'parameters. ^C to quit.',CR,LF 1026FA 44202C203C2324206F66206C 3169 DC.B 'D , <#$ of lines> As ' 10271A 61626F76652C206275742073 3170 DC.B 'above, but start at current address.' 10273E 0D0A 3171 DC.B CR,LF 102740 45203C616464726573733E20 3172 DC.B 'E
' 10275D 45646974204D656D6F72790D 3173 DC.B 'Edit Memory',CR,LF 10276A 46203C73746172743E203C65 3174 DC.B 'F ' 102787 46696C6C204D656D6F72790D 3175 DC.B 'Fill Memory',CR,LF 102794 47203C73746172743E203C62 3176 DC.B 'G ' 1027B1 476F20746F20555345522070 3177 DC.B 'Go to USER program with op' 1027CB 74696F6E616C20627265616B 3178 DC.B 'tional breakpoints.',CR,LF 1027E0 47202C203C626B7074313E20 3179 DC.B 'G , ' 1027FD 41732061626F766520627574 3180 DC.B 'As above but start at ' 102813 63757272656E742070726F67 3181 DC.B 'current program counter.' 10282B 0D0A 3182 DC.B CR,LF 10282D 473C454E543E202020202020 3183 DC.B 'G ' 10284A 537461727420617420637572 3184 DC.B 'Start at current program ' 102863 636F756E7465722C206E6F20 3185 DC.B 'counter, no breakpoints.' 10287B 0D0A 3186 DC.B CR,LF 10287D 48203C64617461313E203C64 3187 DC.B 'H ' 10289A 4865782073756D2026206469 3188 DC.B 'Hex sum & difference',CR,LF 1028B0 4A203C616464726573733E20 3189 DC.B 'J
' 1028CD 4A756D7020746F2061646472 3190 DC.B 'Jump to address',CR,LF 1028DE 4C203C6F7074696F6E616C20 3191 DC.B 'L ' 1028FB 4C6F616420532D46494C4520 3192 DC.B 'Load S-FILE Program. ^C to abandon.' 10291E 0D0A 3193 DC.B CR,LF 102920 4D203C73746172743E203C65 3194 DC.B 'M ' 10293D 4D6F7665204D656D6F72790D 3195 DC.B 'Move Memory',CR,LF 10294A 522020202020202020202020 3196 DC.B 'R ' 102967 52656769737465722044756D 3197 DC.B 'Register Dump',CR,LF 102976 522044372020202020202020 3198 DC.B 'R D7 ' 102993 5265676973746572204D6F64 3199 DC.B 'Register Modify D7',CR,LF 1029A7 54203C6F7074696F6E616C20 3200 DC.B 'T ' 1029C4 54726163652E203E5220446E 3201 DC.B 'Trace. >R Dn to modify any ' 1029E5 726567697374657220776869 3202 DC.B 'register while ',CR,LF 1029F6 202020202020202020202020 3203 DC.B ' ' 102A13 74726163696E672E20547970 3204 DC.B 'tracing. Type to continue ' 102A33 74726163696E672E0D0A 3205 DC.B 'tracing.',CR,LF 102A3D 55203C73746172743E203C23 3206 DC.B 'U <#$ of lines> ' 102A5A 556E617373656D626C65206D 3207 DC.B 'Unassemble memory with optional ' 102A7A 706172616D65746572732E0D 3208 DC.B 'parameters.',CR,LF 102A87 55202C203C2324206F66206C 3209 DC.B 'U , <#$ of lines> As ' 102AA7 61626F76652C206275742073 3210 DC.B 'above, but start at current address.' 102ACB 0D0A 3211 DC.B CR,LF 102ACD 3F2020202020202020202020 3212 DC.B '? ' 102AEA 546869732053637265656E00 3213 DC.B 'This Screen',0 3214 ; 102AF6 42616420436F6D6D616E642E 3215 BADCMD DC.B 'Bad Command.',0 102B03 496E76616C69642061646472 3216 INVDATA DC.B 'Invalid address or hex ' 102B1A 646174612E00 3217 DC.B 'data.',0 102B20 0D0A3638303030204D6F6E69 3218 HELLO DC.B CR,LF,'68000 Monitor, ' 102B31 76657273696F6E20322E3131 3219 DC.B 'version 2.11',CR,LF,LF 102B40 54797065203F20666F722068 3220 DC.B 'Type ? for help menu.' 102B55 0D0A00 3221 DC.B CR,LF,0 3222 ; Load file error message 102B58 54686572652077617320616E 3223 LE_MSG DC.B 'There was an error ' 102B6B 6C6F6164696E672074686520 3224 DC.B 'loading the file.',0 102B7D 2E484558206C6F6164656420 3225 LG_MSG DC.B '.HEX loaded successfully.' 102B96 0D0A00 3226 DC.B CR,LF,0 102B99 0D0A 3227 LS_MSG DC.B CR,LF 102B9B 53746172742073656E64696E 3228 DC.B 'Start sending the file, ' 102BB3 5E4320746F206162616E646F 3229 DC.B '^C to abandon.' 102BC1 0D0A00 3230 DC.B CR,LF,0 102BC4 4C6F6164696E672066696C65 3231 LF_MSG DC.B 'Loading file named ',0 102BD8 0D0A53756D20203D2000 3232 HS_MSG DC.B CR,LF,'Sum = ',0 102BE2 0D0A44696666203D2000 3233 HD_MSG DC.B CR,LF,'Diff = ',0 102BEC 08200800 3234 BSSPBS dc.b 8,' ',8,0 102BF0 0D0A2500 3235 REDOMSG DC.B CR,LF,'%',0 102BF4 0D0A 3236 MSG_NIN DC.B CR,LF 102BF6 5452415020233920656E636F 3237 DC.B 'TRAP #9 encountered at ' 102C0D 616464726573732000 3238 DC.B 'address ',0 102C16 0D0A 3239 MSG_TEN DC.B CR,LF 102C18 427265616B706F696E742065 3240 DC.B 'Breakpoint encountered at ' 102C32 616464726573732000 3241 DC.B 'address ',0 102C3B 5452415020696E7374727563 3242 TRC_MSG DC.B 'TRAP instruction is next. ' 102C55 5472616365207465726D696E 3243 DC.B 'Trace terminated.',0 102C67 0D0A436F6D70617269736F6E 3244 PASSMSG DC.B CR,LF,'Comparison successful.',CR,LF,0 102C82 0D0A436F6D70617269736F6E 3245 FAILMSG DC.B CR,LF,'Comparison failed.',CR,LF,0 102C99 202020202020202020202020 3246 SP24MSG DC.B ' ',0 102CB0 50433A20202000 3247 PC_MSG DC.B 'PC: ',0 102CB7 53523A202020202000 3248 SR_MSG DC.B 'SR: ',0 3249 ; 102CC0 00 3250 ZEND DC.B 0 3251 ; 102CC1 3252 END START End of assembly - no errors were found. Heap usage: -w4095,96 Total hunk sizes: 102cc4 code, 0 data, 0 BSS